1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* 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};
/// 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. For one contract the (unassign_id, source synchronizer) pair is unique. Must be a valid LedgerString (as described in ``value.proto``). Required
#[serde(rename = "unassignId")]
pub unassign_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", skip_serializing_if = "Option::is_none")]
pub template_id: Option<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")]
pub submitter: 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
#[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 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. Required, it is a valid absolute offset (positive integer)
#[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. Required, must be valid node ID (non-negative integer)
#[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(unassign_id: String, contract_id: String, source: String, target: String, submitter: String, reassignment_counter: i64, package_name: String, offset: i64, node_id: i32) -> UnassignedEvent {
UnassignedEvent {
unassign_id,
contract_id,
template_id: None,
source,
target,
submitter,
reassignment_counter,
assignment_exclusivity: None,
witness_parties: None,
package_name,
offset,
node_id,
}
}
}