Skip to content

Commit

Permalink
feat(openapi): upgrade to 6.3.0 phase1
Browse files Browse the repository at this point in the history
    Primary Changes
    ---------------
    1. Updated openapitoos.json for various plugins to use 6.3.0
    version of openapi generator
    2. Relevant code for each plugin was generated

    openapitools.json is updated for the following plugins to
    incorporate 1)
    ------------------------------------------------------------
    a. extensions/cactus-plugin-htlc-coordinator-besu
    b. packages/cactus-plugin-htlc-eth-besu
    c. packages/cactus-plugin-htlc-eth-besu-erc20
    d. packages/cactus-plugin-ledger-connector-besu
    e. packages/cactus-plugin-ledger-connector-quorum
    f. packages/cactus-cmd-api-server
    g. packages/cactus-core-api
    h. packages/cactus-plugin-consortium-manual
    i. packages/cactus-plugin-keychain-aws-sm
    j. packages/cactus-plugin-keychain-azure-kv
    k. packages/cactus-plugin-keychain-google-sm
    l. packages/cactus-plugin-keychain-memory
    m. packages/cactus-plugin-keychain-memory-wasm
    n. packages/cactus-plugin-keychain-vault
    o. packages/cactus-plugin-ledger-connector-ubiquity
    p. packages/cactus-plugin-ledger-connector-xdai packages/cactus-plugin-odap-hermes
    q. examples/cactus-example-carbon-accounting-business-logic-plugin

Fixes hyperledger#2298

Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
  • Loading branch information
jagpreetsinghsasan committed Jun 5, 2023
1 parent 3e6d908 commit c164902
Show file tree
Hide file tree
Showing 361 changed files with 6,720 additions and 4,610 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "5.2.1"
"version": "6.3.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ 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/ApiResponse.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/PartConfig.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
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.1
6.3.0
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# org.openapitools.client - Kotlin client library for Hyperledger Cactus Example - Carbon Accounting App

Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.

## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.

- API version: 0.2.0
- Package version:
- Build package: org.openapitools.codegen.languages.KotlinClientCodegen

## Requires

* Kotlin 1.4.30
* Gradle 6.8.3
* Kotlin 1.7.21
* Gradle 7.5

## Build

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ group 'org.openapitools'
version '1.0.0'

wrapper {
gradleVersion = '6.8.3'
gradleVersion = '7.5'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}

