canton-api-client 3.3.0-0.1.1

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};

/// Completion1 : A completion represents the status of a submitted command on the ledger: it can be successful or failed.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Completion1 {
    /// The ID of the succeeded or failed command. Must be a valid LedgerString (as described in ``value.proto``). Required
    #[serde(rename = "commandId")]
    pub command_id: String,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Box<models::Status>>,
    /// The update_id of the transaction or reassignment that resulted from the command with command_id. Only set for successfully executed commands. Must be a valid LedgerString (as described in ``value.proto``).
    #[serde(rename = "updateId")]
    pub update_id: String,
    /// The user-id that was used for the submission, as described in ``commands.proto``. Must be a valid UserIdString (as described in ``value.proto``). Optional for historic completions where this data is not available.
    #[serde(rename = "userId")]
    pub user_id: String,
    /// The set of parties on whose behalf the commands were executed. Contains the ``act_as`` parties from ``commands.proto`` filtered to the requesting parties in CompletionStreamRequest. The order of the parties need not be the same as in the submission. Each element must be a valid PartyIdString (as described in ``value.proto``). Optional for historic completions where this data is not available.
    #[serde(rename = "actAs", skip_serializing_if = "Option::is_none")]
    pub act_as: Option<Vec<String>>,
    /// The submission ID this completion refers to, as described in ``commands.proto``. Must be a valid LedgerString (as described in ``value.proto``). Optional
    #[serde(rename = "submissionId")]
    pub submission_id: String,
    #[serde(rename = "deduplicationPeriod")]
    pub deduplication_period: Box<models::DeduplicationPeriod1>,
    #[serde(rename = "traceContext", skip_serializing_if = "Option::is_none")]
    pub trace_context: Option<Box<models::TraceContext>>,
    /// May be used in a subsequent CompletionStreamRequest to resume the consumption of this stream at a later time. Required, must be a valid absolute offset (positive integer).
    #[serde(rename = "offset")]
    pub offset: i64,
    #[serde(rename = "synchronizerTime", skip_serializing_if = "Option::is_none")]
    pub synchronizer_time: Option<Box<models::SynchronizerTime>>,
}

impl Completion1 {
    /// A completion represents the status of a submitted command on the ledger: it can be successful or failed.
    pub fn new(command_id: String, update_id: String, user_id: String, submission_id: String, deduplication_period: models::DeduplicationPeriod1, offset: i64) -> Completion1 {
        Completion1 {
            command_id,
            status: None,
            update_id,
            user_id,
            act_as: None,
            submission_id,
            deduplication_period: Box::new(deduplication_period),
            trace_context: None,
            offset,
            synchronizer_time: None,
        }
    }
}