coinbase_mesh/models/
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
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Version : The Version object is utilized to inform the client of the versions of different components of the Rosetta implementation. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Version {
17    /// 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. 
18    #[serde(rename = "rosetta_version")]
19    pub rosetta_version: String,
20    /// The node_version is the canonical version of the node runtime. This can help clients manage deployments. 
21    #[serde(rename = "node_version")]
22    pub node_version: String,
23    /// When a middleware server is used to adhere to the Rosetta interface, it should return its version here. This can help clients manage deployments. 
24    #[serde(rename = "middleware_version", skip_serializing_if = "Option::is_none")]
25    pub middleware_version: Option<String>,
26    /// Any other information that may be useful about versioning of dependent services should be returned here. 
27    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
28    pub metadata: Option<serde_json::Value>,
29}
30
31impl Version {
32    /// The Version object is utilized to inform the client of the versions of different components of the Rosetta implementation. 
33    pub fn new(rosetta_version: String, node_version: String) -> Version {
34        Version {
35            rosetta_version,
36            node_version,
37            middleware_version: None,
38            metadata: None,
39        }
40    }
41}
42