canton-api-client 3.3.0-0.1.2

Canton Ledger API rust client
Documentation
/*
 * JSON Ledger API HTTP endpoints
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 3.3.0-SNAPSHOT
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// JsTransactionTree : Provided for backwards compatibility, it will be removed in the Canton version 3.4.0. Complete view of an on-ledger transaction.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JsTransactionTree {
    /// 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 ID of the command which resulted in this transaction. Missing for everyone except the submitting party. Must be a valid LedgerString (as described in ``value.proto``). Optional
    #[serde(rename = "commandId")]
    pub command_id: String,
    /// The workflow ID used in command submission. Only set if the ``workflow_id`` for the command was set. Must be a valid LedgerString (as described in ``value.proto``). Optional
    #[serde(rename = "workflowId")]
    pub workflow_id: String,
    /// Ledger effective time. Required
    #[serde(rename = "effectiveAt", skip_serializing_if = "Option::is_none")]
    pub effective_at: Option<String>,
    /// The absolute offset. The details of this field are described in ``community/ledger-api/README.md``. Required, it is a valid absolute offset (positive integer).
    #[serde(rename = "offset")]
    pub offset: i64,
    #[serde(rename = "eventsById")]
    pub events_by_id: std::collections::HashMap<String, models::Filters>,
    /// A valid synchronizer id. Identifies the synchronizer that synchronized the transaction. Required
    #[serde(rename = "synchronizerId")]
    pub synchronizer_id: String,
    #[serde(rename = "traceContext", skip_serializing_if = "Option::is_none")]
    pub trace_context: Option<Box<models::TraceContext>>,
    /// The time at which the transaction was recorded. The record time refers to the synchronizer which synchronized the transaction. Required
    #[serde(rename = "recordTime")]
    pub record_time: String,
}

impl JsTransactionTree {
    /// Provided for backwards compatibility, it will be removed in the Canton version 3.4.0. Complete view of an on-ledger transaction.
    pub fn new(update_id: String, command_id: String, workflow_id: String, offset: i64, events_by_id: std::collections::HashMap<String, models::Filters>, synchronizer_id: String, record_time: String) -> JsTransactionTree {
        JsTransactionTree {
            update_id,
            command_id,
            workflow_id,
            effective_at: None,
            offset,
            events_by_id,
            synchronizer_id,
            trace_context: None,
            record_time,
        }
    }
}