diff --git a/.github/workflows/ghpkg-all-kotlin-api-clients-publish.yaml b/.github/workflows/ghpkg-all-kotlin-api-clients-publish.yaml
index ee1080c1a7e..bf144a43e3e 100644
--- a/.github/workflows/ghpkg-all-kotlin-api-clients-publish.yaml
+++ b/.github/workflows/ghpkg-all-kotlin-api-clients-publish.yaml
@@ -58,3 +58,199 @@ jobs:
with:
name: cactus-plugin-ledger-connector-corda-kotlin-client-${{ env.GITVERSION }}.jar
path: packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-cmd-api-server-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-cmd-api-server-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-cmd-api-server-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-core-api-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-core-api-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-core-api-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-consortium-manual-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-consortium-manual-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-consortium-manual-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-keychain-google-sm-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-keychain-google-sm-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-keychain-google-sm-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-keychain-aws-sm-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-keychain-aws-sm-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-keychain-aws-sm-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-keychain-azure-kv-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-keychain-azure-kv-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-keychain-azure-kv-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-keychain-memory-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-keychain-memory-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-keychain-memory-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-keychain-vault-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-keychain-vault-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-keychain-vault-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-ledger-connector-fabric-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-plugin-ledger-connector-fabric/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-ledger-connector-fabric-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-ledger-connector-fabric-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-plugin-ledger-connector-fabric/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-keychain-memory-wasm-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-keychain-memory-wasm-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-keychain-memory-wasm-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-odap-hermes-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-odap-hermes-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-odap-hermes-kotlin-client-${{ env.GITVERSION }}.jar
+ path: packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-example-supply-chain-business-logic-plugin-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-example-supply-chain-business-logic-plugin-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-example-supply-chain-business-logic-plugin-kotlin-client-${{ env.GITVERSION }}.jar
+ path: examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-example-carbon-accounting-business-logic-plugin-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-example-carbon-accounting-business-logic-plugin-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-example-carbon-accounting-business-logic-plugin-kotlin-client-${{ env.GITVERSION }}.jar
+ path: examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
+
+ - name: build-cactus-plugin-object-store-ipfs-kotlin-client
+ run: |
+ WDIR=`pwd`
+ cd ${WDIR}/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client
+ chmod +x gradlew
+ ./gradlew clean
+ ./gradlew build
+
+ - name: publish-cactus-plugin-object-store-ipfs-kotlin-client
+ uses: actions/upload-artifact@v3.0.0
+ with:
+ name: cactus-plugin-object-store-ipfs-kotlin-client-${{ env.GITVERSION }}.jar
+ path: extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/package.json b/examples/cactus-example-carbon-accounting-business-logic-plugin/package.json
index c30c955e807..667eda831e9 100644
--- a/examples/cactus-example-carbon-accounting-business-logic-plugin/package.json
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/package.json
@@ -45,7 +45,9 @@
"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",
+ "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",
+ "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",
"watch": "npm-watch",
"webpack": "npm-run-all webpack:dev",
"webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web",
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-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/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
new file mode 100644
index 00000000000..f1bd499d8bc
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
@@ -0,0 +1,43 @@
+README.md
+build.gradle
+docs/AuthzJwtClaim.md
+docs/AuthzScope.md
+docs/Checkpoint.md
+docs/DaoTokenGetAllowanceNotFoundResponse.md
+docs/DaoTokenGetAllowanceRequest.md
+docs/DaoTokenGetAllowanceResponse.md
+docs/DefaultApi.md
+docs/EnrollAdminInfo.md
+docs/EnrollAdminV1Request.md
+docs/EnrollAdminV1Response.md
+gradle/wrapper/gradle-wrapper.jar
+gradle/wrapper/gradle-wrapper.properties
+gradlew
+gradlew.bat
+settings.gradle
+src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
+src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
+src/main/kotlin/org/openapitools/client/models/AuthzJwtClaim.kt
+src/main/kotlin/org/openapitools/client/models/AuthzScope.kt
+src/main/kotlin/org/openapitools/client/models/Checkpoint.kt
+src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceNotFoundResponse.kt
+src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceRequest.kt
+src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceResponse.kt
+src/main/kotlin/org/openapitools/client/models/EnrollAdminInfo.kt
+src/main/kotlin/org/openapitools/client/models/EnrollAdminV1Request.kt
+src/main/kotlin/org/openapitools/client/models/EnrollAdminV1Response.kt
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
new file mode 100644
index 00000000000..804440660c7
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
@@ -0,0 +1 @@
+5.2.1
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/README.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/README.md
new file mode 100644
index 00000000000..00c512ea757
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/README.md
@@ -0,0 +1,59 @@
+# org.openapitools.client - Kotlin client library for Hyperledger Cactus Example - Carbon Accounting App
+
+## Requires
+
+* Kotlin 1.4.30
+* Gradle 6.8.3
+
+## Build
+
+First, create the gradle wrapper script:
+
+```
+gradle wrapper
+```
+
+Then, run:
+
+```
+./gradlew check assemble
+```
+
+This runs all tests and packages the library.
+
+## Features/Implementation Notes
+
+* Supports JSON inputs/outputs, File inputs, and Form inputs.
+* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
+* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
+* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
+
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://localhost*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*DefaultApi* | [**daoTokenGetAllowanceV1**](docs/DefaultApi.md#daotokengetallowancev1) | **POST** /api/v1/plugins/@hyperledger/cactus-example-carbon-accounting-backend/dao-token/get-allowance | Get the number of tokens `spender` is approved to spend on behalf of `account`
+*DefaultApi* | [**enrollAdminV1**](docs/DefaultApi.md#enrolladminv1) | **POST** /api/v1/utilityemissionchannel/registerEnroll/admin | Registers an admin account within the Fabric organization specified.
+
+
+
+## Documentation for Models
+
+ - [org.openapitools.client.models.AuthzJwtClaim](docs/AuthzJwtClaim.md)
+ - [org.openapitools.client.models.AuthzScope](docs/AuthzScope.md)
+ - [org.openapitools.client.models.Checkpoint](docs/Checkpoint.md)
+ - [org.openapitools.client.models.DaoTokenGetAllowanceNotFoundResponse](docs/DaoTokenGetAllowanceNotFoundResponse.md)
+ - [org.openapitools.client.models.DaoTokenGetAllowanceRequest](docs/DaoTokenGetAllowanceRequest.md)
+ - [org.openapitools.client.models.DaoTokenGetAllowanceResponse](docs/DaoTokenGetAllowanceResponse.md)
+ - [org.openapitools.client.models.EnrollAdminInfo](docs/EnrollAdminInfo.md)
+ - [org.openapitools.client.models.EnrollAdminV1Request](docs/EnrollAdminV1Request.md)
+ - [org.openapitools.client.models.EnrollAdminV1Response](docs/EnrollAdminV1Response.md)
+
+
+
+## Documentation for Authorization
+
+All endpoints do not require authorization.
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
new file mode 100644
index 00000000000..3de8b45b135
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
@@ -0,0 +1,37 @@
+group 'org.openapitools'
+version '1.0.0'
+
+wrapper {
+ gradleVersion = '6.8.3'
+ distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
+}
+
+buildscript {
+ ext.kotlin_version = '1.5.10'
+
+ repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+ }
+ dependencies {
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
+apply plugin: 'kotlin'
+
+repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+}
+
+test {
+ useJUnitPlatform()
+}
+
+dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
+ implementation "com.squareup.moshi:moshi-kotlin:1.12.0"
+ implementation "com.squareup.moshi:moshi-adapters:1.12.0"
+ implementation "com.squareup.okhttp3:okhttp:4.9.1"
+ testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/AuthzJwtClaim.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/AuthzJwtClaim.md
new file mode 100644
index 00000000000..00ce5c083d7
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/AuthzJwtClaim.md
@@ -0,0 +1,10 @@
+
+# AuthzJwtClaim
+
+## Enum
+
+
+ * `iss` (value: `"Hyperledger Labs - Carbon Accounting Tool"`)
+
+
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/AuthzScope.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/AuthzScope.md
new file mode 100644
index 00000000000..29e8faf524e
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/AuthzScope.md
@@ -0,0 +1,12 @@
+
+# AuthzScope
+
+## Enum
+
+
+ * `GroupAdmin` (value: `"group:admin"`)
+
+ * `GroupUser` (value: `"group:user"`)
+
+
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/Checkpoint.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/Checkpoint.md
new file mode 100644
index 00000000000..e42094ce772
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/Checkpoint.md
@@ -0,0 +1,11 @@
+
+# Checkpoint
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fromBlock** | **kotlin.Int** | |
+**votes** | **kotlin.String** | |
+
+
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DaoTokenGetAllowanceNotFoundResponse.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DaoTokenGetAllowanceNotFoundResponse.md
new file mode 100644
index 00000000000..681ce3c9024
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DaoTokenGetAllowanceNotFoundResponse.md
@@ -0,0 +1,11 @@
+
+# DaoTokenGetAllowanceNotFoundResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**accountFound** | **kotlin.Boolean** | Indicates whether the account was found or not. |
+**spenderFound** | **kotlin.Boolean** | Indicates whether the spender was found or not. |
+
+
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DaoTokenGetAllowanceRequest.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DaoTokenGetAllowanceRequest.md
new file mode 100644
index 00000000000..cda21564cb2
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DaoTokenGetAllowanceRequest.md
@@ -0,0 +1,11 @@
+
+# DaoTokenGetAllowanceRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**account** | **kotlin.String** | The address of the account holding the funds |
+**spender** | **kotlin.String** | The address of the account spending the funds |
+
+
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DaoTokenGetAllowanceResponse.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DaoTokenGetAllowanceResponse.md
new file mode 100644
index 00000000000..fae83001525
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DaoTokenGetAllowanceResponse.md
@@ -0,0 +1,10 @@
+
+# DaoTokenGetAllowanceResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**allowance** | **kotlin.Int** | The number of tokens approved |
+
+
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md
new file mode 100644
index 00000000000..5ba63684cc2
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md
@@ -0,0 +1,100 @@
+# DefaultApi
+
+All URIs are relative to *http://localhost*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**daoTokenGetAllowanceV1**](DefaultApi.md#daoTokenGetAllowanceV1) | **POST** /api/v1/plugins/@hyperledger/cactus-example-carbon-accounting-backend/dao-token/get-allowance | Get the number of tokens `spender` is approved to spend on behalf of `account`
+[**enrollAdminV1**](DefaultApi.md#enrollAdminV1) | **POST** /api/v1/utilityemissionchannel/registerEnroll/admin | Registers an admin account within the Fabric organization specified.
+
+
+
+# **daoTokenGetAllowanceV1**
+> DaoTokenGetAllowanceResponse daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest)
+
+Get the number of tokens `spender` is approved to spend on behalf of `account`
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+val daoTokenGetAllowanceRequest : DaoTokenGetAllowanceRequest = // DaoTokenGetAllowanceRequest |
+try {
+ val result : DaoTokenGetAllowanceResponse = apiInstance.daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest)
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#daoTokenGetAllowanceV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#daoTokenGetAllowanceV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **daoTokenGetAllowanceRequest** | [**DaoTokenGetAllowanceRequest**](DaoTokenGetAllowanceRequest.md)| | [optional]
+
+### Return type
+
+[**DaoTokenGetAllowanceResponse**](DaoTokenGetAllowanceResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+
+# **enrollAdminV1**
+> EnrollAdminV1Response enrollAdminV1(enrollAdminV1Request)
+
+Registers an admin account within the Fabric organization specified.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+val enrollAdminV1Request : EnrollAdminV1Request = // EnrollAdminV1Request |
+try {
+ val result : EnrollAdminV1Response = apiInstance.enrollAdminV1(enrollAdminV1Request)
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#enrollAdminV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#enrollAdminV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **enrollAdminV1Request** | [**EnrollAdminV1Request**](EnrollAdminV1Request.md)| | [optional]
+
+### Return type
+
+[**EnrollAdminV1Response**](EnrollAdminV1Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/EnrollAdminInfo.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/EnrollAdminInfo.md
new file mode 100644
index 00000000000..937363da6bb
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/EnrollAdminInfo.md
@@ -0,0 +1,12 @@
+
+# EnrollAdminInfo
+
+## Enum
+
+
+ * `SUCCESSFULLY_ENROLLED_ADMIN` (value: `"Successfully enrolled admin user and imported it into the wallet"`)
+
+ * `ORG_ADMIN_REGISTERED` (value: `"ORG ADMIN REGISTERED"`)
+
+
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/EnrollAdminV1Request.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/EnrollAdminV1Request.md
new file mode 100644
index 00000000000..701d61bc4f3
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/EnrollAdminV1Request.md
@@ -0,0 +1,10 @@
+
+# EnrollAdminV1Request
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orgName** | **kotlin.String** | |
+
+
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/EnrollAdminV1Response.md b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/EnrollAdminV1Response.md
new file mode 100644
index 00000000000..bf64eafefd3
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/EnrollAdminV1Response.md
@@ -0,0 +1,14 @@
+
+# EnrollAdminV1Response
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**info** | **kotlin.String** | |
+**orgName** | **kotlin.String** | |
+**msp** | **kotlin.String** | |
+**caName** | **kotlin.String** | |
+**identityId** | **kotlin.String** | The key under which the identity created will be persisted to the keychain for later retrieval. | [optional]
+
+
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..e708b1c023e
Binary files /dev/null and b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..8cf6eb5ad22
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew
new file mode 100644
index 00000000000..4f906e0c811
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or 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 UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$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='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# 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
+ ;;
+ 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" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat
new file mode 100644
index 00000000000..107acd32c4e
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-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="-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/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
new file mode 100644
index 00000000000..391dcea81db
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
@@ -0,0 +1,2 @@
+
+rootProject.name = 'kotlin-client'
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
new file mode 100644
index 00000000000..20e96437b97
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
@@ -0,0 +1,155 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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.apis
+
+import org.openapitools.client.models.DaoTokenGetAllowanceNotFoundResponse
+import org.openapitools.client.models.DaoTokenGetAllowanceRequest
+import org.openapitools.client.models.DaoTokenGetAllowanceResponse
+import org.openapitools.client.models.EnrollAdminV1Request
+import org.openapitools.client.models.EnrollAdminV1Response
+
+import org.openapitools.client.infrastructure.ApiClient
+import org.openapitools.client.infrastructure.ClientException
+import org.openapitools.client.infrastructure.ClientError
+import org.openapitools.client.infrastructure.ServerException
+import org.openapitools.client.infrastructure.ServerError
+import org.openapitools.client.infrastructure.MultiValueMap
+import org.openapitools.client.infrastructure.RequestConfig
+import org.openapitools.client.infrastructure.RequestMethod
+import org.openapitools.client.infrastructure.ResponseType
+import org.openapitools.client.infrastructure.Success
+import org.openapitools.client.infrastructure.toMultiValue
+
+class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
+ companion object {
+ @JvmStatic
+ val defaultBasePath: String by lazy {
+ System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://localhost")
+ }
+ }
+
+ /**
+ * Get the number of tokens `spender` is approved to spend on behalf of `account`
+ *
+ * @param daoTokenGetAllowanceRequest (optional)
+ * @return DaoTokenGetAllowanceResponse
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest: DaoTokenGetAllowanceRequest?) : DaoTokenGetAllowanceResponse {
+ val localVariableConfig = daoTokenGetAllowanceV1RequestConfig(daoTokenGetAllowanceRequest = daoTokenGetAllowanceRequest)
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as DaoTokenGetAllowanceResponse
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation daoTokenGetAllowanceV1
+ *
+ * @param daoTokenGetAllowanceRequest (optional)
+ * @return RequestConfig
+ */
+ fun daoTokenGetAllowanceV1RequestConfig(daoTokenGetAllowanceRequest: DaoTokenGetAllowanceRequest?) : RequestConfig {
+ val localVariableBody = daoTokenGetAllowanceRequest
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.POST,
+ path = "/api/v1/plugins/@hyperledger/cactus-example-carbon-accounting-backend/dao-token/get-allowance",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+ /**
+ * Registers an admin account within the Fabric organization specified.
+ *
+ * @param enrollAdminV1Request (optional)
+ * @return EnrollAdminV1Response
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun enrollAdminV1(enrollAdminV1Request: EnrollAdminV1Request?) : EnrollAdminV1Response {
+ val localVariableConfig = enrollAdminV1RequestConfig(enrollAdminV1Request = enrollAdminV1Request)
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as EnrollAdminV1Response
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation enrollAdminV1
+ *
+ * @param enrollAdminV1Request (optional)
+ * @return RequestConfig
+ */
+ fun enrollAdminV1RequestConfig(enrollAdminV1Request: EnrollAdminV1Request?) : RequestConfig {
+ val localVariableBody = enrollAdminV1Request
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.POST,
+ path = "/api/v1/utilityemissionchannel/registerEnroll/admin",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
new file mode 100644
index 00000000000..ef7a8f1e1a6
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+typealias MultiValueMap = MutableMap>
+
+fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
+ "csv" -> ","
+ "tsv" -> "\t"
+ "pipe" -> "|"
+ "space" -> " "
+ else -> ""
+}
+
+val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
+
+fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter)
+ = toMultiValue(items.asIterable(), collectionFormat, map)
+
+fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List {
+ return when(collectionFormat) {
+ "multi" -> items.map(map)
+ else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map))
+ }
+}
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
new file mode 100644
index 00000000000..b359be1e41d
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
@@ -0,0 +1,232 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.OkHttpClient
+import okhttp3.RequestBody
+import okhttp3.RequestBody.Companion.asRequestBody
+import okhttp3.RequestBody.Companion.toRequestBody
+import okhttp3.FormBody
+import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
+import okhttp3.ResponseBody
+import okhttp3.MediaType.Companion.toMediaTypeOrNull
+import okhttp3.Request
+import okhttp3.Headers
+import okhttp3.MultipartBody
+import java.io.BufferedWriter
+import java.io.File
+import java.io.FileWriter
+import java.net.URLConnection
+import java.time.LocalDate
+import java.time.LocalDateTime
+import java.time.LocalTime
+import java.time.OffsetDateTime
+import java.time.OffsetTime
+import java.util.Date
+import java.util.Locale
+import com.squareup.moshi.adapter
+
+open class ApiClient(val baseUrl: String) {
+ companion object {
+ protected const val ContentType = "Content-Type"
+ protected const val Accept = "Accept"
+ protected const val Authorization = "Authorization"
+ protected const val JsonMediaType = "application/json"
+ protected const val FormDataMediaType = "multipart/form-data"
+ protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded"
+ protected const val XmlMediaType = "application/xml"
+
+ val apiKey: MutableMap = mutableMapOf()
+ val apiKeyPrefix: MutableMap = mutableMapOf()
+ var username: String? = null
+ var password: String? = null
+ var accessToken: String? = null
+
+ @JvmStatic
+ val client: OkHttpClient by lazy {
+ builder.build()
+ }
+
+ @JvmStatic
+ val builder: OkHttpClient.Builder = OkHttpClient.Builder()
+ }
+
+ /**
+ * Guess Content-Type header from the given file (defaults to "application/octet-stream").
+ *
+ * @param file The given file
+ * @return The guessed Content-Type
+ */
+ protected fun guessContentTypeFromFile(file: File): String {
+ val contentType = URLConnection.guessContentTypeFromName(file.name)
+ return contentType ?: "application/octet-stream"
+ }
+
+ protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody =
+ when {
+ content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull())
+ mediaType == FormDataMediaType -> {
+ MultipartBody.Builder()
+ .setType(MultipartBody.FORM)
+ .apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ if (value is File) {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\"; filename=\"${value.name}\""
+ )
+ val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull()
+ addPart(partHeaders, value.asRequestBody(fileMediaType))
+ } else {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\""
+ )
+ addPart(
+ partHeaders,
+ parameterToString(value).toRequestBody(null)
+ )
+ }
+ }
+ }.build()
+ }
+ mediaType == FormUrlEncMediaType -> {
+ FormBody.Builder().apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ add(key, parameterToString(value))
+ }
+ }.build()
+ }
+ mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody(
+ mediaType.toMediaTypeOrNull()
+ )
+ mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.")
+ // TODO: this should be extended with other serializers
+ else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.")
+ }
+
+ @OptIn(ExperimentalStdlibApi::class)
+ protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? {
+ if(body == null) {
+ return null
+ }
+ val bodyContent = body.string()
+ if (bodyContent.isEmpty()) {
+ return null
+ }
+ if (T::class.java == File::class.java) {
+ // return tempfile
+ val f = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile()
+ f.deleteOnExit()
+ val out = BufferedWriter(FileWriter(f))
+ out.write(bodyContent)
+ out.close()
+ return f as T
+ }
+ return when(mediaType) {
+ JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent)
+ else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.")
+ }
+ }
+
+
+ protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse {
+ val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.")
+
+ val url = httpUrl.newBuilder()
+ .addPathSegments(requestConfig.path.trimStart('/'))
+ .apply {
+ requestConfig.query.forEach { query ->
+ query.value.forEach { queryValue ->
+ addQueryParameter(query.key, queryValue)
+ }
+ }
+ }.build()
+
+ // take content-type/accept from spec or set to default (application/json) if not defined
+ if (requestConfig.headers[ContentType].isNullOrEmpty()) {
+ requestConfig.headers[ContentType] = JsonMediaType
+ }
+ if (requestConfig.headers[Accept].isNullOrEmpty()) {
+ requestConfig.headers[Accept] = JsonMediaType
+ }
+ val headers = requestConfig.headers
+
+ if(headers[ContentType] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Content-Type header. This is required.")
+ }
+
+ if(headers[Accept] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Accept header. This is required.")
+ }
+
+ // TODO: support multiple contentType options here.
+ val contentType = (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault())
+
+ val request = when (requestConfig.method) {
+ RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType))
+ RequestMethod.GET -> Request.Builder().url(url)
+ RequestMethod.HEAD -> Request.Builder().url(url).head()
+ RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType))
+ RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType))
+ RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType))
+ RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null)
+ }.apply {
+ headers.forEach { header -> addHeader(header.key, header.value) }
+ }.build()
+
+ val response = client.newCall(request).execute()
+ val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault())
+
+ // TODO: handle specific mapping types. e.g. Map>
+ return when {
+ response.isRedirect -> Redirection(
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isInformational -> Informational(
+ response.message,
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isSuccessful -> Success(
+ responseBody(response.body, accept),
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isClientError -> ClientError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ else -> ServerError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ }
+ }
+
+ protected fun parameterToString(value: Any?): String = when (value) {
+ null -> ""
+ is Array<*> -> toMultiValue(value, "csv").toString()
+ is Iterable<*> -> toMultiValue(value, "csv").toString()
+ is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date ->
+ parseDateToQueryString(value)
+ else -> value.toString()
+ }
+
+ protected inline fun parseDateToQueryString(value : T): String {
+ /*
+ .replace("\"", "") converts the json object string to an actual string for the query parameter.
+ The moshi or gson adapter allows a more generic solution instead of trying to use a native
+ formatter. It also easily allows to provide a simple way to define a custom date format pattern
+ inside a gson/moshi adapter.
+ */
+ return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "")
+ }
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
new file mode 100644
index 00000000000..9dc8d8dbbfa
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
@@ -0,0 +1,43 @@
+package org.openapitools.client.infrastructure
+
+enum class ResponseType {
+ Success, Informational, Redirection, ClientError, ServerError
+}
+
+interface Response
+
+abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response {
+ abstract val statusCode: Int
+ abstract val headers: Map>
+}
+
+class Success(
+ val data: T,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+): ApiInfrastructureResponse(ResponseType.Success)
+
+class Informational(
+ val statusText: String,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Informational)
+
+class Redirection(
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Redirection)
+
+class ClientError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.ClientError)
+
+class ServerError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map>
+): ApiInfrastructureResponse(ResponseType.ServerError)
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
new file mode 100644
index 00000000000..fb2c972cf8d
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigDecimal
+
+class BigDecimalAdapter {
+ @ToJson
+ fun toJson(value: BigDecimal): String {
+ return value.toPlainString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigDecimal {
+ return BigDecimal(value)
+ }
+}
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
new file mode 100644
index 00000000000..4b6963110c9
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigInteger
+
+class BigIntegerAdapter {
+ @ToJson
+ fun toJson(value: BigInteger): String {
+ return value.toString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigInteger {
+ return BigInteger(value)
+ }
+}
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
new file mode 100644
index 00000000000..ff5e2a81ee8
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
@@ -0,0 +1,12 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+
+class ByteArrayAdapter {
+ @ToJson
+ fun toJson(data: ByteArray): String = String(data)
+
+ @FromJson
+ fun fromJson(data: String): ByteArray = data.toByteArray()
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
new file mode 100644
index 00000000000..b5310e71f13
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
@@ -0,0 +1,18 @@
+@file:Suppress("unused")
+package org.openapitools.client.infrastructure
+
+import java.lang.RuntimeException
+
+open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 123L
+ }
+}
+
+open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 456L
+ }
+}
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
new file mode 100644
index 00000000000..b2e1654479a
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDate
+import java.time.format.DateTimeFormatter
+
+class LocalDateAdapter {
+ @ToJson
+ fun toJson(value: LocalDate): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDate {
+ return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE)
+ }
+
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
new file mode 100644
index 00000000000..e082db94811
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDateTime
+import java.time.format.DateTimeFormatter
+
+class LocalDateTimeAdapter {
+ @ToJson
+ fun toJson(value: LocalDateTime): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDateTime {
+ return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
+ }
+
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
new file mode 100644
index 00000000000..87437871a31
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.OffsetDateTime
+import java.time.format.DateTimeFormatter
+
+class OffsetDateTimeAdapter {
+ @ToJson
+ fun toJson(value: OffsetDateTime): String {
+ return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): OffsetDateTime {
+ return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
+ }
+
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
new file mode 100644
index 00000000000..7e948e1dd07
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Defines a config object for a given request.
+ * NOTE: This object doesn't include 'body' because it
+ * allows for caching of the constructed object
+ * for many request definitions.
+ * NOTE: Headers is a Map because rfc2616 defines
+ * multi-valued headers as csv-only.
+ */
+data class RequestConfig(
+ val method: RequestMethod,
+ val path: String,
+ val headers: MutableMap = mutableMapOf(),
+ val query: MutableMap> = mutableMapOf(),
+ val body: T? = null
+)
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
new file mode 100644
index 00000000000..931b12b8bd7
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
@@ -0,0 +1,8 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Provides enumerated HTTP verbs
+ */
+enum class RequestMethod {
+ GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT
+}
\ No newline at end of file
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
new file mode 100644
index 00000000000..9bd2790dc14
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
@@ -0,0 +1,24 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.Response
+
+/**
+ * Provides an extension to evaluation whether the response is a 1xx code
+ */
+val Response.isInformational : Boolean get() = this.code in 100..199
+
+/**
+ * Provides an extension to evaluation whether the response is a 3xx code
+ */
+@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
+val Response.isRedirect : Boolean get() = this.code in 300..399
+
+/**
+ * Provides an extension to evaluation whether the response is a 4xx code
+ */
+val Response.isClientError : Boolean get() = this.code in 400..499
+
+/**
+ * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code
+ */
+val Response.isServerError : Boolean get() = this.code in 500..999
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
new file mode 100644
index 00000000000..e22592e47d7
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.Moshi
+import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
+
+object Serializer {
+ @JvmStatic
+ val moshiBuilder: Moshi.Builder = Moshi.Builder()
+ .add(OffsetDateTimeAdapter())
+ .add(LocalDateTimeAdapter())
+ .add(LocalDateAdapter())
+ .add(UUIDAdapter())
+ .add(ByteArrayAdapter())
+ .add(URIAdapter())
+ .add(KotlinJsonAdapterFactory())
+ .add(BigDecimalAdapter())
+ .add(BigIntegerAdapter())
+
+ @JvmStatic
+ val moshi: Moshi by lazy {
+ moshiBuilder.build()
+ }
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
new file mode 100644
index 00000000000..927522757da
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.net.URI
+
+class URIAdapter {
+ @ToJson
+ fun toJson(uri: URI) = uri.toString()
+
+ @FromJson
+ fun fromJson(s: String): URI = URI.create(s)
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
new file mode 100644
index 00000000000..7ccf7dc25d2
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.util.UUID
+
+class UUIDAdapter {
+ @ToJson
+ fun toJson(uuid: UUID) = uuid.toString()
+
+ @FromJson
+ fun fromJson(s: String): UUID = UUID.fromString(s)
+}
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AuthzJwtClaim.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AuthzJwtClaim.kt
new file mode 100644
index 00000000000..3f4836b17ab
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AuthzJwtClaim.kt
@@ -0,0 +1,63 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ * Stores global constants related to the authorization of the application. Specifically enumerates the claims to validate for as per RFC 7519, section 4.1. See: https://tools.ietf.org/html/rfc7519#section-4.1
+ *
+ * Values: iss
+ */
+
+enum class AuthzJwtClaim(val value: kotlin.String) {
+
+ @Json(name = "Hyperledger Labs - Carbon Accounting Tool")
+ iss("Hyperledger Labs - Carbon Accounting Tool");
+
+ /**
+ * Override toString() to avoid using the enum variable name as the value, and instead use
+ * the actual value defined in the API spec file.
+ *
+ * This solves a problem when the variable name and its value are different, and ensures that
+ * the client sends the correct enum values to the server always.
+ */
+ override fun toString(): String = value
+
+ companion object {
+ /**
+ * Converts the provided [data] to a [String] on success, null otherwise.
+ */
+ fun encode(data: Any?): kotlin.String? = if (data is AuthzJwtClaim) "$data" else null
+
+ /**
+ * Returns a valid [AuthzJwtClaim] for [data], null otherwise.
+ */
+ fun decode(data: Any?): AuthzJwtClaim? = data?.let {
+ val normalizedData = "$it".lowercase()
+ values().firstOrNull { value ->
+ it == value || normalizedData == "$value".lowercase()
+ }
+ }
+ }
+}
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AuthzScope.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AuthzScope.kt
new file mode 100644
index 00000000000..55bf835d82f
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AuthzScope.kt
@@ -0,0 +1,66 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * Values: GroupAdmin,GroupUser
+ */
+
+enum class AuthzScope(val value: kotlin.String) {
+
+ @Json(name = "group:admin")
+ GroupAdmin("group:admin"),
+
+ @Json(name = "group:user")
+ GroupUser("group:user");
+
+ /**
+ * Override toString() to avoid using the enum variable name as the value, and instead use
+ * the actual value defined in the API spec file.
+ *
+ * This solves a problem when the variable name and its value are different, and ensures that
+ * the client sends the correct enum values to the server always.
+ */
+ override fun toString(): String = value
+
+ companion object {
+ /**
+ * Converts the provided [data] to a [String] on success, null otherwise.
+ */
+ fun encode(data: Any?): kotlin.String? = if (data is AuthzScope) "$data" else null
+
+ /**
+ * Returns a valid [AuthzScope] for [data], null otherwise.
+ */
+ fun decode(data: Any?): AuthzScope? = data?.let {
+ val normalizedData = "$it".lowercase()
+ values().firstOrNull { value ->
+ it == value || normalizedData == "$value".lowercase()
+ }
+ }
+ }
+}
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Checkpoint.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Checkpoint.kt
new file mode 100644
index 00000000000..11aed701b6a
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Checkpoint.kt
@@ -0,0 +1,42 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param fromBlock
+ * @param votes
+ */
+
+data class Checkpoint (
+
+ @Json(name = "fromBlock")
+ val fromBlock: kotlin.Int,
+
+ @Json(name = "votes")
+ val votes: kotlin.String
+
+)
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceNotFoundResponse.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceNotFoundResponse.kt
new file mode 100644
index 00000000000..5f08e0e31c9
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceNotFoundResponse.kt
@@ -0,0 +1,44 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param accountFound Indicates whether the account was found or not.
+ * @param spenderFound Indicates whether the spender was found or not.
+ */
+
+data class DaoTokenGetAllowanceNotFoundResponse (
+
+ /* Indicates whether the account was found or not. */
+ @Json(name = "accountFound")
+ val accountFound: kotlin.Boolean,
+
+ /* Indicates whether the spender was found or not. */
+ @Json(name = "spenderFound")
+ val spenderFound: kotlin.Boolean
+
+)
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceRequest.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceRequest.kt
new file mode 100644
index 00000000000..4a5657ef9a6
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceRequest.kt
@@ -0,0 +1,44 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param account The address of the account holding the funds
+ * @param spender The address of the account spending the funds
+ */
+
+data class DaoTokenGetAllowanceRequest (
+
+ /* The address of the account holding the funds */
+ @Json(name = "account")
+ val account: kotlin.String,
+
+ /* The address of the account spending the funds */
+ @Json(name = "spender")
+ val spender: kotlin.String
+
+)
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceResponse.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceResponse.kt
new file mode 100644
index 00000000000..6acb5f77cb4
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DaoTokenGetAllowanceResponse.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param allowance The number of tokens approved
+ */
+
+data class DaoTokenGetAllowanceResponse (
+
+ /* The number of tokens approved */
+ @Json(name = "allowance")
+ val allowance: kotlin.Int
+
+)
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/EnrollAdminInfo.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/EnrollAdminInfo.kt
new file mode 100644
index 00000000000..677280b6092
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/EnrollAdminInfo.kt
@@ -0,0 +1,66 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * Values: SUCCESSFULLY_ENROLLED_ADMIN,ORG_ADMIN_REGISTERED
+ */
+
+enum class EnrollAdminInfo(val value: kotlin.String) {
+
+ @Json(name = "Successfully enrolled admin user and imported it into the wallet")
+ SUCCESSFULLY_ENROLLED_ADMIN("Successfully enrolled admin user and imported it into the wallet"),
+
+ @Json(name = "ORG ADMIN REGISTERED")
+ ORG_ADMIN_REGISTERED("ORG ADMIN REGISTERED");
+
+ /**
+ * Override toString() to avoid using the enum variable name as the value, and instead use
+ * the actual value defined in the API spec file.
+ *
+ * This solves a problem when the variable name and its value are different, and ensures that
+ * the client sends the correct enum values to the server always.
+ */
+ override fun toString(): String = value
+
+ companion object {
+ /**
+ * Converts the provided [data] to a [String] on success, null otherwise.
+ */
+ fun encode(data: Any?): kotlin.String? = if (data is EnrollAdminInfo) "$data" else null
+
+ /**
+ * Returns a valid [EnrollAdminInfo] for [data], null otherwise.
+ */
+ fun decode(data: Any?): EnrollAdminInfo? = data?.let {
+ val normalizedData = "$it".lowercase()
+ values().firstOrNull { value ->
+ it == value || normalizedData == "$value".lowercase()
+ }
+ }
+ }
+}
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/EnrollAdminV1Request.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/EnrollAdminV1Request.kt
new file mode 100644
index 00000000000..1f393eecee0
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/EnrollAdminV1Request.kt
@@ -0,0 +1,38 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param orgName
+ */
+
+data class EnrollAdminV1Request (
+
+ @Json(name = "orgName")
+ val orgName: kotlin.String
+
+)
+
diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/EnrollAdminV1Response.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/EnrollAdminV1Response.kt
new file mode 100644
index 00000000000..ddd4e4f237e
--- /dev/null
+++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/EnrollAdminV1Response.kt
@@ -0,0 +1,55 @@
+/**
+ * Hyperledger Cactus Example - Carbon Accounting App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param info
+ * @param orgName
+ * @param msp
+ * @param caName
+ * @param identityId The key under which the identity created will be persisted to the keychain for later retrieval.
+ */
+
+data class EnrollAdminV1Response (
+
+ @Json(name = "info")
+ val info: kotlin.String,
+
+ @Json(name = "orgName")
+ val orgName: kotlin.String,
+
+ @Json(name = "msp")
+ val msp: kotlin.String,
+
+ @Json(name = "caName")
+ val caName: kotlin.String,
+
+ /* The key under which the identity created will be persisted to the keychain for later retrieval. */
+ @Json(name = "identityId")
+ val identityId: kotlin.String? = null
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/package.json b/examples/cactus-example-supply-chain-business-logic-plugin/package.json
index ceff346739c..08e05f6a4ba 100644
--- a/examples/cactus-example-supply-chain-business-logic-plugin/package.json
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/package.json
@@ -45,7 +45,9 @@
"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/",
+ "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/",
+ "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",
"watch": "npm-watch",
"webpack": "npm-run-all webpack:dev",
"webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web",
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-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/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
new file mode 100644
index 00000000000..a9f8be8bbb1
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
@@ -0,0 +1,49 @@
+README.md
+build.gradle
+docs/BambooHarvest.md
+docs/Bookshelf.md
+docs/DefaultApi.md
+docs/InsertBambooHarvestRequest.md
+docs/InsertBambooHarvestResponse.md
+docs/InsertBookshelfRequest.md
+docs/InsertBookshelfResponse.md
+docs/InsertShipmentRequest.md
+docs/InsertShipmentResponse.md
+docs/ListBambooHarvestResponse.md
+docs/ListBookshelfResponse.md
+docs/ListShipmentResponse.md
+docs/Shipment.md
+gradle/wrapper/gradle-wrapper.jar
+gradle/wrapper/gradle-wrapper.properties
+gradlew
+gradlew.bat
+settings.gradle
+src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
+src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
+src/main/kotlin/org/openapitools/client/models/BambooHarvest.kt
+src/main/kotlin/org/openapitools/client/models/Bookshelf.kt
+src/main/kotlin/org/openapitools/client/models/InsertBambooHarvestRequest.kt
+src/main/kotlin/org/openapitools/client/models/InsertBambooHarvestResponse.kt
+src/main/kotlin/org/openapitools/client/models/InsertBookshelfRequest.kt
+src/main/kotlin/org/openapitools/client/models/InsertBookshelfResponse.kt
+src/main/kotlin/org/openapitools/client/models/InsertShipmentRequest.kt
+src/main/kotlin/org/openapitools/client/models/InsertShipmentResponse.kt
+src/main/kotlin/org/openapitools/client/models/ListBambooHarvestResponse.kt
+src/main/kotlin/org/openapitools/client/models/ListBookshelfResponse.kt
+src/main/kotlin/org/openapitools/client/models/ListShipmentResponse.kt
+src/main/kotlin/org/openapitools/client/models/Shipment.kt
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
new file mode 100644
index 00000000000..804440660c7
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
@@ -0,0 +1 @@
+5.2.1
\ No newline at end of file
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/README.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/README.md
new file mode 100644
index 00000000000..47c7be89218
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/README.md
@@ -0,0 +1,66 @@
+# org.openapitools.client - Kotlin client library for Hyperledger Cactus Example - Supply Chain App
+
+## Requires
+
+* Kotlin 1.4.30
+* Gradle 6.8.3
+
+## Build
+
+First, create the gradle wrapper script:
+
+```
+gradle wrapper
+```
+
+Then, run:
+
+```
+./gradlew check assemble
+```
+
+This runs all tests and packages the library.
+
+## Features/Implementation Notes
+
+* Supports JSON inputs/outputs, File inputs, and Form inputs.
+* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
+* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
+* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
+
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://localhost*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*DefaultApi* | [**insertBambooHarvestV1**](docs/DefaultApi.md#insertbambooharvestv1) | **POST** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bamboo-harvest | Inserts the provided BambooHarvest entity to the ledger.
+*DefaultApi* | [**insertBookshelfV1**](docs/DefaultApi.md#insertbookshelfv1) | **POST** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bookshelf | Inserts the provided Bookshelf entity to the ledger.
+*DefaultApi* | [**insertShipmentV1**](docs/DefaultApi.md#insertshipmentv1) | **POST** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-shipment | Inserts the provided Shipment entity to the ledger.
+*DefaultApi* | [**listBambooHarvestV1**](docs/DefaultApi.md#listbambooharvestv1) | **GET** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bamboo-harvest | Lists all the BambooHarvest entities stored on the ledger.
+*DefaultApi* | [**listBookshelfV1**](docs/DefaultApi.md#listbookshelfv1) | **GET** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bookshelf | Lists all the Bookshelf entities stored on the ledger.
+*DefaultApi* | [**listShipmentV1**](docs/DefaultApi.md#listshipmentv1) | **GET** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-shipment | Lists all the Shipments entities stored on the ledger.
+
+
+
+## Documentation for Models
+
+ - [org.openapitools.client.models.BambooHarvest](docs/BambooHarvest.md)
+ - [org.openapitools.client.models.Bookshelf](docs/Bookshelf.md)
+ - [org.openapitools.client.models.InsertBambooHarvestRequest](docs/InsertBambooHarvestRequest.md)
+ - [org.openapitools.client.models.InsertBambooHarvestResponse](docs/InsertBambooHarvestResponse.md)
+ - [org.openapitools.client.models.InsertBookshelfRequest](docs/InsertBookshelfRequest.md)
+ - [org.openapitools.client.models.InsertBookshelfResponse](docs/InsertBookshelfResponse.md)
+ - [org.openapitools.client.models.InsertShipmentRequest](docs/InsertShipmentRequest.md)
+ - [org.openapitools.client.models.InsertShipmentResponse](docs/InsertShipmentResponse.md)
+ - [org.openapitools.client.models.ListBambooHarvestResponse](docs/ListBambooHarvestResponse.md)
+ - [org.openapitools.client.models.ListBookshelfResponse](docs/ListBookshelfResponse.md)
+ - [org.openapitools.client.models.ListShipmentResponse](docs/ListShipmentResponse.md)
+ - [org.openapitools.client.models.Shipment](docs/Shipment.md)
+
+
+
+## Documentation for Authorization
+
+All endpoints do not require authorization.
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
new file mode 100644
index 00000000000..3de8b45b135
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
@@ -0,0 +1,37 @@
+group 'org.openapitools'
+version '1.0.0'
+
+wrapper {
+ gradleVersion = '6.8.3'
+ distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
+}
+
+buildscript {
+ ext.kotlin_version = '1.5.10'
+
+ repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+ }
+ dependencies {
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
+apply plugin: 'kotlin'
+
+repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+}
+
+test {
+ useJUnitPlatform()
+}
+
+dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
+ implementation "com.squareup.moshi:moshi-kotlin:1.12.0"
+ implementation "com.squareup.moshi:moshi-adapters:1.12.0"
+ implementation "com.squareup.okhttp3:okhttp:4.9.1"
+ testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/BambooHarvest.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/BambooHarvest.md
new file mode 100644
index 00000000000..87d4b154ac3
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/BambooHarvest.md
@@ -0,0 +1,14 @@
+
+# BambooHarvest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **kotlin.String** | |
+**location** | **kotlin.String** | |
+**startedAt** | **kotlin.String** | |
+**endedAt** | **kotlin.String** | |
+**harvester** | **kotlin.String** | |
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/Bookshelf.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/Bookshelf.md
new file mode 100644
index 00000000000..e0c6e23df8b
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/Bookshelf.md
@@ -0,0 +1,12 @@
+
+# Bookshelf
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **kotlin.String** | |
+**shelfCount** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | The number of shelves the bookshelf comes with. |
+**bambooHarvestId** | **kotlin.String** | The foreign key ID referencing the bamboo harvest that yielded the wood material for the construction of the bookshelf. |
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md
new file mode 100644
index 00000000000..ea7f3cb2cc6
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md
@@ -0,0 +1,272 @@
+# DefaultApi
+
+All URIs are relative to *http://localhost*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**insertBambooHarvestV1**](DefaultApi.md#insertBambooHarvestV1) | **POST** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bamboo-harvest | Inserts the provided BambooHarvest entity to the ledger.
+[**insertBookshelfV1**](DefaultApi.md#insertBookshelfV1) | **POST** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bookshelf | Inserts the provided Bookshelf entity to the ledger.
+[**insertShipmentV1**](DefaultApi.md#insertShipmentV1) | **POST** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-shipment | Inserts the provided Shipment entity to the ledger.
+[**listBambooHarvestV1**](DefaultApi.md#listBambooHarvestV1) | **GET** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bamboo-harvest | Lists all the BambooHarvest entities stored on the ledger.
+[**listBookshelfV1**](DefaultApi.md#listBookshelfV1) | **GET** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bookshelf | Lists all the Bookshelf entities stored on the ledger.
+[**listShipmentV1**](DefaultApi.md#listShipmentV1) | **GET** /api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-shipment | Lists all the Shipments entities stored on the ledger.
+
+
+
+# **insertBambooHarvestV1**
+> InsertBambooHarvestResponse insertBambooHarvestV1(insertBambooHarvestRequest)
+
+Inserts the provided BambooHarvest entity to the ledger.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+val insertBambooHarvestRequest : InsertBambooHarvestRequest = // InsertBambooHarvestRequest |
+try {
+ val result : InsertBambooHarvestResponse = apiInstance.insertBambooHarvestV1(insertBambooHarvestRequest)
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#insertBambooHarvestV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#insertBambooHarvestV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **insertBambooHarvestRequest** | [**InsertBambooHarvestRequest**](InsertBambooHarvestRequest.md)| | [optional]
+
+### Return type
+
+[**InsertBambooHarvestResponse**](InsertBambooHarvestResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+
+# **insertBookshelfV1**
+> InsertBookshelfResponse insertBookshelfV1(insertBookshelfRequest)
+
+Inserts the provided Bookshelf entity to the ledger.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+val insertBookshelfRequest : InsertBookshelfRequest = // InsertBookshelfRequest |
+try {
+ val result : InsertBookshelfResponse = apiInstance.insertBookshelfV1(insertBookshelfRequest)
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#insertBookshelfV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#insertBookshelfV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **insertBookshelfRequest** | [**InsertBookshelfRequest**](InsertBookshelfRequest.md)| | [optional]
+
+### Return type
+
+[**InsertBookshelfResponse**](InsertBookshelfResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+
+# **insertShipmentV1**
+> InsertShipmentResponse insertShipmentV1(insertShipmentRequest)
+
+Inserts the provided Shipment entity to the ledger.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+val insertShipmentRequest : InsertShipmentRequest = // InsertShipmentRequest |
+try {
+ val result : InsertShipmentResponse = apiInstance.insertShipmentV1(insertShipmentRequest)
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#insertShipmentV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#insertShipmentV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **insertShipmentRequest** | [**InsertShipmentRequest**](InsertShipmentRequest.md)| | [optional]
+
+### Return type
+
+[**InsertShipmentResponse**](InsertShipmentResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+
+# **listBambooHarvestV1**
+> ListBambooHarvestResponse listBambooHarvestV1()
+
+Lists all the BambooHarvest entities stored on the ledger.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+try {
+ val result : ListBambooHarvestResponse = apiInstance.listBambooHarvestV1()
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#listBambooHarvestV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#listBambooHarvestV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**ListBambooHarvestResponse**](ListBambooHarvestResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+
+# **listBookshelfV1**
+> ListBookshelfResponse listBookshelfV1()
+
+Lists all the Bookshelf entities stored on the ledger.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+try {
+ val result : ListBookshelfResponse = apiInstance.listBookshelfV1()
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#listBookshelfV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#listBookshelfV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**ListBookshelfResponse**](ListBookshelfResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+
+# **listShipmentV1**
+> ListShipmentResponse listShipmentV1()
+
+Lists all the Shipments entities stored on the ledger.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+try {
+ val result : ListShipmentResponse = apiInstance.listShipmentV1()
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#listShipmentV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#listShipmentV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**ListShipmentResponse**](ListShipmentResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBambooHarvestRequest.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBambooHarvestRequest.md
new file mode 100644
index 00000000000..430a58a538d
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBambooHarvestRequest.md
@@ -0,0 +1,10 @@
+
+# InsertBambooHarvestRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bambooHarvest** | [**BambooHarvest**](BambooHarvest.md) | |
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBambooHarvestResponse.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBambooHarvestResponse.md
new file mode 100644
index 00000000000..b5730d30f77
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBambooHarvestResponse.md
@@ -0,0 +1,11 @@
+
+# InsertBambooHarvestResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**callOutput** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional]
+**transactionReceipt** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional]
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBookshelfRequest.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBookshelfRequest.md
new file mode 100644
index 00000000000..e376ab8714d
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBookshelfRequest.md
@@ -0,0 +1,10 @@
+
+# InsertBookshelfRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bookshelf** | [**Bookshelf**](Bookshelf.md) | |
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBookshelfResponse.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBookshelfResponse.md
new file mode 100644
index 00000000000..39e5e412a69
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertBookshelfResponse.md
@@ -0,0 +1,11 @@
+
+# InsertBookshelfResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**callOutput** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional]
+**transactionReceipt** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional]
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertShipmentRequest.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertShipmentRequest.md
new file mode 100644
index 00000000000..cccc965d60a
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertShipmentRequest.md
@@ -0,0 +1,10 @@
+
+# InsertShipmentRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**shipment** | [**Shipment**](Shipment.md) | |
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertShipmentResponse.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertShipmentResponse.md
new file mode 100644
index 00000000000..854e70ba77a
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/InsertShipmentResponse.md
@@ -0,0 +1,11 @@
+
+# InsertShipmentResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**callOutput** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional]
+**transactionReceipt** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional]
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/ListBambooHarvestResponse.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/ListBambooHarvestResponse.md
new file mode 100644
index 00000000000..5dbdb649d1c
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/ListBambooHarvestResponse.md
@@ -0,0 +1,10 @@
+
+# ListBambooHarvestResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**`data`** | [**kotlin.collections.List<BambooHarvest>**](BambooHarvest.md) | |
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/ListBookshelfResponse.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/ListBookshelfResponse.md
new file mode 100644
index 00000000000..9ce29f650ee
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/ListBookshelfResponse.md
@@ -0,0 +1,10 @@
+
+# ListBookshelfResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**`data`** | [**kotlin.collections.List<Bookshelf>**](Bookshelf.md) | |
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/ListShipmentResponse.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/ListShipmentResponse.md
new file mode 100644
index 00000000000..85f4ceb3369
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/ListShipmentResponse.md
@@ -0,0 +1,10 @@
+
+# ListShipmentResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**`data`** | [**kotlin.collections.List<Shipment>**](Shipment.md) | |
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/Shipment.md b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/Shipment.md
new file mode 100644
index 00000000000..87d1cff1012
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/docs/Shipment.md
@@ -0,0 +1,11 @@
+
+# Shipment
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **kotlin.String** | |
+**bookshelfId** | **kotlin.String** | The foreign key ID referencing the bookshelfId that will go in the shipment. |
+
+
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..e708b1c023e
Binary files /dev/null and b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..8cf6eb5ad22
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew
new file mode 100644
index 00000000000..4f906e0c811
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or 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 UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$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='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# 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
+ ;;
+ 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" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat
new file mode 100644
index 00000000000..107acd32c4e
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-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="-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/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
new file mode 100644
index 00000000000..391dcea81db
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
@@ -0,0 +1,2 @@
+
+rootProject.name = 'kotlin-client'
\ No newline at end of file
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
new file mode 100644
index 00000000000..ea93a3be4a9
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
@@ -0,0 +1,365 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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.apis
+
+import org.openapitools.client.models.InsertBambooHarvestRequest
+import org.openapitools.client.models.InsertBambooHarvestResponse
+import org.openapitools.client.models.InsertBookshelfRequest
+import org.openapitools.client.models.InsertBookshelfResponse
+import org.openapitools.client.models.InsertShipmentRequest
+import org.openapitools.client.models.InsertShipmentResponse
+import org.openapitools.client.models.ListBambooHarvestResponse
+import org.openapitools.client.models.ListBookshelfResponse
+import org.openapitools.client.models.ListShipmentResponse
+
+import org.openapitools.client.infrastructure.ApiClient
+import org.openapitools.client.infrastructure.ClientException
+import org.openapitools.client.infrastructure.ClientError
+import org.openapitools.client.infrastructure.ServerException
+import org.openapitools.client.infrastructure.ServerError
+import org.openapitools.client.infrastructure.MultiValueMap
+import org.openapitools.client.infrastructure.RequestConfig
+import org.openapitools.client.infrastructure.RequestMethod
+import org.openapitools.client.infrastructure.ResponseType
+import org.openapitools.client.infrastructure.Success
+import org.openapitools.client.infrastructure.toMultiValue
+
+class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
+ companion object {
+ @JvmStatic
+ val defaultBasePath: String by lazy {
+ System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://localhost")
+ }
+ }
+
+ /**
+ * Inserts the provided BambooHarvest entity to the ledger.
+ *
+ * @param insertBambooHarvestRequest (optional)
+ * @return InsertBambooHarvestResponse
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun insertBambooHarvestV1(insertBambooHarvestRequest: InsertBambooHarvestRequest?) : InsertBambooHarvestResponse {
+ val localVariableConfig = insertBambooHarvestV1RequestConfig(insertBambooHarvestRequest = insertBambooHarvestRequest)
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as InsertBambooHarvestResponse
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation insertBambooHarvestV1
+ *
+ * @param insertBambooHarvestRequest (optional)
+ * @return RequestConfig
+ */
+ fun insertBambooHarvestV1RequestConfig(insertBambooHarvestRequest: InsertBambooHarvestRequest?) : RequestConfig {
+ val localVariableBody = insertBambooHarvestRequest
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.POST,
+ path = "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bamboo-harvest",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+ /**
+ * Inserts the provided Bookshelf entity to the ledger.
+ *
+ * @param insertBookshelfRequest (optional)
+ * @return InsertBookshelfResponse
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun insertBookshelfV1(insertBookshelfRequest: InsertBookshelfRequest?) : InsertBookshelfResponse {
+ val localVariableConfig = insertBookshelfV1RequestConfig(insertBookshelfRequest = insertBookshelfRequest)
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as InsertBookshelfResponse
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation insertBookshelfV1
+ *
+ * @param insertBookshelfRequest (optional)
+ * @return RequestConfig
+ */
+ fun insertBookshelfV1RequestConfig(insertBookshelfRequest: InsertBookshelfRequest?) : RequestConfig {
+ val localVariableBody = insertBookshelfRequest
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.POST,
+ path = "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bookshelf",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+ /**
+ * Inserts the provided Shipment entity to the ledger.
+ *
+ * @param insertShipmentRequest (optional)
+ * @return InsertShipmentResponse
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun insertShipmentV1(insertShipmentRequest: InsertShipmentRequest?) : InsertShipmentResponse {
+ val localVariableConfig = insertShipmentV1RequestConfig(insertShipmentRequest = insertShipmentRequest)
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as InsertShipmentResponse
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation insertShipmentV1
+ *
+ * @param insertShipmentRequest (optional)
+ * @return RequestConfig
+ */
+ fun insertShipmentV1RequestConfig(insertShipmentRequest: InsertShipmentRequest?) : RequestConfig {
+ val localVariableBody = insertShipmentRequest
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.POST,
+ path = "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-shipment",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+ /**
+ * Lists all the BambooHarvest entities stored on the ledger.
+ *
+ * @return ListBambooHarvestResponse
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun listBambooHarvestV1() : ListBambooHarvestResponse {
+ val localVariableConfig = listBambooHarvestV1RequestConfig()
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as ListBambooHarvestResponse
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation listBambooHarvestV1
+ *
+ * @return RequestConfig
+ */
+ fun listBambooHarvestV1RequestConfig() : RequestConfig {
+ val localVariableBody = null
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.GET,
+ path = "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bamboo-harvest",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+ /**
+ * Lists all the Bookshelf entities stored on the ledger.
+ *
+ * @return ListBookshelfResponse
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun listBookshelfV1() : ListBookshelfResponse {
+ val localVariableConfig = listBookshelfV1RequestConfig()
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as ListBookshelfResponse
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation listBookshelfV1
+ *
+ * @return RequestConfig
+ */
+ fun listBookshelfV1RequestConfig() : RequestConfig {
+ val localVariableBody = null
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.GET,
+ path = "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bookshelf",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+ /**
+ * Lists all the Shipments entities stored on the ledger.
+ *
+ * @return ListShipmentResponse
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun listShipmentV1() : ListShipmentResponse {
+ val localVariableConfig = listShipmentV1RequestConfig()
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as ListShipmentResponse
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation listShipmentV1
+ *
+ * @return RequestConfig
+ */
+ fun listShipmentV1RequestConfig() : RequestConfig {
+ val localVariableBody = null
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.GET,
+ path = "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-shipment",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
new file mode 100644
index 00000000000..ef7a8f1e1a6
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+typealias MultiValueMap = MutableMap>
+
+fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
+ "csv" -> ","
+ "tsv" -> "\t"
+ "pipe" -> "|"
+ "space" -> " "
+ else -> ""
+}
+
+val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
+
+fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter)
+ = toMultiValue(items.asIterable(), collectionFormat, map)
+
+fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List {
+ return when(collectionFormat) {
+ "multi" -> items.map(map)
+ else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map))
+ }
+}
\ No newline at end of file
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
new file mode 100644
index 00000000000..b359be1e41d
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
@@ -0,0 +1,232 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.OkHttpClient
+import okhttp3.RequestBody
+import okhttp3.RequestBody.Companion.asRequestBody
+import okhttp3.RequestBody.Companion.toRequestBody
+import okhttp3.FormBody
+import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
+import okhttp3.ResponseBody
+import okhttp3.MediaType.Companion.toMediaTypeOrNull
+import okhttp3.Request
+import okhttp3.Headers
+import okhttp3.MultipartBody
+import java.io.BufferedWriter
+import java.io.File
+import java.io.FileWriter
+import java.net.URLConnection
+import java.time.LocalDate
+import java.time.LocalDateTime
+import java.time.LocalTime
+import java.time.OffsetDateTime
+import java.time.OffsetTime
+import java.util.Date
+import java.util.Locale
+import com.squareup.moshi.adapter
+
+open class ApiClient(val baseUrl: String) {
+ companion object {
+ protected const val ContentType = "Content-Type"
+ protected const val Accept = "Accept"
+ protected const val Authorization = "Authorization"
+ protected const val JsonMediaType = "application/json"
+ protected const val FormDataMediaType = "multipart/form-data"
+ protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded"
+ protected const val XmlMediaType = "application/xml"
+
+ val apiKey: MutableMap = mutableMapOf()
+ val apiKeyPrefix: MutableMap = mutableMapOf()
+ var username: String? = null
+ var password: String? = null
+ var accessToken: String? = null
+
+ @JvmStatic
+ val client: OkHttpClient by lazy {
+ builder.build()
+ }
+
+ @JvmStatic
+ val builder: OkHttpClient.Builder = OkHttpClient.Builder()
+ }
+
+ /**
+ * Guess Content-Type header from the given file (defaults to "application/octet-stream").
+ *
+ * @param file The given file
+ * @return The guessed Content-Type
+ */
+ protected fun guessContentTypeFromFile(file: File): String {
+ val contentType = URLConnection.guessContentTypeFromName(file.name)
+ return contentType ?: "application/octet-stream"
+ }
+
+ protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody =
+ when {
+ content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull())
+ mediaType == FormDataMediaType -> {
+ MultipartBody.Builder()
+ .setType(MultipartBody.FORM)
+ .apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ if (value is File) {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\"; filename=\"${value.name}\""
+ )
+ val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull()
+ addPart(partHeaders, value.asRequestBody(fileMediaType))
+ } else {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\""
+ )
+ addPart(
+ partHeaders,
+ parameterToString(value).toRequestBody(null)
+ )
+ }
+ }
+ }.build()
+ }
+ mediaType == FormUrlEncMediaType -> {
+ FormBody.Builder().apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ add(key, parameterToString(value))
+ }
+ }.build()
+ }
+ mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody(
+ mediaType.toMediaTypeOrNull()
+ )
+ mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.")
+ // TODO: this should be extended with other serializers
+ else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.")
+ }
+
+ @OptIn(ExperimentalStdlibApi::class)
+ protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? {
+ if(body == null) {
+ return null
+ }
+ val bodyContent = body.string()
+ if (bodyContent.isEmpty()) {
+ return null
+ }
+ if (T::class.java == File::class.java) {
+ // return tempfile
+ val f = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile()
+ f.deleteOnExit()
+ val out = BufferedWriter(FileWriter(f))
+ out.write(bodyContent)
+ out.close()
+ return f as T
+ }
+ return when(mediaType) {
+ JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent)
+ else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.")
+ }
+ }
+
+
+ protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse {
+ val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.")
+
+ val url = httpUrl.newBuilder()
+ .addPathSegments(requestConfig.path.trimStart('/'))
+ .apply {
+ requestConfig.query.forEach { query ->
+ query.value.forEach { queryValue ->
+ addQueryParameter(query.key, queryValue)
+ }
+ }
+ }.build()
+
+ // take content-type/accept from spec or set to default (application/json) if not defined
+ if (requestConfig.headers[ContentType].isNullOrEmpty()) {
+ requestConfig.headers[ContentType] = JsonMediaType
+ }
+ if (requestConfig.headers[Accept].isNullOrEmpty()) {
+ requestConfig.headers[Accept] = JsonMediaType
+ }
+ val headers = requestConfig.headers
+
+ if(headers[ContentType] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Content-Type header. This is required.")
+ }
+
+ if(headers[Accept] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Accept header. This is required.")
+ }
+
+ // TODO: support multiple contentType options here.
+ val contentType = (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault())
+
+ val request = when (requestConfig.method) {
+ RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType))
+ RequestMethod.GET -> Request.Builder().url(url)
+ RequestMethod.HEAD -> Request.Builder().url(url).head()
+ RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType))
+ RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType))
+ RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType))
+ RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null)
+ }.apply {
+ headers.forEach { header -> addHeader(header.key, header.value) }
+ }.build()
+
+ val response = client.newCall(request).execute()
+ val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault())
+
+ // TODO: handle specific mapping types. e.g. Map>
+ return when {
+ response.isRedirect -> Redirection(
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isInformational -> Informational(
+ response.message,
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isSuccessful -> Success(
+ responseBody(response.body, accept),
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isClientError -> ClientError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ else -> ServerError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ }
+ }
+
+ protected fun parameterToString(value: Any?): String = when (value) {
+ null -> ""
+ is Array<*> -> toMultiValue(value, "csv").toString()
+ is Iterable<*> -> toMultiValue(value, "csv").toString()
+ is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date ->
+ parseDateToQueryString(value)
+ else -> value.toString()
+ }
+
+ protected inline fun parseDateToQueryString(value : T): String {
+ /*
+ .replace("\"", "") converts the json object string to an actual string for the query parameter.
+ The moshi or gson adapter allows a more generic solution instead of trying to use a native
+ formatter. It also easily allows to provide a simple way to define a custom date format pattern
+ inside a gson/moshi adapter.
+ */
+ return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "")
+ }
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
new file mode 100644
index 00000000000..9dc8d8dbbfa
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
@@ -0,0 +1,43 @@
+package org.openapitools.client.infrastructure
+
+enum class ResponseType {
+ Success, Informational, Redirection, ClientError, ServerError
+}
+
+interface Response
+
+abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response {
+ abstract val statusCode: Int
+ abstract val headers: Map>
+}
+
+class Success(
+ val data: T,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+): ApiInfrastructureResponse(ResponseType.Success)
+
+class Informational(
+ val statusText: String,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Informational)
+
+class Redirection(
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Redirection)
+
+class ClientError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.ClientError)
+
+class ServerError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map>
+): ApiInfrastructureResponse(ResponseType.ServerError)
\ No newline at end of file
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
new file mode 100644
index 00000000000..fb2c972cf8d
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigDecimal
+
+class BigDecimalAdapter {
+ @ToJson
+ fun toJson(value: BigDecimal): String {
+ return value.toPlainString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigDecimal {
+ return BigDecimal(value)
+ }
+}
\ No newline at end of file
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
new file mode 100644
index 00000000000..4b6963110c9
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigInteger
+
+class BigIntegerAdapter {
+ @ToJson
+ fun toJson(value: BigInteger): String {
+ return value.toString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigInteger {
+ return BigInteger(value)
+ }
+}
\ No newline at end of file
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
new file mode 100644
index 00000000000..ff5e2a81ee8
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
@@ -0,0 +1,12 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+
+class ByteArrayAdapter {
+ @ToJson
+ fun toJson(data: ByteArray): String = String(data)
+
+ @FromJson
+ fun fromJson(data: String): ByteArray = data.toByteArray()
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
new file mode 100644
index 00000000000..b5310e71f13
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
@@ -0,0 +1,18 @@
+@file:Suppress("unused")
+package org.openapitools.client.infrastructure
+
+import java.lang.RuntimeException
+
+open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 123L
+ }
+}
+
+open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 456L
+ }
+}
\ No newline at end of file
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
new file mode 100644
index 00000000000..b2e1654479a
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDate
+import java.time.format.DateTimeFormatter
+
+class LocalDateAdapter {
+ @ToJson
+ fun toJson(value: LocalDate): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDate {
+ return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE)
+ }
+
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
new file mode 100644
index 00000000000..e082db94811
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDateTime
+import java.time.format.DateTimeFormatter
+
+class LocalDateTimeAdapter {
+ @ToJson
+ fun toJson(value: LocalDateTime): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDateTime {
+ return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
+ }
+
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
new file mode 100644
index 00000000000..87437871a31
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.OffsetDateTime
+import java.time.format.DateTimeFormatter
+
+class OffsetDateTimeAdapter {
+ @ToJson
+ fun toJson(value: OffsetDateTime): String {
+ return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): OffsetDateTime {
+ return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
+ }
+
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
new file mode 100644
index 00000000000..7e948e1dd07
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Defines a config object for a given request.
+ * NOTE: This object doesn't include 'body' because it
+ * allows for caching of the constructed object
+ * for many request definitions.
+ * NOTE: Headers is a Map because rfc2616 defines
+ * multi-valued headers as csv-only.
+ */
+data class RequestConfig(
+ val method: RequestMethod,
+ val path: String,
+ val headers: MutableMap = mutableMapOf(),
+ val query: MutableMap> = mutableMapOf(),
+ val body: T? = null
+)
\ No newline at end of file
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
new file mode 100644
index 00000000000..931b12b8bd7
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
@@ -0,0 +1,8 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Provides enumerated HTTP verbs
+ */
+enum class RequestMethod {
+ GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT
+}
\ No newline at end of file
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
new file mode 100644
index 00000000000..9bd2790dc14
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
@@ -0,0 +1,24 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.Response
+
+/**
+ * Provides an extension to evaluation whether the response is a 1xx code
+ */
+val Response.isInformational : Boolean get() = this.code in 100..199
+
+/**
+ * Provides an extension to evaluation whether the response is a 3xx code
+ */
+@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
+val Response.isRedirect : Boolean get() = this.code in 300..399
+
+/**
+ * Provides an extension to evaluation whether the response is a 4xx code
+ */
+val Response.isClientError : Boolean get() = this.code in 400..499
+
+/**
+ * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code
+ */
+val Response.isServerError : Boolean get() = this.code in 500..999
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
new file mode 100644
index 00000000000..e22592e47d7
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.Moshi
+import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
+
+object Serializer {
+ @JvmStatic
+ val moshiBuilder: Moshi.Builder = Moshi.Builder()
+ .add(OffsetDateTimeAdapter())
+ .add(LocalDateTimeAdapter())
+ .add(LocalDateAdapter())
+ .add(UUIDAdapter())
+ .add(ByteArrayAdapter())
+ .add(URIAdapter())
+ .add(KotlinJsonAdapterFactory())
+ .add(BigDecimalAdapter())
+ .add(BigIntegerAdapter())
+
+ @JvmStatic
+ val moshi: Moshi by lazy {
+ moshiBuilder.build()
+ }
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
new file mode 100644
index 00000000000..927522757da
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.net.URI
+
+class URIAdapter {
+ @ToJson
+ fun toJson(uri: URI) = uri.toString()
+
+ @FromJson
+ fun fromJson(s: String): URI = URI.create(s)
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
new file mode 100644
index 00000000000..7ccf7dc25d2
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.util.UUID
+
+class UUIDAdapter {
+ @ToJson
+ fun toJson(uuid: UUID) = uuid.toString()
+
+ @FromJson
+ fun fromJson(s: String): UUID = UUID.fromString(s)
+}
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/BambooHarvest.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/BambooHarvest.kt
new file mode 100644
index 00000000000..ca59f9113be
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/BambooHarvest.kt
@@ -0,0 +1,54 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param id
+ * @param location
+ * @param startedAt
+ * @param endedAt
+ * @param harvester
+ */
+
+data class BambooHarvest (
+
+ @Json(name = "id")
+ val id: kotlin.String,
+
+ @Json(name = "location")
+ val location: kotlin.String,
+
+ @Json(name = "startedAt")
+ val startedAt: kotlin.String,
+
+ @Json(name = "endedAt")
+ val endedAt: kotlin.String,
+
+ @Json(name = "harvester")
+ val harvester: kotlin.String
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Bookshelf.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Bookshelf.kt
new file mode 100644
index 00000000000..ae72c75e086
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Bookshelf.kt
@@ -0,0 +1,48 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param id
+ * @param shelfCount The number of shelves the bookshelf comes with.
+ * @param bambooHarvestId The foreign key ID referencing the bamboo harvest that yielded the wood material for the construction of the bookshelf.
+ */
+
+data class Bookshelf (
+
+ @Json(name = "id")
+ val id: kotlin.String,
+
+ /* The number of shelves the bookshelf comes with. */
+ @Json(name = "shelfCount")
+ val shelfCount: java.math.BigDecimal,
+
+ /* The foreign key ID referencing the bamboo harvest that yielded the wood material for the construction of the bookshelf. */
+ @Json(name = "bambooHarvestId")
+ val bambooHarvestId: kotlin.String
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBambooHarvestRequest.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBambooHarvestRequest.kt
new file mode 100644
index 00000000000..55d74e36dac
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBambooHarvestRequest.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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 org.openapitools.client.models.BambooHarvest
+
+import com.squareup.moshi.Json
+
+/**
+ *
+ *
+ * @param bambooHarvest
+ */
+
+data class InsertBambooHarvestRequest (
+
+ @Json(name = "bambooHarvest")
+ val bambooHarvest: BambooHarvest
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBambooHarvestResponse.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBambooHarvestResponse.kt
new file mode 100644
index 00000000000..908a4878899
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBambooHarvestResponse.kt
@@ -0,0 +1,42 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param callOutput
+ * @param transactionReceipt
+ */
+
+data class InsertBambooHarvestResponse (
+
+ @Json(name = "callOutput")
+ val callOutput: kotlin.collections.Map? = null,
+
+ @Json(name = "transactionReceipt")
+ val transactionReceipt: kotlin.collections.Map? = null
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBookshelfRequest.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBookshelfRequest.kt
new file mode 100644
index 00000000000..f3c7ecbca50
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBookshelfRequest.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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 org.openapitools.client.models.Bookshelf
+
+import com.squareup.moshi.Json
+
+/**
+ *
+ *
+ * @param bookshelf
+ */
+
+data class InsertBookshelfRequest (
+
+ @Json(name = "bookshelf")
+ val bookshelf: Bookshelf
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBookshelfResponse.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBookshelfResponse.kt
new file mode 100644
index 00000000000..92476e28fe9
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertBookshelfResponse.kt
@@ -0,0 +1,42 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param callOutput
+ * @param transactionReceipt
+ */
+
+data class InsertBookshelfResponse (
+
+ @Json(name = "callOutput")
+ val callOutput: kotlin.collections.Map? = null,
+
+ @Json(name = "transactionReceipt")
+ val transactionReceipt: kotlin.collections.Map? = null
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertShipmentRequest.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertShipmentRequest.kt
new file mode 100644
index 00000000000..2f3aa03aa78
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertShipmentRequest.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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 org.openapitools.client.models.Shipment
+
+import com.squareup.moshi.Json
+
+/**
+ *
+ *
+ * @param shipment
+ */
+
+data class InsertShipmentRequest (
+
+ @Json(name = "shipment")
+ val shipment: Shipment
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertShipmentResponse.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertShipmentResponse.kt
new file mode 100644
index 00000000000..8948581ca30
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InsertShipmentResponse.kt
@@ -0,0 +1,42 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param callOutput
+ * @param transactionReceipt
+ */
+
+data class InsertShipmentResponse (
+
+ @Json(name = "callOutput")
+ val callOutput: kotlin.collections.Map? = null,
+
+ @Json(name = "transactionReceipt")
+ val transactionReceipt: kotlin.collections.Map? = null
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListBambooHarvestResponse.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListBambooHarvestResponse.kt
new file mode 100644
index 00000000000..9b9994c6424
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListBambooHarvestResponse.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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 org.openapitools.client.models.BambooHarvest
+
+import com.squareup.moshi.Json
+
+/**
+ *
+ *
+ * @param `data`
+ */
+
+data class ListBambooHarvestResponse (
+
+ @Json(name = "data")
+ val `data`: kotlin.collections.List = arrayListOf()
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListBookshelfResponse.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListBookshelfResponse.kt
new file mode 100644
index 00000000000..313dda5048d
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListBookshelfResponse.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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 org.openapitools.client.models.Bookshelf
+
+import com.squareup.moshi.Json
+
+/**
+ *
+ *
+ * @param `data`
+ */
+
+data class ListBookshelfResponse (
+
+ @Json(name = "data")
+ val `data`: kotlin.collections.List = arrayListOf()
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListShipmentResponse.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListShipmentResponse.kt
new file mode 100644
index 00000000000..b2473559237
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListShipmentResponse.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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 org.openapitools.client.models.Shipment
+
+import com.squareup.moshi.Json
+
+/**
+ *
+ *
+ * @param `data`
+ */
+
+data class ListShipmentResponse (
+
+ @Json(name = "data")
+ val `data`: kotlin.collections.List = arrayListOf()
+
+)
+
diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Shipment.kt b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Shipment.kt
new file mode 100644
index 00000000000..8cf952819f8
--- /dev/null
+++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Shipment.kt
@@ -0,0 +1,43 @@
+/**
+ * Hyperledger Cactus Example - Supply Chain App
+ *
+ * Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param id
+ * @param bookshelfId The foreign key ID referencing the bookshelfId that will go in the shipment.
+ */
+
+data class Shipment (
+
+ @Json(name = "id")
+ val id: kotlin.String,
+
+ /* The foreign key ID referencing the bookshelfId that will go in the shipment. */
+ @Json(name = "bookshelfId")
+ val bookshelfId: kotlin.String
+
+)
+
diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/package.json b/extensions/cactus-plugin-htlc-coordinator-besu/package.json
index a099c42c98b..e07547ee304 100644
--- a/extensions/cactus-plugin-htlc-coordinator-besu/package.json
+++ b/extensions/cactus-plugin-htlc-coordinator-besu/package.json
@@ -45,7 +45,8 @@
"scripts": {
"codegen": "run-p 'codegen:*'",
"codegen:openapi": "run-p 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/",
+ "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/",
"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-object-store-ipfs/package.json b/extensions/cactus-plugin-object-store-ipfs/package.json
index c8bf309fd60..ab3a71c83d9 100644
--- a/extensions/cactus-plugin-object-store-ipfs/package.json
+++ b/extensions/cactus-plugin-object-store-ipfs/package.json
@@ -45,7 +45,9 @@
"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",
+ "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",
+ "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",
"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/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-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/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
new file mode 100644
index 00000000000..38598b1178b
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
@@ -0,0 +1,37 @@
+README.md
+build.gradle
+docs/DefaultApi.md
+docs/GetObjectRequestV1.md
+docs/GetObjectResponseV1.md
+docs/HasObjectRequestV1.md
+docs/HasObjectResponseV1.md
+docs/SetObjectRequestV1.md
+docs/SetObjectResponseV1.md
+gradle/wrapper/gradle-wrapper.jar
+gradle/wrapper/gradle-wrapper.properties
+gradlew
+gradlew.bat
+settings.gradle
+src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
+src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
+src/main/kotlin/org/openapitools/client/models/GetObjectRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/GetObjectResponseV1.kt
+src/main/kotlin/org/openapitools/client/models/HasObjectRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/HasObjectResponseV1.kt
+src/main/kotlin/org/openapitools/client/models/SetObjectRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/SetObjectResponseV1.kt
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
new file mode 100644
index 00000000000..804440660c7
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
@@ -0,0 +1 @@
+5.2.1
\ No newline at end of file
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/README.md b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/README.md
new file mode 100644
index 00000000000..439eb8b61c2
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/README.md
@@ -0,0 +1,57 @@
+# org.openapitools.client - Kotlin client library for Hyperledger Cactus Plugin - Object Store - IPFS
+
+## Requires
+
+* Kotlin 1.4.30
+* Gradle 6.8.3
+
+## Build
+
+First, create the gradle wrapper script:
+
+```
+gradle wrapper
+```
+
+Then, run:
+
+```
+./gradlew check assemble
+```
+
+This runs all tests and packages the library.
+
+## Features/Implementation Notes
+
+* Supports JSON inputs/outputs, File inputs, and Form inputs.
+* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
+* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
+* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
+
+
+## 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
+
+ - [org.openapitools.client.models.GetObjectRequestV1](docs/GetObjectRequestV1.md)
+ - [org.openapitools.client.models.GetObjectResponseV1](docs/GetObjectResponseV1.md)
+ - [org.openapitools.client.models.HasObjectRequestV1](docs/HasObjectRequestV1.md)
+ - [org.openapitools.client.models.HasObjectResponseV1](docs/HasObjectResponseV1.md)
+ - [org.openapitools.client.models.SetObjectRequestV1](docs/SetObjectRequestV1.md)
+ - [org.openapitools.client.models.SetObjectResponseV1](docs/SetObjectResponseV1.md)
+
+
+
+## Documentation for Authorization
+
+All endpoints do not require authorization.
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
new file mode 100644
index 00000000000..3de8b45b135
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
@@ -0,0 +1,37 @@
+group 'org.openapitools'
+version '1.0.0'
+
+wrapper {
+ gradleVersion = '6.8.3'
+ distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
+}
+
+buildscript {
+ ext.kotlin_version = '1.5.10'
+
+ repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+ }
+ dependencies {
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
+apply plugin: 'kotlin'
+
+repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+}
+
+test {
+ useJUnitPlatform()
+}
+
+dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
+ implementation "com.squareup.moshi:moshi-kotlin:1.12.0"
+ implementation "com.squareup.moshi:moshi-adapters:1.12.0"
+ implementation "com.squareup.okhttp3:okhttp:4.9.1"
+ testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md
new file mode 100644
index 00000000000..e9c9eb1fd3c
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md
@@ -0,0 +1,146 @@
+# 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(getObjectRequestV1)
+
+Retrieves an object from the object store.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+val getObjectRequestV1 : GetObjectRequestV1 = // GetObjectRequestV1 | Request body to obtain an object via its key.
+try {
+ val result : GetObjectResponseV1 = apiInstance.getObjectV1(getObjectRequestV1)
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#getObjectV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#getObjectV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+
+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
+
+
+# **hasObjectV1**
+> HasObjectResponseV1 hasObjectV1(hasObjectRequestV1)
+
+Checks the presence of an object in the object store.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+val hasObjectRequestV1 : HasObjectRequestV1 = // HasObjectRequestV1 | Request body to check presence of an object under a key.
+try {
+ val result : HasObjectResponseV1 = apiInstance.hasObjectV1(hasObjectRequestV1)
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#hasObjectV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#hasObjectV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+
+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
+
+
+# **setObjectV1**
+> SetObjectResponseV1 setObjectV1(setObjectRequestV1)
+
+Sets an object in the object store under the specified key.
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+val setObjectRequestV1 : SetObjectRequestV1 = // SetObjectRequestV1 | Request body to set an object under a key.
+try {
+ val result : SetObjectResponseV1 = apiInstance.setObjectV1(setObjectRequestV1)
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#setObjectV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#setObjectV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+
+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
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectRequestV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectRequestV1.md
new file mode 100644
index 00000000000..ddd945004c7
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectRequestV1.md
@@ -0,0 +1,10 @@
+
+# GetObjectRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key for the entry to get from the object store. |
+
+
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectResponseV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectResponseV1.md
new file mode 100644
index 00000000000..f1d8794c4d1
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectResponseV1.md
@@ -0,0 +1,11 @@
+
+# GetObjectResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was used to retrieve the value from the object store. |
+**`value`** | **kotlin.String** | The value associated with the requested key in the object store as a string. |
+
+
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectRequestV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectRequestV1.md
new file mode 100644
index 00000000000..d06b34b86cf
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectRequestV1.md
@@ -0,0 +1,10 @@
+
+# HasObjectRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key to check for presence in the object store. |
+
+
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectResponseV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectResponseV1.md
new file mode 100644
index 00000000000..dcfff57ce1a
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectResponseV1.md
@@ -0,0 +1,12 @@
+
+# HasObjectResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was used to check the presence of the value in the object store. |
+**checkedAt** | **kotlin.String** | Date and time encoded as JSON when the presence check was performed by the plugin backend. |
+**isPresent** | **kotlin.Boolean** | The boolean true or false indicating the presence or absence of an object under 'key'. |
+
+
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectRequestV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectRequestV1.md
new file mode 100644
index 00000000000..a95311857aa
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectRequestV1.md
@@ -0,0 +1,11 @@
+
+# SetObjectRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key for the entry to set in the object store. |
+**`value`** | **kotlin.String** | The value that will be associated with the key in the object store. |
+
+
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectResponseV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectResponseV1.md
new file mode 100644
index 00000000000..688c1f31c86
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectResponseV1.md
@@ -0,0 +1,10 @@
+
+# SetObjectResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was used to set the value in the object store. |
+
+
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..e708b1c023e
Binary files /dev/null and b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..8cf6eb5ad22
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradlew b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradlew
new file mode 100644
index 00000000000..4f906e0c811
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or 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 UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$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='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# 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
+ ;;
+ 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" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat
new file mode 100644
index 00000000000..107acd32c4e
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-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="-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/kotlin/generated/openapi/kotlin-client/settings.gradle b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
new file mode 100644
index 00000000000..391dcea81db
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
@@ -0,0 +1,2 @@
+
+rootProject.name = 'kotlin-client'
\ No newline at end of file
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
new file mode 100644
index 00000000000..b2973ce23fa
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
@@ -0,0 +1,209 @@
+/**
+ * Hyperledger Cactus Plugin - Object Store - IPFS
+ *
+ * Contains/describes the Hyperledger Cactus Object Store IPFS plugin.
+ *
+ * The version of the OpenAPI document: 0.2.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.apis
+
+import org.openapitools.client.models.GetObjectRequestV1
+import org.openapitools.client.models.GetObjectResponseV1
+import org.openapitools.client.models.HasObjectRequestV1
+import org.openapitools.client.models.HasObjectResponseV1
+import org.openapitools.client.models.SetObjectRequestV1
+import org.openapitools.client.models.SetObjectResponseV1
+
+import org.openapitools.client.infrastructure.ApiClient
+import org.openapitools.client.infrastructure.ClientException
+import org.openapitools.client.infrastructure.ClientError
+import org.openapitools.client.infrastructure.ServerException
+import org.openapitools.client.infrastructure.ServerError
+import org.openapitools.client.infrastructure.MultiValueMap
+import org.openapitools.client.infrastructure.RequestConfig
+import org.openapitools.client.infrastructure.RequestMethod
+import org.openapitools.client.infrastructure.ResponseType
+import org.openapitools.client.infrastructure.Success
+import org.openapitools.client.infrastructure.toMultiValue
+
+class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
+ companion object {
+ @JvmStatic
+ val defaultBasePath: String by lazy {
+ System.getProperties().getProperty("org.openapitools.client.baseUrl", "https://www.cactus.stream")
+ }
+ }
+
+ /**
+ * Retrieves an object from the object store.
+ *
+ * @param getObjectRequestV1 Request body to obtain an object via its key.
+ * @return GetObjectResponseV1
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun getObjectV1(getObjectRequestV1: GetObjectRequestV1) : GetObjectResponseV1 {
+ val localVariableConfig = getObjectV1RequestConfig(getObjectRequestV1 = getObjectRequestV1)
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as GetObjectResponseV1
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation getObjectV1
+ *
+ * @param getObjectRequestV1 Request body to obtain an object via its key.
+ * @return RequestConfig
+ */
+ fun getObjectV1RequestConfig(getObjectRequestV1: GetObjectRequestV1) : RequestConfig {
+ val localVariableBody = getObjectRequestV1
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.POST,
+ path = "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+ /**
+ * Checks the presence of an object in the object store.
+ *
+ * @param hasObjectRequestV1 Request body to check presence of an object under a key.
+ * @return HasObjectResponseV1
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun hasObjectV1(hasObjectRequestV1: HasObjectRequestV1) : HasObjectResponseV1 {
+ val localVariableConfig = hasObjectV1RequestConfig(hasObjectRequestV1 = hasObjectRequestV1)
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as HasObjectResponseV1
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation hasObjectV1
+ *
+ * @param hasObjectRequestV1 Request body to check presence of an object under a key.
+ * @return RequestConfig
+ */
+ fun hasObjectV1RequestConfig(hasObjectRequestV1: HasObjectRequestV1) : RequestConfig {
+ val localVariableBody = hasObjectRequestV1
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.POST,
+ path = "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+ /**
+ * Sets an object in the object store under the specified key.
+ *
+ * @param setObjectRequestV1 Request body to set an object under a key.
+ * @return SetObjectResponseV1
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun setObjectV1(setObjectRequestV1: SetObjectRequestV1) : SetObjectResponseV1 {
+ val localVariableConfig = setObjectV1RequestConfig(setObjectRequestV1 = setObjectRequestV1)
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as SetObjectResponseV1
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation setObjectV1
+ *
+ * @param setObjectRequestV1 Request body to set an object under a key.
+ * @return RequestConfig
+ */
+ fun setObjectV1RequestConfig(setObjectRequestV1: SetObjectRequestV1) : RequestConfig {
+ val localVariableBody = setObjectRequestV1
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.POST,
+ path = "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
new file mode 100644
index 00000000000..ef7a8f1e1a6
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+typealias MultiValueMap = MutableMap>
+
+fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
+ "csv" -> ","
+ "tsv" -> "\t"
+ "pipe" -> "|"
+ "space" -> " "
+ else -> ""
+}
+
+val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
+
+fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter)
+ = toMultiValue(items.asIterable(), collectionFormat, map)
+
+fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List {
+ return when(collectionFormat) {
+ "multi" -> items.map(map)
+ else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map))
+ }
+}
\ No newline at end of file
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
new file mode 100644
index 00000000000..b359be1e41d
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
@@ -0,0 +1,232 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.OkHttpClient
+import okhttp3.RequestBody
+import okhttp3.RequestBody.Companion.asRequestBody
+import okhttp3.RequestBody.Companion.toRequestBody
+import okhttp3.FormBody
+import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
+import okhttp3.ResponseBody
+import okhttp3.MediaType.Companion.toMediaTypeOrNull
+import okhttp3.Request
+import okhttp3.Headers
+import okhttp3.MultipartBody
+import java.io.BufferedWriter
+import java.io.File
+import java.io.FileWriter
+import java.net.URLConnection
+import java.time.LocalDate
+import java.time.LocalDateTime
+import java.time.LocalTime
+import java.time.OffsetDateTime
+import java.time.OffsetTime
+import java.util.Date
+import java.util.Locale
+import com.squareup.moshi.adapter
+
+open class ApiClient(val baseUrl: String) {
+ companion object {
+ protected const val ContentType = "Content-Type"
+ protected const val Accept = "Accept"
+ protected const val Authorization = "Authorization"
+ protected const val JsonMediaType = "application/json"
+ protected const val FormDataMediaType = "multipart/form-data"
+ protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded"
+ protected const val XmlMediaType = "application/xml"
+
+ val apiKey: MutableMap = mutableMapOf()
+ val apiKeyPrefix: MutableMap = mutableMapOf()
+ var username: String? = null
+ var password: String? = null
+ var accessToken: String? = null
+
+ @JvmStatic
+ val client: OkHttpClient by lazy {
+ builder.build()
+ }
+
+ @JvmStatic
+ val builder: OkHttpClient.Builder = OkHttpClient.Builder()
+ }
+
+ /**
+ * Guess Content-Type header from the given file (defaults to "application/octet-stream").
+ *
+ * @param file The given file
+ * @return The guessed Content-Type
+ */
+ protected fun guessContentTypeFromFile(file: File): String {
+ val contentType = URLConnection.guessContentTypeFromName(file.name)
+ return contentType ?: "application/octet-stream"
+ }
+
+ protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody =
+ when {
+ content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull())
+ mediaType == FormDataMediaType -> {
+ MultipartBody.Builder()
+ .setType(MultipartBody.FORM)
+ .apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ if (value is File) {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\"; filename=\"${value.name}\""
+ )
+ val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull()
+ addPart(partHeaders, value.asRequestBody(fileMediaType))
+ } else {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\""
+ )
+ addPart(
+ partHeaders,
+ parameterToString(value).toRequestBody(null)
+ )
+ }
+ }
+ }.build()
+ }
+ mediaType == FormUrlEncMediaType -> {
+ FormBody.Builder().apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ add(key, parameterToString(value))
+ }
+ }.build()
+ }
+ mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody(
+ mediaType.toMediaTypeOrNull()
+ )
+ mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.")
+ // TODO: this should be extended with other serializers
+ else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.")
+ }
+
+ @OptIn(ExperimentalStdlibApi::class)
+ protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? {
+ if(body == null) {
+ return null
+ }
+ val bodyContent = body.string()
+ if (bodyContent.isEmpty()) {
+ return null
+ }
+ if (T::class.java == File::class.java) {
+ // return tempfile
+ val f = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile()
+ f.deleteOnExit()
+ val out = BufferedWriter(FileWriter(f))
+ out.write(bodyContent)
+ out.close()
+ return f as T
+ }
+ return when(mediaType) {
+ JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent)
+ else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.")
+ }
+ }
+
+
+ protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse {
+ val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.")
+
+ val url = httpUrl.newBuilder()
+ .addPathSegments(requestConfig.path.trimStart('/'))
+ .apply {
+ requestConfig.query.forEach { query ->
+ query.value.forEach { queryValue ->
+ addQueryParameter(query.key, queryValue)
+ }
+ }
+ }.build()
+
+ // take content-type/accept from spec or set to default (application/json) if not defined
+ if (requestConfig.headers[ContentType].isNullOrEmpty()) {
+ requestConfig.headers[ContentType] = JsonMediaType
+ }
+ if (requestConfig.headers[Accept].isNullOrEmpty()) {
+ requestConfig.headers[Accept] = JsonMediaType
+ }
+ val headers = requestConfig.headers
+
+ if(headers[ContentType] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Content-Type header. This is required.")
+ }
+
+ if(headers[Accept] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Accept header. This is required.")
+ }
+
+ // TODO: support multiple contentType options here.
+ val contentType = (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault())
+
+ val request = when (requestConfig.method) {
+ RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType))
+ RequestMethod.GET -> Request.Builder().url(url)
+ RequestMethod.HEAD -> Request.Builder().url(url).head()
+ RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType))
+ RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType))
+ RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType))
+ RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null)
+ }.apply {
+ headers.forEach { header -> addHeader(header.key, header.value) }
+ }.build()
+
+ val response = client.newCall(request).execute()
+ val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault())
+
+ // TODO: handle specific mapping types. e.g. Map>
+ return when {
+ response.isRedirect -> Redirection(
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isInformational -> Informational(
+ response.message,
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isSuccessful -> Success(
+ responseBody(response.body, accept),
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isClientError -> ClientError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ else -> ServerError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ }
+ }
+
+ protected fun parameterToString(value: Any?): String = when (value) {
+ null -> ""
+ is Array<*> -> toMultiValue(value, "csv").toString()
+ is Iterable<*> -> toMultiValue(value, "csv").toString()
+ is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date ->
+ parseDateToQueryString(value)
+ else -> value.toString()
+ }
+
+ protected inline fun parseDateToQueryString(value : T): String {
+ /*
+ .replace("\"", "") converts the json object string to an actual string for the query parameter.
+ The moshi or gson adapter allows a more generic solution instead of trying to use a native
+ formatter. It also easily allows to provide a simple way to define a custom date format pattern
+ inside a gson/moshi adapter.
+ */
+ return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "")
+ }
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
new file mode 100644
index 00000000000..9dc8d8dbbfa
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
@@ -0,0 +1,43 @@
+package org.openapitools.client.infrastructure
+
+enum class ResponseType {
+ Success, Informational, Redirection, ClientError, ServerError
+}
+
+interface Response
+
+abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response {
+ abstract val statusCode: Int
+ abstract val headers: Map>
+}
+
+class Success(
+ val data: T,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+): ApiInfrastructureResponse(ResponseType.Success)
+
+class Informational(
+ val statusText: String,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Informational)
+
+class Redirection(
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Redirection)
+
+class ClientError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.ClientError)
+
+class ServerError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map>
+): ApiInfrastructureResponse(ResponseType.ServerError)
\ No newline at end of file
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
new file mode 100644
index 00000000000..fb2c972cf8d
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigDecimal
+
+class BigDecimalAdapter {
+ @ToJson
+ fun toJson(value: BigDecimal): String {
+ return value.toPlainString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigDecimal {
+ return BigDecimal(value)
+ }
+}
\ No newline at end of file
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
new file mode 100644
index 00000000000..4b6963110c9
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigInteger
+
+class BigIntegerAdapter {
+ @ToJson
+ fun toJson(value: BigInteger): String {
+ return value.toString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigInteger {
+ return BigInteger(value)
+ }
+}
\ No newline at end of file
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
new file mode 100644
index 00000000000..ff5e2a81ee8
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
@@ -0,0 +1,12 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+
+class ByteArrayAdapter {
+ @ToJson
+ fun toJson(data: ByteArray): String = String(data)
+
+ @FromJson
+ fun fromJson(data: String): ByteArray = data.toByteArray()
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
new file mode 100644
index 00000000000..b5310e71f13
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
@@ -0,0 +1,18 @@
+@file:Suppress("unused")
+package org.openapitools.client.infrastructure
+
+import java.lang.RuntimeException
+
+open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 123L
+ }
+}
+
+open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 456L
+ }
+}
\ No newline at end of file
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
new file mode 100644
index 00000000000..b2e1654479a
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDate
+import java.time.format.DateTimeFormatter
+
+class LocalDateAdapter {
+ @ToJson
+ fun toJson(value: LocalDate): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDate {
+ return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE)
+ }
+
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
new file mode 100644
index 00000000000..e082db94811
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDateTime
+import java.time.format.DateTimeFormatter
+
+class LocalDateTimeAdapter {
+ @ToJson
+ fun toJson(value: LocalDateTime): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDateTime {
+ return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
+ }
+
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
new file mode 100644
index 00000000000..87437871a31
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.OffsetDateTime
+import java.time.format.DateTimeFormatter
+
+class OffsetDateTimeAdapter {
+ @ToJson
+ fun toJson(value: OffsetDateTime): String {
+ return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): OffsetDateTime {
+ return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
+ }
+
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
new file mode 100644
index 00000000000..7e948e1dd07
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Defines a config object for a given request.
+ * NOTE: This object doesn't include 'body' because it
+ * allows for caching of the constructed object
+ * for many request definitions.
+ * NOTE: Headers is a Map because rfc2616 defines
+ * multi-valued headers as csv-only.
+ */
+data class RequestConfig(
+ val method: RequestMethod,
+ val path: String,
+ val headers: MutableMap = mutableMapOf(),
+ val query: MutableMap> = mutableMapOf(),
+ val body: T? = null
+)
\ No newline at end of file
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
new file mode 100644
index 00000000000..931b12b8bd7
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
@@ -0,0 +1,8 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Provides enumerated HTTP verbs
+ */
+enum class RequestMethod {
+ GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT
+}
\ No newline at end of file
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
new file mode 100644
index 00000000000..9bd2790dc14
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
@@ -0,0 +1,24 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.Response
+
+/**
+ * Provides an extension to evaluation whether the response is a 1xx code
+ */
+val Response.isInformational : Boolean get() = this.code in 100..199
+
+/**
+ * Provides an extension to evaluation whether the response is a 3xx code
+ */
+@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
+val Response.isRedirect : Boolean get() = this.code in 300..399
+
+/**
+ * Provides an extension to evaluation whether the response is a 4xx code
+ */
+val Response.isClientError : Boolean get() = this.code in 400..499
+
+/**
+ * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code
+ */
+val Response.isServerError : Boolean get() = this.code in 500..999
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
new file mode 100644
index 00000000000..e22592e47d7
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.Moshi
+import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
+
+object Serializer {
+ @JvmStatic
+ val moshiBuilder: Moshi.Builder = Moshi.Builder()
+ .add(OffsetDateTimeAdapter())
+ .add(LocalDateTimeAdapter())
+ .add(LocalDateAdapter())
+ .add(UUIDAdapter())
+ .add(ByteArrayAdapter())
+ .add(URIAdapter())
+ .add(KotlinJsonAdapterFactory())
+ .add(BigDecimalAdapter())
+ .add(BigIntegerAdapter())
+
+ @JvmStatic
+ val moshi: Moshi by lazy {
+ moshiBuilder.build()
+ }
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
new file mode 100644
index 00000000000..927522757da
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.net.URI
+
+class URIAdapter {
+ @ToJson
+ fun toJson(uri: URI) = uri.toString()
+
+ @FromJson
+ fun fromJson(s: String): URI = URI.create(s)
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
new file mode 100644
index 00000000000..7ccf7dc25d2
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.util.UUID
+
+class UUIDAdapter {
+ @ToJson
+ fun toJson(uuid: UUID) = uuid.toString()
+
+ @FromJson
+ fun fromJson(s: String): UUID = UUID.fromString(s)
+}
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectRequestV1.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectRequestV1.kt
new file mode 100644
index 00000000000..99eb95bcd29
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectRequestV1.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Plugin - Object Store - IPFS
+ *
+ * Contains/describes the Hyperledger Cactus Object Store IPFS plugin.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param key The key for the entry to get from the object store.
+ */
+
+data class GetObjectRequestV1 (
+
+ /* The key for the entry to get from the object store. */
+ @Json(name = "key")
+ val key: kotlin.String
+
+)
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectResponseV1.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectResponseV1.kt
new file mode 100644
index 00000000000..45bc3f6f4fa
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectResponseV1.kt
@@ -0,0 +1,44 @@
+/**
+ * Hyperledger Cactus Plugin - Object Store - IPFS
+ *
+ * Contains/describes the Hyperledger Cactus Object Store IPFS plugin.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param key The key that was used to retrieve the value from the object store.
+ * @param `value` The value associated with the requested key in the object store as a string.
+ */
+
+data class GetObjectResponseV1 (
+
+ /* The key that was used to retrieve the value from the object store. */
+ @Json(name = "key")
+ val key: kotlin.String,
+
+ /* The value associated with the requested key in the object store as a string. */
+ @Json(name = "value")
+ val `value`: kotlin.String
+
+)
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectRequestV1.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectRequestV1.kt
new file mode 100644
index 00000000000..c9c492f9a49
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectRequestV1.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Plugin - Object Store - IPFS
+ *
+ * Contains/describes the Hyperledger Cactus Object Store IPFS plugin.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param key The key to check for presence in the object store.
+ */
+
+data class HasObjectRequestV1 (
+
+ /* The key to check for presence in the object store. */
+ @Json(name = "key")
+ val key: kotlin.String
+
+)
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectResponseV1.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectResponseV1.kt
new file mode 100644
index 00000000000..e2e6ad4bbe3
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectResponseV1.kt
@@ -0,0 +1,49 @@
+/**
+ * Hyperledger Cactus Plugin - Object Store - IPFS
+ *
+ * Contains/describes the Hyperledger Cactus Object Store IPFS plugin.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param key The key that was used to check the presence of the value in the object store.
+ * @param checkedAt Date and time encoded as JSON when the presence check was performed by the plugin backend.
+ * @param isPresent The boolean true or false indicating the presence or absence of an object under 'key'.
+ */
+
+data class HasObjectResponseV1 (
+
+ /* The key that was used to check the presence of the value in the object store. */
+ @Json(name = "key")
+ val key: kotlin.String,
+
+ /* Date and time encoded as JSON when the presence check was performed by the plugin backend. */
+ @Json(name = "checkedAt")
+ val checkedAt: kotlin.String,
+
+ /* The boolean true or false indicating the presence or absence of an object under 'key'. */
+ @Json(name = "isPresent")
+ val isPresent: kotlin.Boolean
+
+)
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectRequestV1.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectRequestV1.kt
new file mode 100644
index 00000000000..610860e1721
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectRequestV1.kt
@@ -0,0 +1,44 @@
+/**
+ * Hyperledger Cactus Plugin - Object Store - IPFS
+ *
+ * Contains/describes the Hyperledger Cactus Object Store IPFS plugin.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param key The key for the entry to set in the object store.
+ * @param `value` The value that will be associated with the key in the object store.
+ */
+
+data class SetObjectRequestV1 (
+
+ /* The key for the entry to set in the object store. */
+ @Json(name = "key")
+ val key: kotlin.String,
+
+ /* The value that will be associated with the key in the object store. */
+ @Json(name = "value")
+ val `value`: kotlin.String
+
+)
+
diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectResponseV1.kt b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectResponseV1.kt
new file mode 100644
index 00000000000..d0c58b78c38
--- /dev/null
+++ b/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectResponseV1.kt
@@ -0,0 +1,39 @@
+/**
+ * Hyperledger Cactus Plugin - Object Store - IPFS
+ *
+ * Contains/describes the Hyperledger Cactus Object Store IPFS plugin.
+ *
+ * The version of the OpenAPI document: 0.2.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
+
+/**
+ *
+ *
+ * @param key The key that was used to set the value in the object store.
+ */
+
+data class SetObjectResponseV1 (
+
+ /* The key that was used to set the value in the object store. */
+ @Json(name = "key")
+ val key: kotlin.String
+
+)
+
diff --git a/packages/cactus-cmd-api-server/package.json b/packages/cactus-cmd-api-server/package.json
index 3b274bfc571..4d60ba0698f 100644
--- a/packages/cactus-cmd-api-server/package.json
+++ b/packages/cactus-cmd-api-server/package.json
@@ -46,7 +46,9 @@
"codegen": "run-p 'codegen:*'",
"codegen:openapi": "npm run generate-sdk",
"codegen:proto": "run-s proto:openapi proto:protoc-gen-ts",
- "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",
+ "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",
+ "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: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/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-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-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
new file mode 100644
index 00000000000..753dcb10d1e
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
@@ -0,0 +1,31 @@
+README.md
+build.gradle
+docs/DefaultApi.md
+docs/HealthCheckResponse.md
+docs/MemoryUsage.md
+docs/WatchHealthcheckV1.md
+gradle/wrapper/gradle-wrapper.jar
+gradle/wrapper/gradle-wrapper.properties
+gradlew
+gradlew.bat
+settings.gradle
+src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
+src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
+src/main/kotlin/org/openapitools/client/models/HealthCheckResponse.kt
+src/main/kotlin/org/openapitools/client/models/MemoryUsage.kt
+src/main/kotlin/org/openapitools/client/models/WatchHealthcheckV1.kt
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
new file mode 100644
index 00000000000..804440660c7
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
@@ -0,0 +1 @@
+5.2.1
\ No newline at end of file
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/README.md
new file mode 100644
index 00000000000..1665b8308cb
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/README.md
@@ -0,0 +1,53 @@
+# org.openapitools.client - Kotlin client library for Hyperledger Cactus API
+
+## Requires
+
+* Kotlin 1.4.30
+* Gradle 6.8.3
+
+## Build
+
+First, create the gradle wrapper script:
+
+```
+gradle wrapper
+```
+
+Then, run:
+
+```
+./gradlew check assemble
+```
+
+This runs all tests and packages the library.
+
+## Features/Implementation Notes
+
+* Supports JSON inputs/outputs, File inputs, and Form inputs.
+* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
+* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
+* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
+
+
+## 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* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **GET** /api/v1/api-server/get-prometheus-exporter-metrics | Get the Prometheus Metrics
+
+
+
+## Documentation for Models
+
+ - [org.openapitools.client.models.HealthCheckResponse](docs/HealthCheckResponse.md)
+ - [org.openapitools.client.models.MemoryUsage](docs/MemoryUsage.md)
+ - [org.openapitools.client.models.WatchHealthcheckV1](docs/WatchHealthcheckV1.md)
+
+
+
+## Documentation for Authorization
+
+All endpoints do not require authorization.
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
new file mode 100644
index 00000000000..3de8b45b135
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
@@ -0,0 +1,37 @@
+group 'org.openapitools'
+version '1.0.0'
+
+wrapper {
+ gradleVersion = '6.8.3'
+ distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
+}
+
+buildscript {
+ ext.kotlin_version = '1.5.10'
+
+ repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+ }
+ dependencies {
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
+apply plugin: 'kotlin'
+
+repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+}
+
+test {
+ useJUnitPlatform()
+}
+
+dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
+ implementation "com.squareup.moshi:moshi-kotlin:1.12.0"
+ implementation "com.squareup.moshi:moshi-adapters:1.12.0"
+ implementation "com.squareup.okhttp3:okhttp:4.9.1"
+ testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md
new file mode 100644
index 00000000000..c1888136a84
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md
@@ -0,0 +1,94 @@
+# DefaultApi
+
+All URIs are relative to *http://localhost*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**getHealthCheckV1**](DefaultApi.md#getHealthCheckV1) | **GET** /api/v1/api-server/healthcheck | Can be used to verify liveness of an API server instance
+[**getPrometheusMetricsV1**](DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/api-server/get-prometheus-exporter-metrics | Get the Prometheus Metrics
+
+
+
+# **getHealthCheckV1**
+> HealthCheckResponse 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
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+try {
+ val result : HealthCheckResponse = apiInstance.getHealthCheckV1()
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#getHealthCheckV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#getHealthCheckV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**HealthCheckResponse**](HealthCheckResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+
+# **getPrometheusMetricsV1**
+> kotlin.String getPrometheusMetricsV1()
+
+Get the Prometheus Metrics
+
+### Example
+```kotlin
+// Import classes:
+//import org.openapitools.client.infrastructure.*
+//import org.openapitools.client.models.*
+
+val apiInstance = DefaultApi()
+try {
+ val result : kotlin.String = apiInstance.getPrometheusMetricsV1()
+ println(result)
+} catch (e: ClientException) {
+ println("4xx response calling DefaultApi#getPrometheusMetricsV1")
+ e.printStackTrace()
+} catch (e: ServerException) {
+ println("5xx response calling DefaultApi#getPrometheusMetricsV1")
+ e.printStackTrace()
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+**kotlin.String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: text/plain
+
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/HealthCheckResponse.md b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/HealthCheckResponse.md
new file mode 100644
index 00000000000..4e96542c896
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/HealthCheckResponse.md
@@ -0,0 +1,12 @@
+
+# HealthCheckResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**createdAt** | **kotlin.String** | |
+**memoryUsage** | [**MemoryUsage**](MemoryUsage.md) | |
+**success** | **kotlin.Boolean** | | [optional]
+
+
+
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/MemoryUsage.md b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/MemoryUsage.md
new file mode 100644
index 00000000000..3e799a1a05a
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/MemoryUsage.md
@@ -0,0 +1,14 @@
+
+# MemoryUsage
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**rss** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
+**heapTotal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
+**heapUsed** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
+**`external`** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
+**arrayBuffers** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
+
+
+
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/WatchHealthcheckV1.md b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/WatchHealthcheckV1.md
new file mode 100644
index 00000000000..e667ba6c9ff
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/docs/WatchHealthcheckV1.md
@@ -0,0 +1,18 @@
+
+# WatchHealthcheckV1
+
+## Enum
+
+
+ * `Subscribe` (value: `"org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe"`)
+
+ * `Next` (value: `"org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next"`)
+
+ * `Unsubscribe` (value: `"org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe"`)
+
+ * `Error` (value: `"org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error"`)
+
+ * `Complete` (value: `"org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete"`)
+
+
+
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..e708b1c023e
Binary files /dev/null and b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..8cf6eb5ad22
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradlew b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradlew
new file mode 100644
index 00000000000..4f906e0c811
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or 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 UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$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='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# 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
+ ;;
+ 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" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat
new file mode 100644
index 00000000000..107acd32c4e
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-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="-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/kotlin/generated/openapi/kotlin-client/settings.gradle b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
new file mode 100644
index 00000000000..391dcea81db
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
@@ -0,0 +1,2 @@
+
+rootProject.name = 'kotlin-client'
\ No newline at end of file
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
new file mode 100644
index 00000000000..30aee70509b
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt
@@ -0,0 +1,147 @@
+/**
+ * Hyperledger Cactus API
+ *
+ * Interact with a Cactus deployment through HTTP.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ *
+ *
+ * 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.apis
+
+import org.openapitools.client.models.HealthCheckResponse
+
+import org.openapitools.client.infrastructure.ApiClient
+import org.openapitools.client.infrastructure.ClientException
+import org.openapitools.client.infrastructure.ClientError
+import org.openapitools.client.infrastructure.ServerException
+import org.openapitools.client.infrastructure.ServerError
+import org.openapitools.client.infrastructure.MultiValueMap
+import org.openapitools.client.infrastructure.RequestConfig
+import org.openapitools.client.infrastructure.RequestMethod
+import org.openapitools.client.infrastructure.ResponseType
+import org.openapitools.client.infrastructure.Success
+import org.openapitools.client.infrastructure.toMultiValue
+
+class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
+ companion object {
+ @JvmStatic
+ val defaultBasePath: String by lazy {
+ System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://localhost")
+ }
+ }
+
+ /**
+ * 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 UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun getHealthCheckV1() : HealthCheckResponse {
+ val localVariableConfig = getHealthCheckV1RequestConfig()
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as HealthCheckResponse
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation getHealthCheckV1
+ *
+ * @return RequestConfig
+ */
+ fun getHealthCheckV1RequestConfig() : RequestConfig {
+ val localVariableBody = null
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.GET,
+ path = "/api/v1/api-server/healthcheck",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+ /**
+ * Get the Prometheus Metrics
+ *
+ * @return kotlin.String
+ * @throws UnsupportedOperationException If the API returns an informational or redirection response
+ * @throws ClientException If the API returns a client error response
+ * @throws ServerException If the API returns a server error response
+ */
+ @Suppress("UNCHECKED_CAST")
+ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
+ fun getPrometheusMetricsV1() : kotlin.String {
+ val localVariableConfig = getPrometheusMetricsV1RequestConfig()
+
+ val localVarResponse = request(
+ localVariableConfig
+ )
+
+ return when (localVarResponse.responseType) {
+ ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
+ ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
+ ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
+ ResponseType.ClientError -> {
+ val localVarError = localVarResponse as ClientError<*>
+ throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ ResponseType.ServerError -> {
+ val localVarError = localVarResponse as ServerError<*>
+ throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
+ }
+ }
+ }
+
+ /**
+ * To obtain the request config of the operation getPrometheusMetricsV1
+ *
+ * @return RequestConfig
+ */
+ fun getPrometheusMetricsV1RequestConfig() : RequestConfig {
+ val localVariableBody = null
+ val localVariableQuery: MultiValueMap = mutableMapOf()
+ val localVariableHeaders: MutableMap = mutableMapOf()
+
+ return RequestConfig(
+ method = RequestMethod.GET,
+ path = "/api/v1/api-server/get-prometheus-exporter-metrics",
+ query = localVariableQuery,
+ headers = localVariableHeaders,
+ body = localVariableBody
+ )
+ }
+
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
new file mode 100644
index 00000000000..ef7a8f1e1a6
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+typealias MultiValueMap = MutableMap>
+
+fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
+ "csv" -> ","
+ "tsv" -> "\t"
+ "pipe" -> "|"
+ "space" -> " "
+ else -> ""
+}
+
+val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
+
+fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter)
+ = toMultiValue(items.asIterable(), collectionFormat, map)
+
+fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List {
+ return when(collectionFormat) {
+ "multi" -> items.map(map)
+ else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map))
+ }
+}
\ No newline at end of file
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
new file mode 100644
index 00000000000..b359be1e41d
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
@@ -0,0 +1,232 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.OkHttpClient
+import okhttp3.RequestBody
+import okhttp3.RequestBody.Companion.asRequestBody
+import okhttp3.RequestBody.Companion.toRequestBody
+import okhttp3.FormBody
+import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
+import okhttp3.ResponseBody
+import okhttp3.MediaType.Companion.toMediaTypeOrNull
+import okhttp3.Request
+import okhttp3.Headers
+import okhttp3.MultipartBody
+import java.io.BufferedWriter
+import java.io.File
+import java.io.FileWriter
+import java.net.URLConnection
+import java.time.LocalDate
+import java.time.LocalDateTime
+import java.time.LocalTime
+import java.time.OffsetDateTime
+import java.time.OffsetTime
+import java.util.Date
+import java.util.Locale
+import com.squareup.moshi.adapter
+
+open class ApiClient(val baseUrl: String) {
+ companion object {
+ protected const val ContentType = "Content-Type"
+ protected const val Accept = "Accept"
+ protected const val Authorization = "Authorization"
+ protected const val JsonMediaType = "application/json"
+ protected const val FormDataMediaType = "multipart/form-data"
+ protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded"
+ protected const val XmlMediaType = "application/xml"
+
+ val apiKey: MutableMap = mutableMapOf()
+ val apiKeyPrefix: MutableMap = mutableMapOf()
+ var username: String? = null
+ var password: String? = null
+ var accessToken: String? = null
+
+ @JvmStatic
+ val client: OkHttpClient by lazy {
+ builder.build()
+ }
+
+ @JvmStatic
+ val builder: OkHttpClient.Builder = OkHttpClient.Builder()
+ }
+
+ /**
+ * Guess Content-Type header from the given file (defaults to "application/octet-stream").
+ *
+ * @param file The given file
+ * @return The guessed Content-Type
+ */
+ protected fun guessContentTypeFromFile(file: File): String {
+ val contentType = URLConnection.guessContentTypeFromName(file.name)
+ return contentType ?: "application/octet-stream"
+ }
+
+ protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody =
+ when {
+ content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull())
+ mediaType == FormDataMediaType -> {
+ MultipartBody.Builder()
+ .setType(MultipartBody.FORM)
+ .apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ if (value is File) {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\"; filename=\"${value.name}\""
+ )
+ val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull()
+ addPart(partHeaders, value.asRequestBody(fileMediaType))
+ } else {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\""
+ )
+ addPart(
+ partHeaders,
+ parameterToString(value).toRequestBody(null)
+ )
+ }
+ }
+ }.build()
+ }
+ mediaType == FormUrlEncMediaType -> {
+ FormBody.Builder().apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ add(key, parameterToString(value))
+ }
+ }.build()
+ }
+ mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody(
+ mediaType.toMediaTypeOrNull()
+ )
+ mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.")
+ // TODO: this should be extended with other serializers
+ else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.")
+ }
+
+ @OptIn(ExperimentalStdlibApi::class)
+ protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? {
+ if(body == null) {
+ return null
+ }
+ val bodyContent = body.string()
+ if (bodyContent.isEmpty()) {
+ return null
+ }
+ if (T::class.java == File::class.java) {
+ // return tempfile
+ val f = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile()
+ f.deleteOnExit()
+ val out = BufferedWriter(FileWriter(f))
+ out.write(bodyContent)
+ out.close()
+ return f as T
+ }
+ return when(mediaType) {
+ JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent)
+ else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.")
+ }
+ }
+
+
+ protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse {
+ val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.")
+
+ val url = httpUrl.newBuilder()
+ .addPathSegments(requestConfig.path.trimStart('/'))
+ .apply {
+ requestConfig.query.forEach { query ->
+ query.value.forEach { queryValue ->
+ addQueryParameter(query.key, queryValue)
+ }
+ }
+ }.build()
+
+ // take content-type/accept from spec or set to default (application/json) if not defined
+ if (requestConfig.headers[ContentType].isNullOrEmpty()) {
+ requestConfig.headers[ContentType] = JsonMediaType
+ }
+ if (requestConfig.headers[Accept].isNullOrEmpty()) {
+ requestConfig.headers[Accept] = JsonMediaType
+ }
+ val headers = requestConfig.headers
+
+ if(headers[ContentType] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Content-Type header. This is required.")
+ }
+
+ if(headers[Accept] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Accept header. This is required.")
+ }
+
+ // TODO: support multiple contentType options here.
+ val contentType = (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault())
+
+ val request = when (requestConfig.method) {
+ RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType))
+ RequestMethod.GET -> Request.Builder().url(url)
+ RequestMethod.HEAD -> Request.Builder().url(url).head()
+ RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType))
+ RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType))
+ RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType))
+ RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null)
+ }.apply {
+ headers.forEach { header -> addHeader(header.key, header.value) }
+ }.build()
+
+ val response = client.newCall(request).execute()
+ val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault())
+
+ // TODO: handle specific mapping types. e.g. Map>
+ return when {
+ response.isRedirect -> Redirection(
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isInformational -> Informational(
+ response.message,
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isSuccessful -> Success(
+ responseBody(response.body, accept),
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isClientError -> ClientError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ else -> ServerError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ }
+ }
+
+ protected fun parameterToString(value: Any?): String = when (value) {
+ null -> ""
+ is Array<*> -> toMultiValue(value, "csv").toString()
+ is Iterable<*> -> toMultiValue(value, "csv").toString()
+ is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date ->
+ parseDateToQueryString(value)
+ else -> value.toString()
+ }
+
+ protected inline fun parseDateToQueryString(value : T): String {
+ /*
+ .replace("\"", "") converts the json object string to an actual string for the query parameter.
+ The moshi or gson adapter allows a more generic solution instead of trying to use a native
+ formatter. It also easily allows to provide a simple way to define a custom date format pattern
+ inside a gson/moshi adapter.
+ */
+ return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "")
+ }
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
new file mode 100644
index 00000000000..9dc8d8dbbfa
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
@@ -0,0 +1,43 @@
+package org.openapitools.client.infrastructure
+
+enum class ResponseType {
+ Success, Informational, Redirection, ClientError, ServerError
+}
+
+interface Response
+
+abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response {
+ abstract val statusCode: Int
+ abstract val headers: Map>
+}
+
+class Success(
+ val data: T,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+): ApiInfrastructureResponse(ResponseType.Success)
+
+class Informational(
+ val statusText: String,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Informational)
+
+class Redirection(
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Redirection)
+
+class ClientError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.ClientError)
+
+class ServerError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map>
+): ApiInfrastructureResponse(ResponseType.ServerError)
\ No newline at end of file
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
new file mode 100644
index 00000000000..fb2c972cf8d
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigDecimal
+
+class BigDecimalAdapter {
+ @ToJson
+ fun toJson(value: BigDecimal): String {
+ return value.toPlainString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigDecimal {
+ return BigDecimal(value)
+ }
+}
\ No newline at end of file
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
new file mode 100644
index 00000000000..4b6963110c9
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigInteger
+
+class BigIntegerAdapter {
+ @ToJson
+ fun toJson(value: BigInteger): String {
+ return value.toString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigInteger {
+ return BigInteger(value)
+ }
+}
\ No newline at end of file
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
new file mode 100644
index 00000000000..ff5e2a81ee8
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
@@ -0,0 +1,12 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+
+class ByteArrayAdapter {
+ @ToJson
+ fun toJson(data: ByteArray): String = String(data)
+
+ @FromJson
+ fun fromJson(data: String): ByteArray = data.toByteArray()
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
new file mode 100644
index 00000000000..b5310e71f13
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
@@ -0,0 +1,18 @@
+@file:Suppress("unused")
+package org.openapitools.client.infrastructure
+
+import java.lang.RuntimeException
+
+open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 123L
+ }
+}
+
+open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 456L
+ }
+}
\ No newline at end of file
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
new file mode 100644
index 00000000000..b2e1654479a
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDate
+import java.time.format.DateTimeFormatter
+
+class LocalDateAdapter {
+ @ToJson
+ fun toJson(value: LocalDate): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDate {
+ return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE)
+ }
+
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
new file mode 100644
index 00000000000..e082db94811
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDateTime
+import java.time.format.DateTimeFormatter
+
+class LocalDateTimeAdapter {
+ @ToJson
+ fun toJson(value: LocalDateTime): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDateTime {
+ return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
+ }
+
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
new file mode 100644
index 00000000000..87437871a31
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.OffsetDateTime
+import java.time.format.DateTimeFormatter
+
+class OffsetDateTimeAdapter {
+ @ToJson
+ fun toJson(value: OffsetDateTime): String {
+ return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): OffsetDateTime {
+ return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
+ }
+
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
new file mode 100644
index 00000000000..7e948e1dd07
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Defines a config object for a given request.
+ * NOTE: This object doesn't include 'body' because it
+ * allows for caching of the constructed object
+ * for many request definitions.
+ * NOTE: Headers is a Map because rfc2616 defines
+ * multi-valued headers as csv-only.
+ */
+data class RequestConfig(
+ val method: RequestMethod,
+ val path: String,
+ val headers: MutableMap = mutableMapOf(),
+ val query: MutableMap> = mutableMapOf(),
+ val body: T? = null
+)
\ No newline at end of file
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
new file mode 100644
index 00000000000..931b12b8bd7
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
@@ -0,0 +1,8 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Provides enumerated HTTP verbs
+ */
+enum class RequestMethod {
+ GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT
+}
\ No newline at end of file
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
new file mode 100644
index 00000000000..9bd2790dc14
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
@@ -0,0 +1,24 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.Response
+
+/**
+ * Provides an extension to evaluation whether the response is a 1xx code
+ */
+val Response.isInformational : Boolean get() = this.code in 100..199
+
+/**
+ * Provides an extension to evaluation whether the response is a 3xx code
+ */
+@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
+val Response.isRedirect : Boolean get() = this.code in 300..399
+
+/**
+ * Provides an extension to evaluation whether the response is a 4xx code
+ */
+val Response.isClientError : Boolean get() = this.code in 400..499
+
+/**
+ * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code
+ */
+val Response.isServerError : Boolean get() = this.code in 500..999
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
new file mode 100644
index 00000000000..e22592e47d7
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.Moshi
+import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
+
+object Serializer {
+ @JvmStatic
+ val moshiBuilder: Moshi.Builder = Moshi.Builder()
+ .add(OffsetDateTimeAdapter())
+ .add(LocalDateTimeAdapter())
+ .add(LocalDateAdapter())
+ .add(UUIDAdapter())
+ .add(ByteArrayAdapter())
+ .add(URIAdapter())
+ .add(KotlinJsonAdapterFactory())
+ .add(BigDecimalAdapter())
+ .add(BigIntegerAdapter())
+
+ @JvmStatic
+ val moshi: Moshi by lazy {
+ moshiBuilder.build()
+ }
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
new file mode 100644
index 00000000000..927522757da
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.net.URI
+
+class URIAdapter {
+ @ToJson
+ fun toJson(uri: URI) = uri.toString()
+
+ @FromJson
+ fun fromJson(s: String): URI = URI.create(s)
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
new file mode 100644
index 00000000000..7ccf7dc25d2
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.util.UUID
+
+class UUIDAdapter {
+ @ToJson
+ fun toJson(uuid: UUID) = uuid.toString()
+
+ @FromJson
+ fun fromJson(s: String): UUID = UUID.fromString(s)
+}
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HealthCheckResponse.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HealthCheckResponse.kt
new file mode 100644
index 00000000000..f6075426ded
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HealthCheckResponse.kt
@@ -0,0 +1,47 @@
+/**
+ * Hyperledger Cactus API
+ *
+ * Interact with a Cactus deployment through HTTP.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ *
+ *
+ * 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 org.openapitools.client.models.MemoryUsage
+
+import com.squareup.moshi.Json
+
+/**
+ *
+ *
+ * @param createdAt
+ * @param memoryUsage
+ * @param success
+ */
+
+data class HealthCheckResponse (
+
+ @Json(name = "createdAt")
+ val createdAt: kotlin.String,
+
+ @Json(name = "memoryUsage")
+ val memoryUsage: MemoryUsage,
+
+ @Json(name = "success")
+ val success: kotlin.Boolean? = null
+
+)
+
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/MemoryUsage.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/MemoryUsage.kt
new file mode 100644
index 00000000000..35b5c5e32fd
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/MemoryUsage.kt
@@ -0,0 +1,54 @@
+/**
+ * Hyperledger Cactus API
+ *
+ * Interact with a Cactus deployment through HTTP.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ *
+ *
+ * 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
+
+/**
+ *
+ *
+ * @param rss
+ * @param heapTotal
+ * @param heapUsed
+ * @param `external`
+ * @param arrayBuffers
+ */
+
+data class MemoryUsage (
+
+ @Json(name = "rss")
+ val rss: java.math.BigDecimal? = null,
+
+ @Json(name = "heapTotal")
+ val heapTotal: java.math.BigDecimal? = null,
+
+ @Json(name = "heapUsed")
+ val heapUsed: java.math.BigDecimal? = null,
+
+ @Json(name = "external")
+ val `external`: java.math.BigDecimal? = null,
+
+ @Json(name = "arrayBuffers")
+ val arrayBuffers: java.math.BigDecimal? = null
+
+)
+
diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/WatchHealthcheckV1.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/WatchHealthcheckV1.kt
new file mode 100644
index 00000000000..35dcc9a3599
--- /dev/null
+++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/WatchHealthcheckV1.kt
@@ -0,0 +1,75 @@
+/**
+ * Hyperledger Cactus API
+ *
+ * Interact with a Cactus deployment through HTTP.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ *
+ *
+ * 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
+
+/**
+ *
+ *
+ * Values: Subscribe,Next,Unsubscribe,Error,Complete
+ */
+
+enum class WatchHealthcheckV1(val value: kotlin.String) {
+
+ @Json(name = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe")
+ Subscribe("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe"),
+
+ @Json(name = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next")
+ Next("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next"),
+
+ @Json(name = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe")
+ Unsubscribe("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe"),
+
+ @Json(name = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error")
+ Error("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error"),
+
+ @Json(name = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete")
+ Complete("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete");
+
+ /**
+ * Override toString() to avoid using the enum variable name as the value, and instead use
+ * the actual value defined in the API spec file.
+ *
+ * This solves a problem when the variable name and its value are different, and ensures that
+ * the client sends the correct enum values to the server always.
+ */
+ override fun toString(): String = value
+
+ companion object {
+ /**
+ * Converts the provided [data] to a [String] on success, null otherwise.
+ */
+ fun encode(data: Any?): kotlin.String? = if (data is WatchHealthcheckV1) "$data" else null
+
+ /**
+ * Returns a valid [WatchHealthcheckV1] for [data], null otherwise.
+ */
+ fun decode(data: Any?): WatchHealthcheckV1? = data?.let {
+ val normalizedData = "$it".lowercase()
+ values().firstOrNull { value ->
+ it == value || normalizedData == "$value".lowercase()
+ }
+ }
+ }
+}
+
diff --git a/packages/cactus-core-api/package.json b/packages/cactus-core-api/package.json
index ad4d04c6740..a69acb97a47 100644
--- a/packages/cactus-core-api/package.json
+++ b/packages/cactus-core-api/package.json
@@ -15,7 +15,9 @@
"codegen": "run-p 'codegen:*'",
"codegen:openapi": "npm run generate-sdk",
"codegen:proto": "run-s proto:protoc-gen-ts",
- "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",
+ "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",
+ "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",
"preproto:protoc-gen-ts": "make-dir ./src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/",
"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/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",
"watch": "npm-watch",
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-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-core-api/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
new file mode 100644
index 00000000000..039847ff0f5
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES
@@ -0,0 +1,87 @@
+README.md
+build.gradle
+docs/CactusNode.md
+docs/CactusNodeAllOf.md
+docs/CactusNodeMeta.md
+docs/ConsensusAlgorithmFamiliesWithOutTxFinality.md
+docs/ConsensusAlgorithmFamiliesWithTxFinality.md
+docs/ConsensusAlgorithmFamily.md
+docs/Consortium.md
+docs/ConsortiumDatabase.md
+docs/ConsortiumMember.md
+docs/Constants.md
+docs/DeleteKeychainEntryRequestV1.md
+docs/DeleteKeychainEntryResponseV1.md
+docs/GetKeychainEntryRequestV1.md
+docs/GetKeychainEntryResponseV1.md
+docs/GetObjectRequestV1.md
+docs/GetObjectResponseV1.md
+docs/HasKeychainEntryRequestV1.md
+docs/HasKeychainEntryResponseV1.md
+docs/HasObjectRequestV1.md
+docs/HasObjectResponseV1.md
+docs/JWSGeneral.md
+docs/JWSRecipient.md
+docs/Ledger.md
+docs/LedgerType.md
+docs/PluginImport.md
+docs/PluginImportAction.md
+docs/PluginImportType.md
+docs/PluginInstance.md
+docs/SetKeychainEntryRequestV1.md
+docs/SetKeychainEntryResponseV1.md
+docs/SetObjectRequestV1.md
+docs/SetObjectResponseV1.md
+gradle/wrapper/gradle-wrapper.jar
+gradle/wrapper/gradle-wrapper.properties
+gradlew
+gradlew.bat
+settings.gradle
+src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
+src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
+src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
+src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
+src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
+src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
+src/main/kotlin/org/openapitools/client/models/CactusNode.kt
+src/main/kotlin/org/openapitools/client/models/CactusNodeAllOf.kt
+src/main/kotlin/org/openapitools/client/models/CactusNodeMeta.kt
+src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithOutTxFinality.kt
+src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithTxFinality.kt
+src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamily.kt
+src/main/kotlin/org/openapitools/client/models/Consortium.kt
+src/main/kotlin/org/openapitools/client/models/ConsortiumDatabase.kt
+src/main/kotlin/org/openapitools/client/models/ConsortiumMember.kt
+src/main/kotlin/org/openapitools/client/models/Constants.kt
+src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt
+src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt
+src/main/kotlin/org/openapitools/client/models/GetObjectRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/GetObjectResponseV1.kt
+src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt
+src/main/kotlin/org/openapitools/client/models/HasObjectRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/HasObjectResponseV1.kt
+src/main/kotlin/org/openapitools/client/models/JWSGeneral.kt
+src/main/kotlin/org/openapitools/client/models/JWSRecipient.kt
+src/main/kotlin/org/openapitools/client/models/Ledger.kt
+src/main/kotlin/org/openapitools/client/models/LedgerType.kt
+src/main/kotlin/org/openapitools/client/models/PluginImport.kt
+src/main/kotlin/org/openapitools/client/models/PluginImportAction.kt
+src/main/kotlin/org/openapitools/client/models/PluginImportType.kt
+src/main/kotlin/org/openapitools/client/models/PluginInstance.kt
+src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt
+src/main/kotlin/org/openapitools/client/models/SetObjectRequestV1.kt
+src/main/kotlin/org/openapitools/client/models/SetObjectResponseV1.kt
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
new file mode 100644
index 00000000000..804440660c7
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION
@@ -0,0 +1 @@
+5.2.1
\ No newline at end of file
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/README.md
new file mode 100644
index 00000000000..60d5e00042a
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/README.md
@@ -0,0 +1,80 @@
+# org.openapitools.client - Kotlin client library for Hyperledger Core API
+
+## Requires
+
+* Kotlin 1.4.30
+* Gradle 6.8.3
+
+## Build
+
+First, create the gradle wrapper script:
+
+```
+gradle wrapper
+```
+
+Then, run:
+
+```
+./gradlew check assemble
+```
+
+This runs all tests and packages the library.
+
+## Features/Implementation Notes
+
+* Supports JSON inputs/outputs, File inputs, and Form inputs.
+* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
+* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
+* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
+
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://localhost*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+
+
+
+## Documentation for Models
+
+ - [org.openapitools.client.models.CactusNode](docs/CactusNode.md)
+ - [org.openapitools.client.models.CactusNodeAllOf](docs/CactusNodeAllOf.md)
+ - [org.openapitools.client.models.CactusNodeMeta](docs/CactusNodeMeta.md)
+ - [org.openapitools.client.models.ConsensusAlgorithmFamiliesWithOutTxFinality](docs/ConsensusAlgorithmFamiliesWithOutTxFinality.md)
+ - [org.openapitools.client.models.ConsensusAlgorithmFamiliesWithTxFinality](docs/ConsensusAlgorithmFamiliesWithTxFinality.md)
+ - [org.openapitools.client.models.ConsensusAlgorithmFamily](docs/ConsensusAlgorithmFamily.md)
+ - [org.openapitools.client.models.Consortium](docs/Consortium.md)
+ - [org.openapitools.client.models.ConsortiumDatabase](docs/ConsortiumDatabase.md)
+ - [org.openapitools.client.models.ConsortiumMember](docs/ConsortiumMember.md)
+ - [org.openapitools.client.models.Constants](docs/Constants.md)
+ - [org.openapitools.client.models.DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md)
+ - [org.openapitools.client.models.DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md)
+ - [org.openapitools.client.models.GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md)
+ - [org.openapitools.client.models.GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md)
+ - [org.openapitools.client.models.GetObjectRequestV1](docs/GetObjectRequestV1.md)
+ - [org.openapitools.client.models.GetObjectResponseV1](docs/GetObjectResponseV1.md)
+ - [org.openapitools.client.models.HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md)
+ - [org.openapitools.client.models.HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md)
+ - [org.openapitools.client.models.HasObjectRequestV1](docs/HasObjectRequestV1.md)
+ - [org.openapitools.client.models.HasObjectResponseV1](docs/HasObjectResponseV1.md)
+ - [org.openapitools.client.models.JWSGeneral](docs/JWSGeneral.md)
+ - [org.openapitools.client.models.JWSRecipient](docs/JWSRecipient.md)
+ - [org.openapitools.client.models.Ledger](docs/Ledger.md)
+ - [org.openapitools.client.models.LedgerType](docs/LedgerType.md)
+ - [org.openapitools.client.models.PluginImport](docs/PluginImport.md)
+ - [org.openapitools.client.models.PluginImportAction](docs/PluginImportAction.md)
+ - [org.openapitools.client.models.PluginImportType](docs/PluginImportType.md)
+ - [org.openapitools.client.models.PluginInstance](docs/PluginInstance.md)
+ - [org.openapitools.client.models.SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md)
+ - [org.openapitools.client.models.SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md)
+ - [org.openapitools.client.models.SetObjectRequestV1](docs/SetObjectRequestV1.md)
+ - [org.openapitools.client.models.SetObjectResponseV1](docs/SetObjectResponseV1.md)
+
+
+
+## Documentation for Authorization
+
+All endpoints do not require authorization.
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
new file mode 100644
index 00000000000..3de8b45b135
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/build.gradle
@@ -0,0 +1,37 @@
+group 'org.openapitools'
+version '1.0.0'
+
+wrapper {
+ gradleVersion = '6.8.3'
+ distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
+}
+
+buildscript {
+ ext.kotlin_version = '1.5.10'
+
+ repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+ }
+ dependencies {
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
+apply plugin: 'kotlin'
+
+repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+}
+
+test {
+ useJUnitPlatform()
+}
+
+dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
+ implementation "com.squareup.moshi:moshi-kotlin:1.12.0"
+ implementation "com.squareup.moshi:moshi-adapters:1.12.0"
+ implementation "com.squareup.okhttp3:okhttp:4.9.1"
+ testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
+}
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/CactusNode.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/CactusNode.md
new file mode 100644
index 00000000000..46f076c93b7
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/CactusNode.md
@@ -0,0 +1,16 @@
+
+# CactusNode
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**nodeApiHost** | **kotlin.String** | |
+**publicKeyPem** | **kotlin.String** | The PEM encoded public key that was used to generate the JWS included in the response (the jws property) |
+**id** | **kotlin.String** | |
+**consortiumId** | **kotlin.String** | |
+**memberId** | **kotlin.String** | |
+**ledgerIds** | **kotlin.collections.List<kotlin.String>** | 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. |
+**pluginInstanceIds** | **kotlin.collections.List<kotlin.String>** | |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/CactusNodeAllOf.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/CactusNodeAllOf.md
new file mode 100644
index 00000000000..42b3c05faec
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/CactusNodeAllOf.md
@@ -0,0 +1,14 @@
+
+# CactusNodeAllOf
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **kotlin.String** | |
+**consortiumId** | **kotlin.String** | |
+**memberId** | **kotlin.String** | |
+**ledgerIds** | **kotlin.collections.List<kotlin.String>** | 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. |
+**pluginInstanceIds** | **kotlin.collections.List<kotlin.String>** | |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/CactusNodeMeta.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/CactusNodeMeta.md
new file mode 100644
index 00000000000..a536c28c7d3
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/CactusNodeMeta.md
@@ -0,0 +1,11 @@
+
+# CactusNodeMeta
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**nodeApiHost** | **kotlin.String** | |
+**publicKeyPem** | **kotlin.String** | The PEM encoded public key that was used to generate the JWS included in the response (the jws property) |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsensusAlgorithmFamiliesWithOutTxFinality.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsensusAlgorithmFamiliesWithOutTxFinality.md
new file mode 100644
index 00000000000..2095484ab53
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsensusAlgorithmFamiliesWithOutTxFinality.md
@@ -0,0 +1,10 @@
+
+# ConsensusAlgorithmFamiliesWithOutTxFinality
+
+## Enum
+
+
+ * `WORK` (value: `"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK"`)
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsensusAlgorithmFamiliesWithTxFinality.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsensusAlgorithmFamiliesWithTxFinality.md
new file mode 100644
index 00000000000..c4f51529a26
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsensusAlgorithmFamiliesWithTxFinality.md
@@ -0,0 +1,12 @@
+
+# ConsensusAlgorithmFamiliesWithTxFinality
+
+## Enum
+
+
+ * `aUTHORITY` (value: `"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY"`)
+
+ * `sTAKE` (value: `"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE"`)
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsensusAlgorithmFamily.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsensusAlgorithmFamily.md
new file mode 100644
index 00000000000..4ab03a9b92c
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsensusAlgorithmFamily.md
@@ -0,0 +1,14 @@
+
+# ConsensusAlgorithmFamily
+
+## Enum
+
+
+ * `aUTHORITY` (value: `"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY"`)
+
+ * `sTAKE` (value: `"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE"`)
+
+ * `wORK` (value: `"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK"`)
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/Consortium.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/Consortium.md
new file mode 100644
index 00000000000..b28eae67903
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/Consortium.md
@@ -0,0 +1,13 @@
+
+# Consortium
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **kotlin.String** | |
+**name** | **kotlin.String** | |
+**mainApiHost** | **kotlin.String** | |
+**memberIds** | **kotlin.collections.List<kotlin.String>** | The collection (array) of primary keys of consortium member entities that belong to this Consortium. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsortiumDatabase.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsortiumDatabase.md
new file mode 100644
index 00000000000..0d8c669da39
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsortiumDatabase.md
@@ -0,0 +1,14 @@
+
+# ConsortiumDatabase
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**consortium** | [**kotlin.collections.List<Consortium>**](Consortium.md) | 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. |
+**ledger** | [**kotlin.collections.List<Ledger>**](Ledger.md) | The complete collection of all ledger entities in existence within the consortium. |
+**consortiumMember** | [**kotlin.collections.List<ConsortiumMember>**](ConsortiumMember.md) | The complete collection of all consortium member entities in existence within the consortium. |
+**cactusNode** | [**kotlin.collections.List<CactusNode>**](CactusNode.md) | The complete collection of all cactus nodes entities in existence within the consortium. |
+**pluginInstance** | [**kotlin.collections.List<PluginInstance>**](PluginInstance.md) | The complete collection of all plugin instance entities in existence within the consortium. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsortiumMember.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsortiumMember.md
new file mode 100644
index 00000000000..4b9031c34c5
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/ConsortiumMember.md
@@ -0,0 +1,12 @@
+
+# ConsortiumMember
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **kotlin.String** | |
+**name** | **kotlin.String** | 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. |
+**nodeIds** | **kotlin.collections.List<kotlin.String>** | |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/Constants.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/Constants.md
new file mode 100644
index 00000000000..f01dd3eca01
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/Constants.md
@@ -0,0 +1,10 @@
+
+# Constants
+
+## Enum
+
+
+ * `SocketIoConnectionPathV1` (value: `"/api/v1/async/socket-io/connect"`)
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/DeleteKeychainEntryRequestV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/DeleteKeychainEntryRequestV1.md
new file mode 100644
index 00000000000..ee0430a181f
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/DeleteKeychainEntryRequestV1.md
@@ -0,0 +1,10 @@
+
+# DeleteKeychainEntryRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key for the entry to check the presence of on the keychain. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/DeleteKeychainEntryResponseV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/DeleteKeychainEntryResponseV1.md
new file mode 100644
index 00000000000..4a78b74455d
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/DeleteKeychainEntryResponseV1.md
@@ -0,0 +1,10 @@
+
+# DeleteKeychainEntryResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was deleted from the keychain. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetKeychainEntryRequestV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetKeychainEntryRequestV1.md
new file mode 100644
index 00000000000..be1fe6918fd
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetKeychainEntryRequestV1.md
@@ -0,0 +1,10 @@
+
+# GetKeychainEntryRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key for the entry to get from the keychain. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetKeychainEntryResponseV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetKeychainEntryResponseV1.md
new file mode 100644
index 00000000000..c756ff8bb68
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetKeychainEntryResponseV1.md
@@ -0,0 +1,11 @@
+
+# GetKeychainEntryResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was used to retrieve the value from the keychain. |
+**`value`** | **kotlin.String** | The value associated with the requested key on the keychain. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectRequestV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectRequestV1.md
new file mode 100644
index 00000000000..ddd945004c7
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectRequestV1.md
@@ -0,0 +1,10 @@
+
+# GetObjectRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key for the entry to get from the object store. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectResponseV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectResponseV1.md
new file mode 100644
index 00000000000..f1d8794c4d1
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/GetObjectResponseV1.md
@@ -0,0 +1,11 @@
+
+# GetObjectResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was used to retrieve the value from the object store. |
+**`value`** | **kotlin.String** | The value associated with the requested key in the object store as a string. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasKeychainEntryRequestV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasKeychainEntryRequestV1.md
new file mode 100644
index 00000000000..add453e3b1d
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasKeychainEntryRequestV1.md
@@ -0,0 +1,10 @@
+
+# HasKeychainEntryRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key to check for presence in the keychain. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasKeychainEntryResponseV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasKeychainEntryResponseV1.md
new file mode 100644
index 00000000000..2cd13deb238
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasKeychainEntryResponseV1.md
@@ -0,0 +1,12 @@
+
+# HasKeychainEntryResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was used to check the presence of the value in the entry store. |
+**checkedAt** | **kotlin.String** | Date and time encoded as JSON when the presence check was performed by the plugin backend. |
+**isPresent** | **kotlin.Boolean** | The boolean true or false indicating the presence or absence of an entry under 'key'. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectRequestV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectRequestV1.md
new file mode 100644
index 00000000000..d06b34b86cf
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectRequestV1.md
@@ -0,0 +1,10 @@
+
+# HasObjectRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key to check for presence in the object store. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectResponseV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectResponseV1.md
new file mode 100644
index 00000000000..dcfff57ce1a
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/HasObjectResponseV1.md
@@ -0,0 +1,12 @@
+
+# HasObjectResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was used to check the presence of the value in the object store. |
+**checkedAt** | **kotlin.String** | Date and time encoded as JSON when the presence check was performed by the plugin backend. |
+**isPresent** | **kotlin.Boolean** | The boolean true or false indicating the presence or absence of an object under 'key'. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/JWSGeneral.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/JWSGeneral.md
new file mode 100644
index 00000000000..2e27169dab2
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/JWSGeneral.md
@@ -0,0 +1,11 @@
+
+# JWSGeneral
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**payload** | **kotlin.String** | |
+**signatures** | [**kotlin.collections.List<JWSRecipient>**](JWSRecipient.md) | |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/JWSRecipient.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/JWSRecipient.md
new file mode 100644
index 00000000000..fcbc1c652d7
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/JWSRecipient.md
@@ -0,0 +1,12 @@
+
+# JWSRecipient
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**signature** | **kotlin.String** | |
+**`protected`** | **kotlin.String** | | [optional]
+**header** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional]
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/Ledger.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/Ledger.md
new file mode 100644
index 00000000000..75046a1be4e
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/Ledger.md
@@ -0,0 +1,12 @@
+
+# Ledger
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **kotlin.String** | |
+**ledgerType** | [**LedgerType**](LedgerType.md) | |
+**consortiumMemberId** | **kotlin.String** | | [optional]
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/LedgerType.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/LedgerType.md
new file mode 100644
index 00000000000..61e709c2976
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/LedgerType.md
@@ -0,0 +1,24 @@
+
+# LedgerType
+
+## Enum
+
+
+ * `bESU1X` (value: `"BESU_1X"`)
+
+ * `bESU2X` (value: `"BESU_2X"`)
+
+ * `bURROW0X` (value: `"BURROW_0X"`)
+
+ * `cORDA4X` (value: `"CORDA_4X"`)
+
+ * `fABRIC14X` (value: `"FABRIC_14X"`)
+
+ * `fABRIC2` (value: `"FABRIC_2"`)
+
+ * `qUORUM2X` (value: `"QUORUM_2X"`)
+
+ * `sAWTOOTH1X` (value: `"SAWTOOTH_1X"`)
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginImport.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginImport.md
new file mode 100644
index 00000000000..6796e38b3e8
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginImport.md
@@ -0,0 +1,13 @@
+
+# PluginImport
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**packageName** | **kotlin.String** | |
+**type** | [**PluginImportType**](PluginImportType.md) | |
+**action** | [**PluginImportAction**](PluginImportAction.md) | |
+**options** | [**kotlin.Any**](.md) | | [optional]
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginImportAction.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginImportAction.md
new file mode 100644
index 00000000000..ef2cd267faa
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginImportAction.md
@@ -0,0 +1,12 @@
+
+# PluginImportAction
+
+## Enum
+
+
+ * `iNSTANTIATE` (value: `"org.hyperledger.cactus.plugin_import_action.INSTANTIATE"`)
+
+ * `iNSTALL` (value: `"org.hyperledger.cactus.plugin_import_action.INSTALL"`)
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginImportType.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginImportType.md
new file mode 100644
index 00000000000..9d8cee197f3
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginImportType.md
@@ -0,0 +1,12 @@
+
+# PluginImportType
+
+## Enum
+
+
+ * `lOCAL` (value: `"org.hyperledger.cactus.plugin_import_type.LOCAL"`)
+
+ * `rEMOTE` (value: `"org.hyperledger.cactus.plugin_import_type.REMOTE"`)
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginInstance.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginInstance.md
new file mode 100644
index 00000000000..2daee611f38
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/PluginInstance.md
@@ -0,0 +1,11 @@
+
+# PluginInstance
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **kotlin.String** | |
+**packageName** | **kotlin.String** | |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetKeychainEntryRequestV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetKeychainEntryRequestV1.md
new file mode 100644
index 00000000000..247e2387545
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetKeychainEntryRequestV1.md
@@ -0,0 +1,11 @@
+
+# SetKeychainEntryRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key for the entry to set on the keychain. |
+**`value`** | **kotlin.String** | The value that will be associated with the key on the keychain. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetKeychainEntryResponseV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetKeychainEntryResponseV1.md
new file mode 100644
index 00000000000..c30adfa558b
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetKeychainEntryResponseV1.md
@@ -0,0 +1,10 @@
+
+# SetKeychainEntryResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was used to set the value on the keychain. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectRequestV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectRequestV1.md
new file mode 100644
index 00000000000..a95311857aa
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectRequestV1.md
@@ -0,0 +1,11 @@
+
+# SetObjectRequestV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key for the entry to set in the object store. |
+**`value`** | **kotlin.String** | The value that will be associated with the key in the object store. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectResponseV1.md b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectResponseV1.md
new file mode 100644
index 00000000000..688c1f31c86
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/docs/SetObjectResponseV1.md
@@ -0,0 +1,10 @@
+
+# SetObjectResponseV1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **kotlin.String** | The key that was used to set the value in the object store. |
+
+
+
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..e708b1c023e
Binary files /dev/null and b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..8cf6eb5ad22
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradlew b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradlew
new file mode 100644
index 00000000000..4f906e0c811
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or 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 UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$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='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# 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
+ ;;
+ 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" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/gradlew.bat
new file mode 100644
index 00000000000..107acd32c4e
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-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="-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/kotlin/generated/openapi/kotlin-client/settings.gradle b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
new file mode 100644
index 00000000000..391dcea81db
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/settings.gradle
@@ -0,0 +1,2 @@
+
+rootProject.name = 'kotlin-client'
\ No newline at end of file
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
new file mode 100644
index 00000000000..ef7a8f1e1a6
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+typealias MultiValueMap = MutableMap>
+
+fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
+ "csv" -> ","
+ "tsv" -> "\t"
+ "pipe" -> "|"
+ "space" -> " "
+ else -> ""
+}
+
+val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
+
+fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter)
+ = toMultiValue(items.asIterable(), collectionFormat, map)
+
+fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List {
+ return when(collectionFormat) {
+ "multi" -> items.map(map)
+ else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map))
+ }
+}
\ No newline at end of file
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
new file mode 100644
index 00000000000..b359be1e41d
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
@@ -0,0 +1,232 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.OkHttpClient
+import okhttp3.RequestBody
+import okhttp3.RequestBody.Companion.asRequestBody
+import okhttp3.RequestBody.Companion.toRequestBody
+import okhttp3.FormBody
+import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
+import okhttp3.ResponseBody
+import okhttp3.MediaType.Companion.toMediaTypeOrNull
+import okhttp3.Request
+import okhttp3.Headers
+import okhttp3.MultipartBody
+import java.io.BufferedWriter
+import java.io.File
+import java.io.FileWriter
+import java.net.URLConnection
+import java.time.LocalDate
+import java.time.LocalDateTime
+import java.time.LocalTime
+import java.time.OffsetDateTime
+import java.time.OffsetTime
+import java.util.Date
+import java.util.Locale
+import com.squareup.moshi.adapter
+
+open class ApiClient(val baseUrl: String) {
+ companion object {
+ protected const val ContentType = "Content-Type"
+ protected const val Accept = "Accept"
+ protected const val Authorization = "Authorization"
+ protected const val JsonMediaType = "application/json"
+ protected const val FormDataMediaType = "multipart/form-data"
+ protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded"
+ protected const val XmlMediaType = "application/xml"
+
+ val apiKey: MutableMap = mutableMapOf()
+ val apiKeyPrefix: MutableMap = mutableMapOf()
+ var username: String? = null
+ var password: String? = null
+ var accessToken: String? = null
+
+ @JvmStatic
+ val client: OkHttpClient by lazy {
+ builder.build()
+ }
+
+ @JvmStatic
+ val builder: OkHttpClient.Builder = OkHttpClient.Builder()
+ }
+
+ /**
+ * Guess Content-Type header from the given file (defaults to "application/octet-stream").
+ *
+ * @param file The given file
+ * @return The guessed Content-Type
+ */
+ protected fun guessContentTypeFromFile(file: File): String {
+ val contentType = URLConnection.guessContentTypeFromName(file.name)
+ return contentType ?: "application/octet-stream"
+ }
+
+ protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody =
+ when {
+ content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull())
+ mediaType == FormDataMediaType -> {
+ MultipartBody.Builder()
+ .setType(MultipartBody.FORM)
+ .apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ if (value is File) {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\"; filename=\"${value.name}\""
+ )
+ val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull()
+ addPart(partHeaders, value.asRequestBody(fileMediaType))
+ } else {
+ val partHeaders = Headers.headersOf(
+ "Content-Disposition",
+ "form-data; name=\"$key\""
+ )
+ addPart(
+ partHeaders,
+ parameterToString(value).toRequestBody(null)
+ )
+ }
+ }
+ }.build()
+ }
+ mediaType == FormUrlEncMediaType -> {
+ FormBody.Builder().apply {
+ // content's type *must* be Map
+ @Suppress("UNCHECKED_CAST")
+ (content as Map).forEach { (key, value) ->
+ add(key, parameterToString(value))
+ }
+ }.build()
+ }
+ mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody(
+ mediaType.toMediaTypeOrNull()
+ )
+ mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.")
+ // TODO: this should be extended with other serializers
+ else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.")
+ }
+
+ @OptIn(ExperimentalStdlibApi::class)
+ protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? {
+ if(body == null) {
+ return null
+ }
+ val bodyContent = body.string()
+ if (bodyContent.isEmpty()) {
+ return null
+ }
+ if (T::class.java == File::class.java) {
+ // return tempfile
+ val f = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile()
+ f.deleteOnExit()
+ val out = BufferedWriter(FileWriter(f))
+ out.write(bodyContent)
+ out.close()
+ return f as T
+ }
+ return when(mediaType) {
+ JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent)
+ else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.")
+ }
+ }
+
+
+ protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse {
+ val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.")
+
+ val url = httpUrl.newBuilder()
+ .addPathSegments(requestConfig.path.trimStart('/'))
+ .apply {
+ requestConfig.query.forEach { query ->
+ query.value.forEach { queryValue ->
+ addQueryParameter(query.key, queryValue)
+ }
+ }
+ }.build()
+
+ // take content-type/accept from spec or set to default (application/json) if not defined
+ if (requestConfig.headers[ContentType].isNullOrEmpty()) {
+ requestConfig.headers[ContentType] = JsonMediaType
+ }
+ if (requestConfig.headers[Accept].isNullOrEmpty()) {
+ requestConfig.headers[Accept] = JsonMediaType
+ }
+ val headers = requestConfig.headers
+
+ if(headers[ContentType] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Content-Type header. This is required.")
+ }
+
+ if(headers[Accept] ?: "" == "") {
+ throw kotlin.IllegalStateException("Missing Accept header. This is required.")
+ }
+
+ // TODO: support multiple contentType options here.
+ val contentType = (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault())
+
+ val request = when (requestConfig.method) {
+ RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType))
+ RequestMethod.GET -> Request.Builder().url(url)
+ RequestMethod.HEAD -> Request.Builder().url(url).head()
+ RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType))
+ RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType))
+ RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType))
+ RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null)
+ }.apply {
+ headers.forEach { header -> addHeader(header.key, header.value) }
+ }.build()
+
+ val response = client.newCall(request).execute()
+ val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault())
+
+ // TODO: handle specific mapping types. e.g. Map>
+ return when {
+ response.isRedirect -> Redirection(
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isInformational -> Informational(
+ response.message,
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isSuccessful -> Success(
+ responseBody(response.body, accept),
+ response.code,
+ response.headers.toMultimap()
+ )
+ response.isClientError -> ClientError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ else -> ServerError(
+ response.message,
+ response.body?.string(),
+ response.code,
+ response.headers.toMultimap()
+ )
+ }
+ }
+
+ protected fun parameterToString(value: Any?): String = when (value) {
+ null -> ""
+ is Array<*> -> toMultiValue(value, "csv").toString()
+ is Iterable<*> -> toMultiValue(value, "csv").toString()
+ is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date ->
+ parseDateToQueryString(value)
+ else -> value.toString()
+ }
+
+ protected inline fun parseDateToQueryString(value : T): String {
+ /*
+ .replace("\"", "") converts the json object string to an actual string for the query parameter.
+ The moshi or gson adapter allows a more generic solution instead of trying to use a native
+ formatter. It also easily allows to provide a simple way to define a custom date format pattern
+ inside a gson/moshi adapter.
+ */
+ return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "")
+ }
+}
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
new file mode 100644
index 00000000000..9dc8d8dbbfa
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt
@@ -0,0 +1,43 @@
+package org.openapitools.client.infrastructure
+
+enum class ResponseType {
+ Success, Informational, Redirection, ClientError, ServerError
+}
+
+interface Response
+
+abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response {
+ abstract val statusCode: Int
+ abstract val headers: Map>
+}
+
+class Success(
+ val data: T,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+): ApiInfrastructureResponse(ResponseType.Success)
+
+class Informational(
+ val statusText: String,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Informational)
+
+class Redirection(
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.Redirection)
+
+class ClientError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map> = mapOf()
+) : ApiInfrastructureResponse(ResponseType.ClientError)
+
+class ServerError(
+ val message: String? = null,
+ val body: Any? = null,
+ override val statusCode: Int = -1,
+ override val headers: Map>
+): ApiInfrastructureResponse(ResponseType.ServerError)
\ No newline at end of file
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
new file mode 100644
index 00000000000..fb2c972cf8d
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigDecimal
+
+class BigDecimalAdapter {
+ @ToJson
+ fun toJson(value: BigDecimal): String {
+ return value.toPlainString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigDecimal {
+ return BigDecimal(value)
+ }
+}
\ No newline at end of file
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
new file mode 100644
index 00000000000..4b6963110c9
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.math.BigInteger
+
+class BigIntegerAdapter {
+ @ToJson
+ fun toJson(value: BigInteger): String {
+ return value.toString()
+ }
+
+ @FromJson
+ fun fromJson(value: String): BigInteger {
+ return BigInteger(value)
+ }
+}
\ No newline at end of file
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
new file mode 100644
index 00000000000..ff5e2a81ee8
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
@@ -0,0 +1,12 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+
+class ByteArrayAdapter {
+ @ToJson
+ fun toJson(data: ByteArray): String = String(data)
+
+ @FromJson
+ fun fromJson(data: String): ByteArray = data.toByteArray()
+}
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
new file mode 100644
index 00000000000..b5310e71f13
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt
@@ -0,0 +1,18 @@
+@file:Suppress("unused")
+package org.openapitools.client.infrastructure
+
+import java.lang.RuntimeException
+
+open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 123L
+ }
+}
+
+open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+
+ companion object {
+ private const val serialVersionUID: Long = 456L
+ }
+}
\ No newline at end of file
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
new file mode 100644
index 00000000000..b2e1654479a
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDate
+import java.time.format.DateTimeFormatter
+
+class LocalDateAdapter {
+ @ToJson
+ fun toJson(value: LocalDate): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDate {
+ return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE)
+ }
+
+}
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
new file mode 100644
index 00000000000..e082db94811
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.LocalDateTime
+import java.time.format.DateTimeFormatter
+
+class LocalDateTimeAdapter {
+ @ToJson
+ fun toJson(value: LocalDateTime): String {
+ return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): LocalDateTime {
+ return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
+ }
+
+}
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
new file mode 100644
index 00000000000..87437871a31
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
@@ -0,0 +1,19 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.time.OffsetDateTime
+import java.time.format.DateTimeFormatter
+
+class OffsetDateTimeAdapter {
+ @ToJson
+ fun toJson(value: OffsetDateTime): String {
+ return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value)
+ }
+
+ @FromJson
+ fun fromJson(value: String): OffsetDateTime {
+ return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
+ }
+
+}
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
new file mode 100644
index 00000000000..7e948e1dd07
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
@@ -0,0 +1,17 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Defines a config object for a given request.
+ * NOTE: This object doesn't include 'body' because it
+ * allows for caching of the constructed object
+ * for many request definitions.
+ * NOTE: Headers is a Map because rfc2616 defines
+ * multi-valued headers as csv-only.
+ */
+data class RequestConfig(
+ val method: RequestMethod,
+ val path: String,
+ val headers: MutableMap = mutableMapOf(),
+ val query: MutableMap> = mutableMapOf(),
+ val body: T? = null
+)
\ No newline at end of file
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
new file mode 100644
index 00000000000..931b12b8bd7
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
@@ -0,0 +1,8 @@
+package org.openapitools.client.infrastructure
+
+/**
+ * Provides enumerated HTTP verbs
+ */
+enum class RequestMethod {
+ GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT
+}
\ No newline at end of file
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
new file mode 100644
index 00000000000..9bd2790dc14
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt
@@ -0,0 +1,24 @@
+package org.openapitools.client.infrastructure
+
+import okhttp3.Response
+
+/**
+ * Provides an extension to evaluation whether the response is a 1xx code
+ */
+val Response.isInformational : Boolean get() = this.code in 100..199
+
+/**
+ * Provides an extension to evaluation whether the response is a 3xx code
+ */
+@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
+val Response.isRedirect : Boolean get() = this.code in 300..399
+
+/**
+ * Provides an extension to evaluation whether the response is a 4xx code
+ */
+val Response.isClientError : Boolean get() = this.code in 400..499
+
+/**
+ * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code
+ */
+val Response.isServerError : Boolean get() = this.code in 500..999
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
new file mode 100644
index 00000000000..e22592e47d7
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
@@ -0,0 +1,23 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.Moshi
+import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
+
+object Serializer {
+ @JvmStatic
+ val moshiBuilder: Moshi.Builder = Moshi.Builder()
+ .add(OffsetDateTimeAdapter())
+ .add(LocalDateTimeAdapter())
+ .add(LocalDateAdapter())
+ .add(UUIDAdapter())
+ .add(ByteArrayAdapter())
+ .add(URIAdapter())
+ .add(KotlinJsonAdapterFactory())
+ .add(BigDecimalAdapter())
+ .add(BigIntegerAdapter())
+
+ @JvmStatic
+ val moshi: Moshi by lazy {
+ moshiBuilder.build()
+ }
+}
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
new file mode 100644
index 00000000000..927522757da
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.net.URI
+
+class URIAdapter {
+ @ToJson
+ fun toJson(uri: URI) = uri.toString()
+
+ @FromJson
+ fun fromJson(s: String): URI = URI.create(s)
+}
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
new file mode 100644
index 00000000000..7ccf7dc25d2
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
@@ -0,0 +1,13 @@
+package org.openapitools.client.infrastructure
+
+import com.squareup.moshi.FromJson
+import com.squareup.moshi.ToJson
+import java.util.UUID
+
+class UUIDAdapter {
+ @ToJson
+ fun toJson(uuid: UUID) = uuid.toString()
+
+ @FromJson
+ fun fromJson(s: String): UUID = UUID.fromString(s)
+}
diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNode.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNode.kt
new file mode 100644
index 00000000000..0312c38ca8a
--- /dev/null
+++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNode.kt
@@ -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: 0.2.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 org.openapitools.client.models.CactusNodeAllOf
+import org.openapitools.client.models.CactusNodeMeta
+
+import com.squareup.moshi.Json
+
+/**
+ * A Cactus node can be a single server, or a set of servers behind a load balancer acting as one.
+ *
+ * @param nodeApiHost
+ * @param publicKeyPem The PEM encoded public key that was used to generate the JWS included in the response (the jws property)
+ * @param id
+ * @param consortiumId
+ * @param memberId
+ * @param ledgerIds 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.
+ * @param pluginInstanceIds
+ */
+
+data class CactusNode (
+
+ @Json(name = "nodeApiHost")
+ val nodeApiHost: kotlin.String,
+
+ /* The PEM encoded public key that was used to generate the JWS included in the response (the jws property) */
+ @Json(name = "publicKeyPem")
+ val publicKeyPem: kotlin.String,
+
+ @Json(name = "id")
+ val id: kotlin.String,
+
+ @Json(name = "consortiumId")
+ val consortiumId: kotlin.String,
+
+ @Json(name = "memberId")
+ val memberId: kotlin.String,
+
+ /* 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. */
+ @Json(name = "ledgerIds")
+ val ledgerIds: kotlin.collections.List = arrayListOf(),
+
+ @Json(name = "pluginInstanceIds")
+ val pluginInstanceIds: kotlin.collections.List