buildscript {
ext.kotlin_version = '1.5.10'
ext.kotlin_version = '1.7.21'

repositories {
maven { url "https://repo1.maven.org/maven2" }
Expand All @@ -18,6 +18,7 @@ buildscript {
}

apply plugin: 'kotlin'
apply plugin: 'maven-publish'

repositories {
maven { url "https://repo1.maven.org/maven2" }
Expand All @@ -30,8 +31,8 @@ test {
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"
implementation "com.squareup.moshi:moshi-kotlin:1.13.0"
implementation "com.squareup.moshi:moshi-adapters:1.13.0"
implementation "com.squareup.okhttp3:okhttp:4.10.0"
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
/**
* 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(
Expand All @@ -20,49 +15,55 @@

package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.HttpUrl

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 com.squareup.moshi.Json

import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiResponse
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.PartConfig
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) {
class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://localhost")
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://localhost")
}
}

/**
* Get the number of tokens &#x60;spender&#x60; is approved to spend on behalf of &#x60;account&#x60;
*
* @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
*/
* Get the number of tokens &#x60;spender&#x60; is approved to spend on behalf of &#x60;account&#x60;
*
* @param daoTokenGetAllowanceRequest (optional)
* @return DaoTokenGetAllowanceResponse
* @throws IllegalStateException If the request is not correctly configured
* @throws IOException Rethrows the OkHttp execute method exception
* @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<DaoTokenGetAllowanceRequest, DaoTokenGetAllowanceResponse>(
localVariableConfig
)
@Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest: DaoTokenGetAllowanceRequest? = null) : DaoTokenGetAllowanceResponse {
val localVarResponse = daoTokenGetAllowanceV1WithHttpInfo(daoTokenGetAllowanceRequest = daoTokenGetAllowanceRequest)

return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as DaoTokenGetAllowanceResponse
Expand All @@ -80,42 +81,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath
}

/**
* To obtain the request config of the operation daoTokenGetAllowanceV1
*
* @param daoTokenGetAllowanceRequest (optional)
* @return RequestConfig
*/
* Get the number of tokens &#x60;spender&#x60; is approved to spend on behalf of &#x60;account&#x60;
*
* @param daoTokenGetAllowanceRequest (optional)
* @return ApiResponse<DaoTokenGetAllowanceResponse?>
* @throws IllegalStateException If the request is not correctly configured
* @throws IOException Rethrows the OkHttp execute method exception
*/
@Suppress("UNCHECKED_CAST")
@Throws(IllegalStateException::class, IOException::class)
fun daoTokenGetAllowanceV1WithHttpInfo(daoTokenGetAllowanceRequest: DaoTokenGetAllowanceRequest?) : ApiResponse<DaoTokenGetAllowanceResponse?> {
val localVariableConfig = daoTokenGetAllowanceV1RequestConfig(daoTokenGetAllowanceRequest = daoTokenGetAllowanceRequest)

return request<DaoTokenGetAllowanceRequest, DaoTokenGetAllowanceResponse>(
localVariableConfig
)
}

/**
* To obtain the request config of the operation daoTokenGetAllowanceV1
*
* @param daoTokenGetAllowanceRequest (optional)
* @return RequestConfig
*/
fun daoTokenGetAllowanceV1RequestConfig(daoTokenGetAllowanceRequest: DaoTokenGetAllowanceRequest?) : RequestConfig<DaoTokenGetAllowanceRequest> {
val localVariableBody = daoTokenGetAllowanceRequest
val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
localVariableHeaders["Content-Type"] = "application/json"
localVariableHeaders["Accept"] = "application/json"

return RequestConfig(
method = RequestMethod.POST,
path = "/api/v1/plugins/@hyperledger/cactus-example-carbon-accounting-backend/dao-token/get-allowance",
query = localVariableQuery,
headers = localVariableHeaders,
requiresAuthentication = false,
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
*/
* Registers an admin account within the Fabric organization specified.
*
* @param enrollAdminV1Request (optional)
* @return EnrollAdminV1Response
* @throws IllegalStateException If the request is not correctly configured
* @throws IOException Rethrows the OkHttp execute method exception
* @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<EnrollAdminV1Request, EnrollAdminV1Response>(
localVariableConfig
)
@Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun enrollAdminV1(enrollAdminV1Request: EnrollAdminV1Request? = null) : EnrollAdminV1Response {
val localVarResponse = enrollAdminV1WithHttpInfo(enrollAdminV1Request = enrollAdminV1Request)

return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as EnrollAdminV1Response
Expand All @@ -133,23 +153,47 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath
}

/**
* To obtain the request config of the operation enrollAdminV1
*
* @param enrollAdminV1Request (optional)
* @return RequestConfig
*/
* Registers an admin account within the Fabric organization specified.
*
* @param enrollAdminV1Request (optional)
* @return ApiResponse<EnrollAdminV1Response?>
* @throws IllegalStateException If the request is not correctly configured
* @throws IOException Rethrows the OkHttp execute method exception
*/
@Suppress("UNCHECKED_CAST")
@Throws(IllegalStateException::class, IOException::class)
fun enrollAdminV1WithHttpInfo(enrollAdminV1Request: EnrollAdminV1Request?) : ApiResponse<EnrollAdminV1Response?> {
val localVariableConfig = enrollAdminV1RequestConfig(enrollAdminV1Request = enrollAdminV1Request)

return request<EnrollAdminV1Request, EnrollAdminV1Response>(
localVariableConfig
)
}

/**
* To obtain the request config of the operation enrollAdminV1
*
* @param enrollAdminV1Request (optional)
* @return RequestConfig
*/
fun enrollAdminV1RequestConfig(enrollAdminV1Request: EnrollAdminV1Request?) : RequestConfig<EnrollAdminV1Request> {
val localVariableBody = enrollAdminV1Request
val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
localVariableHeaders["Content-Type"] = "application/json"
localVariableHeaders["Accept"] = "application/json"

return RequestConfig(
method = RequestMethod.POST,
path = "/api/v1/utilityemissionchannel/registerEnroll/admin",
query = localVariableQuery,
headers = localVariableHeaders,
requiresAuthentication = false,
body = localVariableBody
)
}


private fun encodeURIComponent(uriComponent: kotlin.String): kotlin.String =
HttpUrl.Builder().scheme("http").host("localhost").addPathSegment(uriComponent).build().encodedPathSegments[0]
}

0 comments on commit c164902

Please sign in to comment.