canton_api_client/models/js_reassignment.rs
1/*
2 * JSON Ledger API HTTP endpoints
3 *
4 * 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 from the previous Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.4.12
5 *
6 * The version of the OpenAPI document: 3.4.12-SNAPSHOT
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// JsReassignment : Complete view of an on-ledger reassignment.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct JsReassignment {
17 /// Assigned by the server. Useful for correlating logs. Must be a valid LedgerString (as described in ``value.proto``). Required
18 #[serde(rename = "updateId")]
19 pub update_id: String,
20 /// 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
21 #[serde(rename = "commandId", skip_serializing_if = "Option::is_none")]
22 pub command_id: Option<String>,
23 /// 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
24 #[serde(rename = "workflowId", skip_serializing_if = "Option::is_none")]
25 pub workflow_id: Option<String>,
26 /// 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
27 #[serde(rename = "offset")]
28 pub offset: i64,
29 /// The collection of reassignment events. Required: must be non-empty
30 #[serde(rename = "events")]
31 pub events: Vec<models::JsReassignmentEvent>,
32 #[serde(rename = "traceContext", skip_serializing_if = "Option::is_none")]
33 pub trace_context: Option<Box<models::TraceContext>>,
34 /// The time at which the reassignment was recorded. The record time refers to the source/target synchronizer for an unassign/assign event respectively. Required
35 #[serde(rename = "recordTime")]
36 pub record_time: String,
37 /// A valid synchronizer id. Identifies the synchronizer that synchronized this Reassignment. Required
38 #[serde(rename = "synchronizerId")]
39 pub synchronizer_id: String,
40 /// 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: can be empty
41 #[serde(rename = "paidTrafficCost", skip_serializing_if = "Option::is_none")]
42 pub paid_traffic_cost: Option<i64>,
43}
44
45impl JsReassignment {
46 /// Complete view of an on-ledger reassignment.
47 pub fn new(update_id: String, offset: i64, events: Vec<models::JsReassignmentEvent>, record_time: String, synchronizer_id: String) -> JsReassignment {
48 JsReassignment {
49 update_id,
50 command_id: None,
51 workflow_id: None,
52 offset,
53 events,
54 trace_context: None,
55 record_time,
56 synchronizer_id,
57 paid_traffic_cost: None,
58 }
59 }
60}
61