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
/*
* 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};
/// JsReassignment : Complete view of an on-ledger reassignment.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JsReassignment {
/// Assigned by the server. Useful for correlating logs. Must be a valid LedgerString (as described in ``value.proto``). Required
#[serde(rename = "updateId")]
pub update_id: String,
/// The ID of the command which resulted in this reassignment. Missing for everyone except the submitting party on the submitting participant. Must be a valid LedgerString (as described in ``value.proto``). Optional
#[serde(rename = "commandId", skip_serializing_if = "Option::is_none")]
pub command_id: Option<String>,
/// The workflow ID used in reassignment command submission. Only set if the ``workflow_id`` for the command was set. Must be a valid LedgerString (as described in ``value.proto``). Optional
#[serde(rename = "workflowId", skip_serializing_if = "Option::is_none")]
pub workflow_id: Option<String>,
/// The participant's offset. The details of this field are described in ``community/ledger-api/README.md``. Must be a valid absolute offset (positive integer). Required
#[serde(rename = "offset")]
pub offset: i64,
/// The collection of reassignment events. Required: must be non-empty
#[serde(rename = "events")]
pub events: Vec<models::JsReassignmentEvent>,
#[serde(rename = "traceContext", skip_serializing_if = "Option::is_none")]
pub trace_context: Option<Box<models::TraceContext>>,
/// The time at which the reassignment was recorded. The record time refers to the source/target synchronizer for an unassign/assign event respectively. Required
#[serde(rename = "recordTime")]
pub record_time: String,
/// A valid synchronizer id. Identifies the synchronizer that synchronized this Reassignment. Required
#[serde(rename = "synchronizerId")]
pub synchronizer_id: String,
/// The traffic cost that this participant node paid for the corresponding (un)assignment request. Not set for transactions that were - initiated by another participant - initiated offline via the repair service - processed before the participant started serving traffic cost on the Ledger API - returned as part of a query filtering for a non submitting party Optional
#[serde(rename = "paidTrafficCost", skip_serializing_if = "Option::is_none")]
pub paid_traffic_cost: Option<i64>,
}
impl JsReassignment {
/// Complete view of an on-ledger reassignment.
pub fn new(update_id: String, offset: i64, events: Vec<models::JsReassignmentEvent>, record_time: String, synchronizer_id: String) -> JsReassignment {
JsReassignment {
update_id,
command_id: None,
workflow_id: None,
offset,
events,
trace_context: None,
record_time,
synchronizer_id,
paid_traffic_cost: None,
}
}
}