diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/openapitools.json b/examples/cactus-example-carbon-accounting-business-logic-plugin/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/examples/cactus-example-carbon-accounting-business-logic-plugin/openapitools.json +++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/openapitools.json @@ -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" } } 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 index 449474f95a..5a3b78468c 100644 --- 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 @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 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 index 804440660c..e7e42a4b58 100644 --- 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 @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ 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 index 00c512ea75..8dd7afe77b 100644 --- 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 @@ -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 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 index 3de8b45b13..66a3c68b89 100644 --- 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 @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } 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 index 20e96437b9..6649d6df96 100644 --- 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 @@ -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( @@ -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 `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 - */ + * Get the number of tokens `spender` is approved to spend on behalf of `account` + * + * @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( - 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 @@ -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 `spender` is approved to spend on behalf of `account` + * + * @param daoTokenGetAllowanceRequest (optional) + * @return ApiResponse + * @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 { + val localVariableConfig = daoTokenGetAllowanceV1RequestConfig(daoTokenGetAllowanceRequest = daoTokenGetAllowanceRequest) + + return request( + localVariableConfig + ) + } + + /** + * 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() + 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( - 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 @@ -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 + * @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 { + val localVariableConfig = enrollAdminV1RequestConfig(enrollAdminV1Request = enrollAdminV1Request) + + return request( + localVariableConfig + ) + } + + /** + * 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() + 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] } 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 index b359be1e41..757080d7ed 100644 --- 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 @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } 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/ApiResponse.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /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/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) 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 index fb2c972cf8..064b57fc6b 100644 --- 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 @@ -14,4 +14,4 @@ class BigDecimalAdapter { 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 index 4b6963110c..7df6057b45 100644 --- 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 @@ -14,4 +14,4 @@ class BigIntegerAdapter { 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/PartConfig.kt b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /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/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) 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 index 7e948e1dd0..625a19002b 100644 --- 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 @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, 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/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 index 3f4836b17a..9912d13e9f 100644 --- 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 @@ -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( @@ -47,12 +42,12 @@ enum class AuthzJwtClaim(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is AuthzJwtClaim) "$data" else null + fun encode(data: kotlin.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 { + fun decode(data: kotlin.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 index 55bf835d82..59dad5a032 100644 --- 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 @@ -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( @@ -50,12 +45,12 @@ enum class AuthzScope(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is AuthzScope) "$data" else null + fun encode(data: kotlin.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 { + fun decode(data: kotlin.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 index 11aed701b6..09ef10e250 100644 --- 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 @@ -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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param votes */ + data class Checkpoint ( @Json(name = "fromBlock") 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 index 5f08e0e31c..58ec7f2709 100644 --- 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 @@ -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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param spenderFound Indicates whether the spender was found or not. */ + data class DaoTokenGetAllowanceNotFoundResponse ( /* Indicates whether the account was found or not. */ 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 index 4a5657ef9a..f99c232f22 100644 --- 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 @@ -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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param spender The address of the account spending the funds */ + data class DaoTokenGetAllowanceRequest ( /* The address of the account holding the funds */ 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 index 6acb5f77cb..9a64bcd543 100644 --- 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 @@ -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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param allowance The number of tokens approved */ + data class DaoTokenGetAllowanceResponse ( /* The number of tokens approved */ 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 index 677280b609..fc7f152377 100644 --- 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 @@ -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( @@ -50,12 +45,12 @@ enum class EnrollAdminInfo(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is EnrollAdminInfo) "$data" else null + fun encode(data: kotlin.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 { + fun decode(data: kotlin.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 index 1f393eecee..3e5537e942 100644 --- 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 @@ -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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param orgName */ + data class EnrollAdminV1Request ( @Json(name = "orgName") 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 index ddd4e4f237..ffaed858f7 100644 --- 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 @@ -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( @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param identityId The key under which the identity created will be persisted to the keychain for later retrieval. */ + data class EnrollAdminV1Response ( @Json(name = "info") diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/api.ts b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/api.ts index f1574b9fcb..c209b14122 100644 --- a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * 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 @@ -27,12 +29,15 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr * @enum {string} */ -export enum AuthzJwtClaim { +export const AuthzJwtClaim = { /** * The "iss" (issuer) claim identifies the principal that issued the JWT. The processing of this claim is generally application specific. The "iss" value is a case-sensitive string containing a StringOrURI value. Use of this claim is OPTIONAL. */ - iss = 'Hyperledger Labs - Carbon Accounting Tool' -} + iss: 'Hyperledger Labs - Carbon Accounting Tool' +} as const; + +export type AuthzJwtClaim = typeof AuthzJwtClaim[keyof typeof AuthzJwtClaim]; + /** * @@ -40,16 +45,19 @@ export enum AuthzJwtClaim { * @enum {string} */ -export enum AuthzScope { +export const AuthzScope = { /** * Identities with the group:admin scope are administrators of the system. */ - GroupAdmin = 'group:admin', + GroupAdmin: 'group:admin', /** * Identities with the group:user scope are end users of the system who only have authorization to perform a limited set of actions. */ - GroupUser = 'group:user' -} + GroupUser: 'group:user' +} as const; + +export type AuthzScope = typeof AuthzScope[keyof typeof AuthzScope]; + /** * @@ -62,13 +70,13 @@ export interface Checkpoint { * @type {number} * @memberof Checkpoint */ - fromBlock: number; + 'fromBlock': number; /** * * @type {string} * @memberof Checkpoint */ - votes: string; + 'votes': string; } /** * @@ -81,13 +89,13 @@ export interface DaoTokenGetAllowanceNotFoundResponse { * @type {boolean} * @memberof DaoTokenGetAllowanceNotFoundResponse */ - accountFound: boolean; + 'accountFound': boolean; /** * Indicates whether the spender was found or not. * @type {boolean} * @memberof DaoTokenGetAllowanceNotFoundResponse */ - spenderFound: boolean; + 'spenderFound': boolean; } /** * @@ -100,13 +108,13 @@ export interface DaoTokenGetAllowanceRequest { * @type {string} * @memberof DaoTokenGetAllowanceRequest */ - account: string; + 'account': string; /** * The address of the account spending the funds * @type {string} * @memberof DaoTokenGetAllowanceRequest */ - spender: string; + 'spender': string; } /** * @@ -119,7 +127,7 @@ export interface DaoTokenGetAllowanceResponse { * @type {number} * @memberof DaoTokenGetAllowanceResponse */ - allowance: number; + 'allowance': number; } /** * @@ -127,10 +135,13 @@ export interface DaoTokenGetAllowanceResponse { * @enum {string} */ -export enum EnrollAdminInfo { - SUCCESSFULLY_ENROLLED_ADMIN = 'Successfully enrolled admin user and imported it into the wallet', - ORG_ADMIN_REGISTERED = 'ORG ADMIN REGISTERED' -} +export const EnrollAdminInfo = { + SUCCESSFULLY_ENROLLED_ADMIN: 'Successfully enrolled admin user and imported it into the wallet', + ORG_ADMIN_REGISTERED: 'ORG ADMIN REGISTERED' +} as const; + +export type EnrollAdminInfo = typeof EnrollAdminInfo[keyof typeof EnrollAdminInfo]; + /** * @@ -143,7 +154,7 @@ export interface EnrollAdminV1Request { * @type {string} * @memberof EnrollAdminV1Request */ - orgName: string; + 'orgName': string; } /** * @@ -156,31 +167,31 @@ export interface EnrollAdminV1Response { * @type {string} * @memberof EnrollAdminV1Response */ - info: string; + 'info': string; /** * * @type {string} * @memberof EnrollAdminV1Response */ - orgName: string; + 'orgName': string; /** * * @type {string} * @memberof EnrollAdminV1Response */ - msp: string; + 'msp': string; /** * * @type {string} * @memberof EnrollAdminV1Response */ - caName: string; + 'caName': string; /** * The key under which the identity created will be persisted to the keychain for later retrieval. * @type {string} * @memberof EnrollAdminV1Response */ - identityId?: string; + 'identityId'?: string; } /** @@ -196,7 +207,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - daoTokenGetAllowanceV1: async (daoTokenGetAllowanceRequest?: DaoTokenGetAllowanceRequest, options: any = {}): Promise => { + daoTokenGetAllowanceV1: async (daoTokenGetAllowanceRequest?: DaoTokenGetAllowanceRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-example-carbon-accounting-backend/dao-token/get-allowance`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -213,7 +224,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(daoTokenGetAllowanceRequest, localVarRequestOptions, configuration) @@ -230,7 +241,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - enrollAdminV1: async (enrollAdminV1Request?: EnrollAdminV1Request, options: any = {}): Promise => { + enrollAdminV1: async (enrollAdminV1Request?: EnrollAdminV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/utilityemissionchannel/registerEnroll/admin`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -247,7 +258,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(enrollAdminV1Request, localVarRequestOptions, configuration) @@ -274,7 +285,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest?: DaoTokenGetAllowanceRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest?: DaoTokenGetAllowanceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -285,7 +296,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async enrollAdminV1(enrollAdminV1Request?: EnrollAdminV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async enrollAdminV1(enrollAdminV1Request?: EnrollAdminV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.enrollAdminV1(enrollAdminV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -337,7 +348,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest?: DaoTokenGetAllowanceRequest, options?: any) { + public daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest?: DaoTokenGetAllowanceRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).daoTokenGetAllowanceV1(daoTokenGetAllowanceRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -349,7 +360,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public enrollAdminV1(enrollAdminV1Request?: EnrollAdminV1Request, options?: any) { + public enrollAdminV1(enrollAdminV1Request?: EnrollAdminV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).enrollAdminV1(enrollAdminV1Request, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/base.ts b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/base.ts index 151aa84c48..f07809e7af 100644 --- a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/common.ts b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/common.ts index 2fd1610612..4af08e2336 100644 --- a/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/openapitools.json b/extensions/cactus-plugin-htlc-coordinator-besu/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/openapitools.json +++ b/extensions/cactus-plugin-htlc-coordinator-besu/openapitools.json @@ -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" } } diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts index eab062fa06..1b33940fb2 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,48 +34,53 @@ export interface CounterpartyHTLCRequest { * @type {HtlcPackage} * @memberof CounterpartyHTLCRequest */ - htlcPackage: HtlcPackage; + 'htlcPackage': HtlcPackage; /** * connector Instance Id for the connector plugin * @type {string} * @memberof CounterpartyHTLCRequest */ - connectorInstanceId: string; + 'connectorInstanceId': string; /** * keychainId for the keychain plugin * @type {string} * @memberof CounterpartyHTLCRequest */ - keychainId: string; + 'keychainId': string; /** * Id for the HTLC * @type {string} * @memberof CounterpartyHTLCRequest */ - htlcId: string; + 'htlcId': string; /** * * @type {Web3SigningCredential} * @memberof CounterpartyHTLCRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {number} * @memberof CounterpartyHTLCRequest */ - gas?: number; + 'gas'?: number; } + + /** * * @export * @enum {string} */ -export enum HtlcPackage { - Besu = 'BESU', - BesuErc20 = 'BESU_ERC20' -} +export const HtlcPackage = { + Besu: 'BESU', + BesuErc20: 'BESU_ERC20' +} as const; + +export type HtlcPackage = typeof HtlcPackage[keyof typeof HtlcPackage]; + /** * @@ -86,86 +93,88 @@ export interface OwnHTLCRequest { * @type {HtlcPackage} * @memberof OwnHTLCRequest */ - htlcPackage: HtlcPackage; + 'htlcPackage': HtlcPackage; /** * connector Instance Id for the connector plugin * @type {string} * @memberof OwnHTLCRequest */ - connectorInstanceId: string; + 'connectorInstanceId': string; /** * keychainId for the keychain plugin * @type {string} * @memberof OwnHTLCRequest */ - keychainId: string; + 'keychainId': string; /** * * @type {Array} * @memberof OwnHTLCRequest */ - constructorArgs: Array; + 'constructorArgs': Array; /** * * @type {Web3SigningCredential} * @memberof OwnHTLCRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * Input amount to lock * @type {number} * @memberof OwnHTLCRequest */ - inputAmount: number; + 'inputAmount': number; /** * Output amount to lock * @type {number} * @memberof OwnHTLCRequest */ - outputAmount: number; + 'outputAmount': number; /** * Timestamp to expire the contract * @type {number} * @memberof OwnHTLCRequest */ - expiration: number; + 'expiration': number; /** * Hashlock needed to refund the amount * @type {string} * @memberof OwnHTLCRequest */ - hashLock: string; + 'hashLock': string; /** * The token address * @type {string} * @memberof OwnHTLCRequest */ - tokenAddress: string; + 'tokenAddress': string; /** * The receiver address * @type {string} * @memberof OwnHTLCRequest */ - receiver: string; + 'receiver': string; /** * The output network id * @type {string} * @memberof OwnHTLCRequest */ - outputNetwork: string; + 'outputNetwork': string; /** * The output addreess to receive the tokens * @type {string} * @memberof OwnHTLCRequest */ - outputAddress: string; + 'outputAddress': string; /** * * @type {number} * @memberof OwnHTLCRequest */ - gas?: number; + 'gas'?: number; } + + /** * @type Web3SigningCredential * @export @@ -183,26 +192,28 @@ export interface Web3SigningCredentialCactusKeychainRef { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialCactusKeychainRef */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - ethAccount: string; + 'ethAccount': string; /** * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainEntryKey: string; + 'keychainEntryKey': string; /** * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainId: string; + 'keychainId': string; } + + /** * Using this denotes that there is no signing required because the transaction is pre-signed. * @export @@ -214,8 +225,10 @@ export interface Web3SigningCredentialNone { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialNone */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; } + + /** * * @export @@ -227,32 +240,37 @@ export interface Web3SigningCredentialPrivateKeyHex { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialPrivateKeyHex */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - ethAccount: string; + 'ethAccount': string; /** * The HEX encoded private key of an eth account. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - secret: string; + 'secret': string; } + + /** * * @export * @enum {string} */ -export enum Web3SigningCredentialType { - CactusKeychainRef = 'CACTUS_KEYCHAIN_REF', - GethKeychainPassword = 'GETH_KEYCHAIN_PASSWORD', - PrivateKeyHex = 'PRIVATE_KEY_HEX', - None = 'NONE' -} +export const Web3SigningCredentialType = { + CactusKeychainRef: 'CACTUS_KEYCHAIN_REF', + GethKeychainPassword: 'GETH_KEYCHAIN_PASSWORD', + PrivateKeyHex: 'PRIVATE_KEY_HEX', + None: 'NONE' +} as const; + +export type Web3SigningCredentialType = typeof Web3SigningCredentialType[keyof typeof Web3SigningCredentialType]; + /** * @@ -265,51 +283,53 @@ export interface WithdrawCounterpartyRequest { * @type {HtlcPackage} * @memberof WithdrawCounterpartyRequest */ - htlcPackage: HtlcPackage; + 'htlcPackage': HtlcPackage; /** * connector Instance Id for the connector plugin * @type {string} * @memberof WithdrawCounterpartyRequest */ - connectorInstanceId: string; + 'connectorInstanceId': string; /** * keychainId for the keychain plugin * @type {string} * @memberof WithdrawCounterpartyRequest */ - keychainId: string; + 'keychainId': string; /** * contractId for the contract * @type {string} * @memberof WithdrawCounterpartyRequest */ - contractId?: string; + 'contractId'?: string; /** * * @type {Web3SigningCredential} * @memberof WithdrawCounterpartyRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * Id for the HTLC * @type {string} * @memberof WithdrawCounterpartyRequest */ - htlcId: string; + 'htlcId': string; /** * Counterparty HTLC secret * @type {string} * @memberof WithdrawCounterpartyRequest */ - secret: string; + 'secret': string; /** * * @type {number} * @memberof WithdrawCounterpartyRequest */ - gas?: number; + 'gas'?: number; } + + /** * DefaultApi - axios parameter creator * @export @@ -323,7 +343,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - counterpartyHtlcV1: async (counterpartyHTLCRequest?: CounterpartyHTLCRequest, options: any = {}): Promise => { + counterpartyHtlcV1: async (counterpartyHTLCRequest?: CounterpartyHTLCRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -340,7 +360,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(counterpartyHTLCRequest, localVarRequestOptions, configuration) @@ -357,7 +377,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - ownHtlcV1: async (ownHTLCRequest?: OwnHTLCRequest, options: any = {}): Promise => { + ownHtlcV1: async (ownHTLCRequest?: OwnHTLCRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -374,7 +394,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(ownHTLCRequest, localVarRequestOptions, configuration) @@ -391,7 +411,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - withdrawCounterpartyV1: async (withdrawCounterpartyRequest?: WithdrawCounterpartyRequest, options: any = {}): Promise => { + withdrawCounterpartyV1: async (withdrawCounterpartyRequest?: WithdrawCounterpartyRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -408,7 +428,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(withdrawCounterpartyRequest, localVarRequestOptions, configuration) @@ -435,7 +455,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async counterpartyHtlcV1(counterpartyHTLCRequest?: CounterpartyHTLCRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async counterpartyHtlcV1(counterpartyHTLCRequest?: CounterpartyHTLCRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.counterpartyHtlcV1(counterpartyHTLCRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -446,7 +466,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async ownHtlcV1(ownHTLCRequest?: OwnHTLCRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async ownHtlcV1(ownHTLCRequest?: OwnHTLCRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.ownHtlcV1(ownHTLCRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -457,7 +477,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async withdrawCounterpartyV1(withdrawCounterpartyRequest?: WithdrawCounterpartyRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async withdrawCounterpartyV1(withdrawCounterpartyRequest?: WithdrawCounterpartyRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.withdrawCounterpartyV1(withdrawCounterpartyRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -519,7 +539,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public counterpartyHtlcV1(counterpartyHTLCRequest?: CounterpartyHTLCRequest, options?: any) { + public counterpartyHtlcV1(counterpartyHTLCRequest?: CounterpartyHTLCRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).counterpartyHtlcV1(counterpartyHTLCRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -531,7 +551,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public ownHtlcV1(ownHTLCRequest?: OwnHTLCRequest, options?: any) { + public ownHtlcV1(ownHTLCRequest?: OwnHTLCRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).ownHtlcV1(ownHTLCRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -543,7 +563,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public withdrawCounterpartyV1(withdrawCounterpartyRequest?: WithdrawCounterpartyRequest, options?: any) { + public withdrawCounterpartyV1(withdrawCounterpartyRequest?: WithdrawCounterpartyRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).withdrawCounterpartyV1(withdrawCounterpartyRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts index aededdda88..8d44905c81 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "https://www.cactus.stream".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts index cfdff6d070..d84dc089c3 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-cmd-api-server/openapitools.json b/packages/cactus-cmd-api-server/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-cmd-api-server/openapitools.json +++ b/packages/cactus-cmd-api-server/openapitools.json @@ -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" } } 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 index eae4f1a10a..9354990b61 100644 --- 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 @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 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 index 804440660c..e7e42a4b58 100644 --- 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 @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ 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 index 1665b8308c..82e7e96d21 100644 --- 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 @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus API +Interact with a Cactus deployment through HTTP. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.0.1 +- 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 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 index 3de8b45b13..66a3c68b89 100644 --- 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 @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } 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 index 30aee70509..149d4c6e63 100644 --- 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 @@ -1,14 +1,9 @@ /** - * 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( @@ -20,44 +15,50 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.HealthCheckResponse +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") } } /** - * 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 - */ + * 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 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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getHealthCheckV1() : HealthCheckResponse { - val localVariableConfig = getHealthCheckV1RequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getHealthCheckV1WithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as HealthCheckResponse @@ -75,40 +76,57 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getHealthCheckV1 - * - * @return RequestConfig - */ + * Can be used to verify liveness of an API server instance + * Returns the current timestamp of the API server as proof of health/liveness + * @return ApiResponse + * @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 getHealthCheckV1WithHttpInfo() : ApiResponse { + val localVariableConfig = getHealthCheckV1RequestConfig() + + return request( + localVariableConfig + ) + } + + /** + * 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() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, path = "/api/v1/api-server/healthcheck", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, 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 - */ + * Get the Prometheus Metrics + * + * @return kotlin.String + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPrometheusMetricsV1() : kotlin.String { - val localVariableConfig = getPrometheusMetricsV1RequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPrometheusMetricsV1WithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -126,22 +144,43 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getPrometheusMetricsV1 - * - * @return RequestConfig - */ + * Get the Prometheus Metrics + * + * @return ApiResponse + * @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 getPrometheusMetricsV1WithHttpInfo() : ApiResponse { + val localVariableConfig = getPrometheusMetricsV1RequestConfig() + + return request( + localVariableConfig + ) + } + + /** + * 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, + requiresAuthentication = false, body = localVariableBody ) } + + private fun encodeURIComponent(uriComponent: kotlin.String): kotlin.String = + HttpUrl.Builder().scheme("http").host("localhost").addPathSegment(uriComponent).build().encodedPathSegments[0] } 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 index b359be1e41..757080d7ed 100644 --- 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 @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) 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 index fb2c972cf8..064b57fc6b 100644 --- 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 @@ -14,4 +14,4 @@ class BigDecimalAdapter { 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 index 4b6963110c..7df6057b45 100644 --- 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 @@ -14,4 +14,4 @@ class BigIntegerAdapter { 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/PartConfig.kt b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) 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 index 7e948e1dd0..625a19002b 100644 --- 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 @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, 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/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 index f6075426de..395ee1db0c 100644 --- 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 @@ -1,14 +1,9 @@ /** - * 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( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param success */ + data class HealthCheckResponse ( @Json(name = "createdAt") 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 index 35b5c5e32f..4cc9572408 100644 --- 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 @@ -1,14 +1,9 @@ /** - * 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( @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param arrayBuffers */ + data class MemoryUsage ( @Json(name = "rss") 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 index 35dcc9a359..78ebf05433 100644 --- 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 @@ -1,14 +1,9 @@ /** - * 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( @@ -59,12 +54,12 @@ enum class WatchHealthcheckV1(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is WatchHealthcheckV1) "$data" else null + fun encode(data: kotlin.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 { + fun decode(data: kotlin.Any?): WatchHealthcheckV1? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/.openapi-generator/VERSION b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/.openapi-generator/VERSION +++ b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/README.md b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/README.md index e8f8c7b355..c3dba388ed 100644 --- a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/README.md +++ b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/README.md @@ -3,7 +3,7 @@ Interact with a Cactus deployment through HTTP. ## Overview -These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. - API version: 0.0.1 - Package version: @@ -16,9 +16,9 @@ Below are some usage examples for Go and Ruby. For other languages, please refer ### Go ``` # assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go` -mkdir /var/tmp/go/ -protoc --go_out=/var/tmp/go/ services/* -protoc --go_out=/var/tmp/go/ models/* +mkdir /var/tmp/go/org.hyperledger.cactus.cmd_api_server +protoc --go_out=/var/tmp/go/org.hyperledger.cactus.cmd_api_server services/* +protoc --go_out=/var/tmp/go/org.hyperledger.cactus.cmd_api_server models/* ``` ### Ruby diff --git a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/health_check_response_pb.proto b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/health_check_response_pb.proto index 2a4fc3b992..eea2f52229 100644 --- a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/health_check_response_pb.proto +++ b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/health_check_response_pb.proto @@ -1,10 +1,10 @@ /* Hyperledger Cactus API - + Interact with a Cactus deployment through HTTP. - + The version of the OpenAPI document: 0.0.1 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/memory_usage_pb.proto b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/memory_usage_pb.proto index 0124db27e7..8cb150470b 100644 --- a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/memory_usage_pb.proto +++ b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/memory_usage_pb.proto @@ -1,10 +1,10 @@ /* Hyperledger Cactus API - + Interact with a Cactus deployment through HTTP. - + The version of the OpenAPI document: 0.0.1 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/watch_healthcheck_v1_pb.proto b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/watch_healthcheck_v1_pb.proto index 51fc928a96..62bea96f6b 100644 --- a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/watch_healthcheck_v1_pb.proto +++ b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/models/watch_healthcheck_v1_pb.proto @@ -1,10 +1,10 @@ /* Hyperledger Cactus API - + Interact with a Cactus deployment through HTTP. - + The version of the OpenAPI document: 0.0.1 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/services/default_service.proto b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/services/default_service.proto index 59155057a7..b6e0723fbd 100644 --- a/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/services/default_service.proto +++ b/packages/cactus-cmd-api-server/src/main/proto/generated/openapi/services/default_service.proto @@ -1,10 +1,10 @@ /* Hyperledger Cactus API - + Interact with a Cactus deployment through HTTP. - + The version of the OpenAPI document: 0.0.1 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/api.ts index 23bbaf0050..66c5d2c1be 100644 --- a/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,19 +34,19 @@ export interface HealthCheckResponse { * @type {boolean} * @memberof HealthCheckResponse */ - success?: boolean; + 'success'?: boolean; /** * * @type {string} * @memberof HealthCheckResponse */ - createdAt: string; + 'createdAt': string; /** * * @type {MemoryUsage} * @memberof HealthCheckResponse */ - memoryUsage: MemoryUsage; + 'memoryUsage': MemoryUsage; } /** * @@ -57,31 +59,31 @@ export interface MemoryUsage { * @type {number} * @memberof MemoryUsage */ - rss?: number; + 'rss'?: number; /** * * @type {number} * @memberof MemoryUsage */ - heapTotal?: number; + 'heapTotal'?: number; /** * * @type {number} * @memberof MemoryUsage */ - heapUsed?: number; + 'heapUsed'?: number; /** * * @type {number} * @memberof MemoryUsage */ - external?: number; + 'external'?: number; /** * * @type {number} * @memberof MemoryUsage */ - arrayBuffers?: number; + 'arrayBuffers'?: number; } /** * @@ -89,13 +91,16 @@ export interface MemoryUsage { * @enum {string} */ -export enum WatchHealthcheckV1 { - Subscribe = 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe', - Next = 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next', - Unsubscribe = 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe', - Error = 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error', - Complete = 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete' -} +export const WatchHealthcheckV1 = { + Subscribe: 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe', + Next: 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next', + Unsubscribe: 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe', + Error: 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error', + Complete: 'org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete' +} as const; + +export type WatchHealthcheckV1 = typeof WatchHealthcheckV1[keyof typeof WatchHealthcheckV1]; + /** @@ -110,7 +115,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getHealthCheckV1: async (options: any = {}): Promise => { + getHealthCheckV1: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/api-server/healthcheck`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -125,7 +130,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -140,7 +145,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPrometheusMetricsV1: async (options: any = {}): Promise => { + getPrometheusMetricsV1: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/api-server/get-prometheus-exporter-metrics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -155,7 +160,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -180,7 +185,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getHealthCheckV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getHealthCheckV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getHealthCheckV1(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -190,7 +195,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getPrometheusMetricsV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getPrometheusMetricsV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPrometheusMetricsV1(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -239,7 +244,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getHealthCheckV1(options?: any) { + public getHealthCheckV1(options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getHealthCheckV1(options).then((request) => request(this.axios, this.basePath)); } @@ -250,7 +255,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getPrometheusMetricsV1(options?: any) { + public getPrometheusMetricsV1(options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getPrometheusMetricsV1(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/base.ts index 47259b0f15..5dadf8db6b 100644 --- a/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/common.ts index 0cc7f68adc..83860e982e 100644 --- a/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-cmd-api-server/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-core-api/openapitools.json b/packages/cactus-core-api/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-core-api/openapitools.json +++ b/packages/cactus-core-api/openapitools.json @@ -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" } } 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 index 5dbcb919c1..a5d2479a17 100644 --- 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 @@ -5,7 +5,7 @@ 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/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 @@ -13,6 +13,7 @@ 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 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 index 804440660c..e7e42a4b58 100644 --- 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 @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ 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 index 60d5e00042..c102e2b51c 100644 --- 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 @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Core API +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://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 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 index 3de8b45b13..66a3c68b89 100644 --- 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 @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } 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 index b359be1e41..757080d7ed 100644 --- 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 @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) 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 index fb2c972cf8..064b57fc6b 100644 --- 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 @@ -14,4 +14,4 @@ class BigDecimalAdapter { 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 index 4b6963110c..7df6057b45 100644 --- 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 @@ -14,4 +14,4 @@ class BigIntegerAdapter { 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/PartConfig.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) 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 index 7e948e1dd0..625a19002b 100644 --- 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 @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, 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/models/CactusNode.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNode.kt index 0312c38ca8..4f9aeca4d8 100644 --- 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 @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -20,8 +15,6 @@ package org.openapitools.client.models -import org.openapitools.client.models.CactusNodeAllOf -import org.openapitools.client.models.CactusNodeMeta import com.squareup.moshi.Json @@ -37,6 +30,7 @@ import com.squareup.moshi.Json * @param pluginInstanceIds */ + data class CactusNode ( @Json(name = "nodeApiHost") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNodeAllOf.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNodeAllOf.kt index 8c312ec0ca..c95e11a81c 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNodeAllOf.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNodeAllOf.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param pluginInstanceIds */ + data class CactusNodeAllOf ( @Json(name = "id") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNodeMeta.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNodeMeta.kt index 2b0c24a324..906806ba7d 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNodeMeta.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CactusNodeMeta.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param publicKeyPem The PEM encoded public key that was used to generate the JWS included in the response (the jws property) */ + data class CactusNodeMeta ( @Json(name = "nodeApiHost") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithOutTxFinality.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithOutTxFinality.kt index 52530e457a..a008ba206f 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithOutTxFinality.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithOutTxFinality.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -47,12 +42,12 @@ enum class ConsensusAlgorithmFamiliesWithOutTxFinality(val value: kotlin.String) /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is ConsensusAlgorithmFamiliesWithOutTxFinality) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is ConsensusAlgorithmFamiliesWithOutTxFinality) "$data" else null /** * Returns a valid [ConsensusAlgorithmFamiliesWithOutTxFinality] for [data], null otherwise. */ - fun decode(data: Any?): ConsensusAlgorithmFamiliesWithOutTxFinality? = data?.let { + fun decode(data: kotlin.Any?): ConsensusAlgorithmFamiliesWithOutTxFinality? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithTxFinality.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithTxFinality.kt index 3750303bdb..b94a5cce53 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithTxFinality.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamiliesWithTxFinality.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -50,12 +45,12 @@ enum class ConsensusAlgorithmFamiliesWithTxFinality(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is ConsensusAlgorithmFamiliesWithTxFinality) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is ConsensusAlgorithmFamiliesWithTxFinality) "$data" else null /** * Returns a valid [ConsensusAlgorithmFamiliesWithTxFinality] for [data], null otherwise. */ - fun decode(data: Any?): ConsensusAlgorithmFamiliesWithTxFinality? = data?.let { + fun decode(data: kotlin.Any?): ConsensusAlgorithmFamiliesWithTxFinality? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamily.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamily.kt index 3cf2558665..47a1aa755f 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamily.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsensusAlgorithmFamily.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -53,12 +48,12 @@ enum class ConsensusAlgorithmFamily(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is ConsensusAlgorithmFamily) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is ConsensusAlgorithmFamily) "$data" else null /** * Returns a valid [ConsensusAlgorithmFamily] for [data], null otherwise. */ - fun decode(data: Any?): ConsensusAlgorithmFamily? = data?.let { + fun decode(data: kotlin.Any?): ConsensusAlgorithmFamily? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Consortium.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Consortium.kt index bb67d2b44d..ed9b6db5c9 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Consortium.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Consortium.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param memberIds The collection (array) of primary keys of consortium member entities that belong to this Consortium. */ + data class Consortium ( @Json(name = "id") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsortiumDatabase.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsortiumDatabase.kt index 81ba024132..16d6618457 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsortiumDatabase.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsortiumDatabase.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -38,6 +33,7 @@ import com.squareup.moshi.Json * @param pluginInstance The complete collection of all plugin instance entities in existence within the consortium. */ + data class ConsortiumDatabase ( /* 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. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsortiumMember.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsortiumMember.kt index df60652e5c..ce80b41053 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsortiumMember.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ConsortiumMember.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param nodeIds */ + data class ConsortiumMember ( @Json(name = "id") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Constants.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Constants.kt index 1800cbaaf3..45ccad4e63 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Constants.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Constants.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -47,12 +42,12 @@ enum class Constants(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is Constants) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is Constants) "$data" else null /** * Returns a valid [Constants] for [data], null otherwise. */ - fun decode(data: Any?): Constants? = data?.let { + fun decode(data: kotlin.Any?): Constants? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt index 50e4f7ddec..058005f566 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to check the presence of on the keychain. */ + data class DeleteKeychainEntryRequestV1 ( /* 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/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt index ea78f0b377..ac544c44ef 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was deleted from the keychain. */ + data class DeleteKeychainEntryResponseV1 ( /* The key that was deleted from the keychain. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt index aa5ec39626..82f324d68f 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to get from the keychain. */ + data class GetKeychainEntryRequestV1 ( /* The key for the entry to get from the keychain. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt index 0d0652fb5e..294cc6d743 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value associated with the requested key on the keychain. */ + data class GetKeychainEntryResponseV1 ( /* The key that was used to retrieve the value from the keychain. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectRequestV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectRequestV1.kt index f1e5659299..595921a80d 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectRequestV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -29,6 +24,7 @@ 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. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectResponseV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectResponseV1.kt index b1a7df0315..45643c183d 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectResponseV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetObjectResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @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. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt index 0646068dfc..4f7b976c95 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key to check for presence in the keychain. */ + data class HasKeychainEntryRequestV1 ( /* The key to check for presence in the keychain. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt index ff6a0987b9..34f773aea5 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param isPresent The boolean true or false indicating the presence or absence of an entry under 'key'. */ + data class HasKeychainEntryResponseV1 ( /* The key that was used to check the presence of the value in the entry store. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectRequestV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectRequestV1.kt index 55ad823516..0f4ec48ad8 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectRequestV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -29,6 +24,7 @@ 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. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectResponseV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectResponseV1.kt index 1724cd763a..29c3602a4a 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectResponseV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasObjectResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @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. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSGeneral.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSGeneral.kt index 96a16e0f99..e32c81a50f 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSGeneral.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSGeneral.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param signatures */ + data class JWSGeneral ( @Json(name = "payload") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSRecipient.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSRecipient.kt index 9fb27a6aeb..9b428d7dd8 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSRecipient.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSRecipient.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param header */ + data class JWSRecipient ( @Json(name = "signature") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Ledger.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Ledger.kt index 8a047f69c9..dde4711b4d 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Ledger.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Ledger.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param consortiumMemberId */ + data class Ledger ( @Json(name = "id") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LedgerType.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LedgerType.kt index cd3f6682f0..4d40727ed4 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LedgerType.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LedgerType.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -68,12 +63,12 @@ enum class LedgerType(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is LedgerType) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is LedgerType) "$data" else null /** * Returns a valid [LedgerType] for [data], null otherwise. */ - fun decode(data: Any?): LedgerType? = data?.let { + fun decode(data: kotlin.Any?): LedgerType? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImport.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImport.kt index 8084b0b95c..4e0bbc6ecf 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImport.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImport.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -34,6 +29,7 @@ import com.squareup.moshi.Json * @param options */ + data class PluginImport ( @Json(name = "packageName") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImportAction.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImportAction.kt index 06e8196e21..ecfa75c92e 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImportAction.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImportAction.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -50,12 +45,12 @@ enum class PluginImportAction(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is PluginImportAction) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is PluginImportAction) "$data" else null /** * Returns a valid [PluginImportAction] for [data], null otherwise. */ - fun decode(data: Any?): PluginImportAction? = data?.let { + fun decode(data: kotlin.Any?): PluginImportAction? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImportType.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImportType.kt index 061f6a5ca0..df3c6dd342 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImportType.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginImportType.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -50,12 +45,12 @@ enum class PluginImportType(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is PluginImportType) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is PluginImportType) "$data" else null /** * Returns a valid [PluginImportType] for [data], null otherwise. */ - fun decode(data: Any?): PluginImportType? = data?.let { + fun decode(data: kotlin.Any?): PluginImportType? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginInstance.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginInstance.kt index 43249c35ae..742d41f98b 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginInstance.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PluginInstance.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param packageName */ + data class PluginInstance ( @Json(name = "id") diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt index a45a7b7bec..b02d8928b9 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value that will be associated with the key on the keychain. */ + data class SetKeychainEntryRequestV1 ( /* The key for the entry to set on the keychain. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt index 07b7e73375..32c97773c4 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was used to set the value on the keychain. */ + data class SetKeychainEntryResponseV1 ( /* 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/src/main/kotlin/org/openapitools/client/models/SetObjectRequestV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectRequestV1.kt index 22a7fa2307..106f5d227c 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectRequestV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @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. */ diff --git a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectResponseV1.kt b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectResponseV1.kt index ad4bcd8832..35dd54d5d0 100644 --- a/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectResponseV1.kt +++ b/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetObjectResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Core API - * - * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type 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( @@ -29,6 +24,7 @@ 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. */ diff --git a/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/api.ts index b9a0957d35..5eadbfacdf 100644 --- a/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * A Cactus node can be a single server, or a set of servers behind a load balancer acting as one. @@ -32,43 +34,43 @@ export interface CactusNode { * @type {string} * @memberof CactusNode */ - nodeApiHost: string; + 'nodeApiHost': string; /** * The PEM encoded public key that was used to generate the JWS included in the response (the jws property) * @type {string} * @memberof CactusNode */ - publicKeyPem: string; + 'publicKeyPem': string; /** * * @type {string} * @memberof CactusNode */ - id: string; + 'id': string; /** * * @type {string} * @memberof CactusNode */ - consortiumId: string; + 'consortiumId': string; /** * * @type {string} * @memberof CactusNode */ - memberId: string; + 'memberId': 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. * @type {Array} * @memberof CactusNode */ - ledgerIds: Array; + 'ledgerIds': Array; /** * * @type {Array} * @memberof CactusNode */ - pluginInstanceIds: Array; + 'pluginInstanceIds': Array; } /** * @@ -81,31 +83,31 @@ export interface CactusNodeAllOf { * @type {string} * @memberof CactusNodeAllOf */ - id: string; + 'id': string; /** * * @type {string} * @memberof CactusNodeAllOf */ - consortiumId: string; + 'consortiumId': string; /** * * @type {string} * @memberof CactusNodeAllOf */ - memberId: string; + 'memberId': 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. * @type {Array} * @memberof CactusNodeAllOf */ - ledgerIds: Array; + 'ledgerIds': Array; /** * * @type {Array} * @memberof CactusNodeAllOf */ - pluginInstanceIds: Array; + 'pluginInstanceIds': Array; } /** * A Cactus node meta information @@ -118,13 +120,13 @@ export interface CactusNodeMeta { * @type {string} * @memberof CactusNodeMeta */ - nodeApiHost: string; + 'nodeApiHost': string; /** * The PEM encoded public key that was used to generate the JWS included in the response (the jws property) * @type {string} * @memberof CactusNodeMeta */ - publicKeyPem: string; + 'publicKeyPem': string; } /** * Enumerates a list of consensus algorithm families that do not provide immediate finality @@ -132,9 +134,12 @@ export interface CactusNodeMeta { * @enum {string} */ -export enum ConsensusAlgorithmFamiliesWithOutTxFinality { - WORK = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK' -} +export const ConsensusAlgorithmFamiliesWithOutTxFinality = { + WORK: 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK' +} as const; + +export type ConsensusAlgorithmFamiliesWithOutTxFinality = typeof ConsensusAlgorithmFamiliesWithOutTxFinality[keyof typeof ConsensusAlgorithmFamiliesWithOutTxFinality]; + /** * Enumerates a list of consensus algorithm families that provide immediate finality @@ -142,10 +147,13 @@ export enum ConsensusAlgorithmFamiliesWithOutTxFinality { * @enum {string} */ -export enum ConsensusAlgorithmFamiliesWithTxFinality { - Authority = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY', - Stake = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE' -} +export const ConsensusAlgorithmFamiliesWithTxFinality = { + Authority: 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY', + Stake: 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE' +} as const; + +export type ConsensusAlgorithmFamiliesWithTxFinality = typeof ConsensusAlgorithmFamiliesWithTxFinality[keyof typeof ConsensusAlgorithmFamiliesWithTxFinality]; + /** * Enumerates a list of consensus algorithm families in existence. Does not intend to be an exhaustive list, just a practical one, meaning that we only include items here that are relevant to Hyperledger Cactus in fulfilling its own duties. This can be extended later as more sophisticated features of Cactus get implemented. This enum is meant to be first and foremost a useful abstraction for achieving practical tasks, not an encyclopedia and therefore we ask of everyone that this to be extended only in ways that serve a practical purpose for the runtime behavior of Cactus or Cactus plugins in general. The bottom line is that we can accept this enum being not 100% accurate as long as it 100% satisfies what it was designed to do. @@ -153,11 +161,14 @@ export enum ConsensusAlgorithmFamiliesWithTxFinality { * @enum {string} */ -export enum ConsensusAlgorithmFamily { - Authority = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY', - Stake = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE', - Work = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK' -} +export const ConsensusAlgorithmFamily = { + Authority: 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY', + Stake: 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE', + Work: 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK' +} as const; + +export type ConsensusAlgorithmFamily = typeof ConsensusAlgorithmFamily[keyof typeof ConsensusAlgorithmFamily]; + /** * @@ -170,25 +181,25 @@ export interface Consortium { * @type {string} * @memberof Consortium */ - id: string; + 'id': string; /** * * @type {string} * @memberof Consortium */ - name: string; + 'name': string; /** * * @type {string} * @memberof Consortium */ - mainApiHost: string; + 'mainApiHost': string; /** * The collection (array) of primary keys of consortium member entities that belong to this Consortium. * @type {Array} * @memberof Consortium */ - memberIds: Array; + 'memberIds': Array; } /** * @@ -201,31 +212,31 @@ export interface ConsortiumDatabase { * @type {Array} * @memberof ConsortiumDatabase */ - consortium: Array; + 'consortium': Array; /** * The complete collection of all ledger entities in existence within the consortium. * @type {Array} * @memberof ConsortiumDatabase */ - ledger: Array; + 'ledger': Array; /** * The complete collection of all consortium member entities in existence within the consortium. * @type {Array} * @memberof ConsortiumDatabase */ - consortiumMember: Array; + 'consortiumMember': Array; /** * The complete collection of all cactus nodes entities in existence within the consortium. * @type {Array} * @memberof ConsortiumDatabase */ - cactusNode: Array; + 'cactusNode': Array; /** * The complete collection of all plugin instance entities in existence within the consortium. * @type {Array} * @memberof ConsortiumDatabase */ - pluginInstance: Array; + 'pluginInstance': Array; } /** * @@ -238,19 +249,19 @@ export interface ConsortiumMember { * @type {string} * @memberof ConsortiumMember */ - id: string; + 'id': 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. * @type {string} * @memberof ConsortiumMember */ - name: string; + 'name': string; /** * * @type {Array} * @memberof ConsortiumMember */ - nodeIds: Array; + 'nodeIds': Array; } /** * @@ -258,9 +269,12 @@ export interface ConsortiumMember { * @enum {string} */ -export enum Constants { - SocketIoConnectionPathV1 = '/api/v1/async/socket-io/connect' -} +export const Constants = { + SocketIoConnectionPathV1: '/api/v1/async/socket-io/connect' +} as const; + +export type Constants = typeof Constants[keyof typeof Constants]; + /** * @@ -273,7 +287,7 @@ export interface DeleteKeychainEntryRequestV1 { * @type {string} * @memberof DeleteKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -286,7 +300,7 @@ export interface DeleteKeychainEntryResponseV1 { * @type {string} * @memberof DeleteKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** * @@ -299,7 +313,7 @@ export interface GetKeychainEntryRequestV1 { * @type {string} * @memberof GetKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -312,13 +326,13 @@ export interface GetKeychainEntryResponseV1 { * @type {string} * @memberof GetKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * The value associated with the requested key on the keychain. * @type {string} * @memberof GetKeychainEntryResponseV1 */ - value: string; + 'value': string; } /** * @@ -331,7 +345,7 @@ export interface GetObjectRequestV1 { * @type {string} * @memberof GetObjectRequestV1 */ - key: string; + 'key': string; } /** * @@ -344,13 +358,13 @@ export interface GetObjectResponseV1 { * @type {string} * @memberof GetObjectResponseV1 */ - key: string; + 'key': string; /** * The value associated with the requested key in the object store as a string. * @type {string} * @memberof GetObjectResponseV1 */ - value: string; + 'value': string; } /** * @@ -363,7 +377,7 @@ export interface HasKeychainEntryRequestV1 { * @type {string} * @memberof HasKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -376,19 +390,19 @@ export interface HasKeychainEntryResponseV1 { * @type {string} * @memberof HasKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * Date and time encoded as JSON when the presence check was performed by the plugin backend. * @type {string} * @memberof HasKeychainEntryResponseV1 */ - checkedAt: string; + 'checkedAt': string; /** * The boolean true or false indicating the presence or absence of an entry under \'key\'. * @type {boolean} * @memberof HasKeychainEntryResponseV1 */ - isPresent: boolean; + 'isPresent': boolean; } /** * @@ -401,7 +415,7 @@ export interface HasObjectRequestV1 { * @type {string} * @memberof HasObjectRequestV1 */ - key: string; + 'key': string; } /** * @@ -414,19 +428,19 @@ export interface HasObjectResponseV1 { * @type {string} * @memberof HasObjectResponseV1 */ - key: string; + 'key': string; /** * Date and time encoded as JSON when the presence check was performed by the plugin backend. * @type {string} * @memberof HasObjectResponseV1 */ - checkedAt: string; + 'checkedAt': string; /** * The boolean true or false indicating the presence or absence of an object under \'key\'. * @type {boolean} * @memberof HasObjectResponseV1 */ - isPresent: boolean; + 'isPresent': boolean; } /** * @@ -439,13 +453,13 @@ export interface JWSGeneral { * @type {string} * @memberof JWSGeneral */ - payload: string; + 'payload': string; /** * * @type {Array} * @memberof JWSGeneral */ - signatures: Array; + 'signatures': Array; } /** * A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. @@ -458,19 +472,19 @@ export interface JWSRecipient { * @type {string} * @memberof JWSRecipient */ - signature: string; + 'signature': string; /** * * @type {string} * @memberof JWSRecipient */ - protected?: string; + 'protected'?: string; /** * - * @type {{ [key: string]: object; }} + * @type {{ [key: string]: any; }} * @memberof JWSRecipient */ - header?: { [key: string]: object; }; + 'header'?: { [key: string]: any; }; } /** * @@ -483,36 +497,41 @@ export interface Ledger { * @type {string} * @memberof Ledger */ - id: string; + 'id': string; /** * * @type {LedgerType} * @memberof Ledger */ - ledgerType: LedgerType; + 'ledgerType': LedgerType; /** * * @type {string} * @memberof Ledger */ - consortiumMemberId?: string; + 'consortiumMemberId'?: string; } + + /** * Enumerates the different ledger vendors and their major versions encoded within the name of the LedgerType. For example \"BESU_1X\" involves all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until, but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further explanation. * @export * @enum {string} */ -export enum LedgerType { - Besu1X = 'BESU_1X', - Besu2X = 'BESU_2X', - Burrow0X = 'BURROW_0X', - Corda4X = 'CORDA_4X', - Fabric14X = 'FABRIC_14X', - Fabric2 = 'FABRIC_2', - Quorum2X = 'QUORUM_2X', - Sawtooth1X = 'SAWTOOTH_1X' -} +export const LedgerType = { + Besu1X: 'BESU_1X', + Besu2X: 'BESU_2X', + Burrow0X: 'BURROW_0X', + Corda4X: 'CORDA_4X', + Fabric14X: 'FABRIC_14X', + Fabric2: 'FABRIC_2', + Quorum2X: 'QUORUM_2X', + Sawtooth1X: 'SAWTOOTH_1X' +} as const; + +export type LedgerType = typeof LedgerType[keyof typeof LedgerType]; + /** * @@ -525,36 +544,41 @@ export interface PluginImport { * @type {string} * @memberof PluginImport */ - packageName: string; + 'packageName': string; /** * * @type {PluginImportType} * @memberof PluginImport */ - type: PluginImportType; + 'type': PluginImportType; /** * * @type {PluginImportAction} * @memberof PluginImport */ - action: PluginImportAction; + 'action': PluginImportAction; /** * * @type {any} * @memberof PluginImport */ - options?: any | null; + 'options'?: any; } + + /** * * @export * @enum {string} */ -export enum PluginImportAction { - Instantiate = 'org.hyperledger.cactus.plugin_import_action.INSTANTIATE', - Install = 'org.hyperledger.cactus.plugin_import_action.INSTALL' -} +export const PluginImportAction = { + Instantiate: 'org.hyperledger.cactus.plugin_import_action.INSTANTIATE', + Install: 'org.hyperledger.cactus.plugin_import_action.INSTALL' +} as const; + +export type PluginImportAction = typeof PluginImportAction[keyof typeof PluginImportAction]; + /** * @@ -562,10 +586,13 @@ export enum PluginImportAction { * @enum {string} */ -export enum PluginImportType { - Local = 'org.hyperledger.cactus.plugin_import_type.LOCAL', - Remote = 'org.hyperledger.cactus.plugin_import_type.REMOTE' -} +export const PluginImportType = { + Local: 'org.hyperledger.cactus.plugin_import_type.LOCAL', + Remote: 'org.hyperledger.cactus.plugin_import_type.REMOTE' +} as const; + +export type PluginImportType = typeof PluginImportType[keyof typeof PluginImportType]; + /** * @@ -578,13 +605,13 @@ export interface PluginInstance { * @type {string} * @memberof PluginInstance */ - id: string; + 'id': string; /** * * @type {string} * @memberof PluginInstance */ - packageName: string; + 'packageName': string; } /** * @@ -597,13 +624,13 @@ export interface SetKeychainEntryRequestV1 { * @type {string} * @memberof SetKeychainEntryRequestV1 */ - key: string; + 'key': string; /** * The value that will be associated with the key on the keychain. * @type {string} * @memberof SetKeychainEntryRequestV1 */ - value: string; + 'value': string; } /** * @@ -616,7 +643,7 @@ export interface SetKeychainEntryResponseV1 { * @type {string} * @memberof SetKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** * @@ -629,13 +656,13 @@ export interface SetObjectRequestV1 { * @type {string} * @memberof SetObjectRequestV1 */ - key: string; + 'key': string; /** * The value that will be associated with the key in the object store. * @type {string} * @memberof SetObjectRequestV1 */ - value: string; + 'value': string; } /** * @@ -648,6 +675,6 @@ export interface SetObjectResponseV1 { * @type {string} * @memberof SetObjectResponseV1 */ - key: string; + 'key': string; } diff --git a/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/base.ts index 5edc9104b8..e524b97310 100644 --- a/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/common.ts index a36a5f763c..6f0195c9af 100644 --- a/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-consortium-manual/openapitools.json b/packages/cactus-plugin-consortium-manual/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-consortium-manual/openapitools.json +++ b/packages/cactus-plugin-consortium-manual/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index a41778b486..56a034831a 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/README.md index dc5ac6e84b..ca25788b96 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus Plugin - Consortium Web Service +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.0.1 +- 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 diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 40008966c3..d22519032a 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Consortium Web Service - * - * Manage a Cactus consortium through the APIs. Needs administrative privileges. - * - * 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( @@ -20,46 +15,52 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.GetConsortiumJwsResponse import org.openapitools.client.models.GetNodeJwsResponse +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") } } /** - * Retrieves a consortium JWS - * The JWS asserting the consortium metadata (pub keys and hosts of nodes) - * @param body (optional) - * @return GetConsortiumJwsResponse - * @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 - */ + * Retrieves a consortium JWS + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * @param body (optional) + * @return GetConsortiumJwsResponse + * @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 getConsortiumJwsV1(body: kotlin.Any?) : GetConsortiumJwsResponse { - val localVariableConfig = getConsortiumJwsV1RequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getConsortiumJwsV1(body: kotlin.Any? = null) : GetConsortiumJwsResponse { + val localVarResponse = getConsortiumJwsV1WithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as GetConsortiumJwsResponse @@ -77,42 +78,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getConsortiumJwsV1 - * - * @param body (optional) - * @return RequestConfig - */ + * Retrieves a consortium JWS + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * @param body (optional) + * @return ApiResponse + * @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 getConsortiumJwsV1WithHttpInfo(body: kotlin.Any?) : ApiResponse { + val localVariableConfig = getConsortiumJwsV1RequestConfig(body = body) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getConsortiumJwsV1 + * + * @param body (optional) + * @return RequestConfig + */ fun getConsortiumJwsV1RequestConfig(body: kotlin.Any?) : RequestConfig { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Retrieves the JWT of a Cactus Node - * - * @param body (optional) - * @return GetNodeJwsResponse - * @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 - */ + * Retrieves the JWT of a Cactus Node + * + * @param body (optional) + * @return GetNodeJwsResponse + * @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 getNodeJwsV1(body: kotlin.Any?) : GetNodeJwsResponse { - val localVariableConfig = getNodeJwsV1RequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getNodeJwsV1(body: kotlin.Any? = null) : GetNodeJwsResponse { + val localVarResponse = getNodeJwsV1WithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as GetNodeJwsResponse @@ -130,41 +150,60 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getNodeJwsV1 - * - * @param body (optional) - * @return RequestConfig - */ + * Retrieves the JWT of a Cactus Node + * + * @param body (optional) + * @return ApiResponse + * @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 getNodeJwsV1WithHttpInfo(body: kotlin.Any?) : ApiResponse { + val localVariableConfig = getNodeJwsV1RequestConfig(body = body) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getNodeJwsV1 + * + * @param body (optional) + * @return RequestConfig + */ fun getNodeJwsV1RequestConfig(body: kotlin.Any?) : RequestConfig { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, 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 - */ + * Get the Prometheus Metrics + * + * @return kotlin.String + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPrometheusMetricsV1() : kotlin.String { - val localVariableConfig = getPrometheusMetricsV1RequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPrometheusMetricsV1WithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -182,22 +221,43 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getPrometheusMetricsV1 - * - * @return RequestConfig - */ + * Get the Prometheus Metrics + * + * @return ApiResponse + * @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 getPrometheusMetricsV1WithHttpInfo() : ApiResponse { + val localVariableConfig = getPrometheusMetricsV1RequestConfig() + + return request( + localVariableConfig + ) + } + + /** + * 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/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics", 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] } diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetConsortiumJwsResponse.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetConsortiumJwsResponse.kt index e10a089936..b0f7ac97d8 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetConsortiumJwsResponse.kt +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetConsortiumJwsResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Consortium Web Service - * - * Manage a Cactus consortium through the APIs. Needs administrative privileges. - * - * 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param jws */ + data class GetConsortiumJwsResponse ( @Json(name = "jws") diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetNodeJwsResponse.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetNodeJwsResponse.kt index 6bff47d655..d3d1ba5388 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetNodeJwsResponse.kt +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetNodeJwsResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Consortium Web Service - * - * Manage a Cactus consortium through the APIs. Needs administrative privileges. - * - * 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param jws */ + data class GetNodeJwsResponse ( @Json(name = "jws") diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSGeneral.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSGeneral.kt index 1777a6152e..e32c81a50f 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSGeneral.kt +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSGeneral.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Consortium Web Service - * - * Manage a Cactus consortium through the APIs. Needs administrative privileges. - * - * 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param signatures */ + data class JWSGeneral ( @Json(name = "payload") diff --git a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSRecipient.kt b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSRecipient.kt index 150ed82e7a..9b428d7dd8 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSRecipient.kt +++ b/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JWSRecipient.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Consortium Web Service - * - * Manage a Cactus consortium through the APIs. Needs administrative privileges. - * - * 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param header */ + data class JWSRecipient ( @Json(name = "signature") diff --git a/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/api.ts index 468ec37963..619b0da3ef 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,7 +34,7 @@ export interface GetConsortiumJwsResponse { * @type {JWSGeneral} * @memberof GetConsortiumJwsResponse */ - jws: JWSGeneral; + 'jws': JWSGeneral; } /** * @@ -45,7 +47,7 @@ export interface GetNodeJwsResponse { * @type {JWSGeneral} * @memberof GetNodeJwsResponse */ - jws: JWSGeneral; + 'jws': JWSGeneral; } /** * @@ -58,13 +60,13 @@ export interface JWSGeneral { * @type {string} * @memberof JWSGeneral */ - payload: string; + 'payload': string; /** * * @type {Array} * @memberof JWSGeneral */ - signatures: Array; + 'signatures': Array; } /** * A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. @@ -77,19 +79,19 @@ export interface JWSRecipient { * @type {string} * @memberof JWSRecipient */ - signature: string; + 'signature': string; /** * * @type {string} * @memberof JWSRecipient */ - protected?: string; + 'protected'?: string; /** * - * @type {{ [key: string]: object; }} + * @type {{ [key: string]: any; }} * @memberof JWSRecipient */ - header?: { [key: string]: object; }; + 'header'?: { [key: string]: any; }; } /** @@ -105,7 +107,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getConsortiumJwsV1: async (body?: object, options: any = {}): Promise => { + getConsortiumJwsV1: async (body?: object, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -122,7 +124,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) @@ -139,7 +141,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getNodeJwsV1: async (body?: object, options: any = {}): Promise => { + getNodeJwsV1: async (body?: object, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -156,7 +158,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) @@ -172,7 +174,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPrometheusMetricsV1: async (options: any = {}): Promise => { + getPrometheusMetricsV1: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -187,7 +189,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -213,7 +215,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getConsortiumJwsV1(body?: object, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getConsortiumJwsV1(body?: object, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getConsortiumJwsV1(body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -224,7 +226,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getNodeJwsV1(body?: object, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getNodeJwsV1(body?: object, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getNodeJwsV1(body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -234,7 +236,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getPrometheusMetricsV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getPrometheusMetricsV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPrometheusMetricsV1(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -295,7 +297,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getConsortiumJwsV1(body?: object, options?: any) { + public getConsortiumJwsV1(body?: object, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getConsortiumJwsV1(body, options).then((request) => request(this.axios, this.basePath)); } @@ -307,7 +309,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getNodeJwsV1(body?: object, options?: any) { + public getNodeJwsV1(body?: object, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getNodeJwsV1(body, options).then((request) => request(this.axios, this.basePath)); } @@ -318,7 +320,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getPrometheusMetricsV1(options?: any) { + public getPrometheusMetricsV1(options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getPrometheusMetricsV1(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/base.ts index 6053861d28..b7204b65c2 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/common.ts index a44fb71d29..2016aa9217 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/openapitools.json b/packages/cactus-plugin-htlc-eth-besu-erc20/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/openapitools.json +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index ef26562de4..9a355f61d1 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 @@ -25,6 +26,7 @@ src/main/kotlin/org/openapitools/client/models/GetStatusRequest.kt src/main/kotlin/org/openapitools/client/models/InitializeRequest.kt src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt src/main/kotlin/org/openapitools/client/models/NewContractRequest.kt +src/main/kotlin/org/openapitools/client/models/NewContractRequestGas.kt src/main/kotlin/org/openapitools/client/models/RefundRequest.kt src/main/kotlin/org/openapitools/client/models/RunTransactionResponse.kt src/main/kotlin/org/openapitools/client/models/Web3SigningCredential.kt diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/README.md index 4f190a6d2d..72162de4b4 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.0.1 +- 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 @@ -51,6 +60,7 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.InitializeRequest](docs/InitializeRequest.md) - [org.openapitools.client.models.InvokeContractV1Response](docs/InvokeContractV1Response.md) - [org.openapitools.client.models.NewContractRequest](docs/NewContractRequest.md) + - [org.openapitools.client.models.NewContractRequestGas](docs/NewContractRequestGas.md) - [org.openapitools.client.models.RefundRequest](docs/RefundRequest.md) - [org.openapitools.client.models.RunTransactionResponse](docs/RunTransactionResponse.md) - [org.openapitools.client.models.Web3SigningCredential](docs/Web3SigningCredential.md) diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 523c1ba484..bbfd0078d4 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -20,6 +15,10 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.GetSingleStatusRequest import org.openapitools.client.models.GetStatusRequest import org.openapitools.client.models.InitializeRequest @@ -29,43 +28,45 @@ import org.openapitools.client.models.RefundRequest import org.openapitools.client.models.RunTransactionResponse import org.openapitools.client.models.WithdrawRequest +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") } } /** - * - * - * @param getSingleStatusRequest (optional) - * @return kotlin.Int - * @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 - */ + * + * + * @param getSingleStatusRequest (optional) + * @return kotlin.Int + * @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 getSingleStatusV1(getSingleStatusRequest: GetSingleStatusRequest?) : kotlin.Int { - val localVariableConfig = getSingleStatusV1RequestConfig(getSingleStatusRequest = getSingleStatusRequest) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getSingleStatusV1(getSingleStatusRequest: GetSingleStatusRequest? = null) : kotlin.Int { + val localVarResponse = getSingleStatusV1WithHttpInfo(getSingleStatusRequest = getSingleStatusRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Int @@ -83,42 +84,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getSingleStatusV1 - * - * @param getSingleStatusRequest (optional) - * @return RequestConfig - */ + * + * + * @param getSingleStatusRequest (optional) + * @return ApiResponse + * @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 getSingleStatusV1WithHttpInfo(getSingleStatusRequest: GetSingleStatusRequest?) : ApiResponse { + val localVariableConfig = getSingleStatusV1RequestConfig(getSingleStatusRequest = getSingleStatusRequest) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getSingleStatusV1 + * + * @param getSingleStatusRequest (optional) + * @return RequestConfig + */ fun getSingleStatusV1RequestConfig(getSingleStatusRequest: GetSingleStatusRequest?) : RequestConfig { val localVariableBody = getSingleStatusRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param getStatusRequest (optional) - * @return kotlin.collections.List - * @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 - */ + * + * + * @param getStatusRequest (optional) + * @return kotlin.collections.List + * @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 getStatusV1(getStatusRequest: GetStatusRequest?) : kotlin.collections.List { - val localVariableConfig = getStatusV1RequestConfig(getStatusRequest = getStatusRequest) - - val localVarResponse = request>( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getStatusV1(getStatusRequest: GetStatusRequest? = null) : kotlin.collections.List { + val localVarResponse = getStatusV1WithHttpInfo(getStatusRequest = getStatusRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -136,42 +156,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getStatusV1 - * - * @param getStatusRequest (optional) - * @return RequestConfig - */ + * + * + * @param getStatusRequest (optional) + * @return ApiResponse?> + * @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 getStatusV1WithHttpInfo(getStatusRequest: GetStatusRequest?) : ApiResponse?> { + val localVariableConfig = getStatusV1RequestConfig(getStatusRequest = getStatusRequest) + + return request>( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getStatusV1 + * + * @param getStatusRequest (optional) + * @return RequestConfig + */ fun getStatusV1RequestConfig(getStatusRequest: GetStatusRequest?) : RequestConfig { val localVariableBody = getStatusRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Initialize contract - * - * @param initializeRequest (optional) - * @return RunTransactionResponse - * @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 - */ + * Initialize contract + * + * @param initializeRequest (optional) + * @return RunTransactionResponse + * @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 initializeV1(initializeRequest: InitializeRequest?) : RunTransactionResponse { - val localVariableConfig = initializeV1RequestConfig(initializeRequest = initializeRequest) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun initializeV1(initializeRequest: InitializeRequest? = null) : RunTransactionResponse { + val localVarResponse = initializeV1WithHttpInfo(initializeRequest = initializeRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as RunTransactionResponse @@ -189,42 +228,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation initializeV1 - * - * @param initializeRequest (optional) - * @return RequestConfig - */ + * Initialize contract + * + * @param initializeRequest (optional) + * @return ApiResponse + * @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 initializeV1WithHttpInfo(initializeRequest: InitializeRequest?) : ApiResponse { + val localVariableConfig = initializeV1RequestConfig(initializeRequest = initializeRequest) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation initializeV1 + * + * @param initializeRequest (optional) + * @return RequestConfig + */ fun initializeV1RequestConfig(initializeRequest: InitializeRequest?) : RequestConfig { val localVariableBody = initializeRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Create a new hashtimelock contract - * - * @param newContractRequest (optional) - * @return InvokeContractV1Response - * @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 - */ + * Create a new hashtimelock contract + * + * @param newContractRequest (optional) + * @return InvokeContractV1Response + * @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 newContractV1(newContractRequest: NewContractRequest?) : InvokeContractV1Response { - val localVariableConfig = newContractV1RequestConfig(newContractRequest = newContractRequest) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun newContractV1(newContractRequest: NewContractRequest? = null) : InvokeContractV1Response { + val localVarResponse = newContractV1WithHttpInfo(newContractRequest = newContractRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as InvokeContractV1Response @@ -242,42 +300,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation newContractV1 - * - * @param newContractRequest (optional) - * @return RequestConfig - */ + * Create a new hashtimelock contract + * + * @param newContractRequest (optional) + * @return ApiResponse + * @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 newContractV1WithHttpInfo(newContractRequest: NewContractRequest?) : ApiResponse { + val localVariableConfig = newContractV1RequestConfig(newContractRequest = newContractRequest) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation newContractV1 + * + * @param newContractRequest (optional) + * @return RequestConfig + */ fun newContractV1RequestConfig(newContractRequest: NewContractRequest?) : RequestConfig { val localVariableBody = newContractRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Refund a hashtimelock contract - * - * @param refundRequest (optional) - * @return InvokeContractV1Response - * @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 - */ + * Refund a hashtimelock contract + * + * @param refundRequest (optional) + * @return InvokeContractV1Response + * @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 refundV1(refundRequest: RefundRequest?) : InvokeContractV1Response { - val localVariableConfig = refundV1RequestConfig(refundRequest = refundRequest) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun refundV1(refundRequest: RefundRequest? = null) : InvokeContractV1Response { + val localVarResponse = refundV1WithHttpInfo(refundRequest = refundRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as InvokeContractV1Response @@ -295,42 +372,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation refundV1 - * - * @param refundRequest (optional) - * @return RequestConfig - */ + * Refund a hashtimelock contract + * + * @param refundRequest (optional) + * @return ApiResponse + * @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 refundV1WithHttpInfo(refundRequest: RefundRequest?) : ApiResponse { + val localVariableConfig = refundV1RequestConfig(refundRequest = refundRequest) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation refundV1 + * + * @param refundRequest (optional) + * @return RequestConfig + */ fun refundV1RequestConfig(refundRequest: RefundRequest?) : RequestConfig { val localVariableBody = refundRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Withdraw a hashtimelock contract - * - * @param withdrawRequest (optional) - * @return InvokeContractV1Response - * @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 - */ + * Withdraw a hashtimelock contract + * + * @param withdrawRequest (optional) + * @return InvokeContractV1Response + * @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 withdrawV1(withdrawRequest: WithdrawRequest?) : InvokeContractV1Response { - val localVariableConfig = withdrawV1RequestConfig(withdrawRequest = withdrawRequest) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun withdrawV1(withdrawRequest: WithdrawRequest? = null) : InvokeContractV1Response { + val localVarResponse = withdrawV1WithHttpInfo(withdrawRequest = withdrawRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as InvokeContractV1Response @@ -348,23 +444,47 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation withdrawV1 - * - * @param withdrawRequest (optional) - * @return RequestConfig - */ + * Withdraw a hashtimelock contract + * + * @param withdrawRequest (optional) + * @return ApiResponse + * @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 withdrawV1WithHttpInfo(withdrawRequest: WithdrawRequest?) : ApiResponse { + val localVariableConfig = withdrawV1RequestConfig(withdrawRequest = withdrawRequest) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation withdrawV1 + * + * @param withdrawRequest (optional) + * @return RequestConfig + */ fun withdrawV1RequestConfig(withdrawRequest: WithdrawRequest?) : RequestConfig { val localVariableBody = withdrawRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw", 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] } diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetSingleStatusRequest.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetSingleStatusRequest.kt index 0b2e816b4c..124d2ffd51 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetSingleStatusRequest.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetSingleStatusRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param keychainId */ + data class GetSingleStatusRequest ( @Json(name = "id") diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetStatusRequest.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetStatusRequest.kt index 0ece8361a1..490a0e67da 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetStatusRequest.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetStatusRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param keychainId */ + data class GetStatusRequest ( @Json(name = "ids") diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InitializeRequest.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InitializeRequest.kt index 0acd6f3754..a92e00b10b 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InitializeRequest.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InitializeRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -34,6 +29,7 @@ import com.squareup.moshi.Json * @param gas */ + data class InitializeRequest ( /* connectorId for the connector besu plugin */ diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt index 7f37e2c93d..91566772d7 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param callOutput */ + data class InvokeContractV1Response ( @Json(name = "success") diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NewContractRequest.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NewContractRequest.kt index 8341e00e7b..083917f9f1 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NewContractRequest.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NewContractRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -20,7 +15,7 @@ package org.openapitools.client.models -import org.openapitools.client.models.OneOfLessThanStringCommaNumberGreaterThan +import org.openapitools.client.models.NewContractRequestGas import org.openapitools.client.models.Web3SigningCredential import com.squareup.moshi.Json @@ -43,6 +38,7 @@ import com.squareup.moshi.Json * @param gas */ + data class NewContractRequest ( /* Contract address */ @@ -93,7 +89,7 @@ data class NewContractRequest ( val keychainId: kotlin.String, @Json(name = "gas") - val gas: OneOfLessThanStringCommaNumberGreaterThan? = null + val gas: NewContractRequestGas? = null ) diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NewContractRequestGas.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NewContractRequestGas.kt new file mode 100644 index 0000000000..c1670c37e9 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NewContractRequestGas.kt @@ -0,0 +1,30 @@ +/** + * + * 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 + +/** + * + * + */ + + +data class NewContractRequestGas ( + +) + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RefundRequest.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RefundRequest.kt index ef7242e06e..4dff58326f 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RefundRequest.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RefundRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -20,7 +15,7 @@ package org.openapitools.client.models -import org.openapitools.client.models.OneOfLessThanStringCommaNumberGreaterThan +import org.openapitools.client.models.NewContractRequestGas import org.openapitools.client.models.Web3SigningCredential import com.squareup.moshi.Json @@ -35,6 +30,7 @@ import com.squareup.moshi.Json * @param gas */ + data class RefundRequest ( /* Contract htlc id for refund */ @@ -53,7 +49,7 @@ data class RefundRequest ( val keychainId: kotlin.String, @Json(name = "gas") - val gas: OneOfLessThanStringCommaNumberGreaterThan? = null + val gas: NewContractRequestGas? = null ) diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RunTransactionResponse.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RunTransactionResponse.kt index fcd59f0861..daa4e5221f 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RunTransactionResponse.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RunTransactionResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param transactionReceipt */ + data class RunTransactionResponse ( @Json(name = "transactionReceipt") diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredential.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredential.kt index 5005a118ab..71ca15c9cd 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredential.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredential.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -37,6 +32,7 @@ import com.squareup.moshi.Json * @param secret The HEX encoded private key of an eth account. */ + interface Web3SigningCredential { @Json(name = "type") diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialCactusKeychainRef.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialCactusKeychainRef.kt index 56cd2223d6..3987b37f83 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialCactusKeychainRef.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialCactusKeychainRef.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param keychainId The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. */ + data class Web3SigningCredentialCactusKeychainRef ( @Json(name = "type") diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialNone.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialNone.kt index ede046698a..053a688144 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialNone.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialNone.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param type */ + data class Web3SigningCredentialNone ( @Json(name = "type") diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialPrivateKeyHex.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialPrivateKeyHex.kt index 6c363c557e..1e9c7bb2e3 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialPrivateKeyHex.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialPrivateKeyHex.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param secret The HEX encoded private key of an eth account. */ + data class Web3SigningCredentialPrivateKeyHex ( @Json(name = "type") diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialType.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialType.kt index 433078e828..5665050205 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialType.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3SigningCredentialType.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -56,12 +51,12 @@ enum class Web3SigningCredentialType(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is Web3SigningCredentialType) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is Web3SigningCredentialType) "$data" else null /** * Returns a valid [Web3SigningCredentialType] for [data], null otherwise. */ - fun decode(data: Any?): Web3SigningCredentialType? = data?.let { + fun decode(data: kotlin.Any?): Web3SigningCredentialType? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3TransactionReceipt.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3TransactionReceipt.kt index ef0aa80696..8440e4aaaf 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3TransactionReceipt.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Web3TransactionReceipt.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -37,6 +32,7 @@ import com.squareup.moshi.Json * @param contractAddress */ + data class Web3TransactionReceipt ( @Json(name = "status") diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/WithdrawRequest.kt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/WithdrawRequest.kt index 5b00c87935..f7a90a077b 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/WithdrawRequest.kt +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/WithdrawRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 - * - * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens - * - * The version of the OpenAPI document: 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( @@ -20,7 +15,7 @@ package org.openapitools.client.models -import org.openapitools.client.models.OneOfLessThanStringCommaNumberGreaterThan +import org.openapitools.client.models.NewContractRequestGas import org.openapitools.client.models.Web3SigningCredential import com.squareup.moshi.Json @@ -36,6 +31,7 @@ import com.squareup.moshi.Json * @param gas */ + data class WithdrawRequest ( /* Contract locked id */ @@ -58,7 +54,7 @@ data class WithdrawRequest ( val keychainId: kotlin.String, @Json(name = "gas") - val gas: OneOfLessThanStringCommaNumberGreaterThan? = null + val gas: NewContractRequestGas? = null ) diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/api.ts index 7d801f7f76..6e9653647c 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * Defines the parameters for retrieving the single status of the HTLC swap. @@ -32,25 +34,25 @@ export interface GetSingleStatusRequest { * @type {string} * @memberof GetSingleStatusRequest */ - id: string; + 'id': string; /** * * @type {Web3SigningCredential} * @memberof GetSingleStatusRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {string} * @memberof GetSingleStatusRequest */ - connectorId: string; + 'connectorId': string; /** * * @type {string} * @memberof GetSingleStatusRequest */ - keychainId: string; + 'keychainId': string; } /** * Defines the parameters for retrieving the status of the HTLC swap. @@ -63,25 +65,25 @@ export interface GetStatusRequest { * @type {Array} * @memberof GetStatusRequest */ - ids: Array; + 'ids': Array; /** * * @type {Web3SigningCredential} * @memberof GetStatusRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {string} * @memberof GetStatusRequest */ - connectorId: string; + 'connectorId': string; /** * * @type {string} * @memberof GetStatusRequest */ - keychainId: string; + 'keychainId': string; } /** * @@ -94,31 +96,31 @@ export interface InitializeRequest { * @type {string} * @memberof InitializeRequest */ - connectorId: string; + 'connectorId': string; /** * keychainId for the keychain plugin * @type {string} * @memberof InitializeRequest */ - keychainId: string; + 'keychainId': string; /** * * @type {Array} * @memberof InitializeRequest */ - constructorArgs: Array; + 'constructorArgs': Array; /** * * @type {Web3SigningCredential} * @memberof InitializeRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {number} * @memberof InitializeRequest */ - gas?: number; + 'gas'?: number; } /** * @@ -131,19 +133,19 @@ export interface InvokeContractV1Response { * @type {Web3TransactionReceipt} * @memberof InvokeContractV1Response */ - transactionReceipt?: Web3TransactionReceipt; + 'transactionReceipt'?: Web3TransactionReceipt; /** * * @type {any} * @memberof InvokeContractV1Response */ - callOutput?: any | null; + 'callOutput'?: any; /** * * @type {boolean} * @memberof InvokeContractV1Response */ - success: boolean; + 'success': boolean; } /** * @@ -156,80 +158,86 @@ export interface NewContractRequest { * @type {string} * @memberof NewContractRequest */ - contractAddress: string; + 'contractAddress': string; /** * Input amount to lock * @type {number} * @memberof NewContractRequest */ - inputAmount: number; + 'inputAmount': number; /** * Output amount to lock * @type {number} * @memberof NewContractRequest */ - outputAmount: number; + 'outputAmount': number; /** * Timestamp to expire the contract * @type {number} * @memberof NewContractRequest */ - expiration: number; + 'expiration': number; /** * Hashlock needed to refund the amount * @type {string} * @memberof NewContractRequest */ - hashLock: string; + 'hashLock': string; /** * The token address * @type {string} * @memberof NewContractRequest */ - tokenAddress: string; + 'tokenAddress': string; /** * The receiver address * @type {string} * @memberof NewContractRequest */ - receiver: string; + 'receiver': string; /** * The output network id * @type {string} * @memberof NewContractRequest */ - outputNetwork: string; + 'outputNetwork': string; /** * The output address to receive the tokens * @type {string} * @memberof NewContractRequest */ - outputAddress: string; + 'outputAddress': string; /** * * @type {Web3SigningCredential} * @memberof NewContractRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * connectorId for the connector besu plugin * @type {string} * @memberof NewContractRequest */ - connectorId: string; + 'connectorId': string; /** * keychainId for the keychian plugin * @type {string} * @memberof NewContractRequest */ - keychainId: string; + 'keychainId': string; /** * - * @type {string | number} + * @type {NewContractRequestGas} * @memberof NewContractRequest */ - gas?: string | number; + 'gas'?: NewContractRequestGas; } +/** + * @type NewContractRequestGas + * @export + */ +export type NewContractRequestGas = number | string; + /** * * @export @@ -241,31 +249,31 @@ export interface RefundRequest { * @type {string} * @memberof RefundRequest */ - id: string; + 'id': string; /** * * @type {Web3SigningCredential} * @memberof RefundRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * connectorId for the connector besu plugin * @type {string} * @memberof RefundRequest */ - connectorId: string; + 'connectorId': string; /** * keychainId for the keychain plugin * @type {string} * @memberof RefundRequest */ - keychainId: string; + 'keychainId': string; /** * - * @type {string | number} + * @type {NewContractRequestGas} * @memberof RefundRequest */ - gas?: string | number; + 'gas'?: NewContractRequestGas; } /** * @@ -278,7 +286,7 @@ export interface RunTransactionResponse { * @type {Web3TransactionReceipt} * @memberof RunTransactionResponse */ - transactionReceipt: Web3TransactionReceipt; + 'transactionReceipt': Web3TransactionReceipt; } /** * @type Web3SigningCredential @@ -297,26 +305,28 @@ export interface Web3SigningCredentialCactusKeychainRef { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialCactusKeychainRef */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - ethAccount: string; + 'ethAccount': string; /** * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainEntryKey: string; + 'keychainEntryKey': string; /** * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainId: string; + 'keychainId': string; } + + /** * Using this denotes that there is no signing required because the transaction is pre-signed. * @export @@ -328,8 +338,10 @@ export interface Web3SigningCredentialNone { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialNone */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; } + + /** * * @export @@ -341,32 +353,37 @@ export interface Web3SigningCredentialPrivateKeyHex { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialPrivateKeyHex */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - ethAccount: string; + 'ethAccount': string; /** * The HEX encoded private key of an eth account. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - secret: string; + 'secret': string; } + + /** * * @export * @enum {string} */ -export enum Web3SigningCredentialType { - CactusKeychainRef = 'CACTUS_KEYCHAIN_REF', - GethKeychainPassword = 'GETH_KEYCHAIN_PASSWORD', - PrivateKeyHex = 'PRIVATE_KEY_HEX', - None = 'NONE' -} +export const Web3SigningCredentialType = { + CactusKeychainRef: 'CACTUS_KEYCHAIN_REF', + GethKeychainPassword: 'GETH_KEYCHAIN_PASSWORD', + PrivateKeyHex: 'PRIVATE_KEY_HEX', + None: 'NONE' +} as const; + +export type Web3SigningCredentialType = typeof Web3SigningCredentialType[keyof typeof Web3SigningCredentialType]; + /** * @@ -374,62 +391,62 @@ export enum Web3SigningCredentialType { * @interface Web3TransactionReceipt */ export interface Web3TransactionReceipt { - [key: string]: object | any; + [key: string]: any; /** * * @type {boolean} * @memberof Web3TransactionReceipt */ - status: boolean; + 'status': boolean; /** * * @type {string} * @memberof Web3TransactionReceipt */ - transactionHash: string; + 'transactionHash': string; /** * * @type {number} * @memberof Web3TransactionReceipt */ - transactionIndex: number; + 'transactionIndex': number; /** * * @type {string} * @memberof Web3TransactionReceipt */ - blockHash: string; + 'blockHash': string; /** * * @type {number} * @memberof Web3TransactionReceipt */ - blockNumber: number; + 'blockNumber': number; /** * * @type {number} * @memberof Web3TransactionReceipt */ - gasUsed: number; + 'gasUsed': number; /** * * @type {string} * @memberof Web3TransactionReceipt */ - contractAddress?: string | null; + 'contractAddress'?: string | null; /** * * @type {string} * @memberof Web3TransactionReceipt */ - from: string; + 'from': string; /** * * @type {string} * @memberof Web3TransactionReceipt */ - to: string; + 'to': string; } /** * @@ -442,37 +459,37 @@ export interface WithdrawRequest { * @type {string} * @memberof WithdrawRequest */ - id: string; + 'id': string; /** * Secret need to unlock the contract * @type {string} * @memberof WithdrawRequest */ - secret: string; + 'secret': string; /** * * @type {Web3SigningCredential} * @memberof WithdrawRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * connectorId for the connector besu plugin * @type {string} * @memberof WithdrawRequest */ - connectorId: string; + 'connectorId': string; /** * keychainId for the keychain plugin * @type {string} * @memberof WithdrawRequest */ - keychainId: string; + 'keychainId': string; /** * - * @type {string | number} + * @type {NewContractRequestGas} * @memberof WithdrawRequest */ - gas?: string | number; + 'gas'?: NewContractRequestGas; } /** @@ -487,7 +504,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getSingleStatusV1: async (getSingleStatusRequest?: GetSingleStatusRequest, options: any = {}): Promise => { + getSingleStatusV1: async (getSingleStatusRequest?: GetSingleStatusRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -504,7 +521,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getSingleStatusRequest, localVarRequestOptions, configuration) @@ -520,7 +537,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStatusV1: async (getStatusRequest?: GetStatusRequest, options: any = {}): Promise => { + getStatusV1: async (getStatusRequest?: GetStatusRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -537,7 +554,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getStatusRequest, localVarRequestOptions, configuration) @@ -554,7 +571,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - initializeV1: async (initializeRequest?: InitializeRequest, options: any = {}): Promise => { + initializeV1: async (initializeRequest?: InitializeRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -571,7 +588,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(initializeRequest, localVarRequestOptions, configuration) @@ -588,7 +605,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - newContractV1: async (newContractRequest?: NewContractRequest, options: any = {}): Promise => { + newContractV1: async (newContractRequest?: NewContractRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -605,7 +622,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(newContractRequest, localVarRequestOptions, configuration) @@ -622,7 +639,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - refundV1: async (refundRequest?: RefundRequest, options: any = {}): Promise => { + refundV1: async (refundRequest?: RefundRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -639,7 +656,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(refundRequest, localVarRequestOptions, configuration) @@ -656,7 +673,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - withdrawV1: async (withdrawRequest?: WithdrawRequest, options: any = {}): Promise => { + withdrawV1: async (withdrawRequest?: WithdrawRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -673,7 +690,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(withdrawRequest, localVarRequestOptions, configuration) @@ -699,7 +716,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getSingleStatusV1(getSingleStatusRequest?: GetSingleStatusRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getSingleStatusV1(getSingleStatusRequest?: GetSingleStatusRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSingleStatusV1(getSingleStatusRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -709,7 +726,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getStatusV1(getStatusRequest?: GetStatusRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async getStatusV1(getStatusRequest?: GetStatusRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getStatusV1(getStatusRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -720,7 +737,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async initializeV1(initializeRequest?: InitializeRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async initializeV1(initializeRequest?: InitializeRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.initializeV1(initializeRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -731,7 +748,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async newContractV1(newContractRequest?: NewContractRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async newContractV1(newContractRequest?: NewContractRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.newContractV1(newContractRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -742,7 +759,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async refundV1(refundRequest?: RefundRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async refundV1(refundRequest?: RefundRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.refundV1(refundRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -753,7 +770,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async withdrawV1(withdrawRequest?: WithdrawRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async withdrawV1(withdrawRequest?: WithdrawRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.withdrawV1(withdrawRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -842,7 +859,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getSingleStatusV1(getSingleStatusRequest?: GetSingleStatusRequest, options?: any) { + public getSingleStatusV1(getSingleStatusRequest?: GetSingleStatusRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getSingleStatusV1(getSingleStatusRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -853,7 +870,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getStatusV1(getStatusRequest?: GetStatusRequest, options?: any) { + public getStatusV1(getStatusRequest?: GetStatusRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getStatusV1(getStatusRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -865,7 +882,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public initializeV1(initializeRequest?: InitializeRequest, options?: any) { + public initializeV1(initializeRequest?: InitializeRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).initializeV1(initializeRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -877,7 +894,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public newContractV1(newContractRequest?: NewContractRequest, options?: any) { + public newContractV1(newContractRequest?: NewContractRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).newContractV1(newContractRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -889,7 +906,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public refundV1(refundRequest?: RefundRequest, options?: any) { + public refundV1(refundRequest?: RefundRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).refundV1(refundRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -901,7 +918,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public withdrawV1(withdrawRequest?: WithdrawRequest, options?: any) { + public withdrawV1(withdrawRequest?: WithdrawRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).withdrawV1(withdrawRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/base.ts index 8e33addbf6..78b90aa55c 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/common.ts index 187494c5d1..bb183fc748 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-htlc-eth-besu/openapitools.json b/packages/cactus-plugin-htlc-eth-besu/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-htlc-eth-besu/openapitools.json +++ b/packages/cactus-plugin-htlc-eth-besu/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts index 613aaba70f..41403a5368 100644 --- a/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * Defines the parameters for retrieving the single status of the HTLC swap. @@ -32,25 +34,25 @@ export interface GetSingleStatusRequest { * @type {string} * @memberof GetSingleStatusRequest */ - id: string; + 'id': string; /** * * @type {Web3SigningCredential} * @memberof GetSingleStatusRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {string} * @memberof GetSingleStatusRequest */ - connectorId: string; + 'connectorId': string; /** * * @type {string} * @memberof GetSingleStatusRequest */ - keychainId: string; + 'keychainId': string; } /** * Defines the parameters for retrieving the status of the HTLC swap. @@ -63,25 +65,25 @@ export interface GetStatusRequest { * @type {Array} * @memberof GetStatusRequest */ - ids: Array; + 'ids': Array; /** * * @type {Web3SigningCredential} * @memberof GetStatusRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {string} * @memberof GetStatusRequest */ - connectorId: string; + 'connectorId': string; /** * * @type {string} * @memberof GetStatusRequest */ - keychainId: string; + 'keychainId': string; } /** * @@ -94,31 +96,31 @@ export interface InitializeRequest { * @type {string} * @memberof InitializeRequest */ - connectorId: string; + 'connectorId': string; /** * keychainId for the keychain plugin * @type {string} * @memberof InitializeRequest */ - keychainId: string; + 'keychainId': string; /** * * @type {Array} * @memberof InitializeRequest */ - constructorArgs: Array; + 'constructorArgs': Array; /** * * @type {Web3SigningCredential} * @memberof InitializeRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {number} * @memberof InitializeRequest */ - gas?: number; + 'gas'?: number; } /** * @@ -131,19 +133,19 @@ export interface InvokeContractV1Response { * @type {Web3TransactionReceipt} * @memberof InvokeContractV1Response */ - transactionReceipt?: Web3TransactionReceipt; + 'transactionReceipt'?: Web3TransactionReceipt; /** * * @type {any} * @memberof InvokeContractV1Response */ - callOutput?: any | null; + 'callOutput'?: any; /** * * @type {boolean} * @memberof InvokeContractV1Response */ - success: boolean; + 'success': boolean; } /** * @@ -156,74 +158,80 @@ export interface NewContractObj { * @type {string} * @memberof NewContractObj */ - contractAddress: string; + 'contractAddress': string; /** * * @type {number} * @memberof NewContractObj */ - inputAmount?: number; + 'inputAmount'?: number; /** * * @type {number} * @memberof NewContractObj */ - outputAmount: number; + 'outputAmount': number; /** * * @type {number} * @memberof NewContractObj */ - expiration: number; + 'expiration': number; /** * * @type {string} * @memberof NewContractObj */ - hashLock: string; + 'hashLock': string; /** * * @type {string} * @memberof NewContractObj */ - receiver?: string; + 'receiver'?: string; /** * * @type {string} * @memberof NewContractObj */ - outputNetwork: string; + 'outputNetwork': string; /** * * @type {string} * @memberof NewContractObj */ - outputAddress: string; + 'outputAddress': string; /** * connectorId for the connector besu plugin * @type {string} * @memberof NewContractObj */ - connectorId: string; + 'connectorId': string; /** * * @type {Web3SigningCredential} * @memberof NewContractObj */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * keychainId for the keychian plugin * @type {string} * @memberof NewContractObj */ - keychainId: string; + 'keychainId': string; /** * - * @type {string | number} + * @type {NewContractObjGas} * @memberof NewContractObj */ - gas?: string | number; + 'gas'?: NewContractObjGas; } +/** + * @type NewContractObjGas + * @export + */ +export type NewContractObjGas = number | string; + /** * * @export @@ -235,31 +243,31 @@ export interface RefundReq { * @type {string} * @memberof RefundReq */ - id: string; + 'id': string; /** * * @type {Web3SigningCredential} * @memberof RefundReq */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * connectorId for the connector besu plugin * @type {string} * @memberof RefundReq */ - connectorId: string; + 'connectorId': string; /** * keychainId for the keychain plugin * @type {string} * @memberof RefundReq */ - keychainId: string; + 'keychainId': string; /** * - * @type {string | number} + * @type {NewContractObjGas} * @memberof RefundReq */ - gas?: string | number; + 'gas'?: NewContractObjGas; } /** * @@ -272,7 +280,7 @@ export interface RunTransactionResponse { * @type {Web3TransactionReceipt} * @memberof RunTransactionResponse */ - transactionReceipt: Web3TransactionReceipt; + 'transactionReceipt': Web3TransactionReceipt; } /** * @type Web3SigningCredential @@ -291,26 +299,28 @@ export interface Web3SigningCredentialCactusKeychainRef { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialCactusKeychainRef */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - ethAccount: string; + 'ethAccount': string; /** * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainEntryKey: string; + 'keychainEntryKey': string; /** * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainId: string; + 'keychainId': string; } + + /** * Using this denotes that there is no signing required because the transaction is pre-signed. * @export @@ -322,8 +332,10 @@ export interface Web3SigningCredentialNone { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialNone */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; } + + /** * * @export @@ -335,32 +347,37 @@ export interface Web3SigningCredentialPrivateKeyHex { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialPrivateKeyHex */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - ethAccount: string; + 'ethAccount': string; /** * The HEX encoded private key of an eth account. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - secret: string; + 'secret': string; } + + /** * * @export * @enum {string} */ -export enum Web3SigningCredentialType { - CactusKeychainRef = 'CACTUS_KEYCHAIN_REF', - GethKeychainPassword = 'GETH_KEYCHAIN_PASSWORD', - PrivateKeyHex = 'PRIVATE_KEY_HEX', - None = 'NONE' -} +export const Web3SigningCredentialType = { + CactusKeychainRef: 'CACTUS_KEYCHAIN_REF', + GethKeychainPassword: 'GETH_KEYCHAIN_PASSWORD', + PrivateKeyHex: 'PRIVATE_KEY_HEX', + None: 'NONE' +} as const; + +export type Web3SigningCredentialType = typeof Web3SigningCredentialType[keyof typeof Web3SigningCredentialType]; + /** * @@ -368,62 +385,62 @@ export enum Web3SigningCredentialType { * @interface Web3TransactionReceipt */ export interface Web3TransactionReceipt { - [key: string]: object | any; + [key: string]: any; /** * * @type {boolean} * @memberof Web3TransactionReceipt */ - status: boolean; + 'status': boolean; /** * * @type {string} * @memberof Web3TransactionReceipt */ - transactionHash: string; + 'transactionHash': string; /** * * @type {number} * @memberof Web3TransactionReceipt */ - transactionIndex: number; + 'transactionIndex': number; /** * * @type {string} * @memberof Web3TransactionReceipt */ - blockHash: string; + 'blockHash': string; /** * * @type {number} * @memberof Web3TransactionReceipt */ - blockNumber: number; + 'blockNumber': number; /** * * @type {number} * @memberof Web3TransactionReceipt */ - gasUsed: number; + 'gasUsed': number; /** * * @type {string} * @memberof Web3TransactionReceipt */ - contractAddress?: string | null; + 'contractAddress'?: string | null; /** * * @type {string} * @memberof Web3TransactionReceipt */ - from: string; + 'from': string; /** * * @type {string} * @memberof Web3TransactionReceipt */ - to: string; + 'to': string; } /** * @@ -436,37 +453,37 @@ export interface WithdrawReq { * @type {string} * @memberof WithdrawReq */ - id: string; + 'id': string; /** * Secret need to unlock the contract * @type {string} * @memberof WithdrawReq */ - secret: string; + 'secret': string; /** * * @type {Web3SigningCredential} * @memberof WithdrawReq */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * connectorId for the connector besu plugin * @type {string} * @memberof WithdrawReq */ - connectorId: string; + 'connectorId': string; /** * keychainId for the keychain plugin * @type {string} * @memberof WithdrawReq */ - keychainId: string; + 'keychainId': string; /** * - * @type {string | number} + * @type {NewContractObjGas} * @memberof WithdrawReq */ - gas?: string | number; + 'gas'?: NewContractObjGas; } /** @@ -481,7 +498,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getSingleStatusV1: async (getSingleStatusRequest?: GetSingleStatusRequest, options: any = {}): Promise => { + getSingleStatusV1: async (getSingleStatusRequest?: GetSingleStatusRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -498,7 +515,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getSingleStatusRequest, localVarRequestOptions, configuration) @@ -514,7 +531,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStatusV1: async (getStatusRequest?: GetStatusRequest, options: any = {}): Promise => { + getStatusV1: async (getStatusRequest?: GetStatusRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -531,7 +548,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getStatusRequest, localVarRequestOptions, configuration) @@ -547,7 +564,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - initializeV1: async (initializeRequest?: InitializeRequest, options: any = {}): Promise => { + initializeV1: async (initializeRequest?: InitializeRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -564,7 +581,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(initializeRequest, localVarRequestOptions, configuration) @@ -580,7 +597,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - newContractV1: async (newContractObj?: NewContractObj, options: any = {}): Promise => { + newContractV1: async (newContractObj?: NewContractObj, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -597,7 +614,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(newContractObj, localVarRequestOptions, configuration) @@ -613,7 +630,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - refundV1: async (refundReq?: RefundReq, options: any = {}): Promise => { + refundV1: async (refundReq?: RefundReq, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -630,7 +647,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(refundReq, localVarRequestOptions, configuration) @@ -646,7 +663,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - withdrawV1: async (withdrawReq?: WithdrawReq, options: any = {}): Promise => { + withdrawV1: async (withdrawReq?: WithdrawReq, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -663,7 +680,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(withdrawReq, localVarRequestOptions, configuration) @@ -689,7 +706,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getSingleStatusV1(getSingleStatusRequest?: GetSingleStatusRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getSingleStatusV1(getSingleStatusRequest?: GetSingleStatusRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSingleStatusV1(getSingleStatusRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -699,7 +716,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getStatusV1(getStatusRequest?: GetStatusRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async getStatusV1(getStatusRequest?: GetStatusRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getStatusV1(getStatusRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -709,7 +726,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async initializeV1(initializeRequest?: InitializeRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async initializeV1(initializeRequest?: InitializeRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.initializeV1(initializeRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -719,7 +736,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async newContractV1(newContractObj?: NewContractObj, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async newContractV1(newContractObj?: NewContractObj, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.newContractV1(newContractObj, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -729,7 +746,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async refundV1(refundReq?: RefundReq, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async refundV1(refundReq?: RefundReq, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.refundV1(refundReq, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -739,7 +756,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async withdrawV1(withdrawReq?: WithdrawReq, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async withdrawV1(withdrawReq?: WithdrawReq, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.withdrawV1(withdrawReq, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -824,7 +841,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getSingleStatusV1(getSingleStatusRequest?: GetSingleStatusRequest, options?: any) { + public getSingleStatusV1(getSingleStatusRequest?: GetSingleStatusRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getSingleStatusV1(getSingleStatusRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -835,7 +852,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getStatusV1(getStatusRequest?: GetStatusRequest, options?: any) { + public getStatusV1(getStatusRequest?: GetStatusRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getStatusV1(getStatusRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -846,7 +863,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public initializeV1(initializeRequest?: InitializeRequest, options?: any) { + public initializeV1(initializeRequest?: InitializeRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).initializeV1(initializeRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -857,7 +874,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public newContractV1(newContractObj?: NewContractObj, options?: any) { + public newContractV1(newContractObj?: NewContractObj, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).newContractV1(newContractObj, options).then((request) => request(this.axios, this.basePath)); } @@ -868,7 +885,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public refundV1(refundReq?: RefundReq, options?: any) { + public refundV1(refundReq?: RefundReq, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).refundV1(refundReq, options).then((request) => request(this.axios, this.basePath)); } @@ -879,7 +896,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public withdrawV1(withdrawReq?: WithdrawReq, options?: any) { + public withdrawV1(withdrawReq?: WithdrawReq, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).withdrawV1(withdrawReq, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts index 153947125e..532b7df2db 100644 --- a/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts index f97c3d9e39..6336847822 100644 --- a/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-keychain-aws-sm/openapitools.json b/packages/cactus-plugin-keychain-aws-sm/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-keychain-aws-sm/openapitools.json +++ b/packages/cactus-plugin-keychain-aws-sm/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index e6344b6dd3..15e43f61f3 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/README.md index 22ca388a2f..8f6055b7e4 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus - Keychain API +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.3.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 diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 078e4926f5..2a7fc00071 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -20,6 +15,10 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.DeleteKeychainEntryRequestV1 import org.openapitools.client.models.DeleteKeychainEntryResponseV1 import org.openapitools.client.models.GetKeychainEntryRequestV1 @@ -29,43 +28,45 @@ import org.openapitools.client.models.HasKeychainEntryResponseV1 import org.openapitools.client.models.SetKeychainEntryRequestV1 import org.openapitools.client.models.SetKeychainEntryResponseV1 +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") } } /** - * Deletes an entry under a key on the keychain backend. - * - * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key - * @return DeleteKeychainEntryResponseV1 - * @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 - */ + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return DeleteKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : DeleteKeychainEntryResponseV1 { - val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as DeleteKeychainEntryResponseV1 @@ -83,42 +84,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation deleteKeychainEntryV1 - * - * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key - * @return RequestConfig - */ + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return ApiResponse + * @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 deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation deleteKeychainEntryV1 + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return RequestConfig + */ fun deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : RequestConfig { val localVariableBody = deleteKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Retrieves the contents of a keychain entry from the backend. - * - * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key - * @return GetKeychainEntryResponseV1 - * @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 - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key + * @return GetKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1) : GetKeychainEntryResponseV1 { - val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequestV1 = getKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1 = getKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as GetKeychainEntryResponseV1 @@ -136,41 +156,60 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getKeychainEntryV1 - * - * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key - * @return RequestConfig - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key + * @return ApiResponse + * @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 getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1: GetKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequestV1 = getKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getKeychainEntryV1 + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key + * @return RequestConfig + */ fun getKeychainEntryV1RequestConfig(getKeychainEntryRequestV1: GetKeychainEntryRequestV1) : RequestConfig { val localVariableBody = getKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, 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 - */ + * Get the Prometheus Metrics + * + * @return kotlin.String + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPrometheusMetricsV1() : kotlin.String { - val localVariableConfig = getPrometheusMetricsV1RequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPrometheusMetricsV1WithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -188,41 +227,57 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getPrometheusMetricsV1 - * - * @return RequestConfig - */ + * Get the Prometheus Metrics + * + * @return ApiResponse + * @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 getPrometheusMetricsV1WithHttpInfo() : ApiResponse { + val localVariableConfig = getPrometheusMetricsV1RequestConfig() + + return request( + localVariableConfig + ) + } + + /** + * 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/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Checks that an entry exists under a key on the keychain backend - * - * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key - * @return HasKeychainEntryResponseV1 - * @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 - */ + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return HasKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : HasKeychainEntryResponseV1 { - val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as HasKeychainEntryResponseV1 @@ -240,42 +295,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation hasKeychainEntryV1 - * - * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key - * @return RequestConfig - */ + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return ApiResponse + * @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 hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation hasKeychainEntryV1 + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return RequestConfig + */ fun hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : RequestConfig { val localVariableBody = hasKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Sets a value under a key on the keychain backend. - * - * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key - * @return SetKeychainEntryResponseV1 - * @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 - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key + * @return SetKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1) : SetKeychainEntryResponseV1 { - val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequestV1 = setKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1 = setKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as SetKeychainEntryResponseV1 @@ -293,23 +367,47 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation setKeychainEntryV1 - * - * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key - * @return RequestConfig - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key + * @return ApiResponse + * @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 setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1: SetKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequestV1 = setKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation setKeychainEntryV1 + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key + * @return RequestConfig + */ fun setKeychainEntryV1RequestConfig(setKeychainEntryRequestV1: SetKeychainEntryRequestV1) : RequestConfig { val localVariableBody = setKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry", 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] } diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt index 5b4e9c380e..058005f566 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to check the presence of on the keychain. */ + data class DeleteKeychainEntryRequestV1 ( /* The key for the entry to check the presence of on the keychain. */ diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt index 3af6fe8305..ac544c44ef 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was deleted from the keychain. */ + data class DeleteKeychainEntryResponseV1 ( /* The key that was deleted from the keychain. */ diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt index 960a641c44..82f324d68f 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to get from the keychain. */ + data class GetKeychainEntryRequestV1 ( /* The key for the entry to get from the keychain. */ diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt index 182085b6c9..294cc6d743 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value associated with the requested key on the keychain. */ + data class GetKeychainEntryResponseV1 ( /* The key that was used to retrieve the value from the keychain. */ diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt index 71dee33cb6..4f7b976c95 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key to check for presence in the keychain. */ + data class HasKeychainEntryRequestV1 ( /* The key to check for presence in the keychain. */ diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt index a59f3ed94b..34f773aea5 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param isPresent The boolean true or false indicating the presence or absence of an entry under 'key'. */ + data class HasKeychainEntryResponseV1 ( /* The key that was used to check the presence of the value in the entry store. */ diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt index cee6721377..b02d8928b9 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value that will be associated with the key on the keychain. */ + data class SetKeychainEntryRequestV1 ( /* The key for the entry to set on the keychain. */ diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt index 3a6c956f38..32c97773c4 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was used to set the value on the keychain. */ + data class SetKeychainEntryResponseV1 ( /* The key that was used to set the value on the keychain. */ diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/api.ts index 4353d01b22..216dcc2274 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,7 +34,7 @@ export interface DeleteKeychainEntryRequestV1 { * @type {string} * @memberof DeleteKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -45,7 +47,7 @@ export interface DeleteKeychainEntryResponseV1 { * @type {string} * @memberof DeleteKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** * @@ -58,7 +60,7 @@ export interface GetKeychainEntryRequestV1 { * @type {string} * @memberof GetKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -71,13 +73,13 @@ export interface GetKeychainEntryResponseV1 { * @type {string} * @memberof GetKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * The value associated with the requested key on the keychain. * @type {string} * @memberof GetKeychainEntryResponseV1 */ - value: string; + 'value': string; } /** * @@ -90,7 +92,7 @@ export interface HasKeychainEntryRequestV1 { * @type {string} * @memberof HasKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -103,19 +105,19 @@ export interface HasKeychainEntryResponseV1 { * @type {string} * @memberof HasKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * Date and time encoded as JSON when the presence check was performed by the plugin backend. * @type {string} * @memberof HasKeychainEntryResponseV1 */ - checkedAt: string; + 'checkedAt': string; /** * The boolean true or false indicating the presence or absence of an entry under \'key\'. * @type {boolean} * @memberof HasKeychainEntryResponseV1 */ - isPresent: boolean; + 'isPresent': boolean; } /** * @@ -128,13 +130,13 @@ export interface SetKeychainEntryRequestV1 { * @type {string} * @memberof SetKeychainEntryRequestV1 */ - key: string; + 'key': string; /** * The value that will be associated with the key on the keychain. * @type {string} * @memberof SetKeychainEntryRequestV1 */ - value: string; + 'value': string; } /** * @@ -147,7 +149,7 @@ export interface SetKeychainEntryResponseV1 { * @type {string} * @memberof SetKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** @@ -163,7 +165,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options: any = {}): Promise => { + deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'deleteKeychainEntryRequestV1' is not null or undefined assertParamExists('deleteKeychainEntryV1', 'deleteKeychainEntryRequestV1', deleteKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry`; @@ -182,7 +184,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(deleteKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -199,7 +201,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKeychainEntryV1: async (getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options: any = {}): Promise => { + getKeychainEntryV1: async (getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'getKeychainEntryRequestV1' is not null or undefined assertParamExists('getKeychainEntryV1', 'getKeychainEntryRequestV1', getKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry`; @@ -218,7 +220,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -234,7 +236,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPrometheusMetricsV1: async (options: any = {}): Promise => { + getPrometheusMetricsV1: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -249,7 +251,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -265,7 +267,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - hasKeychainEntryV1: async (hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options: any = {}): Promise => { + hasKeychainEntryV1: async (hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'hasKeychainEntryRequestV1' is not null or undefined assertParamExists('hasKeychainEntryV1', 'hasKeychainEntryRequestV1', hasKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry`; @@ -284,7 +286,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(hasKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -301,7 +303,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - setKeychainEntryV1: async (setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options: any = {}): Promise => { + setKeychainEntryV1: async (setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'setKeychainEntryRequestV1' is not null or undefined assertParamExists('setKeychainEntryV1', 'setKeychainEntryRequestV1', setKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry`; @@ -320,7 +322,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(setKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -347,7 +349,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -358,7 +360,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getKeychainEntryV1(getKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -368,7 +370,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getPrometheusMetricsV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getPrometheusMetricsV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPrometheusMetricsV1(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -379,7 +381,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.hasKeychainEntryV1(hasKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -390,7 +392,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.setKeychainEntryV1(setKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -471,7 +473,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: any) { + public deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -483,7 +485,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: any) { + public getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getKeychainEntryV1(getKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -494,7 +496,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getPrometheusMetricsV1(options?: any) { + public getPrometheusMetricsV1(options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getPrometheusMetricsV1(options).then((request) => request(this.axios, this.basePath)); } @@ -506,7 +508,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: any) { + public hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).hasKeychainEntryV1(hasKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -518,7 +520,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: any) { + public setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).setKeychainEntryV1(setKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/base.ts index 5bdd7d5a90..51fa22c30d 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/common.ts index 551dfb0d3c..e6d53f3c0f 100644 --- a/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-keychain-azure-kv/openapitools.json b/packages/cactus-plugin-keychain-azure-kv/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-keychain-azure-kv/openapitools.json +++ b/packages/cactus-plugin-keychain-azure-kv/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index 94ba8f1f2c..abca8b0131 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/README.md index ed13c0bdd3..d3c3b496d9 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus - Keychain API +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.3.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 diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 63a9934c2d..5ae53b8f8b 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -20,6 +15,10 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.DeleteKeychainEntryRequestV1 import org.openapitools.client.models.DeleteKeychainEntryResponseV1 import org.openapitools.client.models.GetKeychainEntryRequest @@ -29,43 +28,45 @@ import org.openapitools.client.models.HasKeychainEntryResponseV1 import org.openapitools.client.models.SetKeychainEntryRequest import org.openapitools.client.models.SetKeychainEntryResponse +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") } } /** - * Deletes a value under a key on the keychain backend. - * - * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key - * @return DeleteKeychainEntryResponseV1 - * @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 - */ + * Deletes a value under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return DeleteKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : DeleteKeychainEntryResponseV1 { - val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as DeleteKeychainEntryResponseV1 @@ -83,42 +84,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation deleteKeychainEntryV1 - * - * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key - * @return RequestConfig - */ + * Deletes a value under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return ApiResponse + * @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 deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation deleteKeychainEntryV1 + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return RequestConfig + */ fun deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : RequestConfig { val localVariableBody = deleteKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Retrieves the contents of a keychain entry from the backend. - * - * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key - * @return GetKeychainEntryResponse - * @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 - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key + * @return GetKeychainEntryResponse + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest) : GetKeychainEntryResponse { - val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequest = getKeychainEntryRequest) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequest = getKeychainEntryRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as GetKeychainEntryResponse @@ -136,42 +156,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getKeychainEntryV1 - * - * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key - * @return RequestConfig - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key + * @return ApiResponse + * @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 getKeychainEntryV1WithHttpInfo(getKeychainEntryRequest: GetKeychainEntryRequest) : ApiResponse { + val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequest = getKeychainEntryRequest) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getKeychainEntryV1 + * + * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key + * @return RequestConfig + */ fun getKeychainEntryV1RequestConfig(getKeychainEntryRequest: GetKeychainEntryRequest) : RequestConfig { val localVariableBody = getKeychainEntryRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Checks that an entry exists under a key on the keychain backend - * - * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key - * @return HasKeychainEntryResponseV1 - * @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 - */ + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return HasKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : HasKeychainEntryResponseV1 { - val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as HasKeychainEntryResponseV1 @@ -189,42 +228,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation hasKeychainEntryV1 - * - * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key - * @return RequestConfig - */ + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return ApiResponse + * @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 hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation hasKeychainEntryV1 + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return RequestConfig + */ fun hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : RequestConfig { val localVariableBody = hasKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Sets a value under a key on the keychain backend. - * - * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key - * @return SetKeychainEntryResponse - * @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 - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key + * @return SetKeychainEntryResponse + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest) : SetKeychainEntryResponse { - val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequest = setKeychainEntryRequest) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequest = setKeychainEntryRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as SetKeychainEntryResponse @@ -242,23 +300,47 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation setKeychainEntryV1 - * - * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key - * @return RequestConfig - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key + * @return ApiResponse + * @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 setKeychainEntryV1WithHttpInfo(setKeychainEntryRequest: SetKeychainEntryRequest) : ApiResponse { + val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequest = setKeychainEntryRequest) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation setKeychainEntryV1 + * + * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key + * @return RequestConfig + */ fun setKeychainEntryV1RequestConfig(setKeychainEntryRequest: SetKeychainEntryRequest) : RequestConfig { val localVariableBody = setKeychainEntryRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry", 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] } diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt index 5b4e9c380e..058005f566 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to check the presence of on the keychain. */ + data class DeleteKeychainEntryRequestV1 ( /* The key for the entry to check the presence of on the keychain. */ diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt index 3af6fe8305..ac544c44ef 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was deleted from the keychain. */ + data class DeleteKeychainEntryResponseV1 ( /* The key that was deleted from the keychain. */ diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt index feb1e608e5..f3033d77f5 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to get from the keychain. */ + data class GetKeychainEntryRequest ( /* The key for the entry to get from the keychain. */ diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt index 933a0f99d9..9bdb563426 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value associated with the requested key on the keychain. */ + data class GetKeychainEntryResponse ( /* The key that was used to retrieve the value from the keychain. */ diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt index 71dee33cb6..4f7b976c95 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key to check for presence in the keychain. */ + data class HasKeychainEntryRequestV1 ( /* The key to check for presence in the keychain. */ diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt index a59f3ed94b..34f773aea5 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param isPresent The boolean true or false indicating the presence or absence of an entry under 'key'. */ + data class HasKeychainEntryResponseV1 ( /* The key that was used to check the presence of the value in the entry store. */ diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt index 420d2e0bf9..7ec6af0d92 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value that will be associated with the key on the keychain. */ + data class SetKeychainEntryRequest ( /* The key for the entry to set on the keychain. */ diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt index d29ede67a8..14e5d43237 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was used to set the value on the keychain. */ + data class SetKeychainEntryResponse ( /* The key that was used to set the value on the keychain. */ diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/api.ts index dc2dc08bc0..1843dd9661 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,7 +34,7 @@ export interface DeleteKeychainEntryRequestV1 { * @type {string} * @memberof DeleteKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -45,7 +47,7 @@ export interface DeleteKeychainEntryResponseV1 { * @type {string} * @memberof DeleteKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** * @@ -58,7 +60,7 @@ export interface GetKeychainEntryRequest { * @type {string} * @memberof GetKeychainEntryRequest */ - key: string; + 'key': string; } /** * @@ -71,13 +73,13 @@ export interface GetKeychainEntryResponse { * @type {string} * @memberof GetKeychainEntryResponse */ - key: string; + 'key': string; /** * The value associated with the requested key on the keychain. * @type {string} * @memberof GetKeychainEntryResponse */ - value: string; + 'value': string; } /** * @@ -90,7 +92,7 @@ export interface HasKeychainEntryRequestV1 { * @type {string} * @memberof HasKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -103,19 +105,19 @@ export interface HasKeychainEntryResponseV1 { * @type {string} * @memberof HasKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * Date and time encoded as JSON when the presence check was performed by the plugin backend. * @type {string} * @memberof HasKeychainEntryResponseV1 */ - checkedAt: string; + 'checkedAt': string; /** * The boolean true or false indicating the presence or absence of an entry under \'key\'. * @type {boolean} * @memberof HasKeychainEntryResponseV1 */ - isPresent: boolean; + 'isPresent': boolean; } /** * @@ -128,13 +130,13 @@ export interface SetKeychainEntryRequest { * @type {string} * @memberof SetKeychainEntryRequest */ - key: string; + 'key': string; /** * The value that will be associated with the key on the keychain. * @type {string} * @memberof SetKeychainEntryRequest */ - value: string; + 'value': string; } /** * @@ -147,7 +149,7 @@ export interface SetKeychainEntryResponse { * @type {string} * @memberof SetKeychainEntryResponse */ - key: string; + 'key': string; } /** @@ -163,7 +165,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options: any = {}): Promise => { + deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'deleteKeychainEntryRequestV1' is not null or undefined assertParamExists('deleteKeychainEntryV1', 'deleteKeychainEntryRequestV1', deleteKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry`; @@ -182,7 +184,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(deleteKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -199,7 +201,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKeychainEntryV1: async (getKeychainEntryRequest: GetKeychainEntryRequest, options: any = {}): Promise => { + getKeychainEntryV1: async (getKeychainEntryRequest: GetKeychainEntryRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'getKeychainEntryRequest' is not null or undefined assertParamExists('getKeychainEntryV1', 'getKeychainEntryRequest', getKeychainEntryRequest) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry`; @@ -218,7 +220,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getKeychainEntryRequest, localVarRequestOptions, configuration) @@ -235,7 +237,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - hasKeychainEntryV1: async (hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options: any = {}): Promise => { + hasKeychainEntryV1: async (hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'hasKeychainEntryRequestV1' is not null or undefined assertParamExists('hasKeychainEntryV1', 'hasKeychainEntryRequestV1', hasKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry`; @@ -254,7 +256,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(hasKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -271,7 +273,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - setKeychainEntryV1: async (setKeychainEntryRequest: SetKeychainEntryRequest, options: any = {}): Promise => { + setKeychainEntryV1: async (setKeychainEntryRequest: SetKeychainEntryRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'setKeychainEntryRequest' is not null or undefined assertParamExists('setKeychainEntryV1', 'setKeychainEntryRequest', setKeychainEntryRequest) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry`; @@ -290,7 +292,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(setKeychainEntryRequest, localVarRequestOptions, configuration) @@ -317,7 +319,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -328,7 +330,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getKeychainEntryV1(getKeychainEntryRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -339,7 +341,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.hasKeychainEntryV1(hasKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -350,7 +352,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.setKeychainEntryV1(setKeychainEntryRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -422,7 +424,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: any) { + public deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -434,7 +436,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest, options?: any) { + public getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getKeychainEntryV1(getKeychainEntryRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -446,7 +448,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: any) { + public hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).hasKeychainEntryV1(hasKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -458,7 +460,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest, options?: any) { + public setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).setKeychainEntryV1(setKeychainEntryRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/base.ts index 5bdd7d5a90..51fa22c30d 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/common.ts index 551dfb0d3c..e6d53f3c0f 100644 --- a/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-keychain-google-sm/openapitools.json b/packages/cactus-plugin-keychain-google-sm/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-keychain-google-sm/openapitools.json +++ b/packages/cactus-plugin-keychain-google-sm/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index e6344b6dd3..15e43f61f3 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/README.md index ef6e8421d5..86dd4bee2e 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus - Keychain API +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.3.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 diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 63df046bfc..e701c73b1b 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -20,6 +15,10 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.DeleteKeychainEntryRequestV1 import org.openapitools.client.models.DeleteKeychainEntryResponseV1 import org.openapitools.client.models.GetKeychainEntryRequestV1 @@ -29,43 +28,45 @@ import org.openapitools.client.models.HasKeychainEntryResponseV1 import org.openapitools.client.models.SetKeychainEntryRequestV1 import org.openapitools.client.models.SetKeychainEntryResponseV1 +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") } } /** - * Deletes an entry under a key on the keychain backend. - * - * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key - * @return DeleteKeychainEntryResponseV1 - * @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 - */ + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return DeleteKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : DeleteKeychainEntryResponseV1 { - val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as DeleteKeychainEntryResponseV1 @@ -83,42 +84,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation deleteKeychainEntryV1 - * - * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key - * @return RequestConfig - */ + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return ApiResponse + * @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 deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation deleteKeychainEntryV1 + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return RequestConfig + */ fun deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : RequestConfig { val localVariableBody = deleteKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Retrieves the contents of a keychain entry from the backend. - * - * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key - * @return GetKeychainEntryResponseV1 - * @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 - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key + * @return GetKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1) : GetKeychainEntryResponseV1 { - val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequestV1 = getKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1 = getKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as GetKeychainEntryResponseV1 @@ -136,42 +156,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getKeychainEntryV1 - * - * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key - * @return RequestConfig - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key + * @return ApiResponse + * @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 getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1: GetKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequestV1 = getKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getKeychainEntryV1 + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key + * @return RequestConfig + */ fun getKeychainEntryV1RequestConfig(getKeychainEntryRequestV1: GetKeychainEntryRequestV1) : RequestConfig { val localVariableBody = getKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Checks that an entry exists under a key on the keychain backend. - * - * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key - * @return HasKeychainEntryResponseV1 - * @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 - */ + * Checks that an entry exists under a key on the keychain backend. + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return HasKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : HasKeychainEntryResponseV1 { - val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as HasKeychainEntryResponseV1 @@ -189,42 +228,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation hasKeychainEntryV1 - * - * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key - * @return RequestConfig - */ + * Checks that an entry exists under a key on the keychain backend. + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return ApiResponse + * @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 hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation hasKeychainEntryV1 + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return RequestConfig + */ fun hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : RequestConfig { val localVariableBody = hasKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Sets a value under a key on the keychain backend. - * - * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key - * @return SetKeychainEntryResponseV1 - * @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 - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key + * @return SetKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1) : SetKeychainEntryResponseV1 { - val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequestV1 = setKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1 = setKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as SetKeychainEntryResponseV1 @@ -242,23 +300,47 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation setKeychainEntryV1 - * - * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key - * @return RequestConfig - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key + * @return ApiResponse + * @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 setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1: SetKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequestV1 = setKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation setKeychainEntryV1 + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key + * @return RequestConfig + */ fun setKeychainEntryV1RequestConfig(setKeychainEntryRequestV1: SetKeychainEntryRequestV1) : RequestConfig { val localVariableBody = setKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry", 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] } diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt index 5b4e9c380e..058005f566 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to check the presence of on the keychain. */ + data class DeleteKeychainEntryRequestV1 ( /* The key for the entry to check the presence of on the keychain. */ diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt index 3af6fe8305..ac544c44ef 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was deleted from the keychain. */ + data class DeleteKeychainEntryResponseV1 ( /* The key that was deleted from the keychain. */ diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt index 960a641c44..82f324d68f 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to get from the keychain. */ + data class GetKeychainEntryRequestV1 ( /* The key for the entry to get from the keychain. */ diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt index 182085b6c9..294cc6d743 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value associated with the requested key on the keychain. */ + data class GetKeychainEntryResponseV1 ( /* The key that was used to retrieve the value from the keychain. */ diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt index 71dee33cb6..4f7b976c95 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key to check for presence in the keychain. */ + data class HasKeychainEntryRequestV1 ( /* The key to check for presence in the keychain. */ diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt index a59f3ed94b..34f773aea5 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param isPresent The boolean true or false indicating the presence or absence of an entry under 'key'. */ + data class HasKeychainEntryResponseV1 ( /* The key that was used to check the presence of the value in the entry store. */ diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt index cee6721377..b02d8928b9 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value that will be associated with the key on the keychain. */ + data class SetKeychainEntryRequestV1 ( /* The key for the entry to set on the keychain. */ diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt index 3a6c956f38..32c97773c4 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was used to set the value on the keychain. */ + data class SetKeychainEntryResponseV1 ( /* The key that was used to set the value on the keychain. */ diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/api.ts index 13d89b6130..31366163f5 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,7 +34,7 @@ export interface DeleteKeychainEntryRequestV1 { * @type {string} * @memberof DeleteKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -45,7 +47,7 @@ export interface DeleteKeychainEntryResponseV1 { * @type {string} * @memberof DeleteKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** * @@ -58,7 +60,7 @@ export interface GetKeychainEntryRequestV1 { * @type {string} * @memberof GetKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -71,13 +73,13 @@ export interface GetKeychainEntryResponseV1 { * @type {string} * @memberof GetKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * The value associated with the requested key on the keychain. * @type {string} * @memberof GetKeychainEntryResponseV1 */ - value: string; + 'value': string; } /** * @@ -90,7 +92,7 @@ export interface HasKeychainEntryRequestV1 { * @type {string} * @memberof HasKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -103,19 +105,19 @@ export interface HasKeychainEntryResponseV1 { * @type {string} * @memberof HasKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * Date and time encoded as JSON when the presence check was performed by the plugin backend. * @type {string} * @memberof HasKeychainEntryResponseV1 */ - checkedAt: string; + 'checkedAt': string; /** * The boolean true or false indicating the presence or absence of an entry under \'key\'. * @type {boolean} * @memberof HasKeychainEntryResponseV1 */ - isPresent: boolean; + 'isPresent': boolean; } /** * @@ -128,13 +130,13 @@ export interface SetKeychainEntryRequestV1 { * @type {string} * @memberof SetKeychainEntryRequestV1 */ - key: string; + 'key': string; /** * The value that will be associated with the key on the keychain. * @type {string} * @memberof SetKeychainEntryRequestV1 */ - value: string; + 'value': string; } /** * @@ -147,7 +149,7 @@ export interface SetKeychainEntryResponseV1 { * @type {string} * @memberof SetKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** @@ -163,7 +165,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options: any = {}): Promise => { + deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'deleteKeychainEntryRequestV1' is not null or undefined assertParamExists('deleteKeychainEntryV1', 'deleteKeychainEntryRequestV1', deleteKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry`; @@ -182,7 +184,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(deleteKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -199,7 +201,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKeychainEntryV1: async (getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options: any = {}): Promise => { + getKeychainEntryV1: async (getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'getKeychainEntryRequestV1' is not null or undefined assertParamExists('getKeychainEntryV1', 'getKeychainEntryRequestV1', getKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry`; @@ -218,7 +220,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -235,7 +237,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - hasKeychainEntryV1: async (hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options: any = {}): Promise => { + hasKeychainEntryV1: async (hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'hasKeychainEntryRequestV1' is not null or undefined assertParamExists('hasKeychainEntryV1', 'hasKeychainEntryRequestV1', hasKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry`; @@ -254,7 +256,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(hasKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -271,7 +273,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - setKeychainEntryV1: async (setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options: any = {}): Promise => { + setKeychainEntryV1: async (setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'setKeychainEntryRequestV1' is not null or undefined assertParamExists('setKeychainEntryV1', 'setKeychainEntryRequestV1', setKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry`; @@ -290,7 +292,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(setKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -317,7 +319,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -328,7 +330,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getKeychainEntryV1(getKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -339,7 +341,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.hasKeychainEntryV1(hasKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -350,7 +352,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.setKeychainEntryV1(setKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -422,7 +424,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: any) { + public deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -434,7 +436,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: any) { + public getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getKeychainEntryV1(getKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -446,7 +448,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: any) { + public hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).hasKeychainEntryV1(hasKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -458,7 +460,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: any) { + public setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).setKeychainEntryV1(setKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/base.ts index 5bdd7d5a90..51fa22c30d 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/common.ts index 551dfb0d3c..e6d53f3c0f 100644 --- a/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-keychain-google-sm/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-keychain-memory-wasm/openapitools.json b/packages/cactus-plugin-keychain-memory-wasm/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/openapitools.json +++ b/packages/cactus-plugin-keychain-memory-wasm/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index e6344b6dd3..15e43f61f3 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/README.md index 1b8fa73cf8..9a6d80dc51 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus Plugin - Keychain Memory WASM +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +## 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: 1.0.0-rc.1 +- 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 diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index c7777303d6..cc12d5c4bc 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory WASM - * - * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. - * - * The version of the OpenAPI document: 1.0.0-rc.1 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -20,6 +15,10 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.DeleteKeychainEntryRequestV1 import org.openapitools.client.models.DeleteKeychainEntryResponseV1 import org.openapitools.client.models.GetKeychainEntryRequestV1 @@ -29,43 +28,45 @@ import org.openapitools.client.models.HasKeychainEntryResponseV1 import org.openapitools.client.models.SetKeychainEntryRequestV1 import org.openapitools.client.models.SetKeychainEntryResponseV1 +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") } } /** - * Deletes an entry under a key on the keychain backend. - * - * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key - * @return DeleteKeychainEntryResponseV1 - * @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 - */ + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return DeleteKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : DeleteKeychainEntryResponseV1 { - val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as DeleteKeychainEntryResponseV1 @@ -83,42 +84,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation deleteKeychainEntryV1 - * - * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key - * @return RequestConfig - */ + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return ApiResponse + * @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 deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation deleteKeychainEntryV1 + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key + * @return RequestConfig + */ fun deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1) : RequestConfig { val localVariableBody = deleteKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Retrieves the contents of a keychain entry from the backend. - * - * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key - * @return GetKeychainEntryResponseV1 - * @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 - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key + * @return GetKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1) : GetKeychainEntryResponseV1 { - val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequestV1 = getKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1 = getKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as GetKeychainEntryResponseV1 @@ -136,42 +156,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getKeychainEntryV1 - * - * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key - * @return RequestConfig - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key + * @return ApiResponse + * @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 getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1: GetKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequestV1 = getKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getKeychainEntryV1 + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key + * @return RequestConfig + */ fun getKeychainEntryV1RequestConfig(getKeychainEntryRequestV1: GetKeychainEntryRequestV1) : RequestConfig { val localVariableBody = getKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Checks that an entry exists under a key on the keychain backend - * - * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key - * @return HasKeychainEntryResponseV1 - * @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 - */ + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return HasKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : HasKeychainEntryResponseV1 { - val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as HasKeychainEntryResponseV1 @@ -189,42 +228,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation hasKeychainEntryV1 - * - * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key - * @return RequestConfig - */ + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return ApiResponse + * @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 hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation hasKeychainEntryV1 + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key + * @return RequestConfig + */ fun hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1) : RequestConfig { val localVariableBody = hasKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Sets a value under a key on the keychain backend. - * - * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key - * @return SetKeychainEntryResponseV1 - * @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 - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key + * @return SetKeychainEntryResponseV1 + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1) : SetKeychainEntryResponseV1 { - val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequestV1 = setKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1 = setKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as SetKeychainEntryResponseV1 @@ -242,23 +300,47 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation setKeychainEntryV1 - * - * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key - * @return RequestConfig - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key + * @return ApiResponse + * @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 setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1: SetKeychainEntryRequestV1) : ApiResponse { + val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequestV1 = setKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation setKeychainEntryV1 + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key + * @return RequestConfig + */ fun setKeychainEntryV1RequestConfig(setKeychainEntryRequestV1: SetKeychainEntryRequestV1) : RequestConfig { val localVariableBody = setKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry", 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] } diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt index 23ef51943b..058005f566 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory WASM - * - * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. - * - * The version of the OpenAPI document: 1.0.0-rc.1 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to check the presence of on the keychain. */ + data class DeleteKeychainEntryRequestV1 ( /* The key for the entry to check the presence of on the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt index a4d1f3ba2d..ac544c44ef 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory WASM - * - * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. - * - * The version of the OpenAPI document: 1.0.0-rc.1 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was deleted from the keychain. */ + data class DeleteKeychainEntryResponseV1 ( /* The key that was deleted from the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt index c591bdbd3b..82f324d68f 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory WASM - * - * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. - * - * The version of the OpenAPI document: 1.0.0-rc.1 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to get from the keychain. */ + data class GetKeychainEntryRequestV1 ( /* The key for the entry to get from the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt index 0161c610e7..294cc6d743 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory WASM - * - * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. - * - * The version of the OpenAPI document: 1.0.0-rc.1 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value associated with the requested key on the keychain. */ + data class GetKeychainEntryResponseV1 ( /* The key that was used to retrieve the value from the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt index 39de1d07af..4f7b976c95 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory WASM - * - * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. - * - * The version of the OpenAPI document: 1.0.0-rc.1 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key to check for presence in the keychain. */ + data class HasKeychainEntryRequestV1 ( /* The key to check for presence in the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt index 0c7891d71f..34f773aea5 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory WASM - * - * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. - * - * The version of the OpenAPI document: 1.0.0-rc.1 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param isPresent The boolean true or false indicating the presence or absence of an entry under 'key'. */ + data class HasKeychainEntryResponseV1 ( /* The key that was used to check the presence of the value in the entry store. */ diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt index 63cd79f14a..b02d8928b9 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory WASM - * - * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. - * - * The version of the OpenAPI document: 1.0.0-rc.1 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value that will be associated with the key on the keychain. */ + data class SetKeychainEntryRequestV1 ( /* The key for the entry to set on the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt index aa3129bc09..32c97773c4 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory WASM - * - * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. - * - * The version of the OpenAPI document: 1.0.0-rc.1 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was used to set the value on the keychain. */ + data class SetKeychainEntryResponseV1 ( /* The key that was used to set the value on the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/api.ts index 0296a9385d..d5c1ddbc9e 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,7 +34,7 @@ export interface DeleteKeychainEntryRequestV1 { * @type {string} * @memberof DeleteKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -45,7 +47,7 @@ export interface DeleteKeychainEntryResponseV1 { * @type {string} * @memberof DeleteKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** * @@ -58,7 +60,7 @@ export interface GetKeychainEntryRequestV1 { * @type {string} * @memberof GetKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -71,13 +73,13 @@ export interface GetKeychainEntryResponseV1 { * @type {string} * @memberof GetKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * The value associated with the requested key on the keychain. * @type {string} * @memberof GetKeychainEntryResponseV1 */ - value: string; + 'value': string; } /** * @@ -90,7 +92,7 @@ export interface HasKeychainEntryRequestV1 { * @type {string} * @memberof HasKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -103,19 +105,19 @@ export interface HasKeychainEntryResponseV1 { * @type {string} * @memberof HasKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * Date and time encoded as JSON when the presence check was performed by the plugin backend. * @type {string} * @memberof HasKeychainEntryResponseV1 */ - checkedAt: string; + 'checkedAt': string; /** * The boolean true or false indicating the presence or absence of an entry under \'key\'. * @type {boolean} * @memberof HasKeychainEntryResponseV1 */ - isPresent: boolean; + 'isPresent': boolean; } /** * @@ -128,13 +130,13 @@ export interface SetKeychainEntryRequestV1 { * @type {string} * @memberof SetKeychainEntryRequestV1 */ - key: string; + 'key': string; /** * The value that will be associated with the key on the keychain. * @type {string} * @memberof SetKeychainEntryRequestV1 */ - value: string; + 'value': string; } /** * @@ -147,7 +149,7 @@ export interface SetKeychainEntryResponseV1 { * @type {string} * @memberof SetKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** @@ -163,7 +165,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options: any = {}): Promise => { + deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'deleteKeychainEntryRequestV1' is not null or undefined assertParamExists('deleteKeychainEntryV1', 'deleteKeychainEntryRequestV1', deleteKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry`; @@ -182,7 +184,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(deleteKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -199,7 +201,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKeychainEntryV1: async (getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options: any = {}): Promise => { + getKeychainEntryV1: async (getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'getKeychainEntryRequestV1' is not null or undefined assertParamExists('getKeychainEntryV1', 'getKeychainEntryRequestV1', getKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry`; @@ -218,7 +220,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -235,7 +237,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - hasKeychainEntryV1: async (hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options: any = {}): Promise => { + hasKeychainEntryV1: async (hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'hasKeychainEntryRequestV1' is not null or undefined assertParamExists('hasKeychainEntryV1', 'hasKeychainEntryRequestV1', hasKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry`; @@ -254,7 +256,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(hasKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -271,7 +273,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - setKeychainEntryV1: async (setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options: any = {}): Promise => { + setKeychainEntryV1: async (setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'setKeychainEntryRequestV1' is not null or undefined assertParamExists('setKeychainEntryV1', 'setKeychainEntryRequestV1', setKeychainEntryRequestV1) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry`; @@ -290,7 +292,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(setKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -317,7 +319,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -328,7 +330,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getKeychainEntryV1(getKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -339,7 +341,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.hasKeychainEntryV1(hasKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -350,7 +352,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.setKeychainEntryV1(setKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -422,7 +424,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: any) { + public deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -434,7 +436,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: any) { + public getKeychainEntryV1(getKeychainEntryRequestV1: GetKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getKeychainEntryV1(getKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -446,7 +448,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: any) { + public hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).hasKeychainEntryV1(hasKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -458,7 +460,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: any) { + public setKeychainEntryV1(setKeychainEntryRequestV1: SetKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).setKeychainEntryV1(setKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/base.ts index 9557610514..7d8ccf9050 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/common.ts index 7c46a86902..13c7051221 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-keychain-memory/openapitools.json b/packages/cactus-plugin-keychain-memory/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-keychain-memory/openapitools.json +++ b/packages/cactus-plugin-keychain-memory/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index 8417107acc..f95b7cb080 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/README.md index 3b7c4e9ef3..348dcb7263 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus Plugin - Keychain Memory +Contains/describes the Hyperledger Cactus Keychain Memory plugin. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://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 diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 83f04c3f8a..6059971c7c 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory - * - * Contains/describes the Hyperledger Cactus Keychain Memory 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( @@ -20,43 +15,49 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + + +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 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 - */ + * Get the Prometheus Metrics + * + * @return kotlin.String + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPrometheusMetricsV1() : kotlin.String { - val localVariableConfig = getPrometheusMetricsV1RequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPrometheusMetricsV1WithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -74,22 +75,43 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getPrometheusMetricsV1 - * - * @return RequestConfig - */ + * Get the Prometheus Metrics + * + * @return ApiResponse + * @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 getPrometheusMetricsV1WithHttpInfo() : ApiResponse { + val localVariableConfig = getPrometheusMetricsV1RequestConfig() + + return request( + localVariableConfig + ) + } + + /** + * 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/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics", 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] } diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt index 0266b16d54..f3033d77f5 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory - * - * Contains/describes the Hyperledger Cactus Keychain Memory 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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to get from the keychain. */ + data class GetKeychainEntryRequest ( /* The key for the entry to get from the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt index fdd4d0a2e9..9bdb563426 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory - * - * Contains/describes the Hyperledger Cactus Keychain Memory 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value associated with the requested key on the keychain. */ + data class GetKeychainEntryResponse ( /* The key that was used to retrieve the value from the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt index a5d580176c..7ec6af0d92 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory - * - * Contains/describes the Hyperledger Cactus Keychain Memory 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value that will be associated with the key on the keychain. */ + data class SetKeychainEntryRequest ( /* The key for the entry to set on the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt index 1b2e210b1b..14e5d43237 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt +++ b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Keychain Memory - * - * Contains/describes the Hyperledger Cactus Keychain Memory 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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was used to set the value on the keychain. */ + data class SetKeychainEntryResponse ( /* The key that was used to set the value on the keychain. */ diff --git a/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/api.ts index 288fa5a030..d5c0415652 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,7 +34,7 @@ export interface GetKeychainEntryRequest { * @type {string} * @memberof GetKeychainEntryRequest */ - key: string; + 'key': string; } /** * @@ -45,13 +47,13 @@ export interface GetKeychainEntryResponse { * @type {string} * @memberof GetKeychainEntryResponse */ - key: string; + 'key': string; /** * The value associated with the requested key on the keychain. * @type {string} * @memberof GetKeychainEntryResponse */ - value: string; + 'value': string; } /** * @@ -64,13 +66,13 @@ export interface SetKeychainEntryRequest { * @type {string} * @memberof SetKeychainEntryRequest */ - key: string; + 'key': string; /** * The value that will be associated with the key on the keychain. * @type {string} * @memberof SetKeychainEntryRequest */ - value: string; + 'value': string; } /** * @@ -83,7 +85,7 @@ export interface SetKeychainEntryResponse { * @type {string} * @memberof SetKeychainEntryResponse */ - key: string; + 'key': string; } /** @@ -98,7 +100,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPrometheusMetricsV1: async (options: any = {}): Promise => { + getPrometheusMetricsV1: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -113,7 +115,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -138,7 +140,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getPrometheusMetricsV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getPrometheusMetricsV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPrometheusMetricsV1(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -178,7 +180,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getPrometheusMetricsV1(options?: any) { + public getPrometheusMetricsV1(options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getPrometheusMetricsV1(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/base.ts index 92d96644f9..552e7a8241 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/common.ts index a668147ac9..9dd4887ce4 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-keychain-memory/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-keychain-vault/openapitools.json b/packages/cactus-plugin-keychain-vault/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-keychain-vault/openapitools.json +++ b/packages/cactus-plugin-keychain-vault/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index 94ba8f1f2c..abca8b0131 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/README.md index 08d166b285..a449863351 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus - Keychain API +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.3.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 diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 5ff7e4d9b6..8963af7ee6 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -20,6 +15,10 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.DeleteKeychainEntryRequestV1 import org.openapitools.client.models.DeleteKeychainEntryResponseV1 import org.openapitools.client.models.GetKeychainEntryRequest @@ -29,43 +28,45 @@ import org.openapitools.client.models.HasKeychainEntryResponseV1 import org.openapitools.client.models.SetKeychainEntryRequest import org.openapitools.client.models.SetKeychainEntryResponse +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") } } /** - * Deletes an entry from the keychain stored under the provided key. - * - * @param deleteKeychainEntryRequestV1 (optional) - * @return DeleteKeychainEntryResponseV1 - * @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 - */ + * Deletes an entry from the keychain stored under the provided key. + * + * @param deleteKeychainEntryRequestV1 (optional) + * @return DeleteKeychainEntryResponseV1 + * @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 deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1?) : DeleteKeychainEntryResponseV1 { - val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteKeychainEntryV1(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1? = null) : DeleteKeychainEntryResponseV1 { + val localVarResponse = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as DeleteKeychainEntryResponseV1 @@ -83,42 +84,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation deleteKeychainEntryV1 - * - * @param deleteKeychainEntryRequestV1 (optional) - * @return RequestConfig - */ + * Deletes an entry from the keychain stored under the provided key. + * + * @param deleteKeychainEntryRequestV1 (optional) + * @return ApiResponse + * @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 deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1?) : ApiResponse { + val localVariableConfig = deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1 = deleteKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation deleteKeychainEntryV1 + * + * @param deleteKeychainEntryRequestV1 (optional) + * @return RequestConfig + */ fun deleteKeychainEntryV1RequestConfig(deleteKeychainEntryRequestV1: DeleteKeychainEntryRequestV1?) : RequestConfig { val localVariableBody = deleteKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Retrieves the contents of a keychain entry from the backend. - * - * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key - * @return GetKeychainEntryResponse - * @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 - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key + * @return GetKeychainEntryResponse + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest) : GetKeychainEntryResponse { - val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequest = getKeychainEntryRequest) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequest = getKeychainEntryRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as GetKeychainEntryResponse @@ -136,41 +156,60 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getKeychainEntryV1 - * - * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key - * @return RequestConfig - */ + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key + * @return ApiResponse + * @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 getKeychainEntryV1WithHttpInfo(getKeychainEntryRequest: GetKeychainEntryRequest) : ApiResponse { + val localVariableConfig = getKeychainEntryV1RequestConfig(getKeychainEntryRequest = getKeychainEntryRequest) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getKeychainEntryV1 + * + * @param getKeychainEntryRequest Request body to obtain a keychain entry via its key + * @return RequestConfig + */ fun getKeychainEntryV1RequestConfig(getKeychainEntryRequest: GetKeychainEntryRequest) : RequestConfig { val localVariableBody = getKeychainEntryRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, 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 - */ + * Get the Prometheus Metrics + * + * @return kotlin.String + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPrometheusMetricsV1() : kotlin.String { - val localVariableConfig = getPrometheusMetricsV1RequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPrometheusMetricsV1WithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -188,41 +227,57 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getPrometheusMetricsV1 - * - * @return RequestConfig - */ + * Get the Prometheus Metrics + * + * @return ApiResponse + * @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 getPrometheusMetricsV1WithHttpInfo() : ApiResponse { + val localVariableConfig = getPrometheusMetricsV1RequestConfig() + + return request( + localVariableConfig + ) + } + + /** + * 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/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Retrieves the information regarding a key being present on the keychain or not. - * - * @param hasKeychainEntryRequestV1 (optional) - * @return HasKeychainEntryResponseV1 - * @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 - */ + * Retrieves the information regarding a key being present on the keychain or not. + * + * @param hasKeychainEntryRequestV1 (optional) + * @return HasKeychainEntryResponseV1 + * @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 hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1?) : HasKeychainEntryResponseV1 { - val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun hasKeychainEntryV1(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1? = null) : HasKeychainEntryResponseV1 { + val localVarResponse = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as HasKeychainEntryResponseV1 @@ -240,42 +295,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation hasKeychainEntryV1 - * - * @param hasKeychainEntryRequestV1 (optional) - * @return RequestConfig - */ + * Retrieves the information regarding a key being present on the keychain or not. + * + * @param hasKeychainEntryRequestV1 (optional) + * @return ApiResponse + * @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 hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1?) : ApiResponse { + val localVariableConfig = hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1 = hasKeychainEntryRequestV1) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation hasKeychainEntryV1 + * + * @param hasKeychainEntryRequestV1 (optional) + * @return RequestConfig + */ fun hasKeychainEntryV1RequestConfig(hasKeychainEntryRequestV1: HasKeychainEntryRequestV1?) : RequestConfig { val localVariableBody = hasKeychainEntryRequestV1 val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Sets a value under a key on the keychain backend. - * - * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key - * @return SetKeychainEntryResponse - * @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 - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key + * @return SetKeychainEntryResponse + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest) : SetKeychainEntryResponse { - val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequest = setKeychainEntryRequest) - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequest = setKeychainEntryRequest) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as SetKeychainEntryResponse @@ -293,23 +367,47 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation setKeychainEntryV1 - * - * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key - * @return RequestConfig - */ + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key + * @return ApiResponse + * @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 setKeychainEntryV1WithHttpInfo(setKeychainEntryRequest: SetKeychainEntryRequest) : ApiResponse { + val localVariableConfig = setKeychainEntryV1RequestConfig(setKeychainEntryRequest = setKeychainEntryRequest) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation setKeychainEntryV1 + * + * @param setKeychainEntryRequest Request body to write/update a keychain entry via its key + * @return RequestConfig + */ fun setKeychainEntryV1RequestConfig(setKeychainEntryRequest: SetKeychainEntryRequest) : RequestConfig { val localVariableBody = setKeychainEntryRequest val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry", 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] } diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt index 3146cc440c..ba98475cd6 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key of the entry to delete from the keychain. */ + data class DeleteKeychainEntryRequestV1 ( /* The key of the entry to delete from the keychain. */ diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt index 3eea63fb57..986811776c 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeleteKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key of the entry that was deleted from the keychain. */ + data class DeleteKeychainEntryResponseV1 ( /* The key of the entry that was deleted from the keychain. */ diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt index feb1e608e5..f3033d77f5 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key for the entry to get from the keychain. */ + data class GetKeychainEntryRequest ( /* The key for the entry to get from the keychain. */ diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt index 933a0f99d9..9bdb563426 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value associated with the requested key on the keychain. */ + data class GetKeychainEntryResponse ( /* The key that was used to retrieve the value from the keychain. */ diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt index 71dee33cb6..4f7b976c95 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryRequestV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key to check for presence in the keychain. */ + data class HasKeychainEntryRequestV1 ( /* The key to check for presence in the keychain. */ diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt index 2bd2051856..97148e92af 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/HasKeychainEntryResponseV1.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param isPresent The boolean true or false indicating the presence or absence of an entry under 'key'. */ + data class HasKeychainEntryResponseV1 ( /* The key that was used to check the presence of the value in the keychain. */ diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt index 420d2e0bf9..7ec6af0d92 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param `value` The value that will be associated with the key on the keychain. */ + data class SetKeychainEntryRequest ( /* The key for the entry to set on the keychain. */ diff --git a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt index d29ede67a8..14e5d43237 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt +++ b/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus - Keychain API - * - * Contains/describes the Keychain API types/paths for Hyperledger Cactus. - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param key The key that was used to set the value on the keychain. */ + data class SetKeychainEntryResponse ( /* The key that was used to set the value on the keychain. */ diff --git a/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/api.ts index ab09075ca3..9595e453b4 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,7 +34,7 @@ export interface DeleteKeychainEntryRequestV1 { * @type {string} * @memberof DeleteKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -45,7 +47,7 @@ export interface DeleteKeychainEntryResponseV1 { * @type {string} * @memberof DeleteKeychainEntryResponseV1 */ - key: string; + 'key': string; } /** * @@ -58,7 +60,7 @@ export interface GetKeychainEntryRequest { * @type {string} * @memberof GetKeychainEntryRequest */ - key: string; + 'key': string; } /** * @@ -71,13 +73,13 @@ export interface GetKeychainEntryResponse { * @type {string} * @memberof GetKeychainEntryResponse */ - key: string; + 'key': string; /** * The value associated with the requested key on the keychain. * @type {string} * @memberof GetKeychainEntryResponse */ - value: string; + 'value': string; } /** * @@ -90,7 +92,7 @@ export interface HasKeychainEntryRequestV1 { * @type {string} * @memberof HasKeychainEntryRequestV1 */ - key: string; + 'key': string; } /** * @@ -103,19 +105,19 @@ export interface HasKeychainEntryResponseV1 { * @type {string} * @memberof HasKeychainEntryResponseV1 */ - key: string; + 'key': string; /** * Date and time encoded as JSON when the presence check was performed by the plugin backend. * @type {string} * @memberof HasKeychainEntryResponseV1 */ - checkedAt: string; + 'checkedAt': string; /** * The boolean true or false indicating the presence or absence of an entry under \'key\'. * @type {boolean} * @memberof HasKeychainEntryResponseV1 */ - isPresent: boolean; + 'isPresent': boolean; } /** * @@ -128,13 +130,13 @@ export interface SetKeychainEntryRequest { * @type {string} * @memberof SetKeychainEntryRequest */ - key: string; + 'key': string; /** * The value that will be associated with the key on the keychain. * @type {string} * @memberof SetKeychainEntryRequest */ - value: string; + 'value': string; } /** * @@ -147,7 +149,7 @@ export interface SetKeychainEntryResponse { * @type {string} * @memberof SetKeychainEntryResponse */ - key: string; + 'key': string; } /** @@ -163,7 +165,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1?: DeleteKeychainEntryRequestV1, options: any = {}): Promise => { + deleteKeychainEntryV1: async (deleteKeychainEntryRequestV1?: DeleteKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -180,7 +182,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(deleteKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -197,7 +199,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKeychainEntryV1: async (getKeychainEntryRequest: GetKeychainEntryRequest, options: any = {}): Promise => { + getKeychainEntryV1: async (getKeychainEntryRequest: GetKeychainEntryRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'getKeychainEntryRequest' is not null or undefined assertParamExists('getKeychainEntryV1', 'getKeychainEntryRequest', getKeychainEntryRequest) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry`; @@ -216,7 +218,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getKeychainEntryRequest, localVarRequestOptions, configuration) @@ -232,7 +234,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPrometheusMetricsV1: async (options: any = {}): Promise => { + getPrometheusMetricsV1: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -247,7 +249,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -263,7 +265,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - hasKeychainEntryV1: async (hasKeychainEntryRequestV1?: HasKeychainEntryRequestV1, options: any = {}): Promise => { + hasKeychainEntryV1: async (hasKeychainEntryRequestV1?: HasKeychainEntryRequestV1, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -280,7 +282,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(hasKeychainEntryRequestV1, localVarRequestOptions, configuration) @@ -297,7 +299,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - setKeychainEntryV1: async (setKeychainEntryRequest: SetKeychainEntryRequest, options: any = {}): Promise => { + setKeychainEntryV1: async (setKeychainEntryRequest: SetKeychainEntryRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'setKeychainEntryRequest' is not null or undefined assertParamExists('setKeychainEntryV1', 'setKeychainEntryRequest', setKeychainEntryRequest) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry`; @@ -316,7 +318,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(setKeychainEntryRequest, localVarRequestOptions, configuration) @@ -343,7 +345,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deleteKeychainEntryV1(deleteKeychainEntryRequestV1?: DeleteKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async deleteKeychainEntryV1(deleteKeychainEntryRequestV1?: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -354,7 +356,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getKeychainEntryV1(getKeychainEntryRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -364,7 +366,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getPrometheusMetricsV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getPrometheusMetricsV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPrometheusMetricsV1(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -375,7 +377,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async hasKeychainEntryV1(hasKeychainEntryRequestV1?: HasKeychainEntryRequestV1, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async hasKeychainEntryV1(hasKeychainEntryRequestV1?: HasKeychainEntryRequestV1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.hasKeychainEntryV1(hasKeychainEntryRequestV1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -386,7 +388,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.setKeychainEntryV1(setKeychainEntryRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -467,7 +469,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public deleteKeychainEntryV1(deleteKeychainEntryRequestV1?: DeleteKeychainEntryRequestV1, options?: any) { + public deleteKeychainEntryV1(deleteKeychainEntryRequestV1?: DeleteKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).deleteKeychainEntryV1(deleteKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -479,7 +481,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest, options?: any) { + public getKeychainEntryV1(getKeychainEntryRequest: GetKeychainEntryRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getKeychainEntryV1(getKeychainEntryRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -490,7 +492,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getPrometheusMetricsV1(options?: any) { + public getPrometheusMetricsV1(options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getPrometheusMetricsV1(options).then((request) => request(this.axios, this.basePath)); } @@ -502,7 +504,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public hasKeychainEntryV1(hasKeychainEntryRequestV1?: HasKeychainEntryRequestV1, options?: any) { + public hasKeychainEntryV1(hasKeychainEntryRequestV1?: HasKeychainEntryRequestV1, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).hasKeychainEntryV1(hasKeychainEntryRequestV1, options).then((request) => request(this.axios, this.basePath)); } @@ -514,7 +516,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest, options?: any) { + public setKeychainEntryV1(setKeychainEntryRequest: SetKeychainEntryRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).setKeychainEntryV1(setKeychainEntryRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/base.ts index 5bdd7d5a90..51fa22c30d 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/common.ts index 551dfb0d3c..e6d53f3c0f 100644 --- a/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-ledger-connector-besu/openapitools.json b/packages/cactus-plugin-ledger-connector-besu/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-ledger-connector-besu/openapitools.json +++ b/packages/cactus-plugin-ledger-connector-besu/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts index 66cb9f3497..a5a63011f1 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,13 +34,13 @@ export interface BesuPrivateTransactionConfig { * @type {string} * @memberof BesuPrivateTransactionConfig */ - privateFrom: string; + 'privateFrom': string; /** * * @type {Array} * @memberof BesuPrivateTransactionConfig */ - privateFor: Array; + 'privateFor': Array; } /** * @@ -46,57 +48,63 @@ export interface BesuPrivateTransactionConfig { * @interface BesuTransactionConfig */ export interface BesuTransactionConfig { - [key: string]: object | any; + [key: string]: any; /** * * @type {string} * @memberof BesuTransactionConfig */ - rawTransaction?: string; + 'rawTransaction'?: string; /** * - * @type {string | number} + * @type {Web3BlockHeaderTimestamp} * @memberof BesuTransactionConfig */ - from?: string | number; + 'from'?: Web3BlockHeaderTimestamp; /** * - * @type {string} + * @type {BesuTransactionConfigTo} * @memberof BesuTransactionConfig */ - to?: string; + 'to'?: BesuTransactionConfigTo; /** * - * @type {string | number} + * @type {Web3BlockHeaderTimestamp} * @memberof BesuTransactionConfig */ - value?: string | number; + 'value'?: Web3BlockHeaderTimestamp; /** * - * @type {string | number} + * @type {Web3BlockHeaderTimestamp} * @memberof BesuTransactionConfig */ - gas?: string | number; + 'gas'?: Web3BlockHeaderTimestamp; /** * - * @type {string | number} + * @type {Web3BlockHeaderTimestamp} * @memberof BesuTransactionConfig */ - gasPrice?: string | number; + 'gasPrice'?: Web3BlockHeaderTimestamp; /** * * @type {number} * @memberof BesuTransactionConfig */ - nonce?: number; + 'nonce'?: number; /** * - * @type {string} + * @type {BesuTransactionConfigTo} * @memberof BesuTransactionConfig */ - data?: string; + 'data'?: BesuTransactionConfigTo; } +/** + * @type BesuTransactionConfigTo + * @export + */ +export type BesuTransactionConfigTo = string; + /** * * @export @@ -108,20 +116,22 @@ export interface ConsistencyStrategy { * @type {ReceiptType} * @memberof ConsistencyStrategy */ - receiptType: ReceiptType; + 'receiptType': ReceiptType; /** * The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. * @type {number} * @memberof ConsistencyStrategy */ - timeoutMs?: number; + 'timeoutMs'?: number; /** * The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. * @type {number} * @memberof ConsistencyStrategy */ - blockConfirmations: number; + 'blockConfirmations': number; } + + /** * * @export @@ -133,61 +143,61 @@ export interface DeployContractSolidityBytecodeV1Request { * @type {string} * @memberof DeployContractSolidityBytecodeV1Request */ - contractName: string; + 'contractName': string; /** * The application binary interface of the solidity contract * @type {Array} * @memberof DeployContractSolidityBytecodeV1Request */ - contractAbi: Array; + 'contractAbi': Array; /** * * @type {Array} * @memberof DeployContractSolidityBytecodeV1Request */ - constructorArgs: Array; + 'constructorArgs': Array; /** * * @type {Web3SigningCredential} * @memberof DeployContractSolidityBytecodeV1Request */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode * @type {string} * @memberof DeployContractSolidityBytecodeV1Request */ - bytecode: string; + 'bytecode': string; /** * The keychainId for retrieve the contracts json. * @type {string} * @memberof DeployContractSolidityBytecodeV1Request */ - keychainId: string; + 'keychainId': string; /** * * @type {number} * @memberof DeployContractSolidityBytecodeV1Request */ - gas?: number; + 'gas'?: number; /** * * @type {string} * @memberof DeployContractSolidityBytecodeV1Request */ - gasPrice?: string; + 'gasPrice'?: string; /** * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. * @type {number} * @memberof DeployContractSolidityBytecodeV1Request */ - timeoutMs?: number; + 'timeoutMs'?: number; /** * * @type {BesuPrivateTransactionConfig} * @memberof DeployContractSolidityBytecodeV1Request */ - privateTransactionConfig?: BesuPrivateTransactionConfig; + 'privateTransactionConfig'?: BesuPrivateTransactionConfig; } /** * @@ -200,7 +210,7 @@ export interface DeployContractSolidityBytecodeV1Response { * @type {Web3TransactionReceipt} * @memberof DeployContractSolidityBytecodeV1Response */ - transactionReceipt: Web3TransactionReceipt; + 'transactionReceipt': Web3TransactionReceipt; } /** * @@ -208,10 +218,13 @@ export interface DeployContractSolidityBytecodeV1Response { * @enum {string} */ -export enum EthContractInvocationType { - Send = 'SEND', - Call = 'CALL' -} +export const EthContractInvocationType = { + Send: 'SEND', + Call: 'CALL' +} as const; + +export type EthContractInvocationType = typeof EthContractInvocationType[keyof typeof EthContractInvocationType]; + /** * @@ -224,109 +237,109 @@ export interface EvmBlock { * @type {number} * @memberof EvmBlock */ - number?: number; + 'number'?: number; /** * * @type {string} * @memberof EvmBlock */ - hash?: string; + 'hash'?: string; /** * * @type {string} * @memberof EvmBlock */ - parentHash?: string; + 'parentHash'?: string; /** * * @type {string} * @memberof EvmBlock */ - nonce?: string; + 'nonce'?: string; /** * * @type {string} * @memberof EvmBlock */ - sha3Uncles?: string; + 'sha3Uncles'?: string; /** * * @type {string} * @memberof EvmBlock */ - logsBloom?: string; + 'logsBloom'?: string; /** * * @type {string} * @memberof EvmBlock */ - transactionsRoot?: string; + 'transactionsRoot'?: string; /** * * @type {string} * @memberof EvmBlock */ - stateRoot?: string; + 'stateRoot'?: string; /** * * @type {string} * @memberof EvmBlock */ - miner?: string; + 'miner'?: string; /** * * @type {number} * @memberof EvmBlock */ - difficulty?: number; + 'difficulty'?: number; /** * * @type {number} * @memberof EvmBlock */ - totalDifficulty?: number; + 'totalDifficulty'?: number; /** * * @type {string} * @memberof EvmBlock */ - extraData?: string; + 'extraData'?: string; /** * * @type {number} * @memberof EvmBlock */ - size?: number; + 'size'?: number; /** * * @type {number} * @memberof EvmBlock */ - gasLimit?: number; + 'gasLimit'?: number; /** * * @type {number} * @memberof EvmBlock */ - gasUsed?: number; + 'gasUsed'?: number; /** * * @type {any} * @memberof EvmBlock */ - timestamp?: any | null; + 'timestamp'?: any; /** * * @type {Array} * @memberof EvmBlock */ - transactions?: Array; + 'transactions'?: Array; /** * * @type {Array} * @memberof EvmBlock */ - uncles?: Array; + 'uncles'?: Array; } /** * @@ -339,49 +352,49 @@ export interface EvmLog { * @type {string} * @memberof EvmLog */ - address: string; + 'address': string; /** * * @type {string} * @memberof EvmLog */ - data: string; + 'data': string; /** * * @type {string} * @memberof EvmLog */ - blockHash: string; + 'blockHash': string; /** * * @type {string} * @memberof EvmLog */ - transactionHash: string; + 'transactionHash': string; /** * * @type {Array} * @memberof EvmLog */ - topics: Array; + 'topics': Array; /** * * @type {number} * @memberof EvmLog */ - logIndex: number; + 'logIndex': number; /** * * @type {number} * @memberof EvmLog */ - transactionIndex: number; + 'transactionIndex': number; /** * * @type {number} * @memberof EvmLog */ - blockNumber: number; + 'blockNumber': number; } /** * @@ -394,67 +407,67 @@ export interface EvmTransaction { * @type {string} * @memberof EvmTransaction */ - hash?: string; + 'hash'?: string; /** * * @type {number} * @memberof EvmTransaction */ - nonce?: number; + 'nonce'?: number; /** * * @type {any} * @memberof EvmTransaction */ - blockHash?: any | null; + 'blockHash'?: any; /** * * @type {any} * @memberof EvmTransaction */ - blockNumber?: any | null; + 'blockNumber'?: any; /** * * @type {any} * @memberof EvmTransaction */ - transactionIndex?: any | null; + 'transactionIndex'?: any; /** * * @type {string} * @memberof EvmTransaction */ - from?: string; + 'from'?: string; /** * * @type {any} * @memberof EvmTransaction */ - to?: any | null; + 'to'?: any; /** * * @type {string} * @memberof EvmTransaction */ - value?: string; + 'value'?: string; /** * * @type {string} * @memberof EvmTransaction */ - gasPrice?: string; + 'gasPrice'?: string; /** * * @type {number} * @memberof EvmTransaction */ - gas?: number; + 'gas'?: number; /** * * @type {string} * @memberof EvmTransaction */ - input?: string; + 'input'?: string; } /** * @@ -467,13 +480,13 @@ export interface GetBalanceV1Request { * @type {string} * @memberof GetBalanceV1Request */ - address: string; + 'address': string; /** * * @type {any} * @memberof GetBalanceV1Request */ - defaultBlock?: any | null; + 'defaultBlock'?: any; } /** * @@ -486,7 +499,7 @@ export interface GetBalanceV1Response { * @type {string} * @memberof GetBalanceV1Response */ - balance: string; + 'balance': string; } /** * @@ -499,13 +512,13 @@ export interface GetBesuRecordV1Request { * @type {InvokeContractV1Request} * @memberof GetBesuRecordV1Request */ - invokeCall?: InvokeContractV1Request; + 'invokeCall'?: InvokeContractV1Request; /** * * @type {string} * @memberof GetBesuRecordV1Request */ - transactionHash?: string; + 'transactionHash'?: string; } /** * @@ -518,25 +531,25 @@ export interface GetBesuRecordV1Response { * @type {string} * @memberof GetBesuRecordV1Response */ - ledgerId?: string; + 'ledgerId'?: string; /** * * @type {string} * @memberof GetBesuRecordV1Response */ - stateContract?: string; + 'stateContract'?: string; /** * * @type {any} * @memberof GetBesuRecordV1Response */ - transactionInputData?: any | null; + 'transactionInputData'?: any; /** * * @type {any} * @memberof GetBesuRecordV1Response */ - callOutput?: any | null; + 'callOutput'?: any; } /** * @@ -549,7 +562,7 @@ export interface GetBlockV1Request { * @type {any} * @memberof GetBlockV1Request */ - blockHashOrBlockNumber: any | null; + 'blockHashOrBlockNumber': any; } /** * @@ -562,7 +575,7 @@ export interface GetBlockV1Response { * @type {EvmBlock} * @memberof GetBlockV1Response */ - block: EvmBlock; + 'block': EvmBlock; } /** * @@ -575,25 +588,25 @@ export interface GetPastLogsV1Request { * @type {any} * @memberof GetPastLogsV1Request */ - toBlock?: any | null; + 'toBlock'?: any; /** * * @type {any} * @memberof GetPastLogsV1Request */ - fromBlock?: any | null; + 'fromBlock'?: any; /** * * @type {any} * @memberof GetPastLogsV1Request */ - address?: any | null; + 'address'?: any; /** * * @type {Array} * @memberof GetPastLogsV1Request */ - topics?: Array; + 'topics'?: Array; } /** * @@ -606,7 +619,7 @@ export interface GetPastLogsV1Response { * @type {Array} * @memberof GetPastLogsV1Response */ - logs: Array; + 'logs': Array; } /** * @@ -619,7 +632,7 @@ export interface GetTransactionV1Request { * @type {string} * @memberof GetTransactionV1Request */ - transactionHash: string; + 'transactionHash': string; } /** * @@ -632,7 +645,7 @@ export interface GetTransactionV1Response { * @type {EvmTransaction} * @memberof GetTransactionV1Response */ - transaction: EvmTransaction; + 'transaction': EvmTransaction; } /** * @@ -645,86 +658,88 @@ export interface InvokeContractV1Request { * @type {string} * @memberof InvokeContractV1Request */ - contractName: string; + 'contractName': string; /** * * @type {Web3SigningCredential} * @memberof InvokeContractV1Request */ - signingCredential: Web3SigningCredential; + 'signingCredential': Web3SigningCredential; /** * * @type {EthContractInvocationType} * @memberof InvokeContractV1Request */ - invocationType: EthContractInvocationType; + 'invocationType': EthContractInvocationType; /** * The name of the contract method to invoke. * @type {string} * @memberof InvokeContractV1Request */ - methodName: string; + 'methodName': string; /** * The list of arguments to pass in to the contract method being invoked. * @type {Array} * @memberof InvokeContractV1Request */ - params: Array; + 'params': Array; /** * The application binary interface of the solidity contract, optional parameter * @type {Array} * @memberof InvokeContractV1Request */ - contractAbi?: Array; + 'contractAbi'?: Array; /** * Address of the solidity contract, optional parameter * @type {string} * @memberof InvokeContractV1Request */ - contractAddress?: string; + 'contractAddress'?: string; /** * - * @type {string | number} + * @type {Web3BlockHeaderTimestamp} * @memberof InvokeContractV1Request */ - value?: string | number; + 'value'?: Web3BlockHeaderTimestamp; /** * - * @type {string | number} + * @type {Web3BlockHeaderTimestamp} * @memberof InvokeContractV1Request */ - gas?: string | number; + 'gas'?: Web3BlockHeaderTimestamp; /** * - * @type {string | number} + * @type {Web3BlockHeaderTimestamp} * @memberof InvokeContractV1Request */ - gasPrice?: string | number; + 'gasPrice'?: Web3BlockHeaderTimestamp; /** * * @type {number} * @memberof InvokeContractV1Request */ - nonce?: number; + 'nonce'?: number; /** * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND * @type {number} * @memberof InvokeContractV1Request */ - timeoutMs?: number; + 'timeoutMs'?: number; /** * The keychainId for retrieve the contracts json. * @type {string} * @memberof InvokeContractV1Request */ - keychainId?: string; + 'keychainId'?: string; /** * * @type {BesuPrivateTransactionConfig} * @memberof InvokeContractV1Request */ - privateTransactionConfig?: BesuPrivateTransactionConfig; + 'privateTransactionConfig'?: BesuPrivateTransactionConfig; } + + /** * * @export @@ -736,19 +751,19 @@ export interface InvokeContractV1Response { * @type {Web3TransactionReceipt} * @memberof InvokeContractV1Response */ - transactionReceipt?: Web3TransactionReceipt; + 'transactionReceipt'?: Web3TransactionReceipt; /** * * @type {any} * @memberof InvokeContractV1Response */ - callOutput?: any | null; + 'callOutput'?: any; /** * * @type {boolean} * @memberof InvokeContractV1Response */ - success: boolean; + 'success': boolean; } /** * Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. @@ -756,10 +771,13 @@ export interface InvokeContractV1Response { * @enum {string} */ -export enum ReceiptType { - NodeTxPoolAck = 'NODE_TX_POOL_ACK', - LedgerBlockAck = 'LEDGER_BLOCK_ACK' -} +export const ReceiptType = { + NodeTxPoolAck: 'NODE_TX_POOL_ACK', + LedgerBlockAck: 'LEDGER_BLOCK_ACK' +} as const; + +export type ReceiptType = typeof ReceiptType[keyof typeof ReceiptType]; + /** * @@ -772,25 +790,25 @@ export interface RunTransactionRequest { * @type {Web3SigningCredential} * @memberof RunTransactionRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {BesuTransactionConfig} * @memberof RunTransactionRequest */ - transactionConfig: BesuTransactionConfig; + 'transactionConfig': BesuTransactionConfig; /** * * @type {ConsistencyStrategy} * @memberof RunTransactionRequest */ - consistencyStrategy: ConsistencyStrategy; + 'consistencyStrategy': ConsistencyStrategy; /** * * @type {BesuPrivateTransactionConfig} * @memberof RunTransactionRequest */ - privateTransactionConfig?: BesuPrivateTransactionConfig; + 'privateTransactionConfig'?: BesuPrivateTransactionConfig; } /** * @@ -803,7 +821,7 @@ export interface RunTransactionResponse { * @type {Web3TransactionReceipt} * @memberof RunTransactionResponse */ - transactionReceipt: Web3TransactionReceipt; + 'transactionReceipt': Web3TransactionReceipt; } /** * @@ -816,19 +834,19 @@ export interface SignTransactionRequest { * @type {string} * @memberof SignTransactionRequest */ - keychainId: string; + 'keychainId': string; /** * * @type {string} * @memberof SignTransactionRequest */ - keychainRef: string; + 'keychainRef': string; /** * The transaction hash of ledger will be used to fetch the contain. * @type {string} * @memberof SignTransactionRequest */ - transactionHash: string; + 'transactionHash': string; } /** * @@ -841,7 +859,7 @@ export interface SignTransactionResponse { * @type {string} * @memberof SignTransactionResponse */ - signature: string; + 'signature': string; } /** * @@ -854,75 +872,143 @@ export interface SolidityContractJsonArtifact { * @type {string} * @memberof SolidityContractJsonArtifact */ - contractName: string; + 'contractName': string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - metadata?: string; + 'metadata'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - bytecode?: string; + 'bytecode'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - deployedBytecode?: string; + 'deployedBytecode'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - sourceMap?: string; + 'sourceMap'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - deployedSourceMap?: string; + 'deployedSourceMap'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - sourcePath?: string; + 'sourcePath'?: string; /** * - * @type {{ [key: string]: object; }} + * @type {SolidityContractJsonArtifactCompiler} * @memberof SolidityContractJsonArtifact */ - compiler?: { [key: string]: object; }; + 'compiler'?: SolidityContractJsonArtifactCompiler; /** * - * @type {{ [key: string]: object; }} + * @type {{ [key: string]: any; }} * @memberof SolidityContractJsonArtifact */ - functionHashes?: { [key: string]: object; }; + 'functionHashes'?: { [key: string]: any; }; /** * - * @type {object} + * @type {SolidityContractJsonArtifactGasEstimates} * @memberof SolidityContractJsonArtifact */ - gasEstimates?: object; + 'gasEstimates'?: SolidityContractJsonArtifactGasEstimates; } /** * * @export - * @enum {string} + * @interface SolidityContractJsonArtifactCompiler */ +export interface SolidityContractJsonArtifactCompiler { + [key: string]: any; -export enum WatchBlocksV1 { - Subscribe = 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe', - Next = 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next', - Unsubscribe = 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe', - Error = 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error', - Complete = 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete' + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactCompiler + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactCompiler + */ + 'version'?: string; +} +/** + * + * @export + * @interface SolidityContractJsonArtifactGasEstimates + */ +export interface SolidityContractJsonArtifactGasEstimates { + /** + * + * @type {SolidityContractJsonArtifactGasEstimatesCreation} + * @memberof SolidityContractJsonArtifactGasEstimates + */ + 'creation'?: SolidityContractJsonArtifactGasEstimatesCreation; + /** + * + * @type {{ [key: string]: any; }} + * @memberof SolidityContractJsonArtifactGasEstimates + */ + 'external'?: { [key: string]: any; }; +} +/** + * + * @export + * @interface SolidityContractJsonArtifactGasEstimatesCreation + */ +export interface SolidityContractJsonArtifactGasEstimatesCreation { + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactGasEstimatesCreation + */ + 'codeDepositCost'?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactGasEstimatesCreation + */ + 'executionCost'?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactGasEstimatesCreation + */ + 'totalCost'?: string; } +/** + * + * @export + * @enum {string} + */ + +export const WatchBlocksV1 = { + Subscribe: 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe', + Next: 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next', + Unsubscribe: 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe', + Error: 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error', + Complete: 'org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete' +} as const; + +export type WatchBlocksV1 = typeof WatchBlocksV1[keyof typeof WatchBlocksV1]; + /** * @@ -935,7 +1021,7 @@ export interface WatchBlocksV1Progress { * @type {Web3BlockHeader} * @memberof WatchBlocksV1Progress */ - blockHeader: Web3BlockHeader; + 'blockHeader': Web3BlockHeader; } /** * @@ -948,86 +1034,92 @@ export interface Web3BlockHeader { * @type {number} * @memberof Web3BlockHeader */ - number: number; + 'number': number; /** * * @type {string} * @memberof Web3BlockHeader */ - hash: string; + 'hash': string; /** * * @type {string} * @memberof Web3BlockHeader */ - parentHash: string; + 'parentHash': string; /** * * @type {string} * @memberof Web3BlockHeader */ - nonce: string; + 'nonce': string; /** * * @type {string} * @memberof Web3BlockHeader */ - sha3Uncles: string; + 'sha3Uncles': string; /** * * @type {string} * @memberof Web3BlockHeader */ - logsBloom: string; + 'logsBloom': string; /** * * @type {string} * @memberof Web3BlockHeader */ - transactionRoot: string; + 'transactionRoot': string; /** * * @type {string} * @memberof Web3BlockHeader */ - stateRoot: string; + 'stateRoot': string; /** * * @type {string} * @memberof Web3BlockHeader */ - receiptRoot: string; + 'receiptRoot': string; /** * * @type {string} * @memberof Web3BlockHeader */ - miner: string; + 'miner': string; /** * * @type {string} * @memberof Web3BlockHeader */ - extraData: string; + 'extraData': string; /** * * @type {number} * @memberof Web3BlockHeader */ - gasLimit: number; + 'gasLimit': number; /** * * @type {number} * @memberof Web3BlockHeader */ - gasUsed: number; + 'gasUsed': number; /** * - * @type {string | number} + * @type {Web3BlockHeaderTimestamp} * @memberof Web3BlockHeader */ - timestamp: string | number; + 'timestamp': Web3BlockHeaderTimestamp; } +/** + * @type Web3BlockHeaderTimestamp + * @export + */ +export type Web3BlockHeaderTimestamp = number | string; + /** * @type Web3SigningCredential * @export @@ -1045,26 +1137,28 @@ export interface Web3SigningCredentialCactusKeychainRef { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialCactusKeychainRef */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - ethAccount: string; + 'ethAccount': string; /** * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainEntryKey: string; + 'keychainEntryKey': string; /** * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainId: string; + 'keychainId': string; } + + /** * Using this denotes that there is no signing required because the transaction is pre-signed. * @export @@ -1076,8 +1170,10 @@ export interface Web3SigningCredentialNone { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialNone */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; } + + /** * * @export @@ -1089,32 +1185,37 @@ export interface Web3SigningCredentialPrivateKeyHex { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialPrivateKeyHex */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - ethAccount: string; + 'ethAccount': string; /** * The HEX encoded private key of an eth account. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - secret: string; + 'secret': string; } + + /** * * @export * @enum {string} */ -export enum Web3SigningCredentialType { - CactusKeychainRef = 'CACTUS_KEYCHAIN_REF', - GethKeychainPassword = 'GETH_KEYCHAIN_PASSWORD', - PrivateKeyHex = 'PRIVATE_KEY_HEX', - None = 'NONE' -} +export const Web3SigningCredentialType = { + CactusKeychainRef: 'CACTUS_KEYCHAIN_REF', + GethKeychainPassword: 'GETH_KEYCHAIN_PASSWORD', + PrivateKeyHex: 'PRIVATE_KEY_HEX', + None: 'NONE' +} as const; + +export type Web3SigningCredentialType = typeof Web3SigningCredentialType[keyof typeof Web3SigningCredentialType]; + /** * @@ -1122,62 +1223,62 @@ export enum Web3SigningCredentialType { * @interface Web3TransactionReceipt */ export interface Web3TransactionReceipt { - [key: string]: object | any; + [key: string]: any; /** * * @type {boolean} * @memberof Web3TransactionReceipt */ - status: boolean; + 'status': boolean; /** * * @type {string} * @memberof Web3TransactionReceipt */ - transactionHash: string; + 'transactionHash': string; /** * * @type {number} * @memberof Web3TransactionReceipt */ - transactionIndex: number; + 'transactionIndex': number; /** * * @type {string} * @memberof Web3TransactionReceipt */ - blockHash: string; + 'blockHash': string; /** * * @type {number} * @memberof Web3TransactionReceipt */ - blockNumber: number; + 'blockNumber': number; /** * * @type {number} * @memberof Web3TransactionReceipt */ - gasUsed: number; + 'gasUsed': number; /** * * @type {string} * @memberof Web3TransactionReceipt */ - contractAddress?: string | null; + 'contractAddress'?: string | null; /** * * @type {string} * @memberof Web3TransactionReceipt */ - from: string; + 'from': string; /** * * @type {string} * @memberof Web3TransactionReceipt */ - to: string; + 'to': string; } /** @@ -1193,7 +1294,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deployContractSolBytecodeV1: async (deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options: any = {}): Promise => { + deployContractSolBytecodeV1: async (deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1210,7 +1311,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(deployContractSolidityBytecodeV1Request, localVarRequestOptions, configuration) @@ -1227,7 +1328,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getBalanceV1: async (getBalanceV1Request?: GetBalanceV1Request, options: any = {}): Promise => { + getBalanceV1: async (getBalanceV1Request?: GetBalanceV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1244,7 +1345,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getBalanceV1Request, localVarRequestOptions, configuration) @@ -1261,7 +1362,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getBesuRecordV1: async (getBesuRecordV1Request?: GetBesuRecordV1Request, options: any = {}): Promise => { + getBesuRecordV1: async (getBesuRecordV1Request?: GetBesuRecordV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1278,7 +1379,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getBesuRecordV1Request, localVarRequestOptions, configuration) @@ -1295,7 +1396,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getBlockV1: async (getBlockV1Request?: GetBlockV1Request, options: any = {}): Promise => { + getBlockV1: async (getBlockV1Request?: GetBlockV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1312,7 +1413,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getBlockV1Request, localVarRequestOptions, configuration) @@ -1329,7 +1430,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPastLogsV1: async (getPastLogsV1Request?: GetPastLogsV1Request, options: any = {}): Promise => { + getPastLogsV1: async (getPastLogsV1Request?: GetPastLogsV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1346,7 +1447,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getPastLogsV1Request, localVarRequestOptions, configuration) @@ -1362,7 +1463,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPrometheusMetricsV1: async (options: any = {}): Promise => { + getPrometheusMetricsV1: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1377,7 +1478,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -1393,7 +1494,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getTransactionV1: async (getTransactionV1Request?: GetTransactionV1Request, options: any = {}): Promise => { + getTransactionV1: async (getTransactionV1Request?: GetTransactionV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1410,7 +1511,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getTransactionV1Request, localVarRequestOptions, configuration) @@ -1427,7 +1528,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - invokeContractV1: async (invokeContractV1Request?: InvokeContractV1Request, options: any = {}): Promise => { + invokeContractV1: async (invokeContractV1Request?: InvokeContractV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1444,7 +1545,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(invokeContractV1Request, localVarRequestOptions, configuration) @@ -1461,7 +1562,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - runTransactionV1: async (runTransactionRequest?: RunTransactionRequest, options: any = {}): Promise => { + runTransactionV1: async (runTransactionRequest?: RunTransactionRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1478,7 +1579,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(runTransactionRequest, localVarRequestOptions, configuration) @@ -1495,7 +1596,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - signTransactionV1: async (signTransactionRequest: SignTransactionRequest, options: any = {}): Promise => { + signTransactionV1: async (signTransactionRequest: SignTransactionRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'signTransactionRequest' is not null or undefined assertParamExists('signTransactionV1', 'signTransactionRequest', signTransactionRequest) const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction`; @@ -1514,7 +1615,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(signTransactionRequest, localVarRequestOptions, configuration) @@ -1541,7 +1642,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1552,7 +1653,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getBalanceV1(getBalanceV1Request?: GetBalanceV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getBalanceV1(getBalanceV1Request?: GetBalanceV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getBalanceV1(getBalanceV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1563,7 +1664,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getBesuRecordV1(getBesuRecordV1Request?: GetBesuRecordV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getBesuRecordV1(getBesuRecordV1Request?: GetBesuRecordV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getBesuRecordV1(getBesuRecordV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1574,7 +1675,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getBlockV1(getBlockV1Request?: GetBlockV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getBlockV1(getBlockV1Request?: GetBlockV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getBlockV1(getBlockV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1585,7 +1686,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getPastLogsV1(getPastLogsV1Request?: GetPastLogsV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getPastLogsV1(getPastLogsV1Request?: GetPastLogsV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPastLogsV1(getPastLogsV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1595,7 +1696,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getPrometheusMetricsV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getPrometheusMetricsV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPrometheusMetricsV1(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1606,7 +1707,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getTransactionV1(getTransactionV1Request?: GetTransactionV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getTransactionV1(getTransactionV1Request?: GetTransactionV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getTransactionV1(getTransactionV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1617,7 +1718,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.invokeContractV1(invokeContractV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1628,7 +1729,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async runTransactionV1(runTransactionRequest?: RunTransactionRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async runTransactionV1(runTransactionRequest?: RunTransactionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.runTransactionV1(runTransactionRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1639,7 +1740,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async signTransactionV1(signTransactionRequest: SignTransactionRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async signTransactionV1(signTransactionRequest: SignTransactionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.signTransactionV1(signTransactionRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1770,7 +1871,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options?: any) { + public deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1782,7 +1883,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getBalanceV1(getBalanceV1Request?: GetBalanceV1Request, options?: any) { + public getBalanceV1(getBalanceV1Request?: GetBalanceV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getBalanceV1(getBalanceV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1794,7 +1895,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getBesuRecordV1(getBesuRecordV1Request?: GetBesuRecordV1Request, options?: any) { + public getBesuRecordV1(getBesuRecordV1Request?: GetBesuRecordV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getBesuRecordV1(getBesuRecordV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1806,7 +1907,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getBlockV1(getBlockV1Request?: GetBlockV1Request, options?: any) { + public getBlockV1(getBlockV1Request?: GetBlockV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getBlockV1(getBlockV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1818,7 +1919,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getPastLogsV1(getPastLogsV1Request?: GetPastLogsV1Request, options?: any) { + public getPastLogsV1(getPastLogsV1Request?: GetPastLogsV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getPastLogsV1(getPastLogsV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1829,7 +1930,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getPrometheusMetricsV1(options?: any) { + public getPrometheusMetricsV1(options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getPrometheusMetricsV1(options).then((request) => request(this.axios, this.basePath)); } @@ -1841,7 +1942,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getTransactionV1(getTransactionV1Request?: GetTransactionV1Request, options?: any) { + public getTransactionV1(getTransactionV1Request?: GetTransactionV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getTransactionV1(getTransactionV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1853,7 +1954,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any) { + public invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).invokeContractV1(invokeContractV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1865,7 +1966,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public runTransactionV1(runTransactionRequest?: RunTransactionRequest, options?: any) { + public runTransactionV1(runTransactionRequest?: RunTransactionRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).runTransactionV1(runTransactionRequest, options).then((request) => request(this.axios, this.basePath)); } @@ -1877,7 +1978,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public signTransactionV1(signTransactionRequest: SignTransactionRequest, options?: any) { + public signTransactionV1(signTransactionRequest: SignTransactionRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).signTransactionV1(signTransactionRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts index 334a915eb2..b9dcb25a32 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts index 5129b09cf2..fa9cb04339 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-ledger-connector-corda/openapitools.json b/packages/cactus-plugin-ledger-connector-corda/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-ledger-connector-corda/openapitools.json +++ b/packages/cactus-plugin-ledger-connector-corda/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/FILES index 8bd804e7e6..64a8f4a148 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/FILES +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/FILES @@ -1,7 +1,9 @@ README.md pom.xml settings.gradle -src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCorda.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/HomeController.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/SpringDocConfiguration.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaController.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiUtil.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Request.kt @@ -19,7 +21,7 @@ src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/mode src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowInvocationType.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Request.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Response.kt -src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1ResponseTx.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1ResponseTxInner.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Request.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Response.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JarFile.kt @@ -40,3 +42,4 @@ src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/mode src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Response.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/X500Principal.kt src/main/resources/application.yaml +src/main/resources/openapi.yaml diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/VERSION +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/pom.xml b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/pom.xml index 293145393c..572087265d 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/pom.xml +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/pom.xml @@ -6,14 +6,18 @@ cactus-connector-corda-server 0.3.0 - 1.3.30 - 1.2.0 - 1.3.2 + 1.6.8 + 3.0.2 + 2.1.0 + 1.6.21 + + 1.6.21 + UTF-8 org.springframework.boot spring-boot-starter-parent - 2.2.0.M3 + 2.6.7 ${project.basedir}/src/main/kotlin @@ -82,11 +86,18 @@ spring-boot-starter-web + + + org.springdoc + springdoc-openapi-ui + ${springdoc-openapi.version} + + com.google.code.findbugs jsr305 - 3.0.2 + ${findbugs-jsr305.version} com.fasterxml.jackson.dataformat @@ -106,50 +117,20 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api - javax.annotation - javax.annotation-api - ${javax-annotation-version} + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation.version} provided org.jetbrains.kotlin kotlin-test-junit5 - 1.3.31 + ${kotlin-test-junit5.version} test - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/HomeController.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/HomeController.kt new file mode 100644 index 0000000000..7262726110 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/HomeController.kt @@ -0,0 +1,17 @@ +package org.hyperledger.cactus.plugin.ledger.connector.corda.server + +import org.springframework.context.annotation.Bean +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.ResponseBody +import org.springframework.web.bind.annotation.GetMapping + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +class HomeController { + + @RequestMapping("/") + fun index(): String = "redirect:swagger-ui.html" +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/SpringDocConfiguration.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/SpringDocConfiguration.kt new file mode 100644 index 0000000000..adf50d152c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/SpringDocConfiguration.kt @@ -0,0 +1,32 @@ +package org.hyperledger.cactus.plugin.ledger.connector.corda.server + +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +import io.swagger.v3.oas.models.OpenAPI +import io.swagger.v3.oas.models.info.Info +import io.swagger.v3.oas.models.info.Contact +import io.swagger.v3.oas.models.info.License +import io.swagger.v3.oas.models.Components +import io.swagger.v3.oas.models.security.SecurityScheme + +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"]) +@Configuration +class SpringDocConfiguration { + + @Bean + fun apiInfo(): OpenAPI { + return OpenAPI() + .info( + Info() + .title("Hyperledger Cactus Plugin - Connector Corda") + .description("Can perform basic tasks on a Corda ledger") + .license( + License() + .name("Apache 2.0") + .url("https://www.apache.org/licenses/LICENSE-2.0.html") + ) + .version("0.3.0") + ) + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCorda.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaController.kt similarity index 51% rename from packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCorda.kt rename to packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaController.kt index 49252a9558..fda4695832 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCorda.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaController.kt @@ -18,6 +18,11 @@ import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartMo import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartMonitorV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StopMonitorV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StopMonitorV1Response +import io.swagger.v3.oas.annotations.* +import io.swagger.v3.oas.annotations.enums.* +import io.swagger.v3.oas.annotations.media.* +import io.swagger.v3.oas.annotations.responses.* +import io.swagger.v3.oas.annotations.security.* import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -27,14 +32,8 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired +import javax.validation.constraints.* import javax.validation.Valid -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map @@ -44,55 +43,82 @@ import kotlin.collections.Map @RequestMapping("\${api.base-path:}") class ApiPluginLedgerConnectorCordaController(@Autowired(required = true) val service: ApiPluginLedgerConnectorCordaService) { - + @Operation( + summary = "Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore.", + operationId = "clearMonitorTransactionsV1", + description = "", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = ClearMonitorTransactionsV1Response::class))]) ] + ) @RequestMapping( method = [RequestMethod.DELETE], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions"], produces = ["application/json"], consumes = ["application/json"] ) - fun clearMonitorTransactionsV1( @Valid @RequestBody(required = false) clearMonitorTransactionsV1Request: ClearMonitorTransactionsV1Request? -): ResponseEntity { + fun clearMonitorTransactionsV1(@Parameter(description = "") @Valid @RequestBody(required = false) clearMonitorTransactionsV1Request: ClearMonitorTransactionsV1Request?): ResponseEntity { return ResponseEntity(service.clearMonitorTransactionsV1(clearMonitorTransactionsV1Request), HttpStatus.valueOf(200)) } - + @Operation( + summary = "Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak).", + operationId = "deployContractJarsV1", + description = "", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = DeployContractJarsSuccessV1Response::class))]), + ApiResponse(responseCode = "400", description = "Bad Request", content = [Content(schema = Schema(implementation = DeployContractJarsBadRequestV1Response::class))]) ] + ) @RequestMapping( method = [RequestMethod.POST], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars"], produces = ["application/json"], consumes = ["application/json"] ) - fun deployContractJarsV1( @Valid @RequestBody(required = false) deployContractJarsV1Request: DeployContractJarsV1Request? -): ResponseEntity { + fun deployContractJarsV1(@Parameter(description = "") @Valid @RequestBody(required = false) deployContractJarsV1Request: DeployContractJarsV1Request?): ResponseEntity { return ResponseEntity(service.deployContractJarsV1(deployContractJarsV1Request), HttpStatus.valueOf(200)) } - + @Operation( + summary = "", + operationId = "diagnoseNodeV1", + description = "Responds with diagnostic information about the Corda node", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = DiagnoseNodeV1Response::class))]) ] + ) @RequestMapping( method = [RequestMethod.POST], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node"], produces = ["application/json"], consumes = ["application/json"] ) - fun diagnoseNodeV1( @Valid @RequestBody(required = false) diagnoseNodeV1Request: DiagnoseNodeV1Request? -): ResponseEntity { + fun diagnoseNodeV1(@Parameter(description = "") @Valid @RequestBody(required = false) diagnoseNodeV1Request: DiagnoseNodeV1Request?): ResponseEntity { return ResponseEntity(service.diagnoseNodeV1(diagnoseNodeV1Request), HttpStatus.valueOf(200)) } - + @Operation( + summary = "Get transactions for monitored state classes.", + operationId = "getMonitorTransactionsV1", + description = "", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = GetMonitorTransactionsV1Response::class))]) ] + ) @RequestMapping( method = [RequestMethod.GET], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions"], produces = ["application/json"], consumes = ["application/json"] ) - fun getMonitorTransactionsV1( @Valid @RequestBody(required = false) getMonitorTransactionsV1Request: GetMonitorTransactionsV1Request? -): ResponseEntity { + fun getMonitorTransactionsV1(@Parameter(description = "") @Valid @RequestBody(required = false) getMonitorTransactionsV1Request: GetMonitorTransactionsV1Request?): ResponseEntity { return ResponseEntity(service.getMonitorTransactionsV1(getMonitorTransactionsV1Request), HttpStatus.valueOf(200)) } - + @Operation( + summary = "Get the Prometheus Metrics", + operationId = "getPrometheusMetricsV1", + description = "", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = kotlin.String::class))]) ] + ) @RequestMapping( method = [RequestMethod.GET], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics"], @@ -102,63 +128,88 @@ class ApiPluginLedgerConnectorCordaController(@Autowired(required = true) val se return ResponseEntity(service.getPrometheusMetricsV1(), HttpStatus.valueOf(200)) } - + @Operation( + summary = "Invokes a contract on a Corda ledger (e.g. a flow)", + operationId = "invokeContractV1", + description = "", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = InvokeContractV1Response::class))]) ] + ) @RequestMapping( method = [RequestMethod.POST], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract"], produces = ["application/json"], consumes = ["application/json"] ) - fun invokeContractV1( @Valid @RequestBody(required = false) invokeContractV1Request: InvokeContractV1Request? -): ResponseEntity { + fun invokeContractV1(@Parameter(description = "") @Valid @RequestBody(required = false) invokeContractV1Request: InvokeContractV1Request?): ResponseEntity { return ResponseEntity(service.invokeContractV1(invokeContractV1Request), HttpStatus.valueOf(200)) } - + @Operation( + summary = "", + operationId = "listFlowsV1", + description = "Responds with a list of the flows on the Corda node.", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = ListFlowsV1Response::class))]) ] + ) @RequestMapping( method = [RequestMethod.POST], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows"], produces = ["application/json"], consumes = ["application/json"] ) - fun listFlowsV1( @Valid @RequestBody(required = false) listFlowsV1Request: ListFlowsV1Request? -): ResponseEntity { + fun listFlowsV1(@Parameter(description = "") @Valid @RequestBody(required = false) listFlowsV1Request: ListFlowsV1Request?): ResponseEntity { return ResponseEntity(service.listFlowsV1(listFlowsV1Request), HttpStatus.valueOf(200)) } - + @Operation( + summary = "", + operationId = "networkMapV1", + description = "Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = NodeInfo::class))]) ] + ) @RequestMapping( method = [RequestMethod.POST], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map"], produces = ["application/json"], consumes = ["application/json"] ) - fun networkMapV1( @Valid @RequestBody(required = false) body: kotlin.Any? -): ResponseEntity> { + fun networkMapV1(@Parameter(description = "") @Valid @RequestBody(required = false) body: kotlin.Any?): ResponseEntity> { return ResponseEntity(service.networkMapV1(body), HttpStatus.valueOf(200)) } - + @Operation( + summary = "Start monitoring corda changes (transactions) of given state class", + operationId = "startMonitorV1", + description = "", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = StartMonitorV1Response::class))]) ] + ) @RequestMapping( method = [RequestMethod.POST], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor"], produces = ["application/json"], consumes = ["application/json"] ) - fun startMonitorV1( @Valid @RequestBody(required = false) startMonitorV1Request: StartMonitorV1Request? -): ResponseEntity { + fun startMonitorV1(@Parameter(description = "") @Valid @RequestBody(required = false) startMonitorV1Request: StartMonitorV1Request?): ResponseEntity { return ResponseEntity(service.startMonitorV1(startMonitorV1Request), HttpStatus.valueOf(200)) } - + @Operation( + summary = "Stop monitoring corda changes (transactions) of given state class", + operationId = "stopMonitorV1", + description = "", + responses = [ + ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = StopMonitorV1Response::class))]) ] + ) @RequestMapping( method = [RequestMethod.DELETE], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor"], produces = ["application/json"], consumes = ["application/json"] ) - fun stopMonitorV1( @Valid @RequestBody(required = false) stopMonitorV1Request: StopMonitorV1Request? -): ResponseEntity { + fun stopMonitorV1(@Parameter(description = "") @Valid @RequestBody(required = false) stopMonitorV1Request: StopMonitorV1Request?): ResponseEntity { return ResponseEntity(service.stopMonitorV1(stopMonitorV1Request), HttpStatus.valueOf(200)) } } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt index 4c987f50a0..9a9aeb8fd4 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt @@ -21,23 +21,96 @@ import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StopMon interface ApiPluginLedgerConnectorCordaService { + /** + * DELETE /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions : Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + * + * @param clearMonitorTransactionsV1Request (optional) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#clearMonitorTransactionsV1 + */ fun clearMonitorTransactionsV1(clearMonitorTransactionsV1Request: ClearMonitorTransactionsV1Request?): ClearMonitorTransactionsV1Response + /** + * POST /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars : Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + * + * @param deployContractJarsV1Request (optional) + * @return OK (status code 200) + * or Bad Request (status code 400) + * @see ApiPluginLedgerConnectorCorda#deployContractJarsV1 + */ fun deployContractJarsV1(deployContractJarsV1Request: DeployContractJarsV1Request?): DeployContractJarsSuccessV1Response + /** + * POST /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node + * Responds with diagnostic information about the Corda node + * + * @param diagnoseNodeV1Request (optional) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#diagnoseNodeV1 + */ fun diagnoseNodeV1(diagnoseNodeV1Request: DiagnoseNodeV1Request?): DiagnoseNodeV1Response + /** + * GET /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions : Get transactions for monitored state classes. + * + * @param getMonitorTransactionsV1Request (optional) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#getMonitorTransactionsV1 + */ fun getMonitorTransactionsV1(getMonitorTransactionsV1Request: GetMonitorTransactionsV1Request?): GetMonitorTransactionsV1Response + /** + * GET /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics : Get the Prometheus Metrics + * + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#getPrometheusMetricsV1 + */ fun getPrometheusMetricsV1(): kotlin.String + /** + * POST /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract : Invokes a contract on a Corda ledger (e.g. a flow) + * + * @param invokeContractV1Request (optional) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#invokeContractV1 + */ fun invokeContractV1(invokeContractV1Request: InvokeContractV1Request?): InvokeContractV1Response + /** + * POST /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows + * Responds with a list of the flows on the Corda node. + * + * @param listFlowsV1Request (optional) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#listFlowsV1 + */ fun listFlowsV1(listFlowsV1Request: ListFlowsV1Request?): ListFlowsV1Response + /** + * POST /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * + * @param body (optional) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#networkMapV1 + */ fun networkMapV1(body: kotlin.Any?): List + /** + * POST /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor : Start monitoring corda changes (transactions) of given state class + * + * @param startMonitorV1Request (optional) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#startMonitorV1 + */ fun startMonitorV1(startMonitorV1Request: StartMonitorV1Request?): StartMonitorV1Response + /** + * DELETE /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor : Stop monitoring corda changes (transactions) of given state class + * + * @param stopMonitorV1Request (optional) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#stopMonitorV1 + */ fun stopMonitorV1(stopMonitorV1Request: StopMonitorV1Request?): StopMonitorV1Response } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Request.kt index d25c3e40c9..23f3f742d5 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Request.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -20,12 +15,15 @@ import javax.validation.Valid data class ClearMonitorTransactionsV1Request( @get:Size(min=1,max=1024) - @field:JsonProperty("clientAppId", required = true) val clientAppId: kotlin.String, + @Schema(example = "frond_v1_x_7Hdg6s", required = true, description = "ID of a client application that wants to monitor the state changes") + @get:JsonProperty("clientAppId", required = true) val clientAppId: kotlin.String, @get:Size(min=1,max=1024) - @field:JsonProperty("stateFullClassName", required = true) val stateFullClassName: kotlin.String, + @Schema(example = "net.corda.samples.example.states.IOUState", required = true, description = "The fully qualified name of the Corda state to monitor") + @get:JsonProperty("stateFullClassName", required = true) val stateFullClassName: kotlin.String, - @field:JsonProperty("txIndexes", required = true) val txIndexes: kotlin.collections.List = arrayListOf() + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("txIndexes", required = true) val txIndexes: kotlin.collections.List = arrayListOf() ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Response.kt index 3d22addb69..78601a3b8c 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Response.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -18,9 +13,11 @@ import javax.validation.Valid */ data class ClearMonitorTransactionsV1Response( - @field:JsonProperty("success", required = true) val success: kotlin.Boolean, + @Schema(example = "null", required = true, description = "Flag set to true if operation completed correctly.") + @get:JsonProperty("success", required = true) val success: kotlin.Boolean, - @field:JsonProperty("msg", required = true) val msg: kotlin.String + @Schema(example = "null", required = true, description = "Message describing operation status or any errors that occurred.") + @get:JsonProperty("msg", required = true) val msg: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaNodeSshCredentials.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaNodeSshCredentials.kt index 2382e7f695..47d6bf7b52 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaNodeSshCredentials.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaNodeSshCredentials.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -22,20 +17,25 @@ import javax.validation.Valid data class CordaNodeSshCredentials( @get:Size(min=1,max=65535) - @field:JsonProperty("hostKeyEntry", required = true) val hostKeyEntry: kotlin.String, + @Schema(example = "localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13", required = true, description = "") + @get:JsonProperty("hostKeyEntry", required = true) val hostKeyEntry: kotlin.String, @get:Size(min=1,max=32) - @field:JsonProperty("username", required = true) val username: kotlin.String, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("username", required = true) val username: kotlin.String, @get:Size(min=1,max=4096) - @field:JsonProperty("password", required = true) val password: kotlin.String, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("password", required = true) val password: kotlin.String, @get:Size(min=1,max=4096) - @field:JsonProperty("hostname", required = true) val hostname: kotlin.String, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("hostname", required = true) val hostname: kotlin.String, @get:Min(1) @get:Max(65535) - @field:JsonProperty("port", required = true) val port: kotlin.Int + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("port", required = true) val port: kotlin.Int ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaRpcCredentials.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaRpcCredentials.kt index 18a44e48f1..3586868388 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaRpcCredentials.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaRpcCredentials.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -21,17 +16,21 @@ import javax.validation.Valid data class CordaRpcCredentials( @get:Size(min=1,max=65535) - @field:JsonProperty("hostname", required = true) val hostname: kotlin.String, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("hostname", required = true) val hostname: kotlin.String, @get:Min(1) @get:Max(65535) - @field:JsonProperty("port", required = true) val port: kotlin.Int, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("port", required = true) val port: kotlin.Int, @get:Size(min=1,max=1024) - @field:JsonProperty("username", required = true) val username: kotlin.String, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("username", required = true) val username: kotlin.String, @get:Size(min=1,max=65535) - @field:JsonProperty("password", required = true) val password: kotlin.String + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("password", required = true) val password: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaX500Name.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaX500Name.kt index 794d04dbaa..38f1870dcd 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaX500Name.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaX500Name.kt @@ -3,14 +3,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.X500Principal -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -24,20 +19,27 @@ import javax.validation.Valid */ data class CordaX500Name( - @field:JsonProperty("organisation", required = true) val organisation: kotlin.String, + @Schema(example = "PartyA", required = true, description = "") + @get:JsonProperty("organisation", required = true) val organisation: kotlin.String, - @field:JsonProperty("locality", required = true) val locality: kotlin.String, + @Schema(example = "London", required = true, description = "") + @get:JsonProperty("locality", required = true) val locality: kotlin.String, - @field:JsonProperty("country", required = true) val country: kotlin.String, + @Schema(example = "GB", required = true, description = "") + @get:JsonProperty("country", required = true) val country: kotlin.String, @field:Valid - @field:JsonProperty("x500Principal", required = true) val x500Principal: X500Principal, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("x500Principal", required = true) val x500Principal: X500Principal, - @field:JsonProperty("commonName") val commonName: kotlin.String? = null, + @Schema(example = "null", description = "") + @get:JsonProperty("commonName") val commonName: kotlin.String? = null, - @field:JsonProperty("organisationUnit") val organisationUnit: kotlin.String? = null, + @Schema(example = "null", description = "") + @get:JsonProperty("organisationUnit") val organisationUnit: kotlin.String? = null, - @field:JsonProperty("state") val state: kotlin.String? = null + @Schema(example = "null", description = "") + @get:JsonProperty("state") val state: kotlin.String? = null ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordappDeploymentConfig.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordappDeploymentConfig.kt index 2f154ff425..89cbb77074 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordappDeploymentConfig.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordappDeploymentConfig.kt @@ -4,14 +4,9 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.CordaNodeSshCredentials import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.CordaRpcCredentials -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -25,22 +20,28 @@ import javax.validation.Valid data class CordappDeploymentConfig( @field:Valid - @field:JsonProperty("sshCredentials", required = true) val sshCredentials: CordaNodeSshCredentials, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("sshCredentials", required = true) val sshCredentials: CordaNodeSshCredentials, @field:Valid - @field:JsonProperty("rpcCredentials", required = true) val rpcCredentials: CordaRpcCredentials, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("rpcCredentials", required = true) val rpcCredentials: CordaRpcCredentials, @get:Size(min=1,max=65535) - @field:JsonProperty("cordaNodeStartCmd", required = true) val cordaNodeStartCmd: kotlin.String, + @Schema(example = "./build/nodes/runNodes", required = true, description = "The shell command to execute in order to start back up a Corda node after having placed new jars in the cordapp directory of said node.") + @get:JsonProperty("cordaNodeStartCmd", required = true) val cordaNodeStartCmd: kotlin.String, @get:Size(min=1,max=2048) - @field:JsonProperty("cordappDir", required = true) val cordappDir: kotlin.String, + @Schema(example = "null", required = true, description = "The absolute file system path where the Corda Node is expecting deployed Cordapp jar files to be placed.") + @get:JsonProperty("cordappDir", required = true) val cordappDir: kotlin.String, @get:Size(min=1,max=2048) - @field:JsonProperty("cordaJarPath", required = true) val cordaJarPath: kotlin.String, + @Schema(example = "null", required = true, description = "The absolute file system path where the corda.jar file of the node can be found. This is used to execute database schema migrations where applicable (H2 database in use in development environments).") + @get:JsonProperty("cordaJarPath", required = true) val cordaJarPath: kotlin.String, @get:Size(min=1,max=2048) - @field:JsonProperty("nodeBaseDirPath", required = true) val nodeBaseDirPath: kotlin.String + @Schema(example = "null", required = true, description = "The absolute file system path where the base directory of the Corda node can be found. This is used to pass in to corda.jar when being invoked for certain tasks such as executing database schema migrations for a deployed contract.") + @get:JsonProperty("nodeBaseDirPath", required = true) val nodeBaseDirPath: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordappInfo.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordappInfo.kt index 31254d2b70..705f6a38ea 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordappInfo.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordappInfo.kt @@ -3,14 +3,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.SHA256 -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * A CordappInfo describes a single CorDapp currently installed on the node @@ -27,23 +22,32 @@ import javax.validation.Valid data class CordappInfo( @field:Valid - @field:JsonProperty("jarHash", required = true) val jarHash: SHA256, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("jarHash", required = true) val jarHash: SHA256, - @field:JsonProperty("licence", required = true) val licence: kotlin.String, + @Schema(example = "null", required = true, description = "The name of the licence this CorDapp is released under") + @get:JsonProperty("licence", required = true) val licence: kotlin.String, - @field:JsonProperty("minimumPlatformVersion", required = true) val minimumPlatformVersion: kotlin.Int, + @Schema(example = "null", required = true, description = "The minimum platform version the node must be at for the CorDapp to run") + @get:JsonProperty("minimumPlatformVersion", required = true) val minimumPlatformVersion: kotlin.Int, - @field:JsonProperty("name", required = true) val name: kotlin.String, + @Schema(example = "null", required = true, description = "The name of the JAR file that defines the CorDapp") + @get:JsonProperty("name", required = true) val name: kotlin.String, - @field:JsonProperty("shortName", required = true) val shortName: kotlin.String, + @Schema(example = "null", required = true, description = "The name of the CorDapp") + @get:JsonProperty("shortName", required = true) val shortName: kotlin.String, - @field:JsonProperty("targetPlatformVersion", required = true) val targetPlatformVersion: kotlin.Int, + @Schema(example = "null", required = true, description = "The target platform version this CorDapp has been tested against") + @get:JsonProperty("targetPlatformVersion", required = true) val targetPlatformVersion: kotlin.Int, - @field:JsonProperty("type", required = true) val type: kotlin.String, + @Schema(example = "null", required = true, description = "A description of what sort of CorDapp this is - either a contract, workflow, or a combination.") + @get:JsonProperty("type", required = true) val type: kotlin.String, - @field:JsonProperty("vendor", required = true) val vendor: kotlin.String, + @Schema(example = "null", required = true, description = "The vendor of this CorDapp") + @get:JsonProperty("vendor", required = true) val vendor: kotlin.String, - @field:JsonProperty("version", required = true) val version: kotlin.String + @Schema(example = "null", required = true, description = "The version of this CorDapp") + @get:JsonProperty("version", required = true) val version: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsBadRequestV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsBadRequestV1Response.kt index 44a43fd809..2a34f6f688 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsBadRequestV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsBadRequestV1Response.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -17,7 +12,8 @@ import javax.validation.Valid */ data class DeployContractJarsBadRequestV1Response( - @field:JsonProperty("errors", required = true) val errors: kotlin.collections.List + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("errors", required = true) val errors: kotlin.collections.List ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsSuccessV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsSuccessV1Response.kt index 37df9195c6..1f331e5ad6 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsSuccessV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsSuccessV1Response.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -17,7 +12,8 @@ import javax.validation.Valid */ data class DeployContractJarsSuccessV1Response( - @field:JsonProperty("deployedJarFiles", required = true) val deployedJarFiles: kotlin.collections.List + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("deployedJarFiles", required = true) val deployedJarFiles: kotlin.collections.List ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsV1Request.kt index 3031a01b25..cdf49af1f1 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DeployContractJarsV1Request.kt @@ -4,14 +4,9 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.CordappDeploymentConfig import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.JarFile -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -21,10 +16,12 @@ import javax.validation.Valid data class DeployContractJarsV1Request( @field:Valid - @field:JsonProperty("cordappDeploymentConfigs", required = true) val cordappDeploymentConfigs: kotlin.collections.List = arrayListOf(), + @Schema(example = "null", required = true, description = "The list of deployment configurations pointing to the nodes where the provided cordapp jar files are to be deployed .") + @get:JsonProperty("cordappDeploymentConfigs", required = true) val cordappDeploymentConfigs: kotlin.collections.List = arrayListOf(), @field:Valid - @field:JsonProperty("jarFiles", required = true) val jarFiles: kotlin.collections.List + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("jarFiles", required = true) val jarFiles: kotlin.collections.List ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Request.kt index f32c3cefc9..7aeb966a59 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Request.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -18,7 +13,8 @@ import javax.validation.Valid data class DiagnoseNodeV1Request( @get:Size(min=0,max=1024) - @field:JsonProperty("nodeIds") val nodeIds: kotlin.collections.List? = arrayListOf() + @Schema(example = "null", description = "Optional property specifying which Corda Node should be the one being diagnosed in case the Connector has multiple connections established for different nodes (which is not yet a supported feature, but we want to keep this possibility open for the future).") + @get:JsonProperty("nodeIds") val nodeIds: kotlin.collections.List? = arrayListOf() ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Response.kt index ff24a5f8f3..b2c796f30b 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Response.kt @@ -3,14 +3,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.NodeDiagnosticInfo -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -19,7 +14,8 @@ import javax.validation.Valid data class DiagnoseNodeV1Response( @field:Valid - @field:JsonProperty("nodeDiagnosticInfo", required = true) val nodeDiagnosticInfo: NodeDiagnosticInfo + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("nodeDiagnosticInfo", required = true) val nodeDiagnosticInfo: NodeDiagnosticInfo ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowInvocationType.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowInvocationType.kt index 8168c7de61..4d33b6dbf8 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowInvocationType.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowInvocationType.kt @@ -1,15 +1,11 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonValue import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * Determines which flow starting method will be used on the back-end when invoking the flow. Based on the value here the plugin back-end might invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() method. Streamed responses are aggregated and returned in a single response to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. do. @@ -18,8 +14,6 @@ import javax.validation.Valid enum class FlowInvocationType(val value: kotlin.String) { @JsonProperty("TRACKED_FLOW_DYNAMIC") TRACKED_FLOW_DYNAMIC("TRACKED_FLOW_DYNAMIC"), - - @JsonProperty("FLOW_DYNAMIC") FLOW_DYNAMIC("FLOW_DYNAMIC"); - + @JsonProperty("FLOW_DYNAMIC") FLOW_DYNAMIC("FLOW_DYNAMIC") } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Request.kt index 1990872221..691cf76d01 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Request.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -19,10 +14,12 @@ import javax.validation.Valid data class GetMonitorTransactionsV1Request( @get:Size(min=1,max=1024) - @field:JsonProperty("clientAppId", required = true) val clientAppId: kotlin.String, + @Schema(example = "frond_v1_x_7Hdg6s", required = true, description = "ID of a client application that wants to monitor the state changes") + @get:JsonProperty("clientAppId", required = true) val clientAppId: kotlin.String, @get:Size(min=1,max=1024) - @field:JsonProperty("stateFullClassName", required = true) val stateFullClassName: kotlin.String + @Schema(example = "net.corda.samples.example.states.IOUState", required = true, description = "The fully qualified name of the Corda state to monitor") + @get:JsonProperty("stateFullClassName", required = true) val stateFullClassName: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Response.kt index 0afb325eb9..6a1ff4e915 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Response.kt @@ -2,15 +2,10 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetMonitorTransactionsV1ResponseTx -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetMonitorTransactionsV1ResponseTxInner +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -21,15 +16,19 @@ import javax.validation.Valid */ data class GetMonitorTransactionsV1Response( - @field:JsonProperty("success", required = true) val success: kotlin.Boolean, + @Schema(example = "null", required = true, description = "Flag set to true if operation completed correctly.") + @get:JsonProperty("success", required = true) val success: kotlin.Boolean, - @field:JsonProperty("msg", required = true) val msg: kotlin.String, + @Schema(example = "null", required = true, description = "Message describing operation status or any errors that occurred.") + @get:JsonProperty("msg", required = true) val msg: kotlin.String, @get:Size(min=1,max=1024) - @field:JsonProperty("stateFullClassName") val stateFullClassName: kotlin.String? = null, + @Schema(example = "net.corda.samples.example.states.IOUState", description = "The fully qualified name of the Corda state to monitor") + @get:JsonProperty("stateFullClassName") val stateFullClassName: kotlin.String? = null, @field:Valid - @field:JsonProperty("tx") val tx: kotlin.collections.List? = arrayListOf() + @Schema(example = "null", description = "") + @get:JsonProperty("tx") val tx: kotlin.collections.List? = arrayListOf() ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1ResponseTx.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1ResponseTx.kt deleted file mode 100644 index f92c0490c5..0000000000 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1ResponseTx.kt +++ /dev/null @@ -1,27 +0,0 @@ -package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model - -import java.util.Objects -import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size -import javax.validation.Valid - -/** - * - * @param index - * @param `data` - */ -data class GetMonitorTransactionsV1ResponseTx( - - @field:JsonProperty("index") val index: kotlin.String? = null, - - @field:JsonProperty("data") val `data`: kotlin.String? = null -) { - -} - diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1ResponseTxInner.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1ResponseTxInner.kt new file mode 100644 index 0000000000..d6e4b14875 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1ResponseTxInner.kt @@ -0,0 +1,24 @@ +package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import javax.validation.constraints.* +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * + * @param index + * @param `data` + */ +data class GetMonitorTransactionsV1ResponseTxInner( + + @Schema(example = "null", description = "") + @get:JsonProperty("index") val index: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("data") val `data`: kotlin.String? = null +) { + +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Request.kt index c888572a93..969457942b 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Request.kt @@ -2,16 +2,12 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.FlowInvocationType import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.JvmObject -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -23,16 +19,20 @@ import javax.validation.Valid data class InvokeContractV1Request( @get:Size(min=1,max=1024) - @field:JsonProperty("flowFullClassName", required = true) val flowFullClassName: kotlin.String, + @Schema(example = "net.corda.samples.obligation.flows.IOUIssueFlow", required = true, description = "The fully qualified name of the Corda flow to invoke") + @get:JsonProperty("flowFullClassName", required = true) val flowFullClassName: kotlin.String, @field:Valid - @field:JsonProperty("flowInvocationType", required = true) val flowInvocationType: FlowInvocationType, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("flowInvocationType", required = true) val flowInvocationType: FlowInvocationType, @field:Valid - @field:JsonProperty("params", required = true) val params: kotlin.collections.List = arrayListOf(), + @Schema(example = "null", required = true, description = "The list of arguments to pass in to the contract method being invoked.") + @get:JsonProperty("params", required = true) val params: kotlin.collections.List = arrayListOf(), @get:Min(0) - @field:JsonProperty("timeoutMs") val timeoutMs: kotlin.Int? = 60000 + @Schema(example = "null", description = "The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing.") + @get:JsonProperty("timeoutMs") val timeoutMs: kotlin.Int? = 60000 ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Response.kt index 9029a3a134..36ea20a548 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/InvokeContractV1Response.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -21,17 +16,22 @@ import javax.validation.Valid */ data class InvokeContractV1Response( - @field:JsonProperty("success", required = true) val success: kotlin.Boolean, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("success", required = true) val success: kotlin.Boolean, @field:Valid - @field:JsonProperty("callOutput", required = true) val callOutput: kotlin.Any, + @Schema(example = "null", required = true, description = "Data returned from the JVM when no transaction is running") + @get:JsonProperty("callOutput", required = true) val callOutput: kotlin.Any, - @field:JsonProperty("flowId", required = true) val flowId: kotlin.String, + @Schema(example = "null", required = true, description = "The id for the flow handle") + @get:JsonProperty("flowId", required = true) val flowId: kotlin.String, @get:Size(min=1,max=1024) - @field:JsonProperty("transactionId") val transactionId: kotlin.String? = null, + @Schema(example = "null", description = "The net.corda.core.flows.StateMachineRunId value returned by the flow execution.") + @get:JsonProperty("transactionId") val transactionId: kotlin.String? = null, - @field:JsonProperty("progress") val progress: kotlin.collections.List? = arrayListOf() + @Schema(example = "null", description = "An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty.") + @get:JsonProperty("progress") val progress: kotlin.collections.List? = arrayListOf() ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JarFile.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JarFile.kt index b55bd99ee2..f967920b79 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JarFile.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JarFile.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -20,13 +15,16 @@ import javax.validation.Valid data class JarFile( @get:Size(min=1,max=255) - @field:JsonProperty("filename", required = true) val filename: kotlin.String, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("filename", required = true) val filename: kotlin.String, - @field:JsonProperty("hasDbMigrations", required = true) val hasDbMigrations: kotlin.Boolean, + @Schema(example = "null", required = true, description = "Indicates whether the cordapp jar in question contains any embedded migrations that Cactus can/should execute between copying the jar into the cordapp directory and starting the node back up.") + @get:JsonProperty("hasDbMigrations", required = true) val hasDbMigrations: kotlin.Boolean, @get:Size(min=1,max=1073741824) - @field:JsonProperty("contentBase64", required = true) val contentBase64: kotlin.String -) : kotlin.collections.HashMap(){ + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("contentBase64", required = true) val contentBase64: kotlin.String +) : kotlin.collections.HashMap{ } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmObject.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmObject.kt index 5a588a1862..c0a3716f1b 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmObject.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmObject.kt @@ -2,16 +2,12 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.JvmType import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.JvmTypeKind -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * Can represent JVM primitive and reference types as well. The jvmTypeKind field indicates which one is being stored. If the jvmTypeKind field is set to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property is filled with a primitive data type supported by the JSON standard such as strings, booleans, numbers, etc. @@ -23,16 +19,20 @@ import javax.validation.Valid data class JvmObject( @field:Valid - @field:JsonProperty("jvmTypeKind", required = true) val jvmTypeKind: JvmTypeKind, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("jvmTypeKind", required = true) val jvmTypeKind: JvmTypeKind, @field:Valid - @field:JsonProperty("jvmType", required = true) val jvmType: JvmType, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("jvmType", required = true) val jvmType: JvmType, @field:Valid - @field:JsonProperty("primitiveValue") val primitiveValue: kotlin.Any? = null, + @Schema(example = "null", description = "") + @get:JsonProperty("primitiveValue") val primitiveValue: kotlin.Any? = null, @field:Valid - @field:JsonProperty("jvmCtorArgs") val jvmCtorArgs: kotlin.collections.List? = arrayListOf() + @Schema(example = "null", description = "") + @get:JsonProperty("jvmCtorArgs") val jvmCtorArgs: kotlin.collections.List? = arrayListOf() ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmType.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmType.kt index 97545ef80c..57ec04f251 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmType.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmType.kt @@ -3,14 +3,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.JvmObject -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * Represents a reference to a JVM type (such as a Java class) @@ -21,13 +16,16 @@ import javax.validation.Valid data class JvmType( @get:Size(min=1,max=65535) - @field:JsonProperty("fqClassName", required = true) val fqClassName: kotlin.String, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("fqClassName", required = true) val fqClassName: kotlin.String, @get:Size(min=1,max=65535) - @field:JsonProperty("constructorName") val constructorName: kotlin.String? = null, + @Schema(example = "null", description = "This parameter is used to specify that the function used to construct this JvmType is not a constructor function but instead is a factory function. Setting this parameter will cause the plugin to look up methods of the class denoted by fqClassName instead of its constructors.") + @get:JsonProperty("constructorName") val constructorName: kotlin.String? = null, @field:Valid - @field:JsonProperty("invocationTarget") val invocationTarget: JvmObject? = null + @Schema(example = "null", description = "") + @get:JsonProperty("invocationTarget") val invocationTarget: JvmObject? = null ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmTypeKind.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmTypeKind.kt index 887d256cf9..1b5a83736e 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmTypeKind.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmTypeKind.kt @@ -1,15 +1,11 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonValue import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -18,8 +14,6 @@ import javax.validation.Valid enum class JvmTypeKind(val value: kotlin.String) { @JsonProperty("PRIMITIVE") PRIMITIVE("PRIMITIVE"), - - @JsonProperty("REFERENCE") REFERENCE("REFERENCE"); - + @JsonProperty("REFERENCE") REFERENCE("REFERENCE") } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Request.kt index 9ed5bf3fbf..bd63411a45 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Request.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -17,7 +12,8 @@ import javax.validation.Valid */ data class ListFlowsV1Request( - @field:JsonProperty("filter") val filter: kotlin.String? = null + @Schema(example = "null", description = "") + @get:JsonProperty("filter") val filter: kotlin.String? = null ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Response.kt index 283533d4ca..80549e5708 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Response.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -17,7 +12,8 @@ import javax.validation.Valid */ data class ListFlowsV1Response( - @field:JsonProperty("flowNames", required = true) val flowNames: kotlin.collections.List = arrayListOf() + @Schema(example = "[\"net.corda.core.flows.ContractUpgradeFlow$Authorise\",\"net.corda.core.flows.ContractUpgradeFlow$Deauthorise\",\"net.corda.core.flows.ContractUpgradeFlow$Initiate\",\"net.corda.finance.flows.CashExitFlow\",\"net.corda.finance.flows.CashIssueAndPaymentFlow\",\"net.corda.finance.flows.CashIssueFlow\",\"net.corda.finance.flows.CashPaymentFlow\",\"net.corda.finance.internal.CashConfigDataFlow\",\"net.corda.samples.obligation.flows.IOUIssueFlow\",\"net.corda.samples.obligation.flows.IOUSettleFlow\",\"net.corda.samples.obligation.flows.IOUTransferFlow\",\"net.corda.samples.obligation.flows.SelfIssueCashFlow\"]", required = true, description = "An array of strings storing the names of the flows as returned by the flowList Corda RPC.") + @get:JsonProperty("flowNames", required = true) val flowNames: kotlin.collections.List = arrayListOf() ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NetworkHostAndPort.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NetworkHostAndPort.kt index 89d50d3afc..e05eb0b0e0 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NetworkHostAndPort.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NetworkHostAndPort.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -18,9 +13,11 @@ import javax.validation.Valid */ data class NetworkHostAndPort( - @field:JsonProperty("host", required = true) val host: kotlin.String, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("host", required = true) val host: kotlin.String, - @field:JsonProperty("port", required = true) val port: java.math.BigDecimal + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("port", required = true) val port: java.math.BigDecimal ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NodeDiagnosticInfo.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NodeDiagnosticInfo.kt index 15b1fe90ff..3e7acacf1a 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NodeDiagnosticInfo.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NodeDiagnosticInfo.kt @@ -3,14 +3,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.CordappInfo -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * A NodeDiagnosticInfo holds information about the current node version. @@ -24,15 +19,20 @@ data class NodeDiagnosticInfo( @field:Valid @get:Size(min=0,max=4096) - @field:JsonProperty("cordapps", required = true) val cordapps: kotlin.collections.List, + @Schema(example = "null", required = true, description = "A list of CorDapps currently installed on this node") + @get:JsonProperty("cordapps", required = true) val cordapps: kotlin.collections.List, - @field:JsonProperty("platformVersion", required = true) val platformVersion: kotlin.Int, + @Schema(example = "null", required = true, description = "The platform version of this node. This number represents a released API version, and should be used to make functionality decisions (e.g. enabling an app feature only if an underlying platform feature exists)") + @get:JsonProperty("platformVersion", required = true) val platformVersion: kotlin.Int, - @field:JsonProperty("revision", required = true) val revision: kotlin.String, + @Schema(example = "null", required = true, description = "The git commit hash this node was built from") + @get:JsonProperty("revision", required = true) val revision: kotlin.String, - @field:JsonProperty("vendor", required = true) val vendor: kotlin.String, + @Schema(example = "null", required = true, description = "The vendor of this node") + @get:JsonProperty("vendor", required = true) val vendor: kotlin.String, - @field:JsonProperty("version", required = true) val version: kotlin.String + @Schema(example = "null", required = true, description = "The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note that this string is effectively freeform, and so should only be used for providing diagnostic information. It should not be used to make functionality decisions (the platformVersion is a better fit for this).") + @get:JsonProperty("version", required = true) val version: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NodeInfo.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NodeInfo.kt index 43e93d628c..386f685ddd 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NodeInfo.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NodeInfo.kt @@ -4,14 +4,9 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.NetworkHostAndPort import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.Party -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -24,17 +19,22 @@ import javax.validation.Valid data class NodeInfo( @field:Valid - @field:JsonProperty("addresses", required = true) val addresses: kotlin.collections.List, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("addresses", required = true) val addresses: kotlin.collections.List, - @field:JsonProperty("platformVersion", required = true) val platformVersion: kotlin.Int, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("platformVersion", required = true) val platformVersion: kotlin.Int, - @field:JsonProperty("serial", required = true) val serial: java.math.BigDecimal, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("serial", required = true) val serial: java.math.BigDecimal, @field:Valid - @field:JsonProperty("legalIdentities", required = true) val legalIdentities: kotlin.collections.List, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("legalIdentities", required = true) val legalIdentities: kotlin.collections.List, @field:Valid - @field:JsonProperty("legalIdentitiesAndCerts", required = true) val legalIdentitiesAndCerts: kotlin.collections.List + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("legalIdentitiesAndCerts", required = true) val legalIdentitiesAndCerts: kotlin.collections.List ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/Party.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/Party.kt index 8451bf7997..9bd9e71e18 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/Party.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/Party.kt @@ -4,14 +4,9 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.CordaX500Name import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.PublicKey -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -21,10 +16,12 @@ import javax.validation.Valid data class Party( @field:Valid - @field:JsonProperty("name", required = true) val name: CordaX500Name, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("name", required = true) val name: CordaX500Name, @field:Valid - @field:JsonProperty("owningKey", required = true) val owningKey: PublicKey + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("owningKey", required = true) val owningKey: PublicKey ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/PublicKey.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/PublicKey.kt index 40332471d6..c9008a7158 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/PublicKey.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/PublicKey.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * An instance of a java.security.PublicKey (which is an interface) implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl @@ -19,11 +14,14 @@ import javax.validation.Valid */ data class PublicKey( - @field:JsonProperty("algorithm", required = true) val algorithm: kotlin.String, + @Schema(example = "EdDSA", required = true, description = "") + @get:JsonProperty("algorithm", required = true) val algorithm: kotlin.String, - @field:JsonProperty("format", required = true) val format: kotlin.String, + @Schema(example = "X.509", required = true, description = "") + @get:JsonProperty("format", required = true) val format: kotlin.String, - @field:JsonProperty("encoded", required = true) val encoded: kotlin.String + @Schema(example = "MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54=", required = true, description = "") + @get:JsonProperty("encoded", required = true) val encoded: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/SHA256.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/SHA256.kt index 1f041f0361..e984f8b21c 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/SHA256.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/SHA256.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * SHA-256 is part of the SHA-2 hash function family. Generated hash is fixed size, 256-bits (32-bytes). @@ -19,11 +14,14 @@ import javax.validation.Valid */ data class SHA256( - @field:JsonProperty("bytes", required = true) val bytes: kotlin.String, + @Schema(example = "Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc=", required = true, description = "") + @get:JsonProperty("bytes", required = true) val bytes: kotlin.String, - @field:JsonProperty("offset", required = true) val offset: kotlin.Int, + @Schema(example = "0", required = true, description = "") + @get:JsonProperty("offset", required = true) val offset: kotlin.Int, - @field:JsonProperty("size", required = true) val propertySize: kotlin.Int + @Schema(example = "32", required = true, description = "") + @get:JsonProperty("size", required = true) val propertySize: kotlin.Int ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Request.kt index 3955d04202..be401ea34b 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Request.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -19,10 +14,12 @@ import javax.validation.Valid data class StartMonitorV1Request( @get:Size(min=1,max=1024) - @field:JsonProperty("clientAppId", required = true) val clientAppId: kotlin.String, + @Schema(example = "frond_v1_x_7Hdg6s", required = true, description = "ID of a client application that wants to monitor the state changes") + @get:JsonProperty("clientAppId", required = true) val clientAppId: kotlin.String, @get:Size(min=1,max=1024) - @field:JsonProperty("stateFullClassName", required = true) val stateFullClassName: kotlin.String + @Schema(example = "net.corda.samples.example.states.IOUState", required = true, description = "The fully qualified name of the Corda state to monitor") + @get:JsonProperty("stateFullClassName", required = true) val stateFullClassName: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Response.kt index c320125102..2d6f41ec9b 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Response.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -18,9 +13,11 @@ import javax.validation.Valid */ data class StartMonitorV1Response( - @field:JsonProperty("success", required = true) val success: kotlin.Boolean, + @Schema(example = "null", required = true, description = "Flag set to true if monitoring started correctly.") + @get:JsonProperty("success", required = true) val success: kotlin.Boolean, - @field:JsonProperty("msg", required = true) val msg: kotlin.String + @Schema(example = "null", required = true, description = "Message describing operation status or any errors that occurred.") + @get:JsonProperty("msg", required = true) val msg: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Request.kt index 95aaa62bb2..a5c0347846 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Request.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -19,10 +14,12 @@ import javax.validation.Valid data class StopMonitorV1Request( @get:Size(min=1,max=1024) - @field:JsonProperty("clientAppId", required = true) val clientAppId: kotlin.String, + @Schema(example = "frond_v1_x_7Hdg6s", required = true, description = "ID of a client application that wants to monitor the state changes") + @get:JsonProperty("clientAppId", required = true) val clientAppId: kotlin.String, @get:Size(min=1,max=1024) - @field:JsonProperty("stateFullClassName", required = true) val stateFullClassName: kotlin.String + @Schema(example = "net.corda.samples.example.states.IOUState", required = true, description = "The fully qualified name of the Corda state to monitor") + @get:JsonProperty("stateFullClassName", required = true) val stateFullClassName: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Response.kt index 7c0413fac4..498e861849 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Response.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -18,9 +13,11 @@ import javax.validation.Valid */ data class StopMonitorV1Response( - @field:JsonProperty("success", required = true) val success: kotlin.Boolean, + @Schema(example = "null", required = true, description = "Flag set to true if operation completed correctly.") + @get:JsonProperty("success", required = true) val success: kotlin.Boolean, - @field:JsonProperty("msg", required = true) val msg: kotlin.String + @Schema(example = "null", required = true, description = "Message describing operation status or any errors that occurred.") + @get:JsonProperty("msg", required = true) val msg: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/X500Principal.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/X500Principal.kt index b38eac5bcd..45a0a11df7 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/X500Principal.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/X500Principal.kt @@ -2,14 +2,9 @@ package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size +import javax.validation.constraints.* import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema /** * @@ -18,9 +13,11 @@ import javax.validation.Valid */ data class X500Principal( - @field:JsonProperty("name", required = true) val name: kotlin.String, + @Schema(example = "O=PartyA,L=London,C=GB", required = true, description = "") + @get:JsonProperty("name", required = true) val name: kotlin.String, - @field:JsonProperty("encoded", required = true) val encoded: kotlin.String + @Schema(example = "MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ==", required = true, description = "Base64 encoded public key") + @get:JsonProperty("encoded", required = true) val encoded: kotlin.String ) { } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/resources/openapi.yaml b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/resources/openapi.yaml new file mode 100644 index 0000000000..72188e8b42 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/resources/openapi.yaml @@ -0,0 +1,1387 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Corda ledger + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Corda + version: 0.3.0 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars: + post: + operationId: deployContractJarsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsSuccessV1Response' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsBadRequestV1Response' + description: Bad Request + summary: "Deploys a set of jar files (Cordapps, e.g. the contracts in Corda\ + \ speak)." + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a Corda ledger (e.g. a flow) + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor: + post: + operationId: startMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Response' + description: OK + summary: Start monitoring corda changes (transactions) of given state class + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions: + get: + operationId: GetMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response' + description: OK + summary: Get transactions for monitored state classes. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions + verbLowerCase: get + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions: + delete: + operationId: ClearMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Response' + description: OK + summary: Clear transactions from internal store so they'll not be available + by GetMonitorTransactionsV1 anymore. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions + verbLowerCase: delete + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor: + delete: + operationId: stopMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Response' + description: OK + summary: Stop monitoring corda changes (transactions) of given state class + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor + verbLowerCase: delete + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map: + post: + description: "Responds with a snapshot of the network map as provided by the\ + \ Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun\ + \ networkMapSnapshot(): List" + operationId: networkMapV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows: + post: + description: Responds with a list of the flows on the Corda node. + operationId: listFlowsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node: + post: + description: Responds with diagnostic information about the Corda node + operationId: diagnoseNodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics +components: + schemas: + SHA256: + description: "SHA-256 is part of the SHA-2 hash function family. Generated hash\ + \ is fixed size, 256-bits (32-bytes)." + example: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + externalDocs: + description: Official Corda documentation of the SHA256 class. + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.crypto/-secure-hash/-s-h-a256/index.html + properties: + bytes: + example: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + type: string + offset: + example: 0 + type: integer + size: + example: 32 + type: integer + required: + - bytes + - offset + - size + type: object + CordappInfo: + description: A CordappInfo describes a single CorDapp currently installed on + the node + example: + licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + externalDocs: + description: Official Corda Documentation of the class CordappInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.cordapp/-cordapp-info/index.html + properties: + jarHash: + $ref: '#/components/schemas/SHA256' + licence: + description: The name of the licence this CorDapp is released under + type: string + minimumPlatformVersion: + description: The minimum platform version the node must be at for the CorDapp + to run + type: integer + name: + description: The name of the JAR file that defines the CorDapp + type: string + shortName: + description: The name of the CorDapp + type: string + targetPlatformVersion: + description: The target platform version this CorDapp has been tested against + type: integer + type: + description: "A description of what sort of CorDapp this is - either a contract,\ + \ workflow, or a combination." + type: string + vendor: + description: The vendor of this CorDapp + type: string + version: + description: The version of this CorDapp + type: string + required: + - jarHash + - licence + - minimumPlatformVersion + - name + - shortName + - targetPlatformVersion + - type + - vendor + - version + type: object + NodeDiagnosticInfo: + description: A NodeDiagnosticInfo holds information about the current node version. + example: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + externalDocs: + description: Official Corda Documentation of the class NodeDiagnosticInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.node/-node-diagnostic-info/index.html + properties: + cordapps: + description: A list of CorDapps currently installed on this node + items: + $ref: '#/components/schemas/CordappInfo' + maxItems: 4096 + minItems: 0 + type: array + platformVersion: + description: "The platform version of this node. This number represents\ + \ a released API version, and should be used to make functionality decisions\ + \ (e.g. enabling an app feature only if an underlying platform feature\ + \ exists)" + type: integer + revision: + description: The git commit hash this node was built from + type: string + vendor: + description: The vendor of this node + type: string + version: + description: "The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note\ + \ that this string is effectively freeform, and so should only be used\ + \ for providing diagnostic information. It should not be used to make\ + \ functionality decisions (the platformVersion is a better fit for this)." + type: string + required: + - cordapps + - platformVersion + - revision + - vendor + - version + type: object + FlowInvocationType: + description: Determines which flow starting method will be used on the back-end + when invoking the flow. Based on the value here the plugin back-end might + invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() + method. Streamed responses are aggregated and returned in a single response + to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. + do. + enum: + - TRACKED_FLOW_DYNAMIC + - FLOW_DYNAMIC + nullable: false + type: string + JarFile: + additionalProperties: true + example: + filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + properties: + filename: + maxLength: 255 + minLength: 1 + nullable: false + type: string + hasDbMigrations: + description: Indicates whether the cordapp jar in question contains any + embedded migrations that Cactus can/should execute between copying the + jar into the cordapp directory and starting the node back up. + nullable: false + type: boolean + contentBase64: + format: base64 + maxLength: 1073741824 + minLength: 1 + nullable: false + type: string + required: + - contentBase64 + - filename + - hasDbMigrations + type: object + JvmType: + description: Represents a reference to a JVM type (such as a Java class) + example: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + properties: + fqClassName: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + constructorName: + description: This parameter is used to specify that the function used to + construct this JvmType is not a constructor function but instead is a + factory function. Setting this parameter will cause the plugin to look + up methods of the class denoted by fqClassName instead of its constructors. + maxLength: 65535 + minLength: 1 + nullable: false + type: string + invocationTarget: + $ref: '#/components/schemas/JvmObject' + required: + - fqClassName + type: object + JvmTypeKind: + enum: + - PRIMITIVE + - REFERENCE + nullable: false + type: string + JvmObject: + description: "Can represent JVM primitive and reference types as well. The jvmTypeKind\ + \ field indicates which one is being stored. If the jvmTypeKind field is set\ + \ to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise\ + \ (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property\ + \ is filled with a primitive data type supported by the JSON standard such\ + \ as strings, booleans, numbers, etc." + example: + jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + jvmTypeKind: + $ref: '#/components/schemas/JvmTypeKind' + primitiveValue: + type: object + jvmCtorArgs: + default: [] + items: + $ref: '#/components/schemas/JvmObject' + maxLength: 1024 + minLength: 0 + nullable: false + type: array + jvmType: + $ref: '#/components/schemas/JvmType' + required: + - jvmType + - jvmTypeKind + type: object + CordappDeploymentConfig: + example: + cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + sshCredentials: + $ref: '#/components/schemas/CordaNodeSshCredentials' + rpcCredentials: + $ref: '#/components/schemas/CordaRpcCredentials' + cordaNodeStartCmd: + description: The shell command to execute in order to start back up a Corda + node after having placed new jars in the cordapp directory of said node. + example: ./build/nodes/runNodes + maxLength: 65535 + minLength: 1 + nullable: false + type: string + cordappDir: + description: The absolute file system path where the Corda Node is expecting + deployed Cordapp jar files to be placed. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + cordaJarPath: + description: The absolute file system path where the corda.jar file of the + node can be found. This is used to execute database schema migrations + where applicable (H2 database in use in development environments). + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeBaseDirPath: + description: The absolute file system path where the base directory of the + Corda node can be found. This is used to pass in to corda.jar when being + invoked for certain tasks such as executing database schema migrations + for a deployed contract. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + required: + - cordaJarPath + - cordaNodeStartCmd + - cordappDir + - nodeBaseDirPath + - rpcCredentials + - sshCredentials + type: object + CordaRpcCredentials: + example: + hostname: hostname + password: password + port: 39501 + username: username + properties: + hostname: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + username: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + password: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - hostname + - password + - port + - username + type: object + CordaNodeSshCredentials: + example: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + hostKeyEntry: + example: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + maxLength: 65535 + minLength: 1 + nullable: false + type: string + username: + maxLength: 32 + minLength: 1 + nullable: false + type: string + password: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + hostname: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + required: + - hostKeyEntry + - hostname + - password + - port + - username + type: object + DeployContractJarsV1Request: + additionalProperties: false + example: + jarFiles: + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + cordappDeploymentConfigs: + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + cordappDeploymentConfigs: + default: [] + description: The list of deployment configurations pointing to the nodes + where the provided cordapp jar files are to be deployed . + items: + $ref: '#/components/schemas/CordappDeploymentConfig' + maxLength: 1024 + minLength: 0 + type: array + jarFiles: + items: + $ref: '#/components/schemas/JarFile' + nullable: false + type: array + required: + - cordappDeploymentConfigs + - jarFiles + type: object + DeployContractJarsSuccessV1Response: + example: + deployedJarFiles: + - deployedJarFiles + - deployedJarFiles + properties: + deployedJarFiles: + items: + minItems: 1 + nullable: false + type: string + type: array + required: + - deployedJarFiles + type: object + DeployContractJarsBadRequestV1Response: + properties: + errors: + items: + maxItems: 2048 + maxLength: 65535 + minItems: 1 + minLength: 1 + type: string + type: array + required: + - errors + type: object + InvokeContractV1Request: + additionalProperties: false + example: + flowInvocationType: null + timeoutMs: 0 + flowFullClassName: net.corda.samples.obligation.flows.IOUIssueFlow + params: + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + flowFullClassName: + description: The fully qualified name of the Corda flow to invoke + example: net.corda.samples.obligation.flows.IOUIssueFlow + maxLength: 1024 + minLength: 1 + nullable: false + type: string + flowInvocationType: + $ref: '#/components/schemas/FlowInvocationType' + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: + $ref: '#/components/schemas/JvmObject' + nullable: false + type: array + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. + minimum: 0 + nullable: false + type: integer + required: + - flowFullClassName + - flowInvocationType + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + callOutput: "{}" + success: true + progress: + - progress + - progress + flowId: flowId + transactionId: transactionId + properties: + success: + nullable: false + type: boolean + callOutput: + description: Data returned from the JVM when no transaction is running + type: object + transactionId: + description: The net.corda.core.flows.StateMachineRunId value returned by + the flow execution. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + progress: + default: [] + description: "An array of strings representing the aggregated stream of\ + \ progress updates provided by a *tracked* flow invocation. If the flow\ + \ invocation was not tracked, this array is still returned, but as empty." + items: + minItems: 0 + type: string + type: array + flowId: + description: The id for the flow handle + type: string + required: + - callOutput + - flowId + - success + type: object + StartMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StartMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if monitoring started correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + GetMonitorTransactionsV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + GetMonitorTransactionsV1Response: + example: + msg: msg + tx: + - data: data + index: index + - data: data + index: index + success: true + stateFullClassName: net.corda.samples.example.states.IOUState + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + tx: + default: [] + items: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response_tx_inner' + type: array + required: + - msg + - success + type: object + ClearMonitorTransactionsV1Request: + additionalProperties: false + example: + txIndexes: + - txIndexes + - txIndexes + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + txIndexes: + default: [] + items: + type: string + type: array + required: + - clientAppId + - stateFullClassName + - txIndexes + type: object + ClearMonitorTransactionsV1Response: + additionalProperties: false + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + StopMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StopMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + ListFlowsV1Request: + additionalProperties: false + example: + filter: filter + properties: + filter: + type: string + type: object + ListFlowsV1Response: + example: + flowNames: + - net.corda.core.flows.ContractUpgradeFlow$Authorise + - net.corda.core.flows.ContractUpgradeFlow$Deauthorise + - net.corda.core.flows.ContractUpgradeFlow$Initiate + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + properties: + flowNames: + default: [] + description: An array of strings storing the names of the flows as returned + by the flowList Corda RPC. + example: + - net.corda.core.flows.ContractUpgradeFlow$Authorise + - net.corda.core.flows.ContractUpgradeFlow$Deauthorise + - net.corda.core.flows.ContractUpgradeFlow$Initiate + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + items: + minItems: 0 + type: string + type: array + required: + - flowNames + type: object + NetworkHostAndPort: + example: + port: 0.8008281904610115 + host: host + properties: + host: + type: string + port: + type: number + required: + - host + - port + type: object + PartyAndCertificate: + type: object + PublicKey: + description: An instance of a java.security.PublicKey (which is an interface) + implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl + example: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + properties: + algorithm: + example: EdDSA + type: string + format: + example: X.509 + type: string + encoded: + example: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + type: string + required: + - algorithm + - encoded + - format + type: object + X500Principal: + example: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + properties: + name: + example: "O=PartyA,L=London,C=GB" + type: string + encoded: + description: Base64 encoded public key + example: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + type: string + required: + - encoded + - name + type: object + CordaX500Name: + example: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + commonName: + type: string + organisationUnit: + type: string + organisation: + example: PartyA + type: string + locality: + example: London + type: string + state: + type: string + country: + example: GB + type: string + x500Principal: + $ref: '#/components/schemas/X500Principal' + required: + - country + - locality + - organisation + - x500Principal + type: object + Party: + example: + owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + name: + $ref: '#/components/schemas/CordaX500Name' + owningKey: + $ref: '#/components/schemas/PublicKey' + required: + - name + - owningKey + type: object + NodeInfo: + example: + legalIdentities: + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + addresses: + - port: 0.8008281904610115 + host: host + - port: 0.8008281904610115 + host: host + serial: 1.4658129805029452 + platformVersion: 6 + legalIdentitiesAndCerts: + - null + - null + properties: + addresses: + items: + $ref: '#/components/schemas/NetworkHostAndPort' + type: array + platformVersion: + type: integer + serial: + type: number + legalIdentities: + items: + $ref: '#/components/schemas/Party' + type: array + legalIdentitiesAndCerts: + items: + $ref: '#/components/schemas/PartyAndCertificate' + type: array + required: + - addresses + - legalIdentities + - legalIdentitiesAndCerts + - platformVersion + - serial + type: object + NetworkMapV1Request: + type: object + NetworkMapV1Response: + items: + $ref: '#/components/schemas/NodeInfo' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + DiagnoseNodeV1Request: + additionalProperties: false + example: + nodeIds: + - nodeIds + - nodeIds + - nodeIds + - nodeIds + - nodeIds + properties: + nodeIds: + default: [] + description: "Optional property specifying which Corda Node should be the\ + \ one being diagnosed in case the Connector has multiple connections established\ + \ for different nodes (which is not yet a supported feature, but we want\ + \ to keep this possibility open for the future)." + items: + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + type: object + DiagnoseNodeV1Response: + example: + nodeDiagnosticInfo: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + properties: + nodeDiagnosticInfo: + $ref: '#/components/schemas/NodeDiagnosticInfo' + required: + - nodeDiagnosticInfo + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetMonitorTransactionsV1Response_tx_inner: + example: + data: data + index: index + properties: + index: + type: string + data: + minItems: 0 + type: string + type: object diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index 3b099a4f68..935e06c407 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -16,7 +16,7 @@ docs/DiagnoseNodeV1Response.md docs/FlowInvocationType.md docs/GetMonitorTransactionsV1Request.md docs/GetMonitorTransactionsV1Response.md -docs/GetMonitorTransactionsV1ResponseTx.md +docs/GetMonitorTransactionsV1ResponseTxInner.md docs/InvokeContractV1Request.md docs/InvokeContractV1Response.md docs/JarFile.md @@ -44,7 +44,7 @@ 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 @@ -52,6 +52,7 @@ 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 @@ -73,7 +74,7 @@ src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Response.kt src/main/kotlin/org/openapitools/client/models/FlowInvocationType.kt src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Request.kt src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Response.kt -src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1ResponseTx.kt +src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1ResponseTxInner.kt src/main/kotlin/org/openapitools/client/models/InvokeContractV1Request.kt src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt src/main/kotlin/org/openapitools/client/models/JarFile.kt diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/README.md index 1ea566bdad..972aa625b0 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus Plugin - Connector Corda +Can perform basic tasks on a Corda ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.3.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 @@ -65,7 +74,7 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.FlowInvocationType](docs/FlowInvocationType.md) - [org.openapitools.client.models.GetMonitorTransactionsV1Request](docs/GetMonitorTransactionsV1Request.md) - [org.openapitools.client.models.GetMonitorTransactionsV1Response](docs/GetMonitorTransactionsV1Response.md) - - [org.openapitools.client.models.GetMonitorTransactionsV1ResponseTx](docs/GetMonitorTransactionsV1ResponseTx.md) + - [org.openapitools.client.models.GetMonitorTransactionsV1ResponseTxInner](docs/GetMonitorTransactionsV1ResponseTxInner.md) - [org.openapitools.client.models.InvokeContractV1Request](docs/InvokeContractV1Request.md) - [org.openapitools.client.models.InvokeContractV1Response](docs/InvokeContractV1Response.md) - [org.openapitools.client.models.JarFile](docs/JarFile.md) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md index 3a66874e7f..3e1a52a27e 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/DefaultApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: text/plain + - **Accept**: Not defined # **invokeContractV1** diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/GetMonitorTransactionsV1Response.md b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/GetMonitorTransactionsV1Response.md index 0cb77b1b6f..4074ea8a77 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/GetMonitorTransactionsV1Response.md +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/GetMonitorTransactionsV1Response.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **success** | **kotlin.Boolean** | Flag set to true if operation completed correctly. | **msg** | **kotlin.String** | Message describing operation status or any errors that occurred. | **stateFullClassName** | **kotlin.String** | The fully qualified name of the Corda state to monitor | [optional] -**tx** | [**kotlin.collections.List<GetMonitorTransactionsV1ResponseTx>**](GetMonitorTransactionsV1ResponseTx.md) | | [optional] +**tx** | [**kotlin.collections.List<GetMonitorTransactionsV1ResponseTxInner>**](GetMonitorTransactionsV1ResponseTxInner.md) | | [optional] diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/GetMonitorTransactionsV1ResponseTxInner.md b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/GetMonitorTransactionsV1ResponseTxInner.md new file mode 100644 index 0000000000..ac414e83d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/docs/GetMonitorTransactionsV1ResponseTxInner.md @@ -0,0 +1,11 @@ + +# GetMonitorTransactionsV1ResponseTxInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **kotlin.String** | | [optional] +**`data`** | **kotlin.String** | | [optional] + + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 9d3fafef2f..2ee32d5289 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -20,6 +15,10 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.ClearMonitorTransactionsV1Request import org.openapitools.client.models.ClearMonitorTransactionsV1Response import org.openapitools.client.models.DeployContractJarsBadRequestV1Response @@ -39,43 +38,45 @@ import org.openapitools.client.models.StartMonitorV1Response import org.openapitools.client.models.StopMonitorV1Request import org.openapitools.client.models.StopMonitorV1Response +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") } } /** - * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. - * - * @param clearMonitorTransactionsV1Request (optional) - * @return ClearMonitorTransactionsV1Response - * @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 - */ + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + * + * @param clearMonitorTransactionsV1Request (optional) + * @return ClearMonitorTransactionsV1Response + * @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 clearMonitorTransactionsV1(clearMonitorTransactionsV1Request: ClearMonitorTransactionsV1Request?) : ClearMonitorTransactionsV1Response { - val localVariableConfig = clearMonitorTransactionsV1RequestConfig(clearMonitorTransactionsV1Request = clearMonitorTransactionsV1Request) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun clearMonitorTransactionsV1(clearMonitorTransactionsV1Request: ClearMonitorTransactionsV1Request? = null) : ClearMonitorTransactionsV1Response { + val localVarResponse = clearMonitorTransactionsV1WithHttpInfo(clearMonitorTransactionsV1Request = clearMonitorTransactionsV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ClearMonitorTransactionsV1Response @@ -93,42 +94,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation clearMonitorTransactionsV1 - * - * @param clearMonitorTransactionsV1Request (optional) - * @return RequestConfig - */ + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + * + * @param clearMonitorTransactionsV1Request (optional) + * @return ApiResponse + * @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 clearMonitorTransactionsV1WithHttpInfo(clearMonitorTransactionsV1Request: ClearMonitorTransactionsV1Request?) : ApiResponse { + val localVariableConfig = clearMonitorTransactionsV1RequestConfig(clearMonitorTransactionsV1Request = clearMonitorTransactionsV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation clearMonitorTransactionsV1 + * + * @param clearMonitorTransactionsV1Request (optional) + * @return RequestConfig + */ fun clearMonitorTransactionsV1RequestConfig(clearMonitorTransactionsV1Request: ClearMonitorTransactionsV1Request?) : RequestConfig { val localVariableBody = clearMonitorTransactionsV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.DELETE, path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). - * - * @param deployContractJarsV1Request (optional) - * @return DeployContractJarsSuccessV1Response - * @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 - */ + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + * + * @param deployContractJarsV1Request (optional) + * @return DeployContractJarsSuccessV1Response + * @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 deployContractJarsV1(deployContractJarsV1Request: DeployContractJarsV1Request?) : DeployContractJarsSuccessV1Response { - val localVariableConfig = deployContractJarsV1RequestConfig(deployContractJarsV1Request = deployContractJarsV1Request) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deployContractJarsV1(deployContractJarsV1Request: DeployContractJarsV1Request? = null) : DeployContractJarsSuccessV1Response { + val localVarResponse = deployContractJarsV1WithHttpInfo(deployContractJarsV1Request = deployContractJarsV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as DeployContractJarsSuccessV1Response @@ -146,42 +166,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation deployContractJarsV1 - * - * @param deployContractJarsV1Request (optional) - * @return RequestConfig - */ + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + * + * @param deployContractJarsV1Request (optional) + * @return ApiResponse + * @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 deployContractJarsV1WithHttpInfo(deployContractJarsV1Request: DeployContractJarsV1Request?) : ApiResponse { + val localVariableConfig = deployContractJarsV1RequestConfig(deployContractJarsV1Request = deployContractJarsV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation deployContractJarsV1 + * + * @param deployContractJarsV1Request (optional) + * @return RequestConfig + */ fun deployContractJarsV1RequestConfig(deployContractJarsV1Request: DeployContractJarsV1Request?) : RequestConfig { val localVariableBody = deployContractJarsV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * Responds with diagnostic information about the Corda node - * @param diagnoseNodeV1Request (optional) - * @return DiagnoseNodeV1Response - * @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 - */ + * + * Responds with diagnostic information about the Corda node + * @param diagnoseNodeV1Request (optional) + * @return DiagnoseNodeV1Response + * @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 diagnoseNodeV1(diagnoseNodeV1Request: DiagnoseNodeV1Request?) : DiagnoseNodeV1Response { - val localVariableConfig = diagnoseNodeV1RequestConfig(diagnoseNodeV1Request = diagnoseNodeV1Request) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun diagnoseNodeV1(diagnoseNodeV1Request: DiagnoseNodeV1Request? = null) : DiagnoseNodeV1Response { + val localVarResponse = diagnoseNodeV1WithHttpInfo(diagnoseNodeV1Request = diagnoseNodeV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as DiagnoseNodeV1Response @@ -199,42 +238,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation diagnoseNodeV1 - * - * @param diagnoseNodeV1Request (optional) - * @return RequestConfig - */ + * + * Responds with diagnostic information about the Corda node + * @param diagnoseNodeV1Request (optional) + * @return ApiResponse + * @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 diagnoseNodeV1WithHttpInfo(diagnoseNodeV1Request: DiagnoseNodeV1Request?) : ApiResponse { + val localVariableConfig = diagnoseNodeV1RequestConfig(diagnoseNodeV1Request = diagnoseNodeV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation diagnoseNodeV1 + * + * @param diagnoseNodeV1Request (optional) + * @return RequestConfig + */ fun diagnoseNodeV1RequestConfig(diagnoseNodeV1Request: DiagnoseNodeV1Request?) : RequestConfig { val localVariableBody = diagnoseNodeV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Get transactions for monitored state classes. - * - * @param getMonitorTransactionsV1Request (optional) - * @return GetMonitorTransactionsV1Response - * @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 transactions for monitored state classes. + * + * @param getMonitorTransactionsV1Request (optional) + * @return GetMonitorTransactionsV1Response + * @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 getMonitorTransactionsV1(getMonitorTransactionsV1Request: GetMonitorTransactionsV1Request?) : GetMonitorTransactionsV1Response { - val localVariableConfig = getMonitorTransactionsV1RequestConfig(getMonitorTransactionsV1Request = getMonitorTransactionsV1Request) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getMonitorTransactionsV1(getMonitorTransactionsV1Request: GetMonitorTransactionsV1Request? = null) : GetMonitorTransactionsV1Response { + val localVarResponse = getMonitorTransactionsV1WithHttpInfo(getMonitorTransactionsV1Request = getMonitorTransactionsV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as GetMonitorTransactionsV1Response @@ -252,41 +310,60 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getMonitorTransactionsV1 - * - * @param getMonitorTransactionsV1Request (optional) - * @return RequestConfig - */ + * Get transactions for monitored state classes. + * + * @param getMonitorTransactionsV1Request (optional) + * @return ApiResponse + * @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 getMonitorTransactionsV1WithHttpInfo(getMonitorTransactionsV1Request: GetMonitorTransactionsV1Request?) : ApiResponse { + val localVariableConfig = getMonitorTransactionsV1RequestConfig(getMonitorTransactionsV1Request = getMonitorTransactionsV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getMonitorTransactionsV1 + * + * @param getMonitorTransactionsV1Request (optional) + * @return RequestConfig + */ fun getMonitorTransactionsV1RequestConfig(getMonitorTransactionsV1Request: GetMonitorTransactionsV1Request?) : RequestConfig { val localVariableBody = getMonitorTransactionsV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, 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 - */ + * Get the Prometheus Metrics + * + * @return kotlin.String + * @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) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPrometheusMetricsV1() : kotlin.String { - val localVariableConfig = getPrometheusMetricsV1RequestConfig() - - val localVarResponse = request( - localVariableConfig - ) + val localVarResponse = getPrometheusMetricsV1WithHttpInfo() return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String @@ -304,41 +381,57 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation getPrometheusMetricsV1 - * - * @return RequestConfig - */ + * Get the Prometheus Metrics + * + * @return ApiResponse + * @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 getPrometheusMetricsV1WithHttpInfo() : ApiResponse { + val localVariableConfig = getPrometheusMetricsV1RequestConfig() + + return request( + localVariableConfig + ) + } + + /** + * 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/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Invokes a contract on a Corda ledger (e.g. a flow) - * - * @param invokeContractV1Request (optional) - * @return InvokeContractV1Response - * @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 - */ + * Invokes a contract on a Corda ledger (e.g. a flow) + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @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 invokeContractV1(invokeContractV1Request: InvokeContractV1Request?) : InvokeContractV1Response { - val localVariableConfig = invokeContractV1RequestConfig(invokeContractV1Request = invokeContractV1Request) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun invokeContractV1(invokeContractV1Request: InvokeContractV1Request? = null) : InvokeContractV1Response { + val localVarResponse = invokeContractV1WithHttpInfo(invokeContractV1Request = invokeContractV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as InvokeContractV1Response @@ -356,42 +449,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation invokeContractV1 - * - * @param invokeContractV1Request (optional) - * @return RequestConfig - */ + * Invokes a contract on a Corda ledger (e.g. a flow) + * + * @param invokeContractV1Request (optional) + * @return ApiResponse + * @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 invokeContractV1WithHttpInfo(invokeContractV1Request: InvokeContractV1Request?) : ApiResponse { + val localVariableConfig = invokeContractV1RequestConfig(invokeContractV1Request = invokeContractV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation invokeContractV1 + * + * @param invokeContractV1Request (optional) + * @return RequestConfig + */ fun invokeContractV1RequestConfig(invokeContractV1Request: InvokeContractV1Request?) : RequestConfig { val localVariableBody = invokeContractV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * Responds with a list of the flows on the Corda node. - * @param listFlowsV1Request (optional) - * @return ListFlowsV1Response - * @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 - */ + * + * Responds with a list of the flows on the Corda node. + * @param listFlowsV1Request (optional) + * @return ListFlowsV1Response + * @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 listFlowsV1(listFlowsV1Request: ListFlowsV1Request?) : ListFlowsV1Response { - val localVariableConfig = listFlowsV1RequestConfig(listFlowsV1Request = listFlowsV1Request) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun listFlowsV1(listFlowsV1Request: ListFlowsV1Request? = null) : ListFlowsV1Response { + val localVarResponse = listFlowsV1WithHttpInfo(listFlowsV1Request = listFlowsV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as ListFlowsV1Response @@ -409,42 +521,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation listFlowsV1 - * - * @param listFlowsV1Request (optional) - * @return RequestConfig - */ + * + * Responds with a list of the flows on the Corda node. + * @param listFlowsV1Request (optional) + * @return ApiResponse + * @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 listFlowsV1WithHttpInfo(listFlowsV1Request: ListFlowsV1Request?) : ApiResponse { + val localVariableConfig = listFlowsV1RequestConfig(listFlowsV1Request = listFlowsV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation listFlowsV1 + * + * @param listFlowsV1Request (optional) + * @return RequestConfig + */ fun listFlowsV1RequestConfig(listFlowsV1Request: ListFlowsV1Request?) : RequestConfig { val localVariableBody = listFlowsV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> - * @param body (optional) - * @return kotlin.collections.List - * @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 - */ + * + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * @param body (optional) + * @return kotlin.collections.List + * @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 networkMapV1(body: kotlin.Any?) : kotlin.collections.List { - val localVariableConfig = networkMapV1RequestConfig(body = body) - - val localVarResponse = request>( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun networkMapV1(body: kotlin.Any? = null) : kotlin.collections.List { + val localVarResponse = networkMapV1WithHttpInfo(body = body) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List @@ -462,42 +593,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation networkMapV1 - * - * @param body (optional) - * @return RequestConfig - */ + * + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * @param body (optional) + * @return ApiResponse?> + * @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 networkMapV1WithHttpInfo(body: kotlin.Any?) : ApiResponse?> { + val localVariableConfig = networkMapV1RequestConfig(body = body) + + return request>( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation networkMapV1 + * + * @param body (optional) + * @return RequestConfig + */ fun networkMapV1RequestConfig(body: kotlin.Any?) : RequestConfig { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Start monitoring corda changes (transactions) of given state class - * - * @param startMonitorV1Request (optional) - * @return StartMonitorV1Response - * @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 - */ + * Start monitoring corda changes (transactions) of given state class + * + * @param startMonitorV1Request (optional) + * @return StartMonitorV1Response + * @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 startMonitorV1(startMonitorV1Request: StartMonitorV1Request?) : StartMonitorV1Response { - val localVariableConfig = startMonitorV1RequestConfig(startMonitorV1Request = startMonitorV1Request) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun startMonitorV1(startMonitorV1Request: StartMonitorV1Request? = null) : StartMonitorV1Response { + val localVarResponse = startMonitorV1WithHttpInfo(startMonitorV1Request = startMonitorV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as StartMonitorV1Response @@ -515,42 +665,61 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation startMonitorV1 - * - * @param startMonitorV1Request (optional) - * @return RequestConfig - */ + * Start monitoring corda changes (transactions) of given state class + * + * @param startMonitorV1Request (optional) + * @return ApiResponse + * @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 startMonitorV1WithHttpInfo(startMonitorV1Request: StartMonitorV1Request?) : ApiResponse { + val localVariableConfig = startMonitorV1RequestConfig(startMonitorV1Request = startMonitorV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation startMonitorV1 + * + * @param startMonitorV1Request (optional) + * @return RequestConfig + */ fun startMonitorV1RequestConfig(startMonitorV1Request: StartMonitorV1Request?) : RequestConfig { val localVariableBody = startMonitorV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * Stop monitoring corda changes (transactions) of given state class - * - * @param stopMonitorV1Request (optional) - * @return StopMonitorV1Response - * @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 - */ + * Stop monitoring corda changes (transactions) of given state class + * + * @param stopMonitorV1Request (optional) + * @return StopMonitorV1Response + * @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 stopMonitorV1(stopMonitorV1Request: StopMonitorV1Request?) : StopMonitorV1Response { - val localVariableConfig = stopMonitorV1RequestConfig(stopMonitorV1Request = stopMonitorV1Request) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun stopMonitorV1(stopMonitorV1Request: StopMonitorV1Request? = null) : StopMonitorV1Response { + val localVarResponse = stopMonitorV1WithHttpInfo(stopMonitorV1Request = stopMonitorV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as StopMonitorV1Response @@ -568,23 +737,47 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation stopMonitorV1 - * - * @param stopMonitorV1Request (optional) - * @return RequestConfig - */ + * Stop monitoring corda changes (transactions) of given state class + * + * @param stopMonitorV1Request (optional) + * @return ApiResponse + * @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 stopMonitorV1WithHttpInfo(stopMonitorV1Request: StopMonitorV1Request?) : ApiResponse { + val localVariableConfig = stopMonitorV1RequestConfig(stopMonitorV1Request = stopMonitorV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation stopMonitorV1 + * + * @param stopMonitorV1Request (optional) + * @return RequestConfig + */ fun stopMonitorV1RequestConfig(stopMonitorV1Request: StopMonitorV1Request?) : RequestConfig { val localVariableBody = stopMonitorV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.DELETE, path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor", 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] } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Request.kt index 25aba32af7..92923d2cf7 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param txIndexes */ + data class ClearMonitorTransactionsV1Request ( /* ID of a client application that wants to monitor the state changes */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Response.kt index e22a414029..9b3567f436 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param msg Message describing operation status or any errors that occurred. */ + data class ClearMonitorTransactionsV1Response ( /* Flag set to true if operation completed correctly. */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaNodeSshCredentials.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaNodeSshCredentials.kt index d8e4d30bb5..7fd5f82974 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaNodeSshCredentials.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaNodeSshCredentials.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param port */ + data class CordaNodeSshCredentials ( @Json(name = "hostKeyEntry") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaRpcCredentials.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaRpcCredentials.kt index 56b1b6c23b..728b3e1c13 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaRpcCredentials.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaRpcCredentials.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param password */ + data class CordaRpcCredentials ( @Json(name = "hostname") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaX500Name.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaX500Name.kt index 343338c6f3..2dcb714af9 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaX500Name.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordaX500Name.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -36,6 +31,7 @@ import com.squareup.moshi.Json * @param state */ + data class CordaX500Name ( @Json(name = "organisation") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordappDeploymentConfig.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordappDeploymentConfig.kt index 5d2cb68dea..04c4c7a036 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordappDeploymentConfig.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordappDeploymentConfig.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -36,6 +31,7 @@ import com.squareup.moshi.Json * @param nodeBaseDirPath The absolute file system path where the base directory of the Corda node can be found. This is used to pass in to corda.jar when being invoked for certain tasks such as executing database schema migrations for a deployed contract. */ + data class CordappDeploymentConfig ( @Json(name = "sshCredentials") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordappInfo.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordappInfo.kt index eefa7d5951..1d63d574fb 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordappInfo.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CordappInfo.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -38,6 +33,7 @@ import com.squareup.moshi.Json * @param version The version of this CorDapp */ + data class CordappInfo ( @Json(name = "jarHash") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsBadRequestV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsBadRequestV1Response.kt index 84f9b7bf0b..35b5fc7d23 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsBadRequestV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsBadRequestV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param errors */ + data class DeployContractJarsBadRequestV1Response ( @Json(name = "errors") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsSuccessV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsSuccessV1Response.kt index f0ec1dc101..e4a6d849f4 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsSuccessV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsSuccessV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param deployedJarFiles */ + data class DeployContractJarsSuccessV1Response ( @Json(name = "deployedJarFiles") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsV1Request.kt index ba58a0481a..2862604c00 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DeployContractJarsV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param jarFiles */ + data class DeployContractJarsV1Request ( /* The list of deployment configurations pointing to the nodes where the provided cordapp jar files are to be deployed . */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Request.kt index ee97437fad..a97c762efb 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,11 +24,12 @@ import com.squareup.moshi.Json * @param nodeIds Optional property specifying which Corda Node should be the one being diagnosed in case the Connector has multiple connections established for different nodes (which is not yet a supported feature, but we want to keep this possibility open for the future). */ + data class DiagnoseNodeV1Request ( /* Optional property specifying which Corda Node should be the one being diagnosed in case the Connector has multiple connections established for different nodes (which is not yet a supported feature, but we want to keep this possibility open for the future). */ @Json(name = "nodeIds") - val nodeIds: kotlin.collections.List? = null + val nodeIds: kotlin.collections.List? = arrayListOf() ) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Response.kt index fdbac69303..485b109f6d 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param nodeDiagnosticInfo */ + data class DiagnoseNodeV1Response ( @Json(name = "nodeDiagnosticInfo") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowInvocationType.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowInvocationType.kt index 2255e96df7..2d4b83cb68 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowInvocationType.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowInvocationType.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -50,12 +45,12 @@ enum class FlowInvocationType(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is FlowInvocationType) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is FlowInvocationType) "$data" else null /** * Returns a valid [FlowInvocationType] for [data], null otherwise. */ - fun decode(data: Any?): FlowInvocationType? = data?.let { + fun decode(data: kotlin.Any?): FlowInvocationType? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Request.kt index d87d0287fd..b2b8b472e7 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param stateFullClassName The fully qualified name of the Corda state to monitor */ + data class GetMonitorTransactionsV1Request ( /* ID of a client application that wants to monitor the state changes */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Response.kt index 033b622cb6..55371889ba 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -20,7 +15,7 @@ package org.openapitools.client.models -import org.openapitools.client.models.GetMonitorTransactionsV1ResponseTx +import org.openapitools.client.models.GetMonitorTransactionsV1ResponseTxInner import com.squareup.moshi.Json @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param tx */ + data class GetMonitorTransactionsV1Response ( /* Flag set to true if operation completed correctly. */ @@ -48,7 +44,7 @@ data class GetMonitorTransactionsV1Response ( val stateFullClassName: kotlin.String? = null, @Json(name = "tx") - val tx: kotlin.collections.List? = null + val tx: kotlin.collections.List? = arrayListOf() ) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1ResponseTxInner.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1ResponseTxInner.kt new file mode 100644 index 0000000000..22400a6292 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1ResponseTxInner.kt @@ -0,0 +1,38 @@ +/** + * + * 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 index + * @param `data` + */ + + +data class GetMonitorTransactionsV1ResponseTxInner ( + + @Json(name = "index") + val index: kotlin.String? = null, + + @Json(name = "data") + val `data`: kotlin.String? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Request.kt index eb8ebb20d2..4e15108b58 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -34,6 +29,7 @@ import com.squareup.moshi.Json * @param timeoutMs The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. */ + data class InvokeContractV1Request ( /* The fully qualified name of the Corda flow to invoke */ @@ -49,7 +45,7 @@ data class InvokeContractV1Request ( /* The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. */ @Json(name = "timeoutMs") - val timeoutMs: kotlin.Int? = null + val timeoutMs: kotlin.Int? = 60000 ) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt index 464e91e48f..9d73147524 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/InvokeContractV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param progress An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty. */ + data class InvokeContractV1Response ( @Json(name = "success") @@ -52,7 +48,7 @@ data class InvokeContractV1Response ( /* An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty. */ @Json(name = "progress") - val progress: kotlin.collections.List? = null + val progress: kotlin.collections.List? = arrayListOf() ) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JarFile.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JarFile.kt index 4e711ed85a..232a7b6f6c 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JarFile.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JarFile.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param contentBase64 */ + data class JarFile ( @Json(name = "filename") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmObject.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmObject.kt index e2e34f2e56..117793e7b8 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmObject.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmObject.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -34,6 +29,7 @@ import com.squareup.moshi.Json * @param jvmCtorArgs */ + data class JvmObject ( @Json(name = "jvmTypeKind") @@ -46,7 +42,7 @@ data class JvmObject ( val primitiveValue: kotlin.Any? = null, @Json(name = "jvmCtorArgs") - val jvmCtorArgs: kotlin.collections.List? = null + val jvmCtorArgs: kotlin.collections.List? = arrayListOf() ) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmType.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmType.kt index 5648bd7561..94c7dfd351 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmType.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmType.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param invocationTarget */ + data class JvmType ( @Json(name = "fqClassName") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmTypeKind.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmTypeKind.kt index f6c740261b..3cde33cfff 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmTypeKind.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/JvmTypeKind.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -50,12 +45,12 @@ enum class JvmTypeKind(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is JvmTypeKind) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is JvmTypeKind) "$data" else null /** * Returns a valid [JvmTypeKind] for [data], null otherwise. */ - fun decode(data: Any?): JvmTypeKind? = data?.let { + fun decode(data: kotlin.Any?): JvmTypeKind? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListFlowsV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListFlowsV1Request.kt index 43c118469c..2ce418c61d 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListFlowsV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListFlowsV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param filter */ + data class ListFlowsV1Request ( @Json(name = "filter") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListFlowsV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListFlowsV1Response.kt index 6aa42ca4e8..901dd1d4bb 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListFlowsV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListFlowsV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param flowNames An array of strings storing the names of the flows as returned by the flowList Corda RPC. */ + data class ListFlowsV1Response ( /* An array of strings storing the names of the flows as returned by the flowList Corda RPC. */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NetworkHostAndPort.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NetworkHostAndPort.kt index 4869153ed1..8f8a7afb57 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NetworkHostAndPort.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NetworkHostAndPort.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param port */ + data class NetworkHostAndPort ( @Json(name = "host") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NodeDiagnosticInfo.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NodeDiagnosticInfo.kt index a43e1f69b7..c2849b4349 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NodeDiagnosticInfo.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NodeDiagnosticInfo.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -34,6 +29,7 @@ import com.squareup.moshi.Json * @param version The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note that this string is effectively freeform, and so should only be used for providing diagnostic information. It should not be used to make functionality decisions (the platformVersion is a better fit for this). */ + data class NodeDiagnosticInfo ( /* A list of CorDapps currently installed on this node */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NodeInfo.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NodeInfo.kt index 41c1b882d1..8fd705b057 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NodeInfo.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/NodeInfo.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -35,6 +30,7 @@ import com.squareup.moshi.Json * @param legalIdentitiesAndCerts */ + data class NodeInfo ( @Json(name = "addresses") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Party.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Party.kt index b3ca2e5baa..5a4d7cdbe8 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Party.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Party.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param owningKey */ + data class Party ( @Json(name = "name") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PublicKey.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PublicKey.kt index 3b61bc18c4..0476b4f107 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PublicKey.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PublicKey.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param encoded */ + data class PublicKey ( @Json(name = "algorithm") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SHA256.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SHA256.kt index c557720879..4be09b3374 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SHA256.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SHA256.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param propertySize */ + data class SHA256 ( @Json(name = "bytes") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartMonitorV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartMonitorV1Request.kt index 6a7c8748eb..60d220a2cd 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartMonitorV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartMonitorV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param stateFullClassName The fully qualified name of the Corda state to monitor */ + data class StartMonitorV1Request ( /* ID of a client application that wants to monitor the state changes */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartMonitorV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartMonitorV1Response.kt index e1ce5f707d..050a5bf985 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartMonitorV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartMonitorV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param msg Message describing operation status or any errors that occurred. */ + data class StartMonitorV1Response ( /* Flag set to true if monitoring started correctly. */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StopMonitorV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StopMonitorV1Request.kt index b0e93b3b1e..f9fe1a370b 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StopMonitorV1Request.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StopMonitorV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param stateFullClassName The fully qualified name of the Corda state to monitor */ + data class StopMonitorV1Request ( /* ID of a client application that wants to monitor the state changes */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StopMonitorV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StopMonitorV1Response.kt index 7ef86e7342..46e73f6fc3 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StopMonitorV1Response.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StopMonitorV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param msg Message describing operation status or any errors that occurred. */ + data class StopMonitorV1Response ( /* Flag set to true if operation completed correctly. */ diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/X500Principal.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/X500Principal.kt index 5cfccce590..03b7a3b30b 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/X500Principal.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/X500Principal.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Connector Corda - * - * Can perform basic tasks on a Corda ledger - * - * The version of the OpenAPI document: 0.3.0 - * * * Please note: * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * Do not edit this file manually. + * */ @file:Suppress( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param encoded Base64 encoded public key */ + data class X500Principal ( @Json(name = "name") diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/api-client/corda-api-client.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/api-client/corda-api-client.ts index aed280c7b0..e09b395e9c 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/api-client/corda-api-client.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/api-client/corda-api-client.ts @@ -9,13 +9,13 @@ import { import { ISocketApiClient } from "@hyperledger/cactus-core-api"; import { DefaultApi, - GetMonitorTransactionsV1ResponseTx, + GetMonitorTransactionsV1ResponseTxInner, } from "../generated/openapi/typescript-axios"; import { Configuration } from "../generated/openapi/typescript-axios/configuration"; const DEFAULT_POLL_RATE_MS = 5000; -type CordaBlock = GetMonitorTransactionsV1ResponseTx; +type CordaBlock = GetMonitorTransactionsV1ResponseTxInner; /** * Options for CordaApiClient.watchBlocksV1 method. @@ -66,7 +66,7 @@ export class CordaApiClient * @param stateName Corda state to monitor. */ private async sendStartMonitorRequest( - subject: ReplaySubject, + subject: ReplaySubject, clientAppId: string, stateName: string, ) { @@ -103,7 +103,7 @@ export class CordaApiClient * @param stateName Corda state to monitor. */ private async pollTransactionsLogin( - subject: ReplaySubject, + subject: ReplaySubject, clientAppId: string, stateName: string, ) { diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/api.ts index 59a9cd20b4..e027ffd16a 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,19 +34,19 @@ export interface ClearMonitorTransactionsV1Request { * @type {string} * @memberof ClearMonitorTransactionsV1Request */ - clientAppId: string; + 'clientAppId': string; /** * The fully qualified name of the Corda state to monitor * @type {string} * @memberof ClearMonitorTransactionsV1Request */ - stateFullClassName: string; + 'stateFullClassName': string; /** * * @type {Array} * @memberof ClearMonitorTransactionsV1Request */ - txIndexes: Array; + 'txIndexes': Array; } /** * @@ -57,13 +59,13 @@ export interface ClearMonitorTransactionsV1Response { * @type {boolean} * @memberof ClearMonitorTransactionsV1Response */ - success: boolean; + 'success': boolean; /** * Message describing operation status or any errors that occurred. * @type {string} * @memberof ClearMonitorTransactionsV1Response */ - msg: string; + 'msg': string; } /** * @@ -76,31 +78,31 @@ export interface CordaNodeSshCredentials { * @type {string} * @memberof CordaNodeSshCredentials */ - hostKeyEntry: string; + 'hostKeyEntry': string; /** * * @type {string} * @memberof CordaNodeSshCredentials */ - username: string; + 'username': string; /** * * @type {string} * @memberof CordaNodeSshCredentials */ - password: string; + 'password': string; /** * * @type {string} * @memberof CordaNodeSshCredentials */ - hostname: string; + 'hostname': string; /** * * @type {number} * @memberof CordaNodeSshCredentials */ - port: number; + 'port': number; } /** * @@ -113,25 +115,25 @@ export interface CordaRpcCredentials { * @type {string} * @memberof CordaRpcCredentials */ - hostname: string; + 'hostname': string; /** * * @type {number} * @memberof CordaRpcCredentials */ - port: number; + 'port': number; /** * * @type {string} * @memberof CordaRpcCredentials */ - username: string; + 'username': string; /** * * @type {string} * @memberof CordaRpcCredentials */ - password: string; + 'password': string; } /** * @@ -144,43 +146,43 @@ export interface CordaX500Name { * @type {string} * @memberof CordaX500Name */ - commonName?: string; + 'commonName'?: string; /** * * @type {string} * @memberof CordaX500Name */ - organisationUnit?: string; + 'organisationUnit'?: string; /** * * @type {string} * @memberof CordaX500Name */ - organisation: string; + 'organisation': string; /** * * @type {string} * @memberof CordaX500Name */ - locality: string; + 'locality': string; /** * * @type {string} * @memberof CordaX500Name */ - state?: string; + 'state'?: string; /** * * @type {string} * @memberof CordaX500Name */ - country: string; + 'country': string; /** * * @type {X500Principal} * @memberof CordaX500Name */ - x500Principal: X500Principal; + 'x500Principal': X500Principal; } /** * @@ -193,37 +195,37 @@ export interface CordappDeploymentConfig { * @type {CordaNodeSshCredentials} * @memberof CordappDeploymentConfig */ - sshCredentials: CordaNodeSshCredentials; + 'sshCredentials': CordaNodeSshCredentials; /** * * @type {CordaRpcCredentials} * @memberof CordappDeploymentConfig */ - rpcCredentials: CordaRpcCredentials; + 'rpcCredentials': CordaRpcCredentials; /** * The shell command to execute in order to start back up a Corda node after having placed new jars in the cordapp directory of said node. * @type {string} * @memberof CordappDeploymentConfig */ - cordaNodeStartCmd: string; + 'cordaNodeStartCmd': string; /** * The absolute file system path where the Corda Node is expecting deployed Cordapp jar files to be placed. * @type {string} * @memberof CordappDeploymentConfig */ - cordappDir: string; + 'cordappDir': string; /** * The absolute file system path where the corda.jar file of the node can be found. This is used to execute database schema migrations where applicable (H2 database in use in development environments). * @type {string} * @memberof CordappDeploymentConfig */ - cordaJarPath: string; + 'cordaJarPath': string; /** * The absolute file system path where the base directory of the Corda node can be found. This is used to pass in to corda.jar when being invoked for certain tasks such as executing database schema migrations for a deployed contract. * @type {string} * @memberof CordappDeploymentConfig */ - nodeBaseDirPath: string; + 'nodeBaseDirPath': string; } /** * A CordappInfo describes a single CorDapp currently installed on the node @@ -236,55 +238,55 @@ export interface CordappInfo { * @type {SHA256} * @memberof CordappInfo */ - jarHash: SHA256; + 'jarHash': SHA256; /** * The name of the licence this CorDapp is released under * @type {string} * @memberof CordappInfo */ - licence: string; + 'licence': string; /** * The minimum platform version the node must be at for the CorDapp to run * @type {number} * @memberof CordappInfo */ - minimumPlatformVersion: number; + 'minimumPlatformVersion': number; /** * The name of the JAR file that defines the CorDapp * @type {string} * @memberof CordappInfo */ - name: string; + 'name': string; /** * The name of the CorDapp * @type {string} * @memberof CordappInfo */ - shortName: string; + 'shortName': string; /** * The target platform version this CorDapp has been tested against * @type {number} * @memberof CordappInfo */ - targetPlatformVersion: number; + 'targetPlatformVersion': number; /** * A description of what sort of CorDapp this is - either a contract, workflow, or a combination. * @type {string} * @memberof CordappInfo */ - type: string; + 'type': string; /** * The vendor of this CorDapp * @type {string} * @memberof CordappInfo */ - vendor: string; + 'vendor': string; /** * The version of this CorDapp * @type {string} * @memberof CordappInfo */ - version: string; + 'version': string; } /** * @@ -297,7 +299,7 @@ export interface DeployContractJarsBadRequestV1Response { * @type {Array} * @memberof DeployContractJarsBadRequestV1Response */ - errors: Array; + 'errors': Array; } /** * @@ -310,7 +312,7 @@ export interface DeployContractJarsSuccessV1Response { * @type {Array} * @memberof DeployContractJarsSuccessV1Response */ - deployedJarFiles: Array; + 'deployedJarFiles': Array; } /** * @@ -323,13 +325,13 @@ export interface DeployContractJarsV1Request { * @type {Array} * @memberof DeployContractJarsV1Request */ - cordappDeploymentConfigs: Array; + 'cordappDeploymentConfigs': Array; /** * * @type {Array} * @memberof DeployContractJarsV1Request */ - jarFiles: Array; + 'jarFiles': Array; } /** * @@ -342,7 +344,7 @@ export interface DiagnoseNodeV1Request { * @type {Array} * @memberof DiagnoseNodeV1Request */ - nodeIds?: Array; + 'nodeIds'?: Array; } /** * @@ -355,7 +357,7 @@ export interface DiagnoseNodeV1Response { * @type {NodeDiagnosticInfo} * @memberof DiagnoseNodeV1Response */ - nodeDiagnosticInfo: NodeDiagnosticInfo; + 'nodeDiagnosticInfo': NodeDiagnosticInfo; } /** * Determines which flow starting method will be used on the back-end when invoking the flow. Based on the value here the plugin back-end might invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() method. Streamed responses are aggregated and returned in a single response to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. do. @@ -363,10 +365,13 @@ export interface DiagnoseNodeV1Response { * @enum {string} */ -export enum FlowInvocationType { - TrackedFlowDynamic = 'TRACKED_FLOW_DYNAMIC', - FlowDynamic = 'FLOW_DYNAMIC' -} +export const FlowInvocationType = { + TrackedFlowDynamic: 'TRACKED_FLOW_DYNAMIC', + FlowDynamic: 'FLOW_DYNAMIC' +} as const; + +export type FlowInvocationType = typeof FlowInvocationType[keyof typeof FlowInvocationType]; + /** * @@ -379,13 +384,13 @@ export interface GetMonitorTransactionsV1Request { * @type {string} * @memberof GetMonitorTransactionsV1Request */ - clientAppId: string; + 'clientAppId': string; /** * The fully qualified name of the Corda state to monitor * @type {string} * @memberof GetMonitorTransactionsV1Request */ - stateFullClassName: string; + 'stateFullClassName': string; } /** * @@ -398,44 +403,44 @@ export interface GetMonitorTransactionsV1Response { * @type {boolean} * @memberof GetMonitorTransactionsV1Response */ - success: boolean; + 'success': boolean; /** * Message describing operation status or any errors that occurred. * @type {string} * @memberof GetMonitorTransactionsV1Response */ - msg: string; + 'msg': string; /** * The fully qualified name of the Corda state to monitor * @type {string} * @memberof GetMonitorTransactionsV1Response */ - stateFullClassName?: string; + 'stateFullClassName'?: string; /** * - * @type {Array} + * @type {Array} * @memberof GetMonitorTransactionsV1Response */ - tx?: Array; + 'tx'?: Array; } /** * * @export - * @interface GetMonitorTransactionsV1ResponseTx + * @interface GetMonitorTransactionsV1ResponseTxInner */ -export interface GetMonitorTransactionsV1ResponseTx { +export interface GetMonitorTransactionsV1ResponseTxInner { /** * * @type {string} - * @memberof GetMonitorTransactionsV1ResponseTx + * @memberof GetMonitorTransactionsV1ResponseTxInner */ - index?: string; + 'index'?: string; /** * * @type {string} - * @memberof GetMonitorTransactionsV1ResponseTx + * @memberof GetMonitorTransactionsV1ResponseTxInner */ - data?: string; + 'data'?: string; } /** * @@ -448,26 +453,28 @@ export interface InvokeContractV1Request { * @type {string} * @memberof InvokeContractV1Request */ - flowFullClassName: string; + 'flowFullClassName': string; /** * * @type {FlowInvocationType} * @memberof InvokeContractV1Request */ - flowInvocationType: FlowInvocationType; + 'flowInvocationType': FlowInvocationType; /** * The list of arguments to pass in to the contract method being invoked. * @type {Array} * @memberof InvokeContractV1Request */ - params: Array; + 'params': Array; /** * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. * @type {number} * @memberof InvokeContractV1Request */ - timeoutMs?: number; + 'timeoutMs'?: number; } + + /** * * @export @@ -479,31 +486,31 @@ export interface InvokeContractV1Response { * @type {boolean} * @memberof InvokeContractV1Response */ - success: boolean; + 'success': boolean; /** * Data returned from the JVM when no transaction is running * @type {object} * @memberof InvokeContractV1Response */ - callOutput: object; + 'callOutput': object; /** * The net.corda.core.flows.StateMachineRunId value returned by the flow execution. * @type {string} * @memberof InvokeContractV1Response */ - transactionId?: string; + 'transactionId'?: string; /** * An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty. * @type {Array} * @memberof InvokeContractV1Response */ - progress?: Array; + 'progress'?: Array; /** * The id for the flow handle * @type {string} * @memberof InvokeContractV1Response */ - flowId: string; + 'flowId': string; } /** * @@ -511,26 +518,26 @@ export interface InvokeContractV1Response { * @interface JarFile */ export interface JarFile { - [key: string]: object | any; + [key: string]: any; /** * * @type {string} * @memberof JarFile */ - filename: string; + 'filename': string; /** * Indicates whether the cordapp jar in question contains any embedded migrations that Cactus can/should execute between copying the jar into the cordapp directory and starting the node back up. * @type {boolean} * @memberof JarFile */ - hasDbMigrations: boolean; + 'hasDbMigrations': boolean; /** * * @type {string} * @memberof JarFile */ - contentBase64: string; + 'contentBase64': string; } /** * Can represent JVM primitive and reference types as well. The jvmTypeKind field indicates which one is being stored. If the jvmTypeKind field is set to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property is filled with a primitive data type supported by the JSON standard such as strings, booleans, numbers, etc. @@ -543,26 +550,28 @@ export interface JvmObject { * @type {JvmTypeKind} * @memberof JvmObject */ - jvmTypeKind: JvmTypeKind; + 'jvmTypeKind': JvmTypeKind; /** * * @type {object} * @memberof JvmObject */ - primitiveValue?: object; + 'primitiveValue'?: object; /** * * @type {Array} * @memberof JvmObject */ - jvmCtorArgs?: Array; + 'jvmCtorArgs'?: Array; /** * * @type {JvmType} * @memberof JvmObject */ - jvmType: JvmType; + 'jvmType': JvmType; } + + /** * Represents a reference to a JVM type (such as a Java class) * @export @@ -574,19 +583,19 @@ export interface JvmType { * @type {string} * @memberof JvmType */ - fqClassName: string; + 'fqClassName': string; /** * This parameter is used to specify that the function used to construct this JvmType is not a constructor function but instead is a factory function. Setting this parameter will cause the plugin to look up methods of the class denoted by fqClassName instead of its constructors. * @type {string} * @memberof JvmType */ - constructorName?: string; + 'constructorName'?: string; /** * * @type {JvmObject} * @memberof JvmType */ - invocationTarget?: JvmObject; + 'invocationTarget'?: JvmObject; } /** * @@ -594,10 +603,13 @@ export interface JvmType { * @enum {string} */ -export enum JvmTypeKind { - Primitive = 'PRIMITIVE', - Reference = 'REFERENCE' -} +export const JvmTypeKind = { + Primitive: 'PRIMITIVE', + Reference: 'REFERENCE' +} as const; + +export type JvmTypeKind = typeof JvmTypeKind[keyof typeof JvmTypeKind]; + /** * @@ -610,7 +622,7 @@ export interface ListFlowsV1Request { * @type {string} * @memberof ListFlowsV1Request */ - filter?: string; + 'filter'?: string; } /** * @@ -623,7 +635,7 @@ export interface ListFlowsV1Response { * @type {Array} * @memberof ListFlowsV1Response */ - flowNames: Array; + 'flowNames': Array; } /** * @@ -636,13 +648,13 @@ export interface NetworkHostAndPort { * @type {string} * @memberof NetworkHostAndPort */ - host: string; + 'host': string; /** * * @type {number} * @memberof NetworkHostAndPort */ - port: number; + 'port': number; } /** * A NodeDiagnosticInfo holds information about the current node version. @@ -655,31 +667,31 @@ export interface NodeDiagnosticInfo { * @type {Array} * @memberof NodeDiagnosticInfo */ - cordapps: Array; + 'cordapps': Array; /** * The platform version of this node. This number represents a released API version, and should be used to make functionality decisions (e.g. enabling an app feature only if an underlying platform feature exists) * @type {number} * @memberof NodeDiagnosticInfo */ - platformVersion: number; + 'platformVersion': number; /** * The git commit hash this node was built from * @type {string} * @memberof NodeDiagnosticInfo */ - revision: string; + 'revision': string; /** * The vendor of this node * @type {string} * @memberof NodeDiagnosticInfo */ - vendor: string; + 'vendor': string; /** * The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note that this string is effectively freeform, and so should only be used for providing diagnostic information. It should not be used to make functionality decisions (the platformVersion is a better fit for this). * @type {string} * @memberof NodeDiagnosticInfo */ - version: string; + 'version': string; } /** * @@ -692,31 +704,31 @@ export interface NodeInfo { * @type {Array} * @memberof NodeInfo */ - addresses: Array; + 'addresses': Array; /** * * @type {number} * @memberof NodeInfo */ - platformVersion: number; + 'platformVersion': number; /** * * @type {number} * @memberof NodeInfo */ - serial: number; + 'serial': number; /** * * @type {Array} * @memberof NodeInfo */ - legalIdentities: Array; + 'legalIdentities': Array; /** * * @type {Array} * @memberof NodeInfo */ - legalIdentitiesAndCerts: Array; + 'legalIdentitiesAndCerts': Array; } /** * @@ -729,13 +741,13 @@ export interface Party { * @type {CordaX500Name} * @memberof Party */ - name: CordaX500Name; + 'name': CordaX500Name; /** * * @type {PublicKey} * @memberof Party */ - owningKey: PublicKey; + 'owningKey': PublicKey; } /** * An instance of a java.security.PublicKey (which is an interface) implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl @@ -748,19 +760,19 @@ export interface PublicKey { * @type {string} * @memberof PublicKey */ - algorithm: string; + 'algorithm': string; /** * * @type {string} * @memberof PublicKey */ - format: string; + 'format': string; /** * * @type {string} * @memberof PublicKey */ - encoded: string; + 'encoded': string; } /** * SHA-256 is part of the SHA-2 hash function family. Generated hash is fixed size, 256-bits (32-bytes). @@ -773,19 +785,19 @@ export interface SHA256 { * @type {string} * @memberof SHA256 */ - bytes: string; + 'bytes': string; /** * * @type {number} * @memberof SHA256 */ - offset: number; + 'offset': number; /** * * @type {number} * @memberof SHA256 */ - size: number; + 'size': number; } /** * @@ -798,13 +810,13 @@ export interface StartMonitorV1Request { * @type {string} * @memberof StartMonitorV1Request */ - clientAppId: string; + 'clientAppId': string; /** * The fully qualified name of the Corda state to monitor * @type {string} * @memberof StartMonitorV1Request */ - stateFullClassName: string; + 'stateFullClassName': string; } /** * @@ -817,13 +829,13 @@ export interface StartMonitorV1Response { * @type {boolean} * @memberof StartMonitorV1Response */ - success: boolean; + 'success': boolean; /** * Message describing operation status or any errors that occurred. * @type {string} * @memberof StartMonitorV1Response */ - msg: string; + 'msg': string; } /** * @@ -836,13 +848,13 @@ export interface StopMonitorV1Request { * @type {string} * @memberof StopMonitorV1Request */ - clientAppId: string; + 'clientAppId': string; /** * The fully qualified name of the Corda state to monitor * @type {string} * @memberof StopMonitorV1Request */ - stateFullClassName: string; + 'stateFullClassName': string; } /** * @@ -855,13 +867,13 @@ export interface StopMonitorV1Response { * @type {boolean} * @memberof StopMonitorV1Response */ - success: boolean; + 'success': boolean; /** * Message describing operation status or any errors that occurred. * @type {string} * @memberof StopMonitorV1Response */ - msg: string; + 'msg': string; } /** * @@ -874,13 +886,13 @@ export interface X500Principal { * @type {string} * @memberof X500Principal */ - name: string; + 'name': string; /** * Base64 encoded public key * @type {string} * @memberof X500Principal */ - encoded: string; + 'encoded': string; } /** @@ -896,7 +908,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - clearMonitorTransactionsV1: async (clearMonitorTransactionsV1Request?: ClearMonitorTransactionsV1Request, options: any = {}): Promise => { + clearMonitorTransactionsV1: async (clearMonitorTransactionsV1Request?: ClearMonitorTransactionsV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -913,7 +925,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(clearMonitorTransactionsV1Request, localVarRequestOptions, configuration) @@ -930,7 +942,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deployContractJarsV1: async (deployContractJarsV1Request?: DeployContractJarsV1Request, options: any = {}): Promise => { + deployContractJarsV1: async (deployContractJarsV1Request?: DeployContractJarsV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -947,7 +959,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(deployContractJarsV1Request, localVarRequestOptions, configuration) @@ -963,7 +975,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - diagnoseNodeV1: async (diagnoseNodeV1Request?: DiagnoseNodeV1Request, options: any = {}): Promise => { + diagnoseNodeV1: async (diagnoseNodeV1Request?: DiagnoseNodeV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -980,7 +992,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(diagnoseNodeV1Request, localVarRequestOptions, configuration) @@ -997,7 +1009,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getMonitorTransactionsV1: async (getMonitorTransactionsV1Request?: GetMonitorTransactionsV1Request, options: any = {}): Promise => { + getMonitorTransactionsV1: async (getMonitorTransactionsV1Request?: GetMonitorTransactionsV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1014,7 +1026,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getMonitorTransactionsV1Request, localVarRequestOptions, configuration) @@ -1030,7 +1042,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPrometheusMetricsV1: async (options: any = {}): Promise => { + getPrometheusMetricsV1: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1045,7 +1057,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -1061,7 +1073,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - invokeContractV1: async (invokeContractV1Request?: InvokeContractV1Request, options: any = {}): Promise => { + invokeContractV1: async (invokeContractV1Request?: InvokeContractV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1078,7 +1090,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(invokeContractV1Request, localVarRequestOptions, configuration) @@ -1094,7 +1106,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listFlowsV1: async (listFlowsV1Request?: ListFlowsV1Request, options: any = {}): Promise => { + listFlowsV1: async (listFlowsV1Request?: ListFlowsV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1111,7 +1123,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(listFlowsV1Request, localVarRequestOptions, configuration) @@ -1127,7 +1139,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - networkMapV1: async (body?: object, options: any = {}): Promise => { + networkMapV1: async (body?: object, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1144,7 +1156,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) @@ -1161,7 +1173,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - startMonitorV1: async (startMonitorV1Request?: StartMonitorV1Request, options: any = {}): Promise => { + startMonitorV1: async (startMonitorV1Request?: StartMonitorV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1178,7 +1190,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(startMonitorV1Request, localVarRequestOptions, configuration) @@ -1195,7 +1207,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - stopMonitorV1: async (stopMonitorV1Request?: StopMonitorV1Request, options: any = {}): Promise => { + stopMonitorV1: async (stopMonitorV1Request?: StopMonitorV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1212,7 +1224,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(stopMonitorV1Request, localVarRequestOptions, configuration) @@ -1239,7 +1251,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async clearMonitorTransactionsV1(clearMonitorTransactionsV1Request?: ClearMonitorTransactionsV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async clearMonitorTransactionsV1(clearMonitorTransactionsV1Request?: ClearMonitorTransactionsV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.clearMonitorTransactionsV1(clearMonitorTransactionsV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1250,7 +1262,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deployContractJarsV1(deployContractJarsV1Request?: DeployContractJarsV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async deployContractJarsV1(deployContractJarsV1Request?: DeployContractJarsV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deployContractJarsV1(deployContractJarsV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1260,7 +1272,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async diagnoseNodeV1(diagnoseNodeV1Request?: DiagnoseNodeV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async diagnoseNodeV1(diagnoseNodeV1Request?: DiagnoseNodeV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.diagnoseNodeV1(diagnoseNodeV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1271,7 +1283,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getMonitorTransactionsV1(getMonitorTransactionsV1Request?: GetMonitorTransactionsV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getMonitorTransactionsV1(getMonitorTransactionsV1Request?: GetMonitorTransactionsV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getMonitorTransactionsV1(getMonitorTransactionsV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1281,7 +1293,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getPrometheusMetricsV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getPrometheusMetricsV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPrometheusMetricsV1(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1292,7 +1304,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.invokeContractV1(invokeContractV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1302,7 +1314,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listFlowsV1(listFlowsV1Request?: ListFlowsV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listFlowsV1(listFlowsV1Request?: ListFlowsV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listFlowsV1(listFlowsV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1312,7 +1324,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async networkMapV1(body?: object, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async networkMapV1(body?: object, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.networkMapV1(body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1323,7 +1335,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async startMonitorV1(startMonitorV1Request?: StartMonitorV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async startMonitorV1(startMonitorV1Request?: StartMonitorV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.startMonitorV1(startMonitorV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1334,7 +1346,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async stopMonitorV1(stopMonitorV1Request?: StopMonitorV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async stopMonitorV1(stopMonitorV1Request?: StopMonitorV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.stopMonitorV1(stopMonitorV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1462,7 +1474,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public clearMonitorTransactionsV1(clearMonitorTransactionsV1Request?: ClearMonitorTransactionsV1Request, options?: any) { + public clearMonitorTransactionsV1(clearMonitorTransactionsV1Request?: ClearMonitorTransactionsV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).clearMonitorTransactionsV1(clearMonitorTransactionsV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1474,7 +1486,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public deployContractJarsV1(deployContractJarsV1Request?: DeployContractJarsV1Request, options?: any) { + public deployContractJarsV1(deployContractJarsV1Request?: DeployContractJarsV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).deployContractJarsV1(deployContractJarsV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1485,7 +1497,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public diagnoseNodeV1(diagnoseNodeV1Request?: DiagnoseNodeV1Request, options?: any) { + public diagnoseNodeV1(diagnoseNodeV1Request?: DiagnoseNodeV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).diagnoseNodeV1(diagnoseNodeV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1497,7 +1509,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getMonitorTransactionsV1(getMonitorTransactionsV1Request?: GetMonitorTransactionsV1Request, options?: any) { + public getMonitorTransactionsV1(getMonitorTransactionsV1Request?: GetMonitorTransactionsV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getMonitorTransactionsV1(getMonitorTransactionsV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1508,7 +1520,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getPrometheusMetricsV1(options?: any) { + public getPrometheusMetricsV1(options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getPrometheusMetricsV1(options).then((request) => request(this.axios, this.basePath)); } @@ -1520,7 +1532,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any) { + public invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).invokeContractV1(invokeContractV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1531,7 +1543,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public listFlowsV1(listFlowsV1Request?: ListFlowsV1Request, options?: any) { + public listFlowsV1(listFlowsV1Request?: ListFlowsV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).listFlowsV1(listFlowsV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1542,7 +1554,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public networkMapV1(body?: object, options?: any) { + public networkMapV1(body?: object, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).networkMapV1(body, options).then((request) => request(this.axios, this.basePath)); } @@ -1554,7 +1566,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public startMonitorV1(startMonitorV1Request?: StartMonitorV1Request, options?: any) { + public startMonitorV1(startMonitorV1Request?: StartMonitorV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).startMonitorV1(startMonitorV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1566,7 +1578,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public stopMonitorV1(stopMonitorV1Request?: StopMonitorV1Request, options?: any) { + public stopMonitorV1(stopMonitorV1Request?: StopMonitorV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).stopMonitorV1(stopMonitorV1Request, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/base.ts index 9a3e41141e..63ec983187 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/common.ts index 26f527dabd..5c812ea66e 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-ledger-connector-quorum/openapitools.json b/packages/cactus-plugin-ledger-connector-quorum/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-ledger-connector-quorum/openapitools.json +++ b/packages/cactus-plugin-ledger-connector-quorum/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/api.ts index 9727493827..dc86d87e12 100644 --- a/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -27,86 +29,86 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr * @interface ContractJSON */ export interface ContractJSON { - [key: string]: object | any; + [key: string]: any; /** * * @type {string} * @memberof ContractJSON */ - contractName: string; + 'contractName': string; /** * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode * @type {string} * @memberof ContractJSON */ - bytecode: string; + 'bytecode': string; /** * The application binary interface of the solidity contract, optional parameter * @type {Array} * @memberof ContractJSON */ - abi?: Array; + 'abi'?: Array; /** * * @type {string} * @memberof ContractJSON */ - metadata?: string; + 'metadata'?: string; /** * * @type {string} * @memberof ContractJSON */ - deployedBytecode?: string; + 'deployedBytecode'?: string; /** * * @type {string} * @memberof ContractJSON */ - sourceMap?: string; + 'sourceMap'?: string; /** * * @type {string} * @memberof ContractJSON */ - deployedSourceMap?: string; + 'deployedSourceMap'?: string; /** * * @type {string} * @memberof ContractJSON */ - sourcePath?: string; + 'sourcePath'?: string; /** * * @type {object} * @memberof ContractJSON */ - compiler?: object; + 'compiler'?: object; /** * * @type {object} * @memberof ContractJSON */ - networks?: object; + 'networks'?: object; /** * * @type {object} * @memberof ContractJSON */ - ast?: object; + 'ast'?: object; /** * * @type {object} * @memberof ContractJSON */ - functionHashes?: object; + 'functionHashes'?: object; /** * * @type {object} * @memberof ContractJSON */ - gasEstimates?: object; + 'gasEstimates'?: object; } /** * @@ -119,37 +121,37 @@ export interface DeployContractSolidityBytecodeJsonObjectV1Request { * @type {Web3SigningCredential} * @memberof DeployContractSolidityBytecodeJsonObjectV1Request */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {number} * @memberof DeployContractSolidityBytecodeJsonObjectV1Request */ - gas?: number; + 'gas'?: number; /** * * @type {string} * @memberof DeployContractSolidityBytecodeJsonObjectV1Request */ - gasPrice?: string; + 'gasPrice'?: string; /** * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. * @type {number} * @memberof DeployContractSolidityBytecodeJsonObjectV1Request */ - timeoutMs?: number; + 'timeoutMs'?: number; /** * * @type {ContractJSON} * @memberof DeployContractSolidityBytecodeJsonObjectV1Request */ - contractJSON: ContractJSON; + 'contractJSON': ContractJSON; /** * The list of arguments to pass in to the constructor of the contract being deployed. * @type {Array} * @memberof DeployContractSolidityBytecodeJsonObjectV1Request */ - constructorArgs?: Array; + 'constructorArgs'?: Array; } /** * @@ -162,49 +164,49 @@ export interface DeployContractSolidityBytecodeV1Request { * @type {string} * @memberof DeployContractSolidityBytecodeV1Request */ - contractName: string; + 'contractName': string; /** * * @type {Web3SigningCredential} * @memberof DeployContractSolidityBytecodeV1Request */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * The keychainId for retrieve the contracts json. * @type {string} * @memberof DeployContractSolidityBytecodeV1Request */ - keychainId: string; + 'keychainId': string; /** * * @type {number} * @memberof DeployContractSolidityBytecodeV1Request */ - gas?: number; + 'gas'?: number; /** * * @type {string} * @memberof DeployContractSolidityBytecodeV1Request */ - gasPrice?: string; + 'gasPrice'?: string; /** * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. * @type {number} * @memberof DeployContractSolidityBytecodeV1Request */ - timeoutMs?: number; + 'timeoutMs'?: number; /** * For use when not using keychain, pass the contract in as this variable * @type {object} * @memberof DeployContractSolidityBytecodeV1Request */ - contractJSON?: object; + 'contractJSON'?: object; /** * The list of arguments to pass in to the constructor of the contract being deployed. * @type {Array} * @memberof DeployContractSolidityBytecodeV1Request */ - constructorArgs?: Array; + 'constructorArgs'?: Array; } /** * @@ -217,7 +219,7 @@ export interface DeployContractSolidityBytecodeV1Response { * @type {Web3TransactionReceipt} * @memberof DeployContractSolidityBytecodeV1Response */ - transactionReceipt: Web3TransactionReceipt; + 'transactionReceipt': Web3TransactionReceipt; } /** * @@ -225,10 +227,13 @@ export interface DeployContractSolidityBytecodeV1Response { * @enum {string} */ -export enum EthContractInvocationType { - Send = 'SEND', - Call = 'CALL' -} +export const EthContractInvocationType = { + Send: 'SEND', + Call: 'CALL' +} as const; + +export type EthContractInvocationType = typeof EthContractInvocationType[keyof typeof EthContractInvocationType]; + /** * @@ -236,12 +241,15 @@ export enum EthContractInvocationType { * @enum {string} */ -export enum EthContractInvocationWeb3Method { - Send = 'send', - Call = 'call', - EncodeAbi = 'encodeABI', - EstimateGas = 'estimateGas' -} +export const EthContractInvocationWeb3Method = { + Send: 'send', + Call: 'call', + EncodeAbi: 'encodeABI', + EstimateGas: 'estimateGas' +} as const; + +export type EthContractInvocationWeb3Method = typeof EthContractInvocationWeb3Method[keyof typeof EthContractInvocationWeb3Method]; + /** * @@ -254,68 +262,70 @@ export interface InvokeContractJsonObjectV1Request { * @type {Web3SigningCredential} * @memberof InvokeContractJsonObjectV1Request */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {EthContractInvocationType} * @memberof InvokeContractJsonObjectV1Request */ - invocationType: EthContractInvocationType; + 'invocationType': EthContractInvocationType; /** * The name of the contract method to invoke. * @type {string} * @memberof InvokeContractJsonObjectV1Request */ - methodName: string; + 'methodName': string; /** * The list of arguments to pass in to the contract method being invoked. * @type {Array} * @memberof InvokeContractJsonObjectV1Request */ - params: Array; + 'params': Array; /** * Address of the solidity contract * @type {string} * @memberof InvokeContractJsonObjectV1Request */ - contractAddress: string; + 'contractAddress': string; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof InvokeContractJsonObjectV1Request */ - value?: string | number; + 'value'?: QuorumTransactionConfigFrom; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof InvokeContractJsonObjectV1Request */ - gas?: string | number; + 'gas'?: QuorumTransactionConfigFrom; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof InvokeContractJsonObjectV1Request */ - gasPrice?: string | number; + 'gasPrice'?: QuorumTransactionConfigFrom; /** * * @type {number} * @memberof InvokeContractJsonObjectV1Request */ - nonce?: number; + 'nonce'?: number; /** * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND * @type {number} * @memberof InvokeContractJsonObjectV1Request */ - timeoutMs?: number; + 'timeoutMs'?: number; /** * * @type {ContractJSON} * @memberof InvokeContractJsonObjectV1Request */ - contractJSON: ContractJSON; + 'contractJSON': ContractJSON; } + + /** * * @export @@ -327,68 +337,70 @@ export interface InvokeContractV1Request { * @type {string} * @memberof InvokeContractV1Request */ - contractName: string; + 'contractName': string; /** * * @type {Web3SigningCredential} * @memberof InvokeContractV1Request */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {EthContractInvocationType} * @memberof InvokeContractV1Request */ - invocationType: EthContractInvocationType; + 'invocationType': EthContractInvocationType; /** * The name of the contract method to invoke. * @type {string} * @memberof InvokeContractV1Request */ - methodName: string; + 'methodName': string; /** * The list of arguments to pass in to the contract method being invoked. * @type {Array} * @memberof InvokeContractV1Request */ - params: Array; + 'params': Array; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof InvokeContractV1Request */ - value?: string | number; + 'value'?: QuorumTransactionConfigFrom; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof InvokeContractV1Request */ - gas?: string | number; + 'gas'?: QuorumTransactionConfigFrom; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof InvokeContractV1Request */ - gasPrice?: string | number; + 'gasPrice'?: QuorumTransactionConfigFrom; /** * * @type {number} * @memberof InvokeContractV1Request */ - nonce?: number; + 'nonce'?: number; /** * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND * @type {number} * @memberof InvokeContractV1Request */ - timeoutMs?: number; + 'timeoutMs'?: number; /** * The keychainId for retrieve the contracts json. * @type {string} * @memberof InvokeContractV1Request */ - keychainId: string; + 'keychainId': string; } + + /** * * @export @@ -400,19 +412,19 @@ export interface InvokeContractV1Response { * @type {Web3TransactionReceipt} * @memberof InvokeContractV1Response */ - transactionReceipt?: Web3TransactionReceipt; + 'transactionReceipt'?: Web3TransactionReceipt; /** * * @type {any} * @memberof InvokeContractV1Response */ - callOutput?: any | null; + 'callOutput'?: any; /** * * @type {boolean} * @memberof InvokeContractV1Response */ - success: boolean; + 'success': boolean; } /** * @@ -425,38 +437,40 @@ export interface InvokeRawWeb3EthContractV1Request { * @type {Array} * @memberof InvokeRawWeb3EthContractV1Request */ - abi: Array; + 'abi': Array; /** * Deployed solidity contract address * @type {string} * @memberof InvokeRawWeb3EthContractV1Request */ - address: string; + 'address': string; /** * * @type {EthContractInvocationWeb3Method} * @memberof InvokeRawWeb3EthContractV1Request */ - invocationType: EthContractInvocationWeb3Method; + 'invocationType': EthContractInvocationWeb3Method; /** * The list of arguments for contract invocation method (send, call, etc...) * @type {object} * @memberof InvokeRawWeb3EthContractV1Request */ - invocationParams?: object; + 'invocationParams'?: object; /** * Method of deployed solidity contract to execute * @type {string} * @memberof InvokeRawWeb3EthContractV1Request */ - contractMethod: string; + 'contractMethod': string; /** * The list of arguments for deployed solidity contract method * @type {Array} * @memberof InvokeRawWeb3EthContractV1Request */ - contractMethodArgs?: Array; + 'contractMethodArgs'?: Array; } + + /** * * @export @@ -468,19 +482,19 @@ export interface InvokeRawWeb3EthContractV1Response { * @type {number} * @memberof InvokeRawWeb3EthContractV1Response */ - status: number; + 'status': number; /** * Output of contract invocation method * @type {any} * @memberof InvokeRawWeb3EthContractV1Response */ - data?: any | null; + 'data'?: any; /** * Error details * @type {string} * @memberof InvokeRawWeb3EthContractV1Response */ - errorDetail?: string; + 'errorDetail'?: string; } /** * @@ -493,13 +507,13 @@ export interface InvokeRawWeb3EthMethodV1Request { * @type {string} * @memberof InvokeRawWeb3EthMethodV1Request */ - methodName: string; + 'methodName': string; /** * The list of arguments to pass to web3.eth method specified in methodName * @type {Array} * @memberof InvokeRawWeb3EthMethodV1Request */ - params?: Array; + 'params'?: Array; } /** * @@ -512,19 +526,19 @@ export interface InvokeRawWeb3EthMethodV1Response { * @type {number} * @memberof InvokeRawWeb3EthMethodV1Response */ - status: number; + 'status': number; /** * Output of requested web3.eth method * @type {any} * @memberof InvokeRawWeb3EthMethodV1Response */ - data?: any | null; + 'data'?: any; /** * Error details * @type {string} * @memberof InvokeRawWeb3EthMethodV1Response */ - errorDetail?: string; + 'errorDetail'?: string; } /** * @@ -532,57 +546,69 @@ export interface InvokeRawWeb3EthMethodV1Response { * @interface QuorumTransactionConfig */ export interface QuorumTransactionConfig { - [key: string]: object | any; + [key: string]: any; /** * * @type {string} * @memberof QuorumTransactionConfig */ - rawTransaction?: string; + 'rawTransaction'?: string; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof QuorumTransactionConfig */ - from?: string | number; + 'from'?: QuorumTransactionConfigFrom; /** * - * @type {string} + * @type {QuorumTransactionConfigTo} * @memberof QuorumTransactionConfig */ - to?: string; + 'to'?: QuorumTransactionConfigTo; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof QuorumTransactionConfig */ - value?: string | number; + 'value'?: QuorumTransactionConfigFrom; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof QuorumTransactionConfig */ - gas?: string | number; + 'gas'?: QuorumTransactionConfigFrom; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof QuorumTransactionConfig */ - gasPrice?: string | number; + 'gasPrice'?: QuorumTransactionConfigFrom; /** * * @type {number} * @memberof QuorumTransactionConfig */ - nonce?: number; + 'nonce'?: number; /** * - * @type {string} + * @type {QuorumTransactionConfigTo} * @memberof QuorumTransactionConfig */ - data?: string; + 'data'?: QuorumTransactionConfigTo; } +/** + * @type QuorumTransactionConfigFrom + * @export + */ +export type QuorumTransactionConfigFrom = number | string; + +/** + * @type QuorumTransactionConfigTo + * @export + */ +export type QuorumTransactionConfigTo = string; + /** * * @export @@ -594,19 +620,19 @@ export interface RunTransactionRequest { * @type {Web3SigningCredential} * @memberof RunTransactionRequest */ - web3SigningCredential: Web3SigningCredential; + 'web3SigningCredential': Web3SigningCredential; /** * * @type {QuorumTransactionConfig} * @memberof RunTransactionRequest */ - transactionConfig: QuorumTransactionConfig; + 'transactionConfig': QuorumTransactionConfig; /** * The amount of milliseconds to wait for a transaction receipt with thehash of the transaction(which indicates successful execution) beforegiving up and crashing. * @type {number} * @memberof RunTransactionRequest */ - timeoutMs?: number; + 'timeoutMs'?: number; } /** * @@ -619,7 +645,7 @@ export interface RunTransactionResponse { * @type {Web3TransactionReceipt} * @memberof RunTransactionResponse */ - transactionReceipt: Web3TransactionReceipt; + 'transactionReceipt': Web3TransactionReceipt; } /** * @@ -632,75 +658,143 @@ export interface SolidityContractJsonArtifact { * @type {string} * @memberof SolidityContractJsonArtifact */ - contractName: string; + 'contractName': string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - metadata?: string; + 'metadata'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - bytecode?: string; + 'bytecode'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - deployedBytecode?: string; + 'deployedBytecode'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - sourceMap?: string; + 'sourceMap'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - deployedSourceMap?: string; + 'deployedSourceMap'?: string; /** * * @type {string} * @memberof SolidityContractJsonArtifact */ - sourcePath?: string; + 'sourcePath'?: string; /** * - * @type {{ [key: string]: object; }} + * @type {SolidityContractJsonArtifactCompiler} * @memberof SolidityContractJsonArtifact */ - compiler?: { [key: string]: object; }; + 'compiler'?: SolidityContractJsonArtifactCompiler; /** * - * @type {{ [key: string]: object; }} + * @type {{ [key: string]: any; }} * @memberof SolidityContractJsonArtifact */ - functionHashes?: { [key: string]: object; }; + 'functionHashes'?: { [key: string]: any; }; /** * - * @type {object} + * @type {SolidityContractJsonArtifactGasEstimates} * @memberof SolidityContractJsonArtifact */ - gasEstimates?: object; + 'gasEstimates'?: SolidityContractJsonArtifactGasEstimates; } /** * * @export - * @enum {string} + * @interface SolidityContractJsonArtifactCompiler */ +export interface SolidityContractJsonArtifactCompiler { + [key: string]: any; -export enum WatchBlocksV1 { - Subscribe = 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe', - Next = 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next', - Unsubscribe = 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe', - Error = 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error', - Complete = 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete' + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactCompiler + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactCompiler + */ + 'version'?: string; } +/** + * + * @export + * @interface SolidityContractJsonArtifactGasEstimates + */ +export interface SolidityContractJsonArtifactGasEstimates { + /** + * + * @type {SolidityContractJsonArtifactGasEstimatesCreation} + * @memberof SolidityContractJsonArtifactGasEstimates + */ + 'creation'?: SolidityContractJsonArtifactGasEstimatesCreation; + /** + * + * @type {{ [key: string]: any; }} + * @memberof SolidityContractJsonArtifactGasEstimates + */ + 'external'?: { [key: string]: any; }; +} +/** + * + * @export + * @interface SolidityContractJsonArtifactGasEstimatesCreation + */ +export interface SolidityContractJsonArtifactGasEstimatesCreation { + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactGasEstimatesCreation + */ + 'codeDepositCost'?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactGasEstimatesCreation + */ + 'executionCost'?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifactGasEstimatesCreation + */ + 'totalCost'?: string; +} +/** + * + * @export + * @enum {string} + */ + +export const WatchBlocksV1 = { + Subscribe: 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe', + Next: 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next', + Unsubscribe: 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe', + Error: 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error', + Complete: 'org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete' +} as const; + +export type WatchBlocksV1 = typeof WatchBlocksV1[keyof typeof WatchBlocksV1]; + /** * @@ -713,121 +807,121 @@ export interface WatchBlocksV1BlockData { * @type {number} * @memberof WatchBlocksV1BlockData */ - number: number; + 'number': number; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - hash: string; + 'hash': string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - parentHash: string; + 'parentHash': string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - nonce: string; + 'nonce': string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - sha3Uncles: string; + 'sha3Uncles': string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - logsBloom: string; + 'logsBloom': string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - transactionsRoot?: string; + 'transactionsRoot'?: string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - stateRoot: string; + 'stateRoot': string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - receiptsRoot?: string; + 'receiptsRoot'?: string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - difficulty?: string; + 'difficulty'?: string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - mixHash?: string; + 'mixHash'?: string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - miner: string; + 'miner': string; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - extraData: string; + 'extraData': string; /** * * @type {number} * @memberof WatchBlocksV1BlockData */ - gasLimit: number; + 'gasLimit': number; /** * * @type {number} * @memberof WatchBlocksV1BlockData */ - gasUsed: number; + 'gasUsed': number; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof WatchBlocksV1BlockData */ - timestamp: string | number; + 'timestamp': QuorumTransactionConfigFrom; /** * * @type {number} * @memberof WatchBlocksV1BlockData */ - size: number; + 'size': number; /** * * @type {string} * @memberof WatchBlocksV1BlockData */ - totalDifficulty: string; + 'totalDifficulty': string; /** * * @type {Array} * @memberof WatchBlocksV1BlockData */ - uncles: Array; + 'uncles': Array; /** * * @type {Array} * @memberof WatchBlocksV1BlockData */ - transactions: Array; + 'transactions': Array; } /** * @@ -840,7 +934,7 @@ export interface WatchBlocksV1Options { * @type {boolean} * @memberof WatchBlocksV1Options */ - getBlockData?: boolean; + 'getBlockData'?: boolean; } /** * @@ -853,13 +947,13 @@ export interface WatchBlocksV1Progress { * @type {Web3BlockHeader} * @memberof WatchBlocksV1Progress */ - blockHeader?: Web3BlockHeader; + 'blockHeader'?: Web3BlockHeader; /** * * @type {WatchBlocksV1BlockData} * @memberof WatchBlocksV1Progress */ - blockData?: WatchBlocksV1BlockData; + 'blockData'?: WatchBlocksV1BlockData; } /** * @@ -872,97 +966,97 @@ export interface Web3BlockHeader { * @type {number} * @memberof Web3BlockHeader */ - number: number; + 'number': number; /** * * @type {string} * @memberof Web3BlockHeader */ - hash: string; + 'hash': string; /** * * @type {string} * @memberof Web3BlockHeader */ - parentHash: string; + 'parentHash': string; /** * * @type {string} * @memberof Web3BlockHeader */ - nonce: string; + 'nonce': string; /** * * @type {string} * @memberof Web3BlockHeader */ - sha3Uncles: string; + 'sha3Uncles': string; /** * * @type {string} * @memberof Web3BlockHeader */ - logsBloom: string; + 'logsBloom': string; /** * * @type {string} * @memberof Web3BlockHeader */ - transactionsRoot?: string; + 'transactionsRoot'?: string; /** * * @type {string} * @memberof Web3BlockHeader */ - stateRoot: string; + 'stateRoot': string; /** * * @type {string} * @memberof Web3BlockHeader */ - receiptsRoot?: string; + 'receiptsRoot'?: string; /** * * @type {string} * @memberof Web3BlockHeader */ - difficulty?: string; + 'difficulty'?: string; /** * * @type {string} * @memberof Web3BlockHeader */ - mixHash?: string; + 'mixHash'?: string; /** * * @type {string} * @memberof Web3BlockHeader */ - miner: string; + 'miner': string; /** * * @type {string} * @memberof Web3BlockHeader */ - extraData: string; + 'extraData': string; /** * * @type {number} * @memberof Web3BlockHeader */ - gasLimit: number; + 'gasLimit': number; /** * * @type {number} * @memberof Web3BlockHeader */ - gasUsed: number; + 'gasUsed': number; /** * - * @type {string | number} + * @type {QuorumTransactionConfigFrom} * @memberof Web3BlockHeader */ - timestamp: string | number; + 'timestamp': QuorumTransactionConfigFrom; } /** * @type Web3SigningCredential @@ -981,26 +1075,28 @@ export interface Web3SigningCredentialCactusKeychainRef { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialCactusKeychainRef */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - ethAccount: string; + 'ethAccount': string; /** * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainEntryKey: string; + 'keychainEntryKey': string; /** * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. * @type {string} * @memberof Web3SigningCredentialCactusKeychainRef */ - keychainId?: string; + 'keychainId'?: string; } + + /** * * @export @@ -1012,20 +1108,22 @@ export interface Web3SigningCredentialGethKeychainPassword { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialGethKeychainPassword */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialGethKeychainPassword */ - ethAccount: string; + 'ethAccount': string; /** * A geth keychain unlock password. * @type {string} * @memberof Web3SigningCredentialGethKeychainPassword */ - secret: string; + 'secret': string; } + + /** * Using this denotes that there is no signing required because the transaction is pre-signed. * @export @@ -1037,8 +1135,10 @@ export interface Web3SigningCredentialNone { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialNone */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; } + + /** * * @export @@ -1050,32 +1150,37 @@ export interface Web3SigningCredentialPrivateKeyHex { * @type {Web3SigningCredentialType} * @memberof Web3SigningCredentialPrivateKeyHex */ - type: Web3SigningCredentialType; + 'type': Web3SigningCredentialType; /** * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - ethAccount: string; + 'ethAccount': string; /** * The HEX encoded private key of an eth account. * @type {string} * @memberof Web3SigningCredentialPrivateKeyHex */ - secret: string; + 'secret': string; } + + /** * * @export * @enum {string} */ -export enum Web3SigningCredentialType { - CactusKeychainRef = 'CACTUS_KEYCHAIN_REF', - GethKeychainPassword = 'GETH_KEYCHAIN_PASSWORD', - PrivateKeyHex = 'PRIVATE_KEY_HEX', - None = 'NONE' -} +export const Web3SigningCredentialType = { + CactusKeychainRef: 'CACTUS_KEYCHAIN_REF', + GethKeychainPassword: 'GETH_KEYCHAIN_PASSWORD', + PrivateKeyHex: 'PRIVATE_KEY_HEX', + None: 'NONE' +} as const; + +export type Web3SigningCredentialType = typeof Web3SigningCredentialType[keyof typeof Web3SigningCredentialType]; + /** * @@ -1088,85 +1193,85 @@ export interface Web3Transaction { * @type {string} * @memberof Web3Transaction */ - hash: string; + 'hash': string; /** * * @type {number} * @memberof Web3Transaction */ - nonce: number; + 'nonce': number; /** * * @type {string} * @memberof Web3Transaction */ - blockHash: string | null; + 'blockHash': string | null; /** * * @type {number} * @memberof Web3Transaction */ - blockNumber: number | null; + 'blockNumber': number | null; /** * * @type {number} * @memberof Web3Transaction */ - transactionIndex: number | null; + 'transactionIndex': number | null; /** * * @type {string} * @memberof Web3Transaction */ - from: string; + 'from': string; /** * * @type {string} * @memberof Web3Transaction */ - to: string | null; + 'to': string | null; /** * * @type {string} * @memberof Web3Transaction */ - value: string; + 'value': string; /** * * @type {string} * @memberof Web3Transaction */ - gasPrice: string; + 'gasPrice': string; /** * * @type {number} * @memberof Web3Transaction */ - gas: number; + 'gas': number; /** * * @type {string} * @memberof Web3Transaction */ - input: string; + 'input': string; /** * * @type {string} * @memberof Web3Transaction */ - v?: string; + 'v'?: string; /** * * @type {string} * @memberof Web3Transaction */ - r?: string; + 'r'?: string; /** * * @type {string} * @memberof Web3Transaction */ - s?: string; + 's'?: string; } /** * @@ -1174,62 +1279,62 @@ export interface Web3Transaction { * @interface Web3TransactionReceipt */ export interface Web3TransactionReceipt { - [key: string]: object | any; + [key: string]: any; /** * * @type {boolean} * @memberof Web3TransactionReceipt */ - status: boolean; + 'status': boolean; /** * * @type {string} * @memberof Web3TransactionReceipt */ - transactionHash: string; + 'transactionHash': string; /** * * @type {number} * @memberof Web3TransactionReceipt */ - transactionIndex: number; + 'transactionIndex': number; /** * * @type {string} * @memberof Web3TransactionReceipt */ - blockHash: string; + 'blockHash': string; /** * * @type {number} * @memberof Web3TransactionReceipt */ - blockNumber: number; + 'blockNumber': number; /** * * @type {number} * @memberof Web3TransactionReceipt */ - gasUsed: number; + 'gasUsed': number; /** * * @type {string} * @memberof Web3TransactionReceipt */ - contractAddress?: string | null; + 'contractAddress'?: string | null; /** * * @type {string} * @memberof Web3TransactionReceipt */ - from: string; + 'from': string; /** * * @type {string} * @memberof Web3TransactionReceipt */ - to: string; + 'to': string; } /** @@ -1245,7 +1350,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deployContractSolBytecodeJsonObjectV1: async (deployContractSolidityBytecodeJsonObjectV1Request?: DeployContractSolidityBytecodeJsonObjectV1Request, options: any = {}): Promise => { + deployContractSolBytecodeJsonObjectV1: async (deployContractSolidityBytecodeJsonObjectV1Request?: DeployContractSolidityBytecodeJsonObjectV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1262,7 +1367,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(deployContractSolidityBytecodeJsonObjectV1Request, localVarRequestOptions, configuration) @@ -1279,7 +1384,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deployContractSolBytecodeV1: async (deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options: any = {}): Promise => { + deployContractSolBytecodeV1: async (deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1296,7 +1401,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(deployContractSolidityBytecodeV1Request, localVarRequestOptions, configuration) @@ -1312,7 +1417,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPrometheusMetricsV1: async (options: any = {}): Promise => { + getPrometheusMetricsV1: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1327,7 +1432,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -1343,7 +1448,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - invokeContractV1: async (invokeContractV1Request?: InvokeContractV1Request, options: any = {}): Promise => { + invokeContractV1: async (invokeContractV1Request?: InvokeContractV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1360,7 +1465,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(invokeContractV1Request, localVarRequestOptions, configuration) @@ -1377,7 +1482,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - invokeContractV1NoKeychain: async (invokeContractJsonObjectV1Request?: InvokeContractJsonObjectV1Request, options: any = {}): Promise => { + invokeContractV1NoKeychain: async (invokeContractJsonObjectV1Request?: InvokeContractJsonObjectV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1394,7 +1499,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(invokeContractJsonObjectV1Request, localVarRequestOptions, configuration) @@ -1411,7 +1516,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - invokeRawWeb3EthContractV1: async (invokeRawWeb3EthContractV1Request?: InvokeRawWeb3EthContractV1Request, options: any = {}): Promise => { + invokeRawWeb3EthContractV1: async (invokeRawWeb3EthContractV1Request?: InvokeRawWeb3EthContractV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1428,7 +1533,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(invokeRawWeb3EthContractV1Request, localVarRequestOptions, configuration) @@ -1445,7 +1550,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - invokeWeb3EthMethodV1: async (invokeRawWeb3EthMethodV1Request?: InvokeRawWeb3EthMethodV1Request, options: any = {}): Promise => { + invokeWeb3EthMethodV1: async (invokeRawWeb3EthMethodV1Request?: InvokeRawWeb3EthMethodV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1462,7 +1567,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(invokeRawWeb3EthMethodV1Request, localVarRequestOptions, configuration) @@ -1479,7 +1584,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - runTransactionV1: async (runTransactionRequest?: RunTransactionRequest, options: any = {}): Promise => { + runTransactionV1: async (runTransactionRequest?: RunTransactionRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1496,7 +1601,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(runTransactionRequest, localVarRequestOptions, configuration) @@ -1523,7 +1628,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request?: DeployContractSolidityBytecodeJsonObjectV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request?: DeployContractSolidityBytecodeJsonObjectV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1534,7 +1639,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1544,7 +1649,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getPrometheusMetricsV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async getPrometheusMetricsV1(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPrometheusMetricsV1(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1555,7 +1660,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.invokeContractV1(invokeContractV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1566,7 +1671,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async invokeContractV1NoKeychain(invokeContractJsonObjectV1Request?: InvokeContractJsonObjectV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async invokeContractV1NoKeychain(invokeContractJsonObjectV1Request?: InvokeContractJsonObjectV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.invokeContractV1NoKeychain(invokeContractJsonObjectV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1577,7 +1682,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request?: InvokeRawWeb3EthContractV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request?: InvokeRawWeb3EthContractV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1588,7 +1693,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request?: InvokeRawWeb3EthMethodV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request?: InvokeRawWeb3EthMethodV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1599,7 +1704,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async runTransactionV1(runTransactionRequest?: RunTransactionRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async runTransactionV1(runTransactionRequest?: RunTransactionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.runTransactionV1(runTransactionRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1710,7 +1815,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request?: DeployContractSolidityBytecodeJsonObjectV1Request, options?: any) { + public deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request?: DeployContractSolidityBytecodeJsonObjectV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1722,7 +1827,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options?: any) { + public deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request?: DeployContractSolidityBytecodeV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1733,7 +1838,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public getPrometheusMetricsV1(options?: any) { + public getPrometheusMetricsV1(options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).getPrometheusMetricsV1(options).then((request) => request(this.axios, this.basePath)); } @@ -1745,7 +1850,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any) { + public invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).invokeContractV1(invokeContractV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1757,7 +1862,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public invokeContractV1NoKeychain(invokeContractJsonObjectV1Request?: InvokeContractJsonObjectV1Request, options?: any) { + public invokeContractV1NoKeychain(invokeContractJsonObjectV1Request?: InvokeContractJsonObjectV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).invokeContractV1NoKeychain(invokeContractJsonObjectV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1769,7 +1874,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request?: InvokeRawWeb3EthContractV1Request, options?: any) { + public invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request?: InvokeRawWeb3EthContractV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1781,7 +1886,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request?: InvokeRawWeb3EthMethodV1Request, options?: any) { + public invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request?: InvokeRawWeb3EthMethodV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -1793,7 +1898,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public runTransactionV1(runTransactionRequest?: RunTransactionRequest, options?: any) { + public runTransactionV1(runTransactionRequest?: RunTransactionRequest, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).runTransactionV1(runTransactionRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/base.ts index 3a4258beb8..bccd2a204c 100644 --- a/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/common.ts index c3f7a841ef..5e3dc6aaaf 100644 --- a/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; } diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/openapitools.json b/packages/cactus-plugin-ledger-connector-ubiquity/openapitools.json index 54d00804a3..03392961f6 100644 --- a/packages/cactus-plugin-ledger-connector-ubiquity/openapitools.json +++ b/packages/cactus-plugin-ledger-connector-ubiquity/openapitools.json @@ -2,6 +2,6 @@ "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "6.0.1" + "version": "6.3.0" } } diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 6d54bbd775..e7e42a4b58 100644 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -6.0.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/api.ts index b487c2e579..d989331275 100644 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * Gets transactions that an address was involved with, from newest to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/base.ts index 3a29f50c20..21740fdfd0 100644 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/common.ts index 319f2b5d77..7bee5cf8cf 100644 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance, AxiosResponse } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } diff --git a/packages/cactus-plugin-odap-hermes/openapitools.json b/packages/cactus-plugin-odap-hermes/openapitools.json index 601ac1d61f..03392961f6 100644 --- a/packages/cactus-plugin-odap-hermes/openapitools.json +++ b/packages/cactus-plugin-odap-hermes/openapitools.json @@ -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" } } diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index d805df58e4..54b948c8a5 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -6,7 +6,7 @@ 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 @@ -14,6 +14,7 @@ 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 diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/README.md index eeb1bf2134..52f3d78b15 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -1,9 +1,18 @@ # org.openapitools.client - Kotlin client library for Hyperledger Cactus Plugin - Odap Hermes +Implementation for Odap and Hermes + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.0.1 +- 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 diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/build.gradle b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/build.gradle index 3de8b45b13..66a3c68b89 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/build.gradle +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/build.gradle @@ -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" } @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'kotlin' +apply plugin: 'maven-publish' repositories { maven { url "https://repo1.maven.org/maven2" } @@ -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" } diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index b4b85797ce..aada4a542e 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -20,6 +15,10 @@ package org.openapitools.client.apis +import java.io.IOException +import okhttp3.OkHttpClient +import okhttp3.HttpUrl + import org.openapitools.client.models.ClientV1Request import org.openapitools.client.models.CommitFinalV1Request import org.openapitools.client.models.CommitFinalV1Response @@ -39,43 +38,45 @@ import org.openapitools.client.models.TransferCompleteV1Request import org.openapitools.client.models.TransferInitializationV1Request import org.openapitools.client.models.TransferInitializationV1Response +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") } } /** - * - * - * @param clientV1Request (optional) - * @return kotlin.Any - * @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 - */ + * + * + * @param clientV1Request (optional) + * @return kotlin.Any + * @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 clientRequestV1(clientV1Request: ClientV1Request?) : kotlin.Any { - val localVariableConfig = clientRequestV1RequestConfig(clientV1Request = clientV1Request) - - val localVarResponse = request( - localVariableConfig - ) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun clientRequestV1(clientV1Request: ClientV1Request? = null) : kotlin.Any { + val localVarResponse = clientRequestV1WithHttpInfo(clientV1Request = clientV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Any @@ -93,41 +94,60 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation clientRequestV1 - * - * @param clientV1Request (optional) - * @return RequestConfig - */ + * + * + * @param clientV1Request (optional) + * @return ApiResponse + * @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 clientRequestV1WithHttpInfo(clientV1Request: ClientV1Request?) : ApiResponse { + val localVariableConfig = clientRequestV1RequestConfig(clientV1Request = clientV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation clientRequestV1 + * + * @param clientV1Request (optional) + * @return RequestConfig + */ fun clientRequestV1RequestConfig(clientV1Request: ClientV1Request?) : RequestConfig { val localVariableBody = clientV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param transferInitializationV1Request (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase1TransferInitiationRequestV1(transferInitializationV1Request: TransferInitializationV1Request?) : Unit { - val localVariableConfig = phase1TransferInitiationRequestV1RequestConfig(transferInitializationV1Request = transferInitializationV1Request) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param transferInitializationV1Request (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase1TransferInitiationRequestV1(transferInitializationV1Request: TransferInitializationV1Request? = null) : Unit { + val localVarResponse = phase1TransferInitiationRequestV1WithHttpInfo(transferInitializationV1Request = transferInitializationV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -145,41 +165,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase1TransferInitiationRequestV1 - * - * @param transferInitializationV1Request (optional) - * @return RequestConfig - */ + * + * + * @param transferInitializationV1Request (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase1TransferInitiationRequestV1WithHttpInfo(transferInitializationV1Request: TransferInitializationV1Request?) : ApiResponse { + val localVariableConfig = phase1TransferInitiationRequestV1RequestConfig(transferInitializationV1Request = transferInitializationV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase1TransferInitiationRequestV1 + * + * @param transferInitializationV1Request (optional) + * @return RequestConfig + */ fun phase1TransferInitiationRequestV1RequestConfig(transferInitializationV1Request: TransferInitializationV1Request?) : RequestConfig { val localVariableBody = transferInitializationV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param transferInitializationV1Response (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase1TransferInitiationResponseV1(transferInitializationV1Response: TransferInitializationV1Response?) : Unit { - val localVariableConfig = phase1TransferInitiationResponseV1RequestConfig(transferInitializationV1Response = transferInitializationV1Response) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param transferInitializationV1Response (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase1TransferInitiationResponseV1(transferInitializationV1Response: TransferInitializationV1Response? = null) : Unit { + val localVarResponse = phase1TransferInitiationResponseV1WithHttpInfo(transferInitializationV1Response = transferInitializationV1Response) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -197,41 +234,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase1TransferInitiationResponseV1 - * - * @param transferInitializationV1Response (optional) - * @return RequestConfig - */ + * + * + * @param transferInitializationV1Response (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase1TransferInitiationResponseV1WithHttpInfo(transferInitializationV1Response: TransferInitializationV1Response?) : ApiResponse { + val localVariableConfig = phase1TransferInitiationResponseV1RequestConfig(transferInitializationV1Response = transferInitializationV1Response) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase1TransferInitiationResponseV1 + * + * @param transferInitializationV1Response (optional) + * @return RequestConfig + */ fun phase1TransferInitiationResponseV1RequestConfig(transferInitializationV1Response: TransferInitializationV1Response?) : RequestConfig { val localVariableBody = transferInitializationV1Response val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param lockEvidenceV1Request (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase2LockEvidenceRequestV1(lockEvidenceV1Request: LockEvidenceV1Request?) : Unit { - val localVariableConfig = phase2LockEvidenceRequestV1RequestConfig(lockEvidenceV1Request = lockEvidenceV1Request) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param lockEvidenceV1Request (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase2LockEvidenceRequestV1(lockEvidenceV1Request: LockEvidenceV1Request? = null) : Unit { + val localVarResponse = phase2LockEvidenceRequestV1WithHttpInfo(lockEvidenceV1Request = lockEvidenceV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -249,41 +303,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase2LockEvidenceRequestV1 - * - * @param lockEvidenceV1Request (optional) - * @return RequestConfig - */ + * + * + * @param lockEvidenceV1Request (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase2LockEvidenceRequestV1WithHttpInfo(lockEvidenceV1Request: LockEvidenceV1Request?) : ApiResponse { + val localVariableConfig = phase2LockEvidenceRequestV1RequestConfig(lockEvidenceV1Request = lockEvidenceV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase2LockEvidenceRequestV1 + * + * @param lockEvidenceV1Request (optional) + * @return RequestConfig + */ fun phase2LockEvidenceRequestV1RequestConfig(lockEvidenceV1Request: LockEvidenceV1Request?) : RequestConfig { val localVariableBody = lockEvidenceV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param lockEvidenceV1Response (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase2LockEvidenceResponseV1(lockEvidenceV1Response: LockEvidenceV1Response?) : Unit { - val localVariableConfig = phase2LockEvidenceResponseV1RequestConfig(lockEvidenceV1Response = lockEvidenceV1Response) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param lockEvidenceV1Response (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase2LockEvidenceResponseV1(lockEvidenceV1Response: LockEvidenceV1Response? = null) : Unit { + val localVarResponse = phase2LockEvidenceResponseV1WithHttpInfo(lockEvidenceV1Response = lockEvidenceV1Response) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -301,41 +372,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase2LockEvidenceResponseV1 - * - * @param lockEvidenceV1Response (optional) - * @return RequestConfig - */ + * + * + * @param lockEvidenceV1Response (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase2LockEvidenceResponseV1WithHttpInfo(lockEvidenceV1Response: LockEvidenceV1Response?) : ApiResponse { + val localVariableConfig = phase2LockEvidenceResponseV1RequestConfig(lockEvidenceV1Response = lockEvidenceV1Response) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase2LockEvidenceResponseV1 + * + * @param lockEvidenceV1Response (optional) + * @return RequestConfig + */ fun phase2LockEvidenceResponseV1RequestConfig(lockEvidenceV1Response: LockEvidenceV1Response?) : RequestConfig { val localVariableBody = lockEvidenceV1Response val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param transferCommenceV1Request (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase2TransferCommenceRequestV1(transferCommenceV1Request: TransferCommenceV1Request?) : Unit { - val localVariableConfig = phase2TransferCommenceRequestV1RequestConfig(transferCommenceV1Request = transferCommenceV1Request) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param transferCommenceV1Request (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase2TransferCommenceRequestV1(transferCommenceV1Request: TransferCommenceV1Request? = null) : Unit { + val localVarResponse = phase2TransferCommenceRequestV1WithHttpInfo(transferCommenceV1Request = transferCommenceV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -353,41 +441,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase2TransferCommenceRequestV1 - * - * @param transferCommenceV1Request (optional) - * @return RequestConfig - */ + * + * + * @param transferCommenceV1Request (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase2TransferCommenceRequestV1WithHttpInfo(transferCommenceV1Request: TransferCommenceV1Request?) : ApiResponse { + val localVariableConfig = phase2TransferCommenceRequestV1RequestConfig(transferCommenceV1Request = transferCommenceV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase2TransferCommenceRequestV1 + * + * @param transferCommenceV1Request (optional) + * @return RequestConfig + */ fun phase2TransferCommenceRequestV1RequestConfig(transferCommenceV1Request: TransferCommenceV1Request?) : RequestConfig { val localVariableBody = transferCommenceV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param transferCommenceV1Response (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase2TransferCommenceResponseV1(transferCommenceV1Response: TransferCommenceV1Response?) : Unit { - val localVariableConfig = phase2TransferCommenceResponseV1RequestConfig(transferCommenceV1Response = transferCommenceV1Response) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param transferCommenceV1Response (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase2TransferCommenceResponseV1(transferCommenceV1Response: TransferCommenceV1Response? = null) : Unit { + val localVarResponse = phase2TransferCommenceResponseV1WithHttpInfo(transferCommenceV1Response = transferCommenceV1Response) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -405,41 +510,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase2TransferCommenceResponseV1 - * - * @param transferCommenceV1Response (optional) - * @return RequestConfig - */ + * + * + * @param transferCommenceV1Response (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase2TransferCommenceResponseV1WithHttpInfo(transferCommenceV1Response: TransferCommenceV1Response?) : ApiResponse { + val localVariableConfig = phase2TransferCommenceResponseV1RequestConfig(transferCommenceV1Response = transferCommenceV1Response) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase2TransferCommenceResponseV1 + * + * @param transferCommenceV1Response (optional) + * @return RequestConfig + */ fun phase2TransferCommenceResponseV1RequestConfig(transferCommenceV1Response: TransferCommenceV1Response?) : RequestConfig { val localVariableBody = transferCommenceV1Response val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param commitFinalV1Request (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase3CommitFinalRequestV1(commitFinalV1Request: CommitFinalV1Request?) : Unit { - val localVariableConfig = phase3CommitFinalRequestV1RequestConfig(commitFinalV1Request = commitFinalV1Request) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param commitFinalV1Request (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase3CommitFinalRequestV1(commitFinalV1Request: CommitFinalV1Request? = null) : Unit { + val localVarResponse = phase3CommitFinalRequestV1WithHttpInfo(commitFinalV1Request = commitFinalV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -457,41 +579,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase3CommitFinalRequestV1 - * - * @param commitFinalV1Request (optional) - * @return RequestConfig - */ + * + * + * @param commitFinalV1Request (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase3CommitFinalRequestV1WithHttpInfo(commitFinalV1Request: CommitFinalV1Request?) : ApiResponse { + val localVariableConfig = phase3CommitFinalRequestV1RequestConfig(commitFinalV1Request = commitFinalV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase3CommitFinalRequestV1 + * + * @param commitFinalV1Request (optional) + * @return RequestConfig + */ fun phase3CommitFinalRequestV1RequestConfig(commitFinalV1Request: CommitFinalV1Request?) : RequestConfig { val localVariableBody = commitFinalV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param commitFinalV1Response (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase3CommitFinalResponseV1(commitFinalV1Response: CommitFinalV1Response?) : Unit { - val localVariableConfig = phase3CommitFinalResponseV1RequestConfig(commitFinalV1Response = commitFinalV1Response) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param commitFinalV1Response (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase3CommitFinalResponseV1(commitFinalV1Response: CommitFinalV1Response? = null) : Unit { + val localVarResponse = phase3CommitFinalResponseV1WithHttpInfo(commitFinalV1Response = commitFinalV1Response) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -509,41 +648,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase3CommitFinalResponseV1 - * - * @param commitFinalV1Response (optional) - * @return RequestConfig - */ + * + * + * @param commitFinalV1Response (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase3CommitFinalResponseV1WithHttpInfo(commitFinalV1Response: CommitFinalV1Response?) : ApiResponse { + val localVariableConfig = phase3CommitFinalResponseV1RequestConfig(commitFinalV1Response = commitFinalV1Response) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase3CommitFinalResponseV1 + * + * @param commitFinalV1Response (optional) + * @return RequestConfig + */ fun phase3CommitFinalResponseV1RequestConfig(commitFinalV1Response: CommitFinalV1Response?) : RequestConfig { val localVariableBody = commitFinalV1Response val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param commitPreparationV1Request (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase3CommitPreparationRequestV1(commitPreparationV1Request: CommitPreparationV1Request?) : Unit { - val localVariableConfig = phase3CommitPreparationRequestV1RequestConfig(commitPreparationV1Request = commitPreparationV1Request) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param commitPreparationV1Request (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase3CommitPreparationRequestV1(commitPreparationV1Request: CommitPreparationV1Request? = null) : Unit { + val localVarResponse = phase3CommitPreparationRequestV1WithHttpInfo(commitPreparationV1Request = commitPreparationV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -561,41 +717,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase3CommitPreparationRequestV1 - * - * @param commitPreparationV1Request (optional) - * @return RequestConfig - */ + * + * + * @param commitPreparationV1Request (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase3CommitPreparationRequestV1WithHttpInfo(commitPreparationV1Request: CommitPreparationV1Request?) : ApiResponse { + val localVariableConfig = phase3CommitPreparationRequestV1RequestConfig(commitPreparationV1Request = commitPreparationV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase3CommitPreparationRequestV1 + * + * @param commitPreparationV1Request (optional) + * @return RequestConfig + */ fun phase3CommitPreparationRequestV1RequestConfig(commitPreparationV1Request: CommitPreparationV1Request?) : RequestConfig { val localVariableBody = commitPreparationV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param commitPreparationV1Response (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase3CommitPreparationResponseV1(commitPreparationV1Response: CommitPreparationV1Response?) : Unit { - val localVariableConfig = phase3CommitPreparationResponseV1RequestConfig(commitPreparationV1Response = commitPreparationV1Response) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param commitPreparationV1Response (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase3CommitPreparationResponseV1(commitPreparationV1Response: CommitPreparationV1Response? = null) : Unit { + val localVarResponse = phase3CommitPreparationResponseV1WithHttpInfo(commitPreparationV1Response = commitPreparationV1Response) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -613,41 +786,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase3CommitPreparationResponseV1 - * - * @param commitPreparationV1Response (optional) - * @return RequestConfig - */ + * + * + * @param commitPreparationV1Response (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase3CommitPreparationResponseV1WithHttpInfo(commitPreparationV1Response: CommitPreparationV1Response?) : ApiResponse { + val localVariableConfig = phase3CommitPreparationResponseV1RequestConfig(commitPreparationV1Response = commitPreparationV1Response) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase3CommitPreparationResponseV1 + * + * @param commitPreparationV1Response (optional) + * @return RequestConfig + */ fun phase3CommitPreparationResponseV1RequestConfig(commitPreparationV1Response: CommitPreparationV1Response?) : RequestConfig { val localVariableBody = commitPreparationV1Response val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param transferCompleteV1Request (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun phase3TransferCompleteRequestV1(transferCompleteV1Request: TransferCompleteV1Request?) : Unit { - val localVariableConfig = phase3TransferCompleteRequestV1RequestConfig(transferCompleteV1Request = transferCompleteV1Request) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param transferCompleteV1Request (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun phase3TransferCompleteRequestV1(transferCompleteV1Request: TransferCompleteV1Request? = null) : Unit { + val localVarResponse = phase3TransferCompleteRequestV1WithHttpInfo(transferCompleteV1Request = transferCompleteV1Request) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -665,41 +855,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation phase3TransferCompleteRequestV1 - * - * @param transferCompleteV1Request (optional) - * @return RequestConfig - */ + * + * + * @param transferCompleteV1Request (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun phase3TransferCompleteRequestV1WithHttpInfo(transferCompleteV1Request: TransferCompleteV1Request?) : ApiResponse { + val localVariableConfig = phase3TransferCompleteRequestV1RequestConfig(transferCompleteV1Request = transferCompleteV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation phase3TransferCompleteRequestV1 + * + * @param transferCompleteV1Request (optional) + * @return RequestConfig + */ fun phase3TransferCompleteRequestV1RequestConfig(transferCompleteV1Request: TransferCompleteV1Request?) : RequestConfig { val localVariableBody = transferCompleteV1Request val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.GET, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param recoverUpdateAckV1Message (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun recoverUpdateAckV1Message(recoverUpdateAckV1Message: RecoverUpdateAckV1Message?) : Unit { - val localVariableConfig = recoverUpdateAckV1MessageRequestConfig(recoverUpdateAckV1Message = recoverUpdateAckV1Message) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param recoverUpdateAckV1Message (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun recoverUpdateAckV1Message(recoverUpdateAckV1Message: RecoverUpdateAckV1Message? = null) : Unit { + val localVarResponse = recoverUpdateAckV1MessageWithHttpInfo(recoverUpdateAckV1Message = recoverUpdateAckV1Message) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -717,41 +924,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation recoverUpdateAckV1Message - * - * @param recoverUpdateAckV1Message (optional) - * @return RequestConfig - */ + * + * + * @param recoverUpdateAckV1Message (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun recoverUpdateAckV1MessageWithHttpInfo(recoverUpdateAckV1Message: RecoverUpdateAckV1Message?) : ApiResponse { + val localVariableConfig = recoverUpdateAckV1MessageRequestConfig(recoverUpdateAckV1Message = recoverUpdateAckV1Message) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation recoverUpdateAckV1Message + * + * @param recoverUpdateAckV1Message (optional) + * @return RequestConfig + */ fun recoverUpdateAckV1MessageRequestConfig(recoverUpdateAckV1Message: RecoverUpdateAckV1Message?) : RequestConfig { val localVariableBody = recoverUpdateAckV1Message val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param recoverUpdateV1Message (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun recoverUpdateV1Message(recoverUpdateV1Message: RecoverUpdateV1Message?) : Unit { - val localVariableConfig = recoverUpdateV1MessageRequestConfig(recoverUpdateV1Message = recoverUpdateV1Message) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param recoverUpdateV1Message (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun recoverUpdateV1Message(recoverUpdateV1Message: RecoverUpdateV1Message? = null) : Unit { + val localVarResponse = recoverUpdateV1MessageWithHttpInfo(recoverUpdateV1Message = recoverUpdateV1Message) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -769,41 +993,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation recoverUpdateV1Message - * - * @param recoverUpdateV1Message (optional) - * @return RequestConfig - */ + * + * + * @param recoverUpdateV1Message (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun recoverUpdateV1MessageWithHttpInfo(recoverUpdateV1Message: RecoverUpdateV1Message?) : ApiResponse { + val localVariableConfig = recoverUpdateV1MessageRequestConfig(recoverUpdateV1Message = recoverUpdateV1Message) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation recoverUpdateV1Message + * + * @param recoverUpdateV1Message (optional) + * @return RequestConfig + */ fun recoverUpdateV1MessageRequestConfig(recoverUpdateV1Message: RecoverUpdateV1Message?) : RequestConfig { val localVariableBody = recoverUpdateV1Message val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param recoverV1Message (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun recoverV1Message(recoverV1Message: RecoverV1Message?) : Unit { - val localVariableConfig = recoverV1MessageRequestConfig(recoverV1Message = recoverV1Message) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param recoverV1Message (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun recoverV1Message(recoverV1Message: RecoverV1Message? = null) : Unit { + val localVarResponse = recoverV1MessageWithHttpInfo(recoverV1Message = recoverV1Message) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -821,41 +1062,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation recoverV1Message - * - * @param recoverV1Message (optional) - * @return RequestConfig - */ + * + * + * @param recoverV1Message (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun recoverV1MessageWithHttpInfo(recoverV1Message: RecoverV1Message?) : ApiResponse { + val localVariableConfig = recoverV1MessageRequestConfig(recoverV1Message = recoverV1Message) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation recoverV1Message + * + * @param recoverV1Message (optional) + * @return RequestConfig + */ fun recoverV1MessageRequestConfig(recoverV1Message: RecoverV1Message?) : RequestConfig { val localVariableBody = recoverV1Message val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param recoverSuccessV1Message (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun recoverV1Success(recoverSuccessV1Message: RecoverSuccessV1Message?) : Unit { - val localVariableConfig = recoverV1SuccessRequestConfig(recoverSuccessV1Message = recoverSuccessV1Message) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param recoverSuccessV1Message (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun recoverV1Success(recoverSuccessV1Message: RecoverSuccessV1Message? = null) : Unit { + val localVarResponse = recoverV1SuccessWithHttpInfo(recoverSuccessV1Message = recoverSuccessV1Message) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -873,41 +1131,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation recoverV1Success - * - * @param recoverSuccessV1Message (optional) - * @return RequestConfig - */ + * + * + * @param recoverSuccessV1Message (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun recoverV1SuccessWithHttpInfo(recoverSuccessV1Message: RecoverSuccessV1Message?) : ApiResponse { + val localVariableConfig = recoverV1SuccessRequestConfig(recoverSuccessV1Message = recoverSuccessV1Message) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation recoverV1Success + * + * @param recoverSuccessV1Message (optional) + * @return RequestConfig + */ fun recoverV1SuccessRequestConfig(recoverSuccessV1Message: RecoverSuccessV1Message?) : RequestConfig { val localVariableBody = recoverSuccessV1Message val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param rollbackAckV1Message (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun rollbackAckV1Message(rollbackAckV1Message: RollbackAckV1Message?) : Unit { - val localVariableConfig = rollbackAckV1MessageRequestConfig(rollbackAckV1Message = rollbackAckV1Message) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param rollbackAckV1Message (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun rollbackAckV1Message(rollbackAckV1Message: RollbackAckV1Message? = null) : Unit { + val localVarResponse = rollbackAckV1MessageWithHttpInfo(rollbackAckV1Message = rollbackAckV1Message) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -925,41 +1200,58 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation rollbackAckV1Message - * - * @param rollbackAckV1Message (optional) - * @return RequestConfig - */ + * + * + * @param rollbackAckV1Message (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun rollbackAckV1MessageWithHttpInfo(rollbackAckV1Message: RollbackAckV1Message?) : ApiResponse { + val localVariableConfig = rollbackAckV1MessageRequestConfig(rollbackAckV1Message = rollbackAckV1Message) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation rollbackAckV1Message + * + * @param rollbackAckV1Message (optional) + * @return RequestConfig + */ fun rollbackAckV1MessageRequestConfig(rollbackAckV1Message: RollbackAckV1Message?) : RequestConfig { val localVariableBody = rollbackAckV1Message val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage", query = localVariableQuery, headers = localVariableHeaders, + requiresAuthentication = false, body = localVariableBody ) } /** - * - * - * @param rollbackV1Message (optional) - * @return void - * @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 - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun rollbackV1Message(rollbackV1Message: RollbackV1Message?) : Unit { - val localVariableConfig = rollbackV1MessageRequestConfig(rollbackV1Message = rollbackV1Message) - - val localVarResponse = request( - localVariableConfig - ) + * + * + * @param rollbackV1Message (optional) + * @return void + * @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 + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun rollbackV1Message(rollbackV1Message: RollbackV1Message? = null) : Unit { + val localVarResponse = rollbackV1MessageWithHttpInfo(rollbackV1Message = rollbackV1Message) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -977,23 +1269,45 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath } /** - * To obtain the request config of the operation rollbackV1Message - * - * @param rollbackV1Message (optional) - * @return RequestConfig - */ + * + * + * @param rollbackV1Message (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun rollbackV1MessageWithHttpInfo(rollbackV1Message: RollbackV1Message?) : ApiResponse { + val localVariableConfig = rollbackV1MessageRequestConfig(rollbackV1Message = rollbackV1Message) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation rollbackV1Message + * + * @param rollbackV1Message (optional) + * @return RequestConfig + */ fun rollbackV1MessageRequestConfig(rollbackV1Message: RollbackV1Message?) : RequestConfig { val localVariableBody = rollbackV1Message val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage", 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] } diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41..757080d7ed 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,21 +10,26 @@ import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers +import okhttp3.Headers.Companion.toHeaders import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException 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) { +open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { protected const val ContentType = "Content-Type" protected const val Accept = "Accept" @@ -39,9 +44,10 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic - val client: OkHttpClient by lazy { + val defaultClient: OkHttpClient by lazy { builder.build() } @@ -60,48 +66,50 @@ open class ApiClient(val baseUrl: String) { return contentType ?: "application/octet-stream" } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) - mediaType == FormDataMediaType -> { + content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) + mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) .apply { - // content's type *must* be Map + // 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}\"" + (content as Map>).forEach { (name, part) -> + if (part.body is File) { + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") + val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() + addPart( + partHeaders.toHeaders(), + part.body.asRequestBody(fileMediaType) ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) + val partHeaders = part.headers.toMutableMap() + + ("Content-Disposition" to "form-data; name=\"$name\"") addPart( - partHeaders, - parameterToString(value).toRequestBody(null) + partHeaders.toHeaders(), + parameterToString(part.body).toRequestBody(null) ) } } }.build() - } mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map> @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map>).forEach { (name, part) -> + add(name, parameterToString(part.body)) } }.build() } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) + mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody((mediaType ?: JsonMediaType).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.") @@ -112,31 +120,35 @@ open class ApiClient(val baseUrl: String) { if(body == null) { return null } + if (T::class.java == File::class.java) { + // return tempFile + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options + val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + tempFile.deleteOnExit() + body.byteStream().use { inputStream -> + tempFile.outputStream().use { tempFileOutputStream -> + inputStream.copyTo(tempFileOutputStream) + } + } + return tempFile as T + } 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) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) + .addEncodedPathSegments(requestConfig.path.trimStart('/')) .apply { requestConfig.query.forEach { query -> query.value.forEach { queryValue -> @@ -146,7 +158,7 @@ open class ApiClient(val baseUrl: String) { }.build() // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { + if (requestConfig.body != null && requestConfig.headers[ContentType].isNullOrEmpty()) { requestConfig.headers[ContentType] = JsonMediaType } if (requestConfig.headers[Accept].isNullOrEmpty()) { @@ -154,16 +166,16 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { + if (headers[Accept].isNullOrEmpty()) { 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 contentType = if (headers[ContentType] != null) { + // TODO: support multiple contentType options here. + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + } else { + null + } val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) @@ -178,6 +190,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> @@ -215,7 +228,7 @@ open class ApiClient(val baseUrl: String) { 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 -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(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() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt index fb2c972cf8..064b57fc6b 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -14,4 +14,4 @@ class BigDecimalAdapter { fun fromJson(value: String): BigDecimal { return BigDecimal(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt index 4b6963110c..7df6057b45 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -14,4 +14,4 @@ class BigIntegerAdapter { fun fromJson(value: String): BigInteger { return BigInteger(value) } -} \ No newline at end of file +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 0000000000..be00e38fba --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 7e948e1dd0..625a19002b 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -13,5 +13,6 @@ data class RequestConfig( val path: String, val headers: MutableMap = mutableMapOf(), val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, val body: T? = null ) \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AssetProfile.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AssetProfile.kt index 8ac097b537..d7e338ca33 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AssetProfile.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/AssetProfile.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -40,6 +35,7 @@ import com.squareup.moshi.Json * @param ledgerRequirements */ + data class AssetProfile ( @Json(name = "expirationDate") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClientV1Request.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClientV1Request.kt index 3a01329117..5d4a16791a 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClientV1Request.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClientV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -53,6 +48,7 @@ import com.squareup.moshi.Json * @param recipientLedgerAssetID */ + data class ClientV1Request ( @Json(name = "version") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClientV1RequestClientGatewayConfiguration.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClientV1RequestClientGatewayConfiguration.kt index 6fc40d9c20..504f22e72e 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClientV1RequestClientGatewayConfiguration.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ClientV1RequestClientGatewayConfiguration.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -29,6 +24,7 @@ import com.squareup.moshi.Json * @param apiHost */ + data class ClientV1RequestClientGatewayConfiguration ( @Json(name = "apiHost") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitFinalV1Request.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitFinalV1Request.kt index 53d0a70a0c..47f4f961e8 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitFinalV1Request.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitFinalV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -38,6 +33,7 @@ import com.squareup.moshi.Json * @param clientTransferNumber */ + data class CommitFinalV1Request ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitFinalV1Response.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitFinalV1Response.kt index 26ea09ca97..62c4cf3366 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitFinalV1Response.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitFinalV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -38,6 +33,7 @@ import com.squareup.moshi.Json * @param serverTransferNumber */ + data class CommitFinalV1Response ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitPreparationV1Request.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitPreparationV1Request.kt index 3833320b18..dddb775189 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitPreparationV1Request.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitPreparationV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -36,6 +31,7 @@ import com.squareup.moshi.Json * @param clientTransferNumber */ + data class CommitPreparationV1Request ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitPreparationV1Response.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitPreparationV1Response.kt index 0f9133a85b..e7774c6a69 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitPreparationV1Response.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CommitPreparationV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -36,6 +31,7 @@ import com.squareup.moshi.Json * @param serverTransferNumber */ + data class CommitPreparationV1Response ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CredentialProfile.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CredentialProfile.kt index b0820be7d1..0c74f0373c 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CredentialProfile.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CredentialProfile.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -53,12 +48,12 @@ enum class CredentialProfile(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is CredentialProfile) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is CredentialProfile) "$data" else null /** * Returns a valid [CredentialProfile] for [data], null otherwise. */ - fun decode(data: Any?): CredentialProfile? = data?.let { + fun decode(data: kotlin.Any?): CredentialProfile? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/History.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/History.kt index 28b4c5380a..142f7c2efb 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/History.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/History.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -35,6 +30,7 @@ import com.squareup.moshi.Json * @param applicationSpecificParameters */ + data class History ( @Json(name = "Transactions") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LockEvidenceV1Request.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LockEvidenceV1Request.kt index 66cfe1f2d0..c357047911 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LockEvidenceV1Request.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LockEvidenceV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -40,6 +35,7 @@ import com.squareup.moshi.Json * @param messageHash */ + data class LockEvidenceV1Request ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LockEvidenceV1Response.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LockEvidenceV1Response.kt index 2cdbfc9fd0..8e8de79399 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LockEvidenceV1Response.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/LockEvidenceV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -36,6 +31,7 @@ import com.squareup.moshi.Json * @param serverTransferNumber */ + data class LockEvidenceV1Response ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapLocalLog.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapLocalLog.kt index bcfcbcf140..0ffd5ca5a2 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapLocalLog.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapLocalLog.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -34,6 +29,7 @@ import com.squareup.moshi.Json * @param timestamp */ + data class OdapLocalLog ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapMessage.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapMessage.kt index 77c2815ce8..3d25bdad4e 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapMessage.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapMessage.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -42,6 +37,7 @@ import com.squareup.moshi.Json * @param messageSignature */ + data class OdapMessage ( @Json(name = "SequenceNumber") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapMessageActionResponse.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapMessageActionResponse.kt index 8673ac67cf..85525355e8 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapMessageActionResponse.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/OdapMessageActionResponse.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -30,6 +25,7 @@ import com.squareup.moshi.Json * @param arguments */ + data class OdapMessageActionResponse ( @Json(name = "ResponseCode") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PayloadProfile.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PayloadProfile.kt index 2157a47d6b..dfc8127c0b 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PayloadProfile.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/PayloadProfile.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param capabilities */ + data class PayloadProfile ( @Json(name = "assetProfile") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverSuccessV1Message.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverSuccessV1Message.kt index 0b59d3326d..c9283a7aa4 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverSuccessV1Message.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverSuccessV1Message.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param signature */ + data class RecoverSuccessV1Message ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverUpdateAckV1Message.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverUpdateAckV1Message.kt index 26467411ea..91033eac53 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverUpdateAckV1Message.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverUpdateAckV1Message.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param signature */ + data class RecoverUpdateAckV1Message ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverUpdateV1Message.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverUpdateV1Message.kt index b7580fa75a..a2469113a4 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverUpdateV1Message.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverUpdateV1Message.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -32,6 +27,7 @@ import com.squareup.moshi.Json * @param signature */ + data class RecoverUpdateV1Message ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverV1Message.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverV1Message.kt index 3afc534216..7a1dbfbf2c 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverV1Message.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RecoverV1Message.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -36,6 +31,7 @@ import com.squareup.moshi.Json * @param newGatewayPubKey */ + data class RecoverV1Message ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RollbackAckV1Message.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RollbackAckV1Message.kt index 6d362fe868..266781868c 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RollbackAckV1Message.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RollbackAckV1Message.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -31,6 +26,7 @@ import com.squareup.moshi.Json * @param signature */ + data class RollbackAckV1Message ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RollbackV1Message.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RollbackV1Message.kt index 3119d50923..712b3f9bb7 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RollbackV1Message.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RollbackV1Message.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -33,6 +28,7 @@ import com.squareup.moshi.Json * @param signature */ + data class RollbackV1Message ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SessionData.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SessionData.kt index dd8a24e7ae..5beebafa1e 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SessionData.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SessionData.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -91,6 +86,7 @@ import com.squareup.moshi.Json * @param rollbackActionsPerformed */ + data class SessionData ( @Json(name = "id") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCommenceV1Request.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCommenceV1Request.kt index d0f6cb95be..9b92bb5f05 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCommenceV1Request.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCommenceV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -42,6 +37,7 @@ import com.squareup.moshi.Json * @param clientTransferNumber */ + data class TransferCommenceV1Request ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCommenceV1Response.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCommenceV1Response.kt index 948650acc1..825ab05ab7 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCommenceV1Response.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCommenceV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -37,6 +32,7 @@ import com.squareup.moshi.Json * @param messageHash */ + data class TransferCommenceV1Response ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCompleteV1Request.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCompleteV1Request.kt index 5c84fd4b3c..53144a87a7 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCompleteV1Request.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferCompleteV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -37,6 +32,7 @@ import com.squareup.moshi.Json * @param clientTransferNumber */ + data class TransferCompleteV1Request ( @Json(name = "sessionID") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferInitializationV1Request.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferInitializationV1Request.kt index abf07a3b3f..b024d5ef7c 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferInitializationV1Request.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferInitializationV1Request.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -62,6 +57,7 @@ import com.squareup.moshi.Json * @param histories */ + data class TransferInitializationV1Request ( @Json(name = "messageType") diff --git a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferInitializationV1Response.kt b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferInitializationV1Response.kt index dd84cfdbe4..4f64f38fea 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferInitializationV1Response.kt +++ b/packages/cactus-plugin-odap-hermes/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/TransferInitializationV1Response.kt @@ -1,14 +1,9 @@ /** - * Hyperledger Cactus Plugin - Odap Hermes - * - * Implementation for Odap and Hermes - * - * 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( @@ -39,6 +34,7 @@ import com.squareup.moshi.Json * @param destination */ + data class TransferInitializationV1Response ( @Json(name = "messageType") diff --git a/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION index 804440660c..e7e42a4b58 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ b/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.1 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/api.ts index 897436c653..8cdd6225ae 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -13,13 +13,15 @@ */ -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * @@ -32,73 +34,73 @@ export interface AssetProfile { * @type {string} * @memberof AssetProfile */ - issuer?: string; + 'issuer'?: string; /** * * @type {string} * @memberof AssetProfile */ - assetCode?: string; + 'assetCode'?: string; /** * * @type {string} * @memberof AssetProfile */ - assetCodeType?: string; + 'assetCodeType'?: string; /** * * @type {string} * @memberof AssetProfile */ - issuanceDate?: string; + 'issuanceDate'?: string; /** * * @type {string} * @memberof AssetProfile */ - expirationDate: string; + 'expirationDate': string; /** * * @type {string} * @memberof AssetProfile */ - verificationEndPoint?: string; + 'verificationEndPoint'?: string; /** * * @type {string} * @memberof AssetProfile */ - digitalSignature?: string; + 'digitalSignature'?: string; /** * * @type {string} * @memberof AssetProfile */ - prospectusLink?: string; + 'prospectusLink'?: string; /** * * @type {Array} * @memberof AssetProfile */ - keyInformationLink?: Array; + 'keyInformationLink'?: Array; /** * * @type {Array} * @memberof AssetProfile */ - keyWord?: Array; + 'keyWord'?: Array; /** * * @type {Array} * @memberof AssetProfile */ - transferRestriction?: Array; + 'transferRestriction'?: Array; /** * * @type {Array} * @memberof AssetProfile */ - ledgerRequirements?: Array; + 'ledgerRequirements'?: Array; } /** * @@ -111,133 +113,133 @@ export interface ClientV1Request { * @type {string} * @memberof ClientV1Request */ - version: string; + 'version': string; /** * * @type {string} * @memberof ClientV1Request */ - loggingProfile: string; + 'loggingProfile': string; /** * * @type {string} * @memberof ClientV1Request */ - accessControlProfile: string; + 'accessControlProfile': string; /** * * @type {string} * @memberof ClientV1Request */ - assetControlProfile: string; + 'assetControlProfile': string; /** * * @type {string} * @memberof ClientV1Request */ - applicationProfile: string; + 'applicationProfile': string; /** * * @type {AssetProfile} * @memberof ClientV1Request */ - assetProfile: AssetProfile; + 'assetProfile': AssetProfile; /** * * @type {PayloadProfile} * @memberof ClientV1Request */ - payloadProfile: PayloadProfile; + 'payloadProfile': PayloadProfile; /** * * @type {string} * @memberof ClientV1Request */ - sourceGatewayDltSystem: string; + 'sourceGatewayDltSystem': string; /** * * @type {string} * @memberof ClientV1Request */ - recipientGatewayDltSystem: string; + 'recipientGatewayDltSystem': string; /** * * @type {string} * @memberof ClientV1Request */ - recipientGatewayPubkey: string; + 'recipientGatewayPubkey': string; /** * * @type {string} * @memberof ClientV1Request */ - originatorPubkey: string; + 'originatorPubkey': string; /** * * @type {string} * @memberof ClientV1Request */ - beneficiaryPubkey: string; + 'beneficiaryPubkey': string; /** * * @type {string} * @memberof ClientV1Request */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof ClientV1Request */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof ClientV1Request */ - clientDltSystem: string; + 'clientDltSystem': string; /** * * @type {string} * @memberof ClientV1Request */ - serverDltSystem: string; + 'serverDltSystem': string; /** * * @type {ClientV1RequestClientGatewayConfiguration} * @memberof ClientV1Request */ - clientGatewayConfiguration: ClientV1RequestClientGatewayConfiguration; + 'clientGatewayConfiguration': ClientV1RequestClientGatewayConfiguration; /** * * @type {ClientV1RequestClientGatewayConfiguration} * @memberof ClientV1Request */ - serverGatewayConfiguration: ClientV1RequestClientGatewayConfiguration; + 'serverGatewayConfiguration': ClientV1RequestClientGatewayConfiguration; /** * * @type {number} * @memberof ClientV1Request */ - maxRetries: number; + 'maxRetries': number; /** * * @type {number} * @memberof ClientV1Request */ - maxTimeout: number; + 'maxTimeout': number; /** * * @type {string} * @memberof ClientV1Request */ - sourceLedgerAssetID: string; + 'sourceLedgerAssetID': string; /** * * @type {string} * @memberof ClientV1Request */ - recipientLedgerAssetID: string; + 'recipientLedgerAssetID': string; } /** * @@ -250,7 +252,7 @@ export interface ClientV1RequestClientGatewayConfiguration { * @type {string} * @memberof ClientV1RequestClientGatewayConfiguration */ - apiHost: string; + 'apiHost': string; } /** * @@ -263,61 +265,61 @@ export interface CommitFinalV1Request { * @type {string} * @memberof CommitFinalV1Request */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof CommitFinalV1Request */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof CommitFinalV1Request */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof CommitFinalV1Request */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof CommitFinalV1Request */ - commitFinalClaim: string; + 'commitFinalClaim': string; /** * * @type {object} * @memberof CommitFinalV1Request */ - commitFinalClaimFormat?: object; + 'commitFinalClaimFormat'?: object; /** * * @type {string} * @memberof CommitFinalV1Request */ - hashCommitPrepareAck: string; + 'hashCommitPrepareAck': string; /** * * @type {number} * @memberof CommitFinalV1Request */ - clientTransferNumber?: number | null; + 'clientTransferNumber'?: number | null; /** * * @type {string} * @memberof CommitFinalV1Request */ - signature: string; + 'signature': string; /** * * @type {number} * @memberof CommitFinalV1Request */ - sequenceNumber: number; + 'sequenceNumber': number; } /** * @@ -330,61 +332,61 @@ export interface CommitFinalV1Response { * @type {string} * @memberof CommitFinalV1Response */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof CommitFinalV1Response */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof CommitFinalV1Response */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof CommitFinalV1Response */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof CommitFinalV1Response */ - commitAcknowledgementClaim: string; + 'commitAcknowledgementClaim': string; /** * * @type {object} * @memberof CommitFinalV1Response */ - commitAcknowledgementClaimFormat?: object; + 'commitAcknowledgementClaimFormat'?: object; /** * * @type {string} * @memberof CommitFinalV1Response */ - hashCommitFinal: string; + 'hashCommitFinal': string; /** * * @type {number} * @memberof CommitFinalV1Response */ - serverTransferNumber?: number; + 'serverTransferNumber'?: number; /** * * @type {string} * @memberof CommitFinalV1Response */ - signature: string; + 'signature': string; /** * * @type {number} * @memberof CommitFinalV1Response */ - sequenceNumber: number; + 'sequenceNumber': number; } /** * @@ -397,49 +399,49 @@ export interface CommitPreparationV1Request { * @type {string} * @memberof CommitPreparationV1Request */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof CommitPreparationV1Request */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof CommitPreparationV1Request */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof CommitPreparationV1Request */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof CommitPreparationV1Request */ - hashLockEvidenceAck: string; + 'hashLockEvidenceAck': string; /** * * @type {number} * @memberof CommitPreparationV1Request */ - clientTransferNumber?: number; + 'clientTransferNumber'?: number; /** * * @type {string} * @memberof CommitPreparationV1Request */ - signature: string; + 'signature': string; /** * * @type {number} * @memberof CommitPreparationV1Request */ - sequenceNumber: number; + 'sequenceNumber': number; } /** * @@ -452,49 +454,49 @@ export interface CommitPreparationV1Response { * @type {string} * @memberof CommitPreparationV1Response */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof CommitPreparationV1Response */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof CommitPreparationV1Response */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof CommitPreparationV1Response */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof CommitPreparationV1Response */ - hashCommitPrep: string; + 'hashCommitPrep': string; /** * * @type {string} * @memberof CommitPreparationV1Response */ - serverTransferNumber?: string; + 'serverTransferNumber'?: string; /** * * @type {string} * @memberof CommitPreparationV1Response */ - signature: string; + 'signature': string; /** * * @type {number} * @memberof CommitPreparationV1Response */ - sequenceNumber: number; + 'sequenceNumber': number; } /** * @@ -502,11 +504,14 @@ export interface CommitPreparationV1Response { * @enum {string} */ -export enum CredentialProfile { - Saml = 'SAML', - Oauth = 'OAUTH', - X509 = 'X509' -} +export const CredentialProfile = { + Saml: 'SAML', + Oauth: 'OAUTH', + X509: 'X509' +} as const; + +export type CredentialProfile = typeof CredentialProfile[keyof typeof CredentialProfile]; + /** * @@ -519,43 +524,43 @@ export interface History { * @type {Array} * @memberof History */ - Transactions?: Array; + 'Transactions'?: Array; /** * * @type {Array} * @memberof History */ - Actions?: Array; + 'Actions'?: Array; /** * * @type {string} * @memberof History */ - Origin?: string; + 'Origin'?: string; /** * * @type {string} * @memberof History */ - Destination?: string; + 'Destination'?: string; /** * * @type {string} * @memberof History */ - Balance?: string; + 'Balance'?: string; /** * * @type {object} * @memberof History */ - CurrentStatus?: object; + 'CurrentStatus'?: object; /** * * @type {object} * @memberof History */ - ApplicationSpecificParameters?: object; + 'ApplicationSpecificParameters'?: object; } /** * @@ -568,73 +573,73 @@ export interface LockEvidenceV1Request { * @type {string} * @memberof LockEvidenceV1Request */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof LockEvidenceV1Request */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof LockEvidenceV1Request */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof LockEvidenceV1Request */ - lockEvidenceClaim: string; + 'lockEvidenceClaim': string; /** * * @type {object} * @memberof LockEvidenceV1Request */ - lockEvidenceFormat?: object; + 'lockEvidenceFormat'?: object; /** * * @type {string} * @memberof LockEvidenceV1Request */ - lockEvidenceExpiration: string; + 'lockEvidenceExpiration': string; /** * * @type {string} * @memberof LockEvidenceV1Request */ - hashCommenceAckRequest: string; + 'hashCommenceAckRequest': string; /** * * @type {number} * @memberof LockEvidenceV1Request */ - clientTransferNumber?: number | null; + 'clientTransferNumber'?: number | null; /** * * @type {string} * @memberof LockEvidenceV1Request */ - signature: string; + 'signature': string; /** * * @type {string} * @memberof LockEvidenceV1Request */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof LockEvidenceV1Request */ - messageHash?: string; + 'messageHash'?: string; /** * * @type {number} * @memberof LockEvidenceV1Request */ - sequenceNumber: number; + 'sequenceNumber': number; } /** * @@ -647,49 +652,49 @@ export interface LockEvidenceV1Response { * @type {string} * @memberof LockEvidenceV1Response */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof LockEvidenceV1Response */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof LockEvidenceV1Response */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof LockEvidenceV1Response */ - hashLockEvidenceRequest: string; + 'hashLockEvidenceRequest': string; /** * * @type {number} * @memberof LockEvidenceV1Response */ - serverTransferNumber?: number | null; + 'serverTransferNumber'?: number | null; /** * * @type {string} * @memberof LockEvidenceV1Response */ - signature: string; + 'signature': string; /** * * @type {string} * @memberof LockEvidenceV1Response */ - messageType: string; + 'messageType': string; /** * * @type {number} * @memberof LockEvidenceV1Response */ - sequenceNumber: number; + 'sequenceNumber': number; } /** * @@ -702,37 +707,37 @@ export interface OdapLocalLog { * @type {string} * @memberof OdapLocalLog */ - key?: string; + 'key'?: string; /** * * @type {string} * @memberof OdapLocalLog */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof OdapLocalLog */ - data?: string; + 'data'?: string; /** * * @type {string} * @memberof OdapLocalLog */ - type: string; + 'type': string; /** * * @type {string} * @memberof OdapLocalLog */ - operation: string; + 'operation': string; /** * * @type {string} * @memberof OdapLocalLog */ - timestamp?: string; + 'timestamp'?: string; } /** * @@ -745,93 +750,89 @@ export interface OdapMessage { * @type {number} * @memberof OdapMessage */ - SequenceNumber?: number; + 'SequenceNumber'?: number; /** * * @type {string} * @memberof OdapMessage */ - Phase?: OdapMessagePhaseEnum; + 'Phase'?: OdapMessagePhaseEnum; /** * * @type {string} * @memberof OdapMessage */ - ResourceURL?: string; + 'ResourceURL'?: string; /** * * @type {string} * @memberof OdapMessage */ - DeveloperURN?: string; + 'DeveloperURN'?: string; /** * * @type {OdapMessageActionResponse} * @memberof OdapMessage */ - ActionResponse?: OdapMessageActionResponse; + 'ActionResponse'?: OdapMessageActionResponse; /** * * @type {string} * @memberof OdapMessage */ - CredentialProfile?: OdapMessageCredentialProfileEnum; + 'CredentialProfile'?: OdapMessageCredentialProfileEnum; /** * * @type {Array} * @memberof OdapMessage */ - CredentialBlock?: Array; + 'CredentialBlock'?: Array; /** * * @type {PayloadProfile} * @memberof OdapMessage */ - CredentialsProfile?: PayloadProfile; + 'CredentialsProfile'?: PayloadProfile; /** * * @type {object} * @memberof OdapMessage */ - ApplicationProfile?: object; + 'ApplicationProfile'?: object; /** * * @type {object} * @memberof OdapMessage */ - Payload?: object; + 'Payload'?: object; /** * * @type {string} * @memberof OdapMessage */ - PayloadHash?: string; + 'PayloadHash'?: string; /** * * @type {string} * @memberof OdapMessage */ - MessageSignature?: string; + 'MessageSignature'?: string; } -/** - * @export - * @enum {string} - */ -export enum OdapMessagePhaseEnum { - TransferInitialization = 'TransferInitialization', - LockEvidenceVerification = 'LockEvidenceVerification', - CommitmentEstablishment = 'CommitmentEstablishment' -} -/** - * @export - * @enum {string} - */ -export enum OdapMessageCredentialProfileEnum { - Saml = 'SAML', - OAuth = 'OAuth', - X509 = 'X509' -} +export const OdapMessagePhaseEnum = { + TransferInitialization: 'TransferInitialization', + LockEvidenceVerification: 'LockEvidenceVerification', + CommitmentEstablishment: 'CommitmentEstablishment' +} as const; + +export type OdapMessagePhaseEnum = typeof OdapMessagePhaseEnum[keyof typeof OdapMessagePhaseEnum]; +export const OdapMessageCredentialProfileEnum = { + Saml: 'SAML', + OAuth: 'OAuth', + X509: 'X509' +} as const; + +export type OdapMessageCredentialProfileEnum = typeof OdapMessageCredentialProfileEnum[keyof typeof OdapMessageCredentialProfileEnum]; /** * @@ -844,23 +845,21 @@ export interface OdapMessageActionResponse { * @type {string} * @memberof OdapMessageActionResponse */ - ResponseCode?: OdapMessageActionResponseResponseCodeEnum; + 'ResponseCode'?: OdapMessageActionResponseResponseCodeEnum; /** * * @type {Array} * @memberof OdapMessageActionResponse */ - Arguments?: Array; + 'Arguments'?: Array; } -/** - * @export - * @enum {string} - */ -export enum OdapMessageActionResponseResponseCodeEnum { - OK = '200', - RESOURCE_NOT_FOUND = '404' -} +export const OdapMessageActionResponseResponseCodeEnum = { + OK: '200', + RESOURCE_NOT_FOUND: '404' +} as const; + +export type OdapMessageActionResponseResponseCodeEnum = typeof OdapMessageActionResponseResponseCodeEnum[keyof typeof OdapMessageActionResponseResponseCodeEnum]; /** * @@ -873,13 +872,13 @@ export interface PayloadProfile { * @type {AssetProfile} * @memberof PayloadProfile */ - assetProfile: AssetProfile; + 'assetProfile': AssetProfile; /** * * @type {string} * @memberof PayloadProfile */ - capabilities?: string; + 'capabilities'?: string; } /** * @@ -892,19 +891,19 @@ export interface RecoverSuccessV1Message { * @type {string} * @memberof RecoverSuccessV1Message */ - sessionID: string; + 'sessionID': string; /** * * @type {boolean} * @memberof RecoverSuccessV1Message */ - success: boolean; + 'success': boolean; /** * * @type {string} * @memberof RecoverSuccessV1Message */ - signature: string; + 'signature': string; } /** * @@ -917,25 +916,25 @@ export interface RecoverUpdateAckV1Message { * @type {string} * @memberof RecoverUpdateAckV1Message */ - sessionID: string; + 'sessionID': string; /** * * @type {boolean} * @memberof RecoverUpdateAckV1Message */ - success: boolean; + 'success': boolean; /** * * @type {Array} * @memberof RecoverUpdateAckV1Message */ - changedEntriesHash: Array; + 'changedEntriesHash': Array; /** * * @type {string} * @memberof RecoverUpdateAckV1Message */ - signature: string; + 'signature': string; } /** * @@ -948,19 +947,19 @@ export interface RecoverUpdateV1Message { * @type {string} * @memberof RecoverUpdateV1Message */ - sessionID: string; + 'sessionID': string; /** * * @type {Array} * @memberof RecoverUpdateV1Message */ - recoveredLogs: Array; + 'recoveredLogs': Array; /** * * @type {string} * @memberof RecoverUpdateV1Message */ - signature: string; + 'signature': string; } /** * @@ -973,49 +972,49 @@ export interface RecoverV1Message { * @type {string} * @memberof RecoverV1Message */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof RecoverV1Message */ - odapPhase: string; + 'odapPhase': string; /** * * @type {number} * @memberof RecoverV1Message */ - sequenceNumber: number; + 'sequenceNumber': number; /** * * @type {string} * @memberof RecoverV1Message */ - lastLogEntryTimestamp: string; + 'lastLogEntryTimestamp': string; /** * * @type {boolean} * @memberof RecoverV1Message */ - isBackup: boolean; + 'isBackup': boolean; /** * * @type {string} * @memberof RecoverV1Message */ - newBasePath: string; + 'newBasePath': string; /** * * @type {string} * @memberof RecoverV1Message */ - newGatewayPubKey?: string; + 'newGatewayPubKey'?: string; /** * * @type {string} * @memberof RecoverV1Message */ - signature: string; + 'signature': string; } /** * @@ -1028,19 +1027,19 @@ export interface RollbackAckV1Message { * @type {string} * @memberof RollbackAckV1Message */ - sessionID: string; + 'sessionID': string; /** * * @type {boolean} * @memberof RollbackAckV1Message */ - success: boolean; + 'success': boolean; /** * * @type {string} * @memberof RollbackAckV1Message */ - signature: string; + 'signature': string; } /** * @@ -1053,31 +1052,31 @@ export interface RollbackV1Message { * @type {string} * @memberof RollbackV1Message */ - sessionID: string; + 'sessionID': string; /** * * @type {boolean} * @memberof RollbackV1Message */ - success: boolean; + 'success': boolean; /** * * @type {Array} * @memberof RollbackV1Message */ - actionPerformed: Array; + 'actionPerformed': Array; /** * * @type {Array} * @memberof RollbackV1Message */ - proofs: Array; + 'proofs': Array; /** * * @type {string} * @memberof RollbackV1Message */ - signature: string; + 'signature': string; } /** * @@ -1090,379 +1089,377 @@ export interface SessionData { * @type {string} * @memberof SessionData */ - id?: string; + 'id'?: string; /** * * @type {number} * @memberof SessionData */ - step?: number; + 'step'?: number; /** * * @type {string} * @memberof SessionData */ - version?: string; + 'version'?: string; /** * * @type {number} * @memberof SessionData */ - lastSequenceNumber?: number; + 'lastSequenceNumber'?: number; /** * * @type {string} * @memberof SessionData */ - loggingProfile?: string; + 'loggingProfile'?: string; /** * * @type {string} * @memberof SessionData */ - accessControlProfile?: string; + 'accessControlProfile'?: string; /** * * @type {string} * @memberof SessionData */ - applicationProfile?: string; + 'applicationProfile'?: string; /** * * @type {PayloadProfile} * @memberof SessionData */ - payloadProfile?: PayloadProfile; + 'payloadProfile'?: PayloadProfile; /** * * @type {AssetProfile} * @memberof SessionData */ - assetProfile?: AssetProfile; + 'assetProfile'?: AssetProfile; /** * * @type {Array} * @memberof SessionData */ - allowedSourceBackupGateways?: Array; + 'allowedSourceBackupGateways'?: Array; /** * * @type {Array} * @memberof SessionData */ - allowedRecipientBackupGateways?: Array; + 'allowedRecipientBackupGateways'?: Array; /** * * @type {string} * @memberof SessionData */ - sourceBasePath?: string; + 'sourceBasePath'?: string; /** * * @type {string} * @memberof SessionData */ - recipientBasePath?: string; + 'recipientBasePath'?: string; /** * * @type {string} * @memberof SessionData */ - originatorPubkey?: string; + 'originatorPubkey'?: string; /** * * @type {string} * @memberof SessionData */ - beneficiaryPubkey?: string; + 'beneficiaryPubkey'?: string; /** * * @type {string} * @memberof SessionData */ - sourceGatewayPubkey?: string; + 'sourceGatewayPubkey'?: string; /** * * @type {string} * @memberof SessionData */ - sourceGatewayDltSystem?: string; + 'sourceGatewayDltSystem'?: string; /** * * @type {string} * @memberof SessionData */ - recipientGatewayPubkey?: string; + 'recipientGatewayPubkey'?: string; /** * * @type {string} * @memberof SessionData */ - recipientGatewayDltSystem?: string; + 'recipientGatewayDltSystem'?: string; /** * * @type {string} * @memberof SessionData */ - initializationRequestMessageHash?: string; + 'initializationRequestMessageHash'?: string; /** * * @type {string} * @memberof SessionData */ - initializationResponseMessageHash?: string; + 'initializationResponseMessageHash'?: string; /** * * @type {string} * @memberof SessionData */ - initializationRequestMessageRcvTimeStamp?: string; + 'initializationRequestMessageRcvTimeStamp'?: string; /** * * @type {string} * @memberof SessionData */ - initializationRequestMessageProcessedTimeStamp?: string; + 'initializationRequestMessageProcessedTimeStamp'?: string; /** * * @type {string} * @memberof SessionData */ - clientSignatureInitializationRequestMessage?: string; + 'clientSignatureInitializationRequestMessage'?: string; /** * * @type {string} * @memberof SessionData */ - serverSignatureInitializationResponseMessage?: string; + 'serverSignatureInitializationResponseMessage'?: string; /** * * @type {string} * @memberof SessionData */ - transferCommenceMessageRequestHash?: string; + 'transferCommenceMessageRequestHash'?: string; /** * * @type {string} * @memberof SessionData */ - transferCommenceMessageResponseHash?: string; + 'transferCommenceMessageResponseHash'?: string; /** * * @type {string} * @memberof SessionData */ - clientSignatureTransferCommenceRequestMessage?: string; + 'clientSignatureTransferCommenceRequestMessage'?: string; /** * * @type {string} * @memberof SessionData */ - serverSignatureTransferCommenceResponseMessage?: string; + 'serverSignatureTransferCommenceResponseMessage'?: string; /** * * @type {string} * @memberof SessionData */ - lockEvidenceRequestMessageHash?: string; + 'lockEvidenceRequestMessageHash'?: string; /** * * @type {string} * @memberof SessionData */ - lockEvidenceResponseMessageHash?: string; + 'lockEvidenceResponseMessageHash'?: string; /** * * @type {string} * @memberof SessionData */ - clientSignatureLockEvidenceRequestMessage?: string; + 'clientSignatureLockEvidenceRequestMessage'?: string; /** * * @type {string} * @memberof SessionData */ - serverSignatureLockEvidenceResponseMessage?: string; + 'serverSignatureLockEvidenceResponseMessage'?: string; /** * * @type {string} * @memberof SessionData */ - lockEvidenceClaim?: string; + 'lockEvidenceClaim'?: string; /** * * @type {string} * @memberof SessionData */ - commitPrepareRequestMessageHash?: string; + 'commitPrepareRequestMessageHash'?: string; /** * * @type {string} * @memberof SessionData */ - commitPrepareResponseMessageHash?: string; + 'commitPrepareResponseMessageHash'?: string; /** * * @type {string} * @memberof SessionData */ - clientSignatureCommitPreparationRequestMessage?: string; + 'clientSignatureCommitPreparationRequestMessage'?: string; /** * * @type {string} * @memberof SessionData */ - serverSignatureCommitPreparationResponseMessage?: string; + 'serverSignatureCommitPreparationResponseMessage'?: string; /** * * @type {string} * @memberof SessionData */ - commitFinalRequestMessageHash?: string; + 'commitFinalRequestMessageHash'?: string; /** * * @type {string} * @memberof SessionData */ - commitFinalResponseMessageHash?: string; + 'commitFinalResponseMessageHash'?: string; /** * * @type {string} * @memberof SessionData */ - commitFinalClaim?: string; + 'commitFinalClaim'?: string; /** * * @type {string} * @memberof SessionData */ - commitFinalClaimFormat?: string; + 'commitFinalClaimFormat'?: string; /** * * @type {string} * @memberof SessionData */ - commitAcknowledgementClaim?: string; + 'commitAcknowledgementClaim'?: string; /** * * @type {string} * @memberof SessionData */ - commitAcknowledgementClaimFormat?: string; + 'commitAcknowledgementClaimFormat'?: string; /** * * @type {string} * @memberof SessionData */ - clientSignatureCommitFinalRequestMessage?: string; + 'clientSignatureCommitFinalRequestMessage'?: string; /** * * @type {string} * @memberof SessionData */ - serverSignatureCommitFinalResponseMessage?: string; + 'serverSignatureCommitFinalResponseMessage'?: string; /** * * @type {string} * @memberof SessionData */ - transferCompleteMessageHash?: string; + 'transferCompleteMessageHash'?: string; /** * * @type {string} * @memberof SessionData */ - clientSignatureTransferCompleteMessage?: string; + 'clientSignatureTransferCompleteMessage'?: string; /** * * @type {number} * @memberof SessionData */ - maxRetries?: number; + 'maxRetries'?: number; /** * * @type {string} * @memberof SessionData */ - recipientLedgerAssetID?: string; + 'recipientLedgerAssetID'?: string; /** * * @type {string} * @memberof SessionData */ - sourceLedgerAssetID?: string; + 'sourceLedgerAssetID'?: string; /** * * @type {number} * @memberof SessionData */ - maxTimeout?: number; + 'maxTimeout'?: number; /** * * @type {string} * @memberof SessionData */ - lastLogEntryTimestamp?: string; + 'lastLogEntryTimestamp'?: string; /** * * @type {string} * @memberof SessionData */ - unlockAssetClaim?: string; + 'unlockAssetClaim'?: string; /** * * @type {string} * @memberof SessionData */ - recreateAssetClaim?: string; + 'recreateAssetClaim'?: string; /** * * @type {string} * @memberof SessionData */ - deleteAssetClaim?: string; + 'deleteAssetClaim'?: string; /** * * @type {string} * @memberof SessionData */ - lastMessageReceivedTimestamp?: string; + 'lastMessageReceivedTimestamp'?: string; /** * * @type {boolean} * @memberof SessionData */ - rollback?: boolean; + 'rollback'?: boolean; /** * * @type {string} * @memberof SessionData */ - rollbackMessageHash?: string; + 'rollbackMessageHash'?: string; /** * * @type {Array} * @memberof SessionData */ - rollbackProofs?: Array; + 'rollbackProofs'?: Array; /** * * @type {Array} * @memberof SessionData */ - rollbackActionsPerformed?: Array; + 'rollbackActionsPerformed'?: Array; } -/** - * @export - * @enum {string} - */ -export enum SessionDataRollbackActionsPerformedEnum { - Create = 'CREATE', - Delete = 'DELETE', - Lock = 'LOCK', - Unlock = 'UNLOCK' -} +export const SessionDataRollbackActionsPerformedEnum = { + Create: 'CREATE', + Delete: 'DELETE', + Lock: 'LOCK', + Unlock: 'UNLOCK' +} as const; + +export type SessionDataRollbackActionsPerformedEnum = typeof SessionDataRollbackActionsPerformedEnum[keyof typeof SessionDataRollbackActionsPerformedEnum]; /** * @@ -1475,85 +1472,85 @@ export interface TransferCommenceV1Request { * @type {string} * @memberof TransferCommenceV1Request */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof TransferCommenceV1Request */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof TransferCommenceV1Request */ - originatorPubkey: string; + 'originatorPubkey': string; /** * * @type {string} * @memberof TransferCommenceV1Request */ - beneficiaryPubkey: string; + 'beneficiaryPubkey': string; /** * * @type {string} * @memberof TransferCommenceV1Request */ - senderDltSystem: string; + 'senderDltSystem': string; /** * * @type {string} * @memberof TransferCommenceV1Request */ - recipientDltSystem: string; + 'recipientDltSystem': string; /** * * @type {string} * @memberof TransferCommenceV1Request */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof TransferCommenceV1Request */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof TransferCommenceV1Request */ - hashAssetProfile: string; + 'hashAssetProfile': string; /** * * @type {number} * @memberof TransferCommenceV1Request */ - assetUnit?: number; + 'assetUnit'?: number; /** * * @type {string} * @memberof TransferCommenceV1Request */ - hashPrevMessage: string; + 'hashPrevMessage': string; /** * * @type {number} * @memberof TransferCommenceV1Request */ - clientTransferNumber?: number | null; + 'clientTransferNumber'?: number | null; /** * * @type {string} * @memberof TransferCommenceV1Request */ - signature: string; + 'signature': string; /** * * @type {number} * @memberof TransferCommenceV1Request */ - sequenceNumber: number; + 'sequenceNumber': number; } /** * @@ -1566,55 +1563,55 @@ export interface TransferCommenceV1Response { * @type {string} * @memberof TransferCommenceV1Response */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof TransferCommenceV1Response */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof TransferCommenceV1Response */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof TransferCommenceV1Response */ - hashCommenceRequest: string; + 'hashCommenceRequest': string; /** * * @type {number} * @memberof TransferCommenceV1Response */ - serverTransferNumber?: number | null; + 'serverTransferNumber'?: number | null; /** * * @type {string} * @memberof TransferCommenceV1Response */ - signature: string; + 'signature': string; /** * * @type {string} * @memberof TransferCommenceV1Response */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof TransferCommenceV1Response */ - messageHash?: string; + 'messageHash'?: string; /** * * @type {number} * @memberof TransferCommenceV1Response */ - sequenceNumber: number; + 'sequenceNumber': number; } /** * @@ -1627,55 +1624,55 @@ export interface TransferCompleteV1Request { * @type {string} * @memberof TransferCompleteV1Request */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof TransferCompleteV1Request */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof TransferCompleteV1Request */ - clientIdentityPubkey: string; + 'clientIdentityPubkey': string; /** * * @type {string} * @memberof TransferCompleteV1Request */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof TransferCompleteV1Request */ - hashCommitFinalAck: string; + 'hashCommitFinalAck': string; /** * * @type {number} * @memberof TransferCompleteV1Request */ - clientTransferNumber?: number | null; + 'clientTransferNumber'?: number | null; /** * * @type {string} * @memberof TransferCompleteV1Request */ - signature: string; + 'signature': string; /** * * @type {string} * @memberof TransferCompleteV1Request */ - hashTransferCommence: string; + 'hashTransferCommence': string; /** * * @type {number} * @memberof TransferCompleteV1Request */ - sequenceNumber: number; + 'sequenceNumber': number; } /** * @@ -1688,202 +1685,200 @@ export interface TransferInitializationV1Request { * @type {string} * @memberof TransferInitializationV1Request */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - sessionID: string; + 'sessionID': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - version?: string; + 'version'?: string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - developerURN?: string; + 'developerURN'?: string; /** * * @type {CredentialProfile} * @memberof TransferInitializationV1Request */ - credentialProfile?: CredentialProfile; + 'credentialProfile'?: CredentialProfile; /** * * @type {PayloadProfile} * @memberof TransferInitializationV1Request */ - payloadProfile: PayloadProfile; + 'payloadProfile': PayloadProfile; /** * * @type {string} * @memberof TransferInitializationV1Request */ - applicationProfile: string; + 'applicationProfile': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - loggingProfile: string; + 'loggingProfile': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - accessControlProfile: string; + 'accessControlProfile': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - signature: string; + 'signature': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - sourceGatewayPubkey: string; + 'sourceGatewayPubkey': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - sourceGatewayDltSystem: string; + 'sourceGatewayDltSystem': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - recipientGatewayPubkey: string; + 'recipientGatewayPubkey': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - recipientGatewayDltSystem: string; + 'recipientGatewayDltSystem': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - escrowType?: TransferInitializationV1RequestEscrowTypeEnum; + 'escrowType'?: TransferInitializationV1RequestEscrowTypeEnum; /** * * @type {string} * @memberof TransferInitializationV1Request */ - expiryTime?: string; + 'expiryTime'?: string; /** * * @type {boolean} * @memberof TransferInitializationV1Request */ - multipleClaimsAllowed?: boolean; + 'multipleClaimsAllowed'?: boolean; /** * * @type {boolean} * @memberof TransferInitializationV1Request */ - multipleCancelsAllowed?: boolean; + 'multipleCancelsAllowed'?: boolean; /** * * @type {object} * @memberof TransferInitializationV1Request */ - permissions?: object; + 'permissions'?: object; /** * * @type {string} * @memberof TransferInitializationV1Request */ - origin?: string; + 'origin'?: string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - destination?: string; + 'destination'?: string; /** * * @type {object} * @memberof TransferInitializationV1Request */ - subsequentCalls?: object; + 'subsequentCalls'?: object; /** * * @type {Array} * @memberof TransferInitializationV1Request */ - histories?: Array; + 'histories'?: Array; /** * * @type {number} * @memberof TransferInitializationV1Request */ - sequenceNumber: number; + 'sequenceNumber': number; /** * * @type {string} * @memberof TransferInitializationV1Request */ - sourceBasePath: string; + 'sourceBasePath': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - recipientBasePath: string; + 'recipientBasePath': string; /** * * @type {number} * @memberof TransferInitializationV1Request */ - maxRetries: number; + 'maxRetries': number; /** * * @type {number} * @memberof TransferInitializationV1Request */ - maxTimeout: number; + 'maxTimeout': number; /** * * @type {Array} * @memberof TransferInitializationV1Request */ - backupGatewaysAllowed: Array; + 'backupGatewaysAllowed': Array; /** * * @type {string} * @memberof TransferInitializationV1Request */ - recipientLedgerAssetID: string; + 'recipientLedgerAssetID': string; /** * * @type {string} * @memberof TransferInitializationV1Request */ - sourceLedgerAssetID: string; + 'sourceLedgerAssetID': string; } -/** - * @export - * @enum {string} - */ -export enum TransferInitializationV1RequestEscrowTypeEnum { - Faucet = 'FAUCET', - Timelock = 'TIMELOCK', - Hashlock = 'HASHLOCK', - Hashtimelock = 'HASHTIMELOCK', - Multiclaimpc = 'MULTICLAIMPC', - Destroy = 'DESTROY', - Burn = 'BURN' -} +export const TransferInitializationV1RequestEscrowTypeEnum = { + Faucet: 'FAUCET', + Timelock: 'TIMELOCK', + Hashlock: 'HASHLOCK', + Hashtimelock: 'HASHTIMELOCK', + Multiclaimpc: 'MULTICLAIMPC', + Destroy: 'DESTROY', + Burn: 'BURN' +} as const; + +export type TransferInitializationV1RequestEscrowTypeEnum = typeof TransferInitializationV1RequestEscrowTypeEnum[keyof typeof TransferInitializationV1RequestEscrowTypeEnum]; /** * @@ -1896,78 +1891,76 @@ export interface TransferInitializationV1Response { * @type {string} * @memberof TransferInitializationV1Response */ - messageType: string; + 'messageType': string; /** * * @type {string} * @memberof TransferInitializationV1Response */ - sessionID: string; + 'sessionID': string; /** * * @type {number} * @memberof TransferInitializationV1Response */ - sequenceNumber: number; + 'sequenceNumber': number; /** * * @type {string} * @memberof TransferInitializationV1Response */ - odapPhase?: TransferInitializationV1ResponseOdapPhaseEnum; + 'odapPhase'?: TransferInitializationV1ResponseOdapPhaseEnum; /** * * @type {string} * @memberof TransferInitializationV1Response */ - initialRequestMessageHash: string; + 'initialRequestMessageHash': string; /** * * @type {string} * @memberof TransferInitializationV1Response */ - destination?: string; + 'destination'?: string; /** * * @type {string} * @memberof TransferInitializationV1Response */ - timeStamp: string; + 'timeStamp': string; /** * * @type {string} * @memberof TransferInitializationV1Response */ - processedTimeStamp: string; + 'processedTimeStamp': string; /** * * @type {string} * @memberof TransferInitializationV1Response */ - serverIdentityPubkey: string; + 'serverIdentityPubkey': string; /** * * @type {string} * @memberof TransferInitializationV1Response */ - signature: string; + 'signature': string; /** * * @type {Array} * @memberof TransferInitializationV1Response */ - backupGatewaysAllowed: Array; + 'backupGatewaysAllowed': Array; } -/** - * @export - * @enum {string} - */ -export enum TransferInitializationV1ResponseOdapPhaseEnum { - TransferInitialization = 'TransferInitialization', - LockEvidenceVerification = 'LockEvidenceVerification', - CommitmentEstablishment = 'CommitmentEstablishment' -} +export const TransferInitializationV1ResponseOdapPhaseEnum = { + TransferInitialization: 'TransferInitialization', + LockEvidenceVerification: 'LockEvidenceVerification', + CommitmentEstablishment: 'CommitmentEstablishment' +} as const; + +export type TransferInitializationV1ResponseOdapPhaseEnum = typeof TransferInitializationV1ResponseOdapPhaseEnum[keyof typeof TransferInitializationV1ResponseOdapPhaseEnum]; /** @@ -1982,7 +1975,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - clientRequestV1: async (clientV1Request?: ClientV1Request, options: any = {}): Promise => { + clientRequestV1: async (clientV1Request?: ClientV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1999,7 +1992,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(clientV1Request, localVarRequestOptions, configuration) @@ -2015,7 +2008,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase1TransferInitiationRequestV1: async (transferInitializationV1Request?: TransferInitializationV1Request, options: any = {}): Promise => { + phase1TransferInitiationRequestV1: async (transferInitializationV1Request?: TransferInitializationV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2032,7 +2025,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(transferInitializationV1Request, localVarRequestOptions, configuration) @@ -2048,7 +2041,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase1TransferInitiationResponseV1: async (transferInitializationV1Response?: TransferInitializationV1Response, options: any = {}): Promise => { + phase1TransferInitiationResponseV1: async (transferInitializationV1Response?: TransferInitializationV1Response, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2065,7 +2058,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(transferInitializationV1Response, localVarRequestOptions, configuration) @@ -2081,7 +2074,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase2LockEvidenceRequestV1: async (lockEvidenceV1Request?: LockEvidenceV1Request, options: any = {}): Promise => { + phase2LockEvidenceRequestV1: async (lockEvidenceV1Request?: LockEvidenceV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2098,7 +2091,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(lockEvidenceV1Request, localVarRequestOptions, configuration) @@ -2114,7 +2107,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase2LockEvidenceResponseV1: async (lockEvidenceV1Response?: LockEvidenceV1Response, options: any = {}): Promise => { + phase2LockEvidenceResponseV1: async (lockEvidenceV1Response?: LockEvidenceV1Response, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2131,7 +2124,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(lockEvidenceV1Response, localVarRequestOptions, configuration) @@ -2147,7 +2140,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase2TransferCommenceRequestV1: async (transferCommenceV1Request?: TransferCommenceV1Request, options: any = {}): Promise => { + phase2TransferCommenceRequestV1: async (transferCommenceV1Request?: TransferCommenceV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2164,7 +2157,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(transferCommenceV1Request, localVarRequestOptions, configuration) @@ -2180,7 +2173,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase2TransferCommenceResponseV1: async (transferCommenceV1Response?: TransferCommenceV1Response, options: any = {}): Promise => { + phase2TransferCommenceResponseV1: async (transferCommenceV1Response?: TransferCommenceV1Response, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2197,7 +2190,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(transferCommenceV1Response, localVarRequestOptions, configuration) @@ -2213,7 +2206,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase3CommitFinalRequestV1: async (commitFinalV1Request?: CommitFinalV1Request, options: any = {}): Promise => { + phase3CommitFinalRequestV1: async (commitFinalV1Request?: CommitFinalV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2230,7 +2223,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(commitFinalV1Request, localVarRequestOptions, configuration) @@ -2246,7 +2239,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase3CommitFinalResponseV1: async (commitFinalV1Response?: CommitFinalV1Response, options: any = {}): Promise => { + phase3CommitFinalResponseV1: async (commitFinalV1Response?: CommitFinalV1Response, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2263,7 +2256,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(commitFinalV1Response, localVarRequestOptions, configuration) @@ -2279,7 +2272,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase3CommitPreparationRequestV1: async (commitPreparationV1Request?: CommitPreparationV1Request, options: any = {}): Promise => { + phase3CommitPreparationRequestV1: async (commitPreparationV1Request?: CommitPreparationV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2296,7 +2289,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(commitPreparationV1Request, localVarRequestOptions, configuration) @@ -2312,7 +2305,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase3CommitPreparationResponseV1: async (commitPreparationV1Response?: CommitPreparationV1Response, options: any = {}): Promise => { + phase3CommitPreparationResponseV1: async (commitPreparationV1Response?: CommitPreparationV1Response, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2329,7 +2322,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(commitPreparationV1Response, localVarRequestOptions, configuration) @@ -2345,7 +2338,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - phase3TransferCompleteRequestV1: async (transferCompleteV1Request?: TransferCompleteV1Request, options: any = {}): Promise => { + phase3TransferCompleteRequestV1: async (transferCompleteV1Request?: TransferCompleteV1Request, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2362,7 +2355,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(transferCompleteV1Request, localVarRequestOptions, configuration) @@ -2378,7 +2371,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - recoverUpdateAckV1Message: async (recoverUpdateAckV1Message?: RecoverUpdateAckV1Message, options: any = {}): Promise => { + recoverUpdateAckV1Message: async (recoverUpdateAckV1Message?: RecoverUpdateAckV1Message, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2395,7 +2388,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(recoverUpdateAckV1Message, localVarRequestOptions, configuration) @@ -2411,7 +2404,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - recoverUpdateV1Message: async (recoverUpdateV1Message?: RecoverUpdateV1Message, options: any = {}): Promise => { + recoverUpdateV1Message: async (recoverUpdateV1Message?: RecoverUpdateV1Message, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2428,7 +2421,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(recoverUpdateV1Message, localVarRequestOptions, configuration) @@ -2444,7 +2437,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - recoverV1Message: async (recoverV1Message?: RecoverV1Message, options: any = {}): Promise => { + recoverV1Message: async (recoverV1Message?: RecoverV1Message, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2461,7 +2454,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(recoverV1Message, localVarRequestOptions, configuration) @@ -2477,7 +2470,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - recoverV1Success: async (recoverSuccessV1Message?: RecoverSuccessV1Message, options: any = {}): Promise => { + recoverV1Success: async (recoverSuccessV1Message?: RecoverSuccessV1Message, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2494,7 +2487,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(recoverSuccessV1Message, localVarRequestOptions, configuration) @@ -2510,7 +2503,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - rollbackAckV1Message: async (rollbackAckV1Message?: RollbackAckV1Message, options: any = {}): Promise => { + rollbackAckV1Message: async (rollbackAckV1Message?: RollbackAckV1Message, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2527,7 +2520,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(rollbackAckV1Message, localVarRequestOptions, configuration) @@ -2543,7 +2536,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - rollbackV1Message: async (rollbackV1Message?: RollbackV1Message, options: any = {}): Promise => { + rollbackV1Message: async (rollbackV1Message?: RollbackV1Message, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2560,7 +2553,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(rollbackV1Message, localVarRequestOptions, configuration) @@ -2586,7 +2579,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async clientRequestV1(clientV1Request?: ClientV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async clientRequestV1(clientV1Request?: ClientV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.clientRequestV1(clientV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2596,7 +2589,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase1TransferInitiationRequestV1(transferInitializationV1Request?: TransferInitializationV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase1TransferInitiationRequestV1(transferInitializationV1Request?: TransferInitializationV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase1TransferInitiationRequestV1(transferInitializationV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2606,7 +2599,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase1TransferInitiationResponseV1(transferInitializationV1Response?: TransferInitializationV1Response, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase1TransferInitiationResponseV1(transferInitializationV1Response?: TransferInitializationV1Response, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase1TransferInitiationResponseV1(transferInitializationV1Response, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2616,7 +2609,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase2LockEvidenceRequestV1(lockEvidenceV1Request?: LockEvidenceV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase2LockEvidenceRequestV1(lockEvidenceV1Request?: LockEvidenceV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase2LockEvidenceRequestV1(lockEvidenceV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2626,7 +2619,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase2LockEvidenceResponseV1(lockEvidenceV1Response?: LockEvidenceV1Response, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase2LockEvidenceResponseV1(lockEvidenceV1Response?: LockEvidenceV1Response, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase2LockEvidenceResponseV1(lockEvidenceV1Response, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2636,7 +2629,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase2TransferCommenceRequestV1(transferCommenceV1Request?: TransferCommenceV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase2TransferCommenceRequestV1(transferCommenceV1Request?: TransferCommenceV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase2TransferCommenceRequestV1(transferCommenceV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2646,7 +2639,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase2TransferCommenceResponseV1(transferCommenceV1Response?: TransferCommenceV1Response, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase2TransferCommenceResponseV1(transferCommenceV1Response?: TransferCommenceV1Response, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase2TransferCommenceResponseV1(transferCommenceV1Response, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2656,7 +2649,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase3CommitFinalRequestV1(commitFinalV1Request?: CommitFinalV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase3CommitFinalRequestV1(commitFinalV1Request?: CommitFinalV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase3CommitFinalRequestV1(commitFinalV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2666,7 +2659,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase3CommitFinalResponseV1(commitFinalV1Response?: CommitFinalV1Response, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase3CommitFinalResponseV1(commitFinalV1Response?: CommitFinalV1Response, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase3CommitFinalResponseV1(commitFinalV1Response, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2676,7 +2669,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase3CommitPreparationRequestV1(commitPreparationV1Request?: CommitPreparationV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase3CommitPreparationRequestV1(commitPreparationV1Request?: CommitPreparationV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase3CommitPreparationRequestV1(commitPreparationV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2686,7 +2679,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase3CommitPreparationResponseV1(commitPreparationV1Response?: CommitPreparationV1Response, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase3CommitPreparationResponseV1(commitPreparationV1Response?: CommitPreparationV1Response, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase3CommitPreparationResponseV1(commitPreparationV1Response, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2696,7 +2689,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async phase3TransferCompleteRequestV1(transferCompleteV1Request?: TransferCompleteV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async phase3TransferCompleteRequestV1(transferCompleteV1Request?: TransferCompleteV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.phase3TransferCompleteRequestV1(transferCompleteV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2706,7 +2699,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async recoverUpdateAckV1Message(recoverUpdateAckV1Message?: RecoverUpdateAckV1Message, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async recoverUpdateAckV1Message(recoverUpdateAckV1Message?: RecoverUpdateAckV1Message, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.recoverUpdateAckV1Message(recoverUpdateAckV1Message, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2716,7 +2709,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async recoverUpdateV1Message(recoverUpdateV1Message?: RecoverUpdateV1Message, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async recoverUpdateV1Message(recoverUpdateV1Message?: RecoverUpdateV1Message, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.recoverUpdateV1Message(recoverUpdateV1Message, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2726,7 +2719,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async recoverV1Message(recoverV1Message?: RecoverV1Message, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async recoverV1Message(recoverV1Message?: RecoverV1Message, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.recoverV1Message(recoverV1Message, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2736,7 +2729,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async recoverV1Success(recoverSuccessV1Message?: RecoverSuccessV1Message, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async recoverV1Success(recoverSuccessV1Message?: RecoverSuccessV1Message, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.recoverV1Success(recoverSuccessV1Message, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2746,7 +2739,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async rollbackAckV1Message(rollbackAckV1Message?: RollbackAckV1Message, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async rollbackAckV1Message(rollbackAckV1Message?: RollbackAckV1Message, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.rollbackAckV1Message(rollbackAckV1Message, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2756,7 +2749,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async rollbackV1Message(rollbackV1Message?: RollbackV1Message, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async rollbackV1Message(rollbackV1Message?: RollbackV1Message, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.rollbackV1Message(rollbackV1Message, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2949,7 +2942,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public clientRequestV1(clientV1Request?: ClientV1Request, options?: any) { + public clientRequestV1(clientV1Request?: ClientV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).clientRequestV1(clientV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -2960,7 +2953,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase1TransferInitiationRequestV1(transferInitializationV1Request?: TransferInitializationV1Request, options?: any) { + public phase1TransferInitiationRequestV1(transferInitializationV1Request?: TransferInitializationV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase1TransferInitiationRequestV1(transferInitializationV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -2971,7 +2964,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase1TransferInitiationResponseV1(transferInitializationV1Response?: TransferInitializationV1Response, options?: any) { + public phase1TransferInitiationResponseV1(transferInitializationV1Response?: TransferInitializationV1Response, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase1TransferInitiationResponseV1(transferInitializationV1Response, options).then((request) => request(this.axios, this.basePath)); } @@ -2982,7 +2975,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase2LockEvidenceRequestV1(lockEvidenceV1Request?: LockEvidenceV1Request, options?: any) { + public phase2LockEvidenceRequestV1(lockEvidenceV1Request?: LockEvidenceV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase2LockEvidenceRequestV1(lockEvidenceV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -2993,7 +2986,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase2LockEvidenceResponseV1(lockEvidenceV1Response?: LockEvidenceV1Response, options?: any) { + public phase2LockEvidenceResponseV1(lockEvidenceV1Response?: LockEvidenceV1Response, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase2LockEvidenceResponseV1(lockEvidenceV1Response, options).then((request) => request(this.axios, this.basePath)); } @@ -3004,7 +2997,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase2TransferCommenceRequestV1(transferCommenceV1Request?: TransferCommenceV1Request, options?: any) { + public phase2TransferCommenceRequestV1(transferCommenceV1Request?: TransferCommenceV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase2TransferCommenceRequestV1(transferCommenceV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -3015,7 +3008,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase2TransferCommenceResponseV1(transferCommenceV1Response?: TransferCommenceV1Response, options?: any) { + public phase2TransferCommenceResponseV1(transferCommenceV1Response?: TransferCommenceV1Response, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase2TransferCommenceResponseV1(transferCommenceV1Response, options).then((request) => request(this.axios, this.basePath)); } @@ -3026,7 +3019,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase3CommitFinalRequestV1(commitFinalV1Request?: CommitFinalV1Request, options?: any) { + public phase3CommitFinalRequestV1(commitFinalV1Request?: CommitFinalV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase3CommitFinalRequestV1(commitFinalV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -3037,7 +3030,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase3CommitFinalResponseV1(commitFinalV1Response?: CommitFinalV1Response, options?: any) { + public phase3CommitFinalResponseV1(commitFinalV1Response?: CommitFinalV1Response, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase3CommitFinalResponseV1(commitFinalV1Response, options).then((request) => request(this.axios, this.basePath)); } @@ -3048,7 +3041,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase3CommitPreparationRequestV1(commitPreparationV1Request?: CommitPreparationV1Request, options?: any) { + public phase3CommitPreparationRequestV1(commitPreparationV1Request?: CommitPreparationV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase3CommitPreparationRequestV1(commitPreparationV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -3059,7 +3052,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase3CommitPreparationResponseV1(commitPreparationV1Response?: CommitPreparationV1Response, options?: any) { + public phase3CommitPreparationResponseV1(commitPreparationV1Response?: CommitPreparationV1Response, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase3CommitPreparationResponseV1(commitPreparationV1Response, options).then((request) => request(this.axios, this.basePath)); } @@ -3070,7 +3063,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public phase3TransferCompleteRequestV1(transferCompleteV1Request?: TransferCompleteV1Request, options?: any) { + public phase3TransferCompleteRequestV1(transferCompleteV1Request?: TransferCompleteV1Request, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).phase3TransferCompleteRequestV1(transferCompleteV1Request, options).then((request) => request(this.axios, this.basePath)); } @@ -3081,7 +3074,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public recoverUpdateAckV1Message(recoverUpdateAckV1Message?: RecoverUpdateAckV1Message, options?: any) { + public recoverUpdateAckV1Message(recoverUpdateAckV1Message?: RecoverUpdateAckV1Message, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).recoverUpdateAckV1Message(recoverUpdateAckV1Message, options).then((request) => request(this.axios, this.basePath)); } @@ -3092,7 +3085,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public recoverUpdateV1Message(recoverUpdateV1Message?: RecoverUpdateV1Message, options?: any) { + public recoverUpdateV1Message(recoverUpdateV1Message?: RecoverUpdateV1Message, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).recoverUpdateV1Message(recoverUpdateV1Message, options).then((request) => request(this.axios, this.basePath)); } @@ -3103,7 +3096,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public recoverV1Message(recoverV1Message?: RecoverV1Message, options?: any) { + public recoverV1Message(recoverV1Message?: RecoverV1Message, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).recoverV1Message(recoverV1Message, options).then((request) => request(this.axios, this.basePath)); } @@ -3114,7 +3107,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public recoverV1Success(recoverSuccessV1Message?: RecoverSuccessV1Message, options?: any) { + public recoverV1Success(recoverSuccessV1Message?: RecoverSuccessV1Message, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).recoverV1Success(recoverSuccessV1Message, options).then((request) => request(this.axios, this.basePath)); } @@ -3125,7 +3118,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public rollbackAckV1Message(rollbackAckV1Message?: RollbackAckV1Message, options?: any) { + public rollbackAckV1Message(rollbackAckV1Message?: RollbackAckV1Message, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).rollbackAckV1Message(rollbackAckV1Message, options).then((request) => request(this.axios, this.basePath)); } @@ -3136,7 +3129,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public rollbackV1Message(rollbackV1Message?: RollbackV1Message, options?: any) { + public rollbackV1Message(rollbackV1Message?: RollbackV1Message, options?: AxiosRequestConfig) { return DefaultApiFp(this.configuration).rollbackV1Message(rollbackV1Message, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/base.ts index 3959c9161f..b941fd05a6 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ b/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -13,10 +13,11 @@ */ -import { Configuration } from "./configuration"; +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); @@ -38,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: any; + options: AxiosRequestConfig; } /** @@ -64,8 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; constructor(public field: string, msg?: string) { super(msg); + this.name = "RequiredError" } } diff --git a/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/common.ts index 12cb47901c..29acfe3d10 100644 --- a/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ b/packages/cactus-plugin-odap-hermes/src/main/typescript/generated/openapi/typescript-axios/common.ts @@ -13,9 +13,10 @@ */ -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance } from 'axios'; +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * @@ -83,24 +84,35 @@ export const setOAuthToObject = async function (object: any, name: string, scope } } +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + /** * * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } + setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); } @@ -131,8 +143,8 @@ export const toPathString = function (url: URL) { * @export */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); + return axios.request(axiosRequestArgs); }; }