canton-api-client 3.6.0-0.1.0

Canton Ledger API rust client
Documentation
/*
 * JSON Ledger API HTTP endpoints
 *
 * This specification version fixes the API inconsistencies where certain fields marked as required in the spec are in fact optional. If you use code generation tool based on this file, you might need to adjust the existing application code to handle those fields as optional. If you do not want to change your client code, continue using the OpenAPI specification for the latest Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.6.0
 *
 * The version of the OpenAPI document: 3.6.0-SNAPSHOT
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JsTopologyTransaction {
    /// Assigned by the server. Useful for correlating logs. Must be a valid LedgerString (as described in ``value.proto``).  Required
    #[serde(rename = "updateId")]
    pub update_id: String,
    /// The absolute offset. The details of this field are described in ``community/ledger-api/README.md``. It is a valid absolute offset (positive integer).  Required
    #[serde(rename = "offset")]
    pub offset: i64,
    /// A valid synchronizer id. Identifies the synchronizer that synchronized the topology transaction.  Required
    #[serde(rename = "synchronizerId")]
    pub synchronizer_id: String,
    /// The time at which the changes in the topology transaction become effective. There is a small delay between a topology transaction being sequenced and the changes it contains becoming effective. Topology transactions appear in order relative to a synchronizer based on their effective time rather than their sequencing time.  Required
    #[serde(rename = "recordTime")]
    pub record_time: String,
    /// A non-empty list of topology events.  Required: must be non-empty
    #[serde(rename = "events")]
    pub events: Vec<models::TopologyEvent>,
    #[serde(rename = "traceContext", skip_serializing_if = "Option::is_none")]
    pub trace_context: Option<Box<models::TraceContext>>,
}

impl JsTopologyTransaction {
    pub fn new(update_id: String, offset: i64, synchronizer_id: String, record_time: String, events: Vec<models::TopologyEvent>) -> JsTopologyTransaction {
        JsTopologyTransaction {
            update_id,
            offset,
            synchronizer_id,
            record_time,
            events,
            trace_context: None,
        }
    }
}