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

/// ArchivedEvent : Records that a contract has been archived, and choices may no longer be exercised on it.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ArchivedEvent {
    /// The offset of origin. Offsets are managed by the participant nodes. Transactions can thus NOT be assumed to have the same offsets on different participant nodes. It is a valid absolute offset (positive integer)  Required
    #[serde(rename = "offset")]
    pub offset: i64,
    /// The position of this event in the originating transaction or reassignment. Node IDs are not necessarily equal across participants, as these may see different projections/parts of transactions. Must be valid node ID (non-negative integer)  Required
    #[serde(rename = "nodeId")]
    pub node_id: i32,
    /// The ID of the archived contract. Must be a valid LedgerString (as described in ``value.proto``).  Required
    #[serde(rename = "contractId")]
    pub contract_id: String,
    /// Identifies the template that defines the choice that archived the contract. This template's package-id may differ from the target contract's package-id if the target contract has been upgraded or downgraded.  The identifier uses the package-id reference format.  Required
    #[serde(rename = "templateId")]
    pub template_id: String,
    /// The parties that are notified of this event. For an ``ArchivedEvent``, these are the intersection of the stakeholders of the contract in question and the parties specified in the ``TransactionFilter``. The stakeholders are the union of the signatories and the observers of the contract. Each one of its elements must be a valid PartyIdString (as described in ``value.proto``).  Required: must be non-empty
    #[serde(rename = "witnessParties")]
    pub witness_parties: Vec<String>,
    /// The package name of the contract.  Required
    #[serde(rename = "packageName")]
    pub package_name: String,
    /// The interfaces implemented by the target template that have been matched from the interface filter query. Populated only in case interface filters with include_interface_view set.  If defined, the identifier uses the package-id reference format.  Optional: can be empty
    #[serde(rename = "implementedInterfaces", skip_serializing_if = "Option::is_none")]
    pub implemented_interfaces: Option<Vec<String>>,
}

impl ArchivedEvent {
    /// Records that a contract has been archived, and choices may no longer be exercised on it.
    pub fn new(offset: i64, node_id: i32, contract_id: String, template_id: String, witness_parties: Vec<String>, package_name: String) -> ArchivedEvent {
        ArchivedEvent {
            offset,
            node_id,
            contract_id,
            template_id,
            witness_parties,
            package_name,
            implemented_interfaces: None,
        }
    }
}