forked from RafaelAPB/blockchain-integration-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cacti): consortium get node by capability
Signed-off-by: eduv09 <eduardovasques10@tecnico.ulisboa.pt>
- Loading branch information
Showing
10 changed files
with
487 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...erated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/Capability.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* | ||
* Please note: | ||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* Do not edit this file manually. | ||
* | ||
*/ | ||
|
||
@file:Suppress( | ||
"ArrayInDataClass", | ||
"EnumEntryName", | ||
"RemoveRedundantQualifierName", | ||
"UnusedImport" | ||
) | ||
|
||
package org.openapitools.client.models | ||
|
||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
/** | ||
* String that represents a capability, i.e. if the gateway has the plugin with a certain capability | ||
* | ||
* Values: sATPHermes,bUNGEEHermes,fabricConnector,besuConnector,ethConnector | ||
*/ | ||
|
||
@JsonClass(generateAdapter = false) | ||
enum class Capability(val value: kotlin.String) { | ||
|
||
@Json(name = "org.hyperledger.cactus.capability.SATPHermes") | ||
sATPHermes("org.hyperledger.cactus.capability.SATPHermes"), | ||
|
||
@Json(name = "org.hyperledger.cactus.capability.BUNGEEHermes") | ||
bUNGEEHermes("org.hyperledger.cactus.capability.BUNGEEHermes"), | ||
|
||
@Json(name = "org.hyperledger.cactus.capability.FabricConnector") | ||
fabricConnector("org.hyperledger.cactus.capability.FabricConnector"), | ||
|
||
@Json(name = "org.hyperledger.cactus.capability.BesuConnector") | ||
besuConnector("org.hyperledger.cactus.capability.BesuConnector"), | ||
|
||
@Json(name = "org.hyperledger.cactus.capability.EthConnector") | ||
ethConnector("org.hyperledger.cactus.capability.EthConnector"); | ||
|
||
/** | ||
* Override [toString()] to avoid using the enum variable name as the value, and instead use | ||
* the actual value defined in the API spec file. | ||
* | ||
* This solves a problem when the variable name and its value are different, and ensures that | ||
* the client sends the correct enum values to the server always. | ||
*/ | ||
override fun toString(): String = value | ||
|
||
companion object { | ||
/** | ||
* Converts the provided [data] to a [String] on success, null otherwise. | ||
*/ | ||
fun encode(data: kotlin.Any?): kotlin.String? = if (data is Capability) "$data" else null | ||
|
||
/** | ||
* Returns a valid [Capability] for [data], null otherwise. | ||
*/ | ||
fun decode(data: kotlin.Any?): Capability? = data?.let { | ||
val normalizedData = "$it".lowercase() | ||
values().firstOrNull { value -> | ||
it == value || normalizedData == "$value".lowercase() | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.