canton_api_client/models/
js_reassignment.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/// 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")]
22    pub command_id: 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")]
25    pub workflow_id: String,
26    /// The participant's offset. The details of this field are described in ``community/ledger-api/README.md``. Required, must be a valid absolute offset (positive integer).
27    #[serde(rename = "offset")]
28    pub offset: i64,
29    /// The collection of reassignment events. Required.
30    #[serde(rename = "events", skip_serializing_if = "Option::is_none")]
31    pub events: Option<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}
38
39impl JsReassignment {
40    /// Complete view of an on-ledger reassignment.
41    pub fn new(update_id: String, command_id: String, workflow_id: String, offset: i64, record_time: String) -> JsReassignment {
42        JsReassignment {
43            update_id,
44            command_id,
45            workflow_id,
46            offset,
47            events: None,
48            trace_context: None,
49            record_time,
50        }
51    }
52}
53