rosetta_types/
version.rs

1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Version : The Version object is utilized to inform the client of the versions of different components of the Rosetta implementation.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct Version {
15    /// The rosetta_version is the version of the Rosetta interface the implementation adheres to. This can be useful for clients looking to reliably parse responses.
16    #[serde(rename = "rosetta_version")]
17    pub rosetta_version: String,
18    /// The node_version is the canonical version of the node runtime. This can help clients manage deployments.
19    #[serde(rename = "node_version")]
20    pub node_version: String,
21    /// When a middleware server is used to adhere to the Rosetta interface, it should return its version here. This can help clients manage deployments.
22    #[serde(rename = "middleware_version", skip_serializing_if = "Option::is_none")]
23    pub middleware_version: Option<String>,
24    /// Any other information that may be useful about versioning of dependent services should be returned here.
25    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
26    pub metadata: Option<serde_json::Value>,
27}
28
29impl Version {
30    /// The Version object is utilized to inform the client of the versions of different components of the Rosetta implementation.
31    pub fn new(rosetta_version: String, node_version: String) -> Version {
32        Version {
33            rosetta_version,
34            node_version,
35            middleware_version: None,
36            metadata: None,
37        }
38    }
39}