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

/// UnassignedEvent : Records that a contract has been unassigned, and it becomes unusable on the source synchronizer
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UnassignedEvent {
    /// The ID of the unassignment. This needs to be used as an input for a assign ReassignmentCommand. Must be a valid LedgerString (as described in ``value.proto``).  Required
    #[serde(rename = "reassignmentId")]
    pub reassignment_id: String,
    /// The ID of the reassigned contract. Must be a valid LedgerString (as described in ``value.proto``).  Required
    #[serde(rename = "contractId")]
    pub contract_id: String,
    /// The template of the reassigned contract. The identifier uses the package-id reference format.  Required
    #[serde(rename = "templateId")]
    pub template_id: String,
    /// The ID of the source synchronizer Must be a valid synchronizer id  Required
    #[serde(rename = "source")]
    pub source: String,
    /// The ID of the target synchronizer Must be a valid synchronizer id  Required
    #[serde(rename = "target")]
    pub target: String,
    /// Party on whose behalf the unassign command was executed. Empty if the unassignment happened offline via the repair service. Must be a valid PartyIdString (as described in ``value.proto``).  Optional
    #[serde(rename = "submitter", skip_serializing_if = "Option::is_none")]
    pub submitter: Option<String>,
    /// Each corresponding assigned and unassigned event has the same reassignment_counter. This strictly increases with each unassign command for the same contract. Creation of the contract corresponds to reassignment_counter equals zero.  Required
    #[serde(rename = "reassignmentCounter")]
    pub reassignment_counter: i64,
    /// Assignment exclusivity Before this time (measured on the target synchronizer), only the submitter of the unassignment can initiate the assignment Defined for reassigning participants.  Optional
    #[serde(rename = "assignmentExclusivity", skip_serializing_if = "Option::is_none")]
    pub assignment_exclusivity: Option<String>,
    /// The parties that are notified of this event.  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 offset of origin. Offsets are managed by the participant nodes. Reassignments can thus NOT be assumed to have the same offsets on different participant nodes. Must be a valid absolute offset (positive integer)  Required
    #[serde(rename = "offset")]
    pub offset: i64,
    /// The position of this event in the originating reassignment. Node IDs are not necessarily equal across participants, as these may see different projections/parts of reassignments. Must be valid node ID (non-negative integer)  Required
    #[serde(rename = "nodeId")]
    pub node_id: i32,
}

impl UnassignedEvent {
    /// Records that a contract has been unassigned, and it becomes unusable on the source synchronizer
    pub fn new(reassignment_id: String, contract_id: String, template_id: String, source: String, target: String, reassignment_counter: i64, witness_parties: Vec<String>, package_name: String, offset: i64, node_id: i32) -> UnassignedEvent {
        UnassignedEvent {
            reassignment_id,
            contract_id,
            template_id,
            source,
            target,
            submitter: None,
            reassignment_counter,
            assignment_exclusivity: None,
            witness_parties,
            package_name,
            offset,
            node_id,
        }
    }
}