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

/// 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. Required, it is a valid absolute offset (positive integer)
    #[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. Required, must be valid node ID (non-negative integer)
    #[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,
    /// The template of the archived contract. 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
    #[serde(rename = "witnessParties", skip_serializing_if = "Option::is_none")]
    pub witness_parties: Option<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
    #[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, package_name: String) -> ArchivedEvent {
        ArchivedEvent {
            offset,
            node_id,
            contract_id,
            template_id,
            witness_parties: None,
            package_name,
            implemented_interfaces: None,
        }
    }
}