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};

/// JsTransactionTree : Provided for backwards compatibility, it will be removed in the Canton version 3.5.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", skip_serializing_if = "Option::is_none")]
    pub command_id: Option<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", skip_serializing_if = "Option::is_none")]
    pub workflow_id: Option<String>,
    /// Ledger effective time. Required
    #[serde(rename = "effectiveAt")]
    pub effective_at: 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::TreeEvent>,
    /// 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.5.0. Complete view of an on-ledger transaction.
    pub fn new(update_id: String, effective_at: String, offset: i64, events_by_id: std::collections::HashMap<String, models::TreeEvent>, synchronizer_id: String, record_time: String) -> JsTransactionTree {
        JsTransactionTree {
            update_id,
            command_id: None,
            workflow_id: None,
            effective_at,
            offset,
            events_by_id,
            synchronizer_id,
            trace_context: None,
            record_time,
        }
    }
}