Skip to main content

canton_api_client/models/
disclosed_contract.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/// DisclosedContract : An additional contract that is used to resolve contract & contract key lookups.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DisclosedContract {
17    /// The template id of the contract. The identifier uses the package-id reference format.  If provided, used to validate the template id of the contract serialized in the created_event_blob.  Optional
18    #[serde(rename = "templateId", skip_serializing_if = "Option::is_none")]
19    pub template_id: Option<String>,
20    /// The contract id  If provided, used to validate the contract id of the contract serialized in the created_event_blob.  Optional
21    #[serde(rename = "contractId", skip_serializing_if = "Option::is_none")]
22    pub contract_id: Option<String>,
23    /// Opaque byte string containing the complete payload required by the Daml engine to reconstruct a contract not known to the receiving participant.  Required: must be non-empty
24    #[serde(rename = "createdEventBlob")]
25    pub created_event_blob: String,
26    /// The ID of the synchronizer where the contract is currently assigned  Optional
27    #[serde(rename = "synchronizerId", skip_serializing_if = "Option::is_none")]
28    pub synchronizer_id: Option<String>,
29}
30
31impl DisclosedContract {
32    /// An additional contract that is used to resolve contract & contract key lookups.
33    pub fn new(created_event_blob: String) -> DisclosedContract {
34        DisclosedContract {
35            template_id: None,
36            contract_id: None,
37            created_event_blob,
38            synchronizer_id: None,
39        }
40    }
41}
42