Skip to main content

canton_api_client/models/
transaction_format.rs

1/*
2 * JSON Ledger API HTTP endpoints
3 *
4 * 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
5 *
6 * The version of the OpenAPI document: 3.6.0-SNAPSHOT
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// TransactionFormat : A format that specifies what events to include in Daml transactions and what data to compute and include for them.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TransactionFormat {
17    #[serde(rename = "eventFormat")]
18    pub event_format: Box<models::EventFormat>,
19    /// What transaction shape to use for interpreting the filters of the event format.  Required
20    #[serde(rename = "transactionShape")]
21    pub transaction_shape: TransactionShape,
22}
23
24impl TransactionFormat {
25    /// A format that specifies what events to include in Daml transactions and what data to compute and include for them.
26    pub fn new(event_format: models::EventFormat, transaction_shape: TransactionShape) -> TransactionFormat {
27        TransactionFormat {
28            event_format: Box::new(event_format),
29            transaction_shape,
30        }
31    }
32}
33/// What transaction shape to use for interpreting the filters of the event format.  Required
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
35pub enum TransactionShape {
36    #[serde(rename = "TRANSACTION_SHAPE_UNSPECIFIED")]
37    TransactionShapeUnspecified,
38    #[serde(rename = "TRANSACTION_SHAPE_ACS_DELTA")]
39    TransactionShapeAcsDelta,
40    #[serde(rename = "TRANSACTION_SHAPE_LEDGER_EFFECTS")]
41    TransactionShapeLedgerEffects,
42}
43
44impl Default for TransactionShape {
45    fn default() -> TransactionShape {
46        Self::TransactionShapeUnspecified
47    }
48}
49