canton-api-client 3.3.0-0.1.2

Canton Ledger API rust client
Documentation
/*
 * 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};

/// 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")]
    pub command_id: 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")]
    pub workflow_id: String,
    /// 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).
    #[serde(rename = "offset")]
    pub offset: i64,
    /// The collection of reassignment events. Required.
    #[serde(rename = "events", skip_serializing_if = "Option::is_none")]
    pub events: Option<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,
}

impl JsReassignment {
    /// Complete view of an on-ledger reassignment.
    pub fn new(update_id: String, command_id: String, workflow_id: String, offset: i64, record_time: String) -> JsReassignment {
        JsReassignment {
            update_id,
            command_id,
            workflow_id,
            offset,
            events: None,
            trace_context: None,
            record_time,
        }
    }
}