Skip to main content

canton_api_client/models/
js_assigned_event.rs

1/*
2 * JSON Ledger API HTTP endpoints
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 3.3.0-SNAPSHOT
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// JsAssignedEvent : Records that a contract has been assigned, and it can be used on the target synchronizer.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct JsAssignedEvent {
17    /// The ID of the source synchronizer. Must be a valid synchronizer id. Required
18    #[serde(rename = "source")]
19    pub source: String,
20    /// The ID of the target synchronizer. Must be a valid synchronizer id. Required
21    #[serde(rename = "target")]
22    pub target: String,
23    /// The ID from the unassigned event. For correlation capabilities. For one contract the (unassign_id, source synchronizer) pair is unique. Must be a valid LedgerString (as described in ``value.proto``). Required
24    #[serde(rename = "unassignId")]
25    pub unassign_id: String,
26    /// Party on whose behalf the assign command was executed. Empty if the assignment happened offline via the repair service. Must be a valid PartyIdString (as described in ``value.proto``). Optional
27    #[serde(rename = "submitter")]
28    pub submitter: String,
29    /// 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
30    #[serde(rename = "reassignmentCounter")]
31    pub reassignment_counter: i64,
32    #[serde(rename = "createdEvent")]
33    pub created_event: Box<models::CreatedEvent>,
34}
35
36impl JsAssignedEvent {
37    /// Records that a contract has been assigned, and it can be used on the target synchronizer.
38    pub fn new(source: String, target: String, unassign_id: String, submitter: String, reassignment_counter: i64, created_event: models::CreatedEvent) -> JsAssignedEvent {
39        JsAssignedEvent {
40            source,
41            target,
42            unassign_id,
43            submitter,
44            reassignment_counter,
45            created_event: Box::new(created_event),
46        }
47    }
48}
49