canton_api_client/models/completion1.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/// Completion1 : A completion represents the status of a submitted command on the ledger: it can be successful or failed.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Completion1 {
17 /// The ID of the succeeded or failed command. Must be a valid LedgerString (as described in ``value.proto``). Required
18 #[serde(rename = "commandId")]
19 pub command_id: String,
20 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
21 pub status: Option<Box<models::Status>>,
22 /// 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``).
23 #[serde(rename = "updateId")]
24 pub update_id: String,
25 /// 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.
26 #[serde(rename = "userId")]
27 pub user_id: String,
28 /// 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.
29 #[serde(rename = "actAs", skip_serializing_if = "Option::is_none")]
30 pub act_as: Option<Vec<String>>,
31 /// The submission ID this completion refers to, as described in ``commands.proto``. Must be a valid LedgerString (as described in ``value.proto``). Optional
32 #[serde(rename = "submissionId")]
33 pub submission_id: String,
34 #[serde(rename = "deduplicationPeriod")]
35 pub deduplication_period: Box<models::DeduplicationPeriod1>,
36 #[serde(rename = "traceContext", skip_serializing_if = "Option::is_none")]
37 pub trace_context: Option<Box<models::TraceContext>>,
38 /// 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).
39 #[serde(rename = "offset")]
40 pub offset: i64,
41 #[serde(rename = "synchronizerTime", skip_serializing_if = "Option::is_none")]
42 pub synchronizer_time: Option<Box<models::SynchronizerTime>>,
43}
44
45impl Completion1 {
46 /// A completion represents the status of a submitted command on the ledger: it can be successful or failed.
47 pub fn new(command_id: String, update_id: String, user_id: String, submission_id: String, deduplication_period: models::DeduplicationPeriod1, offset: i64) -> Completion1 {
48 Completion1 {
49 command_id,
50 status: None,
51 update_id,
52 user_id,
53 act_as: None,
54 submission_id,
55 deduplication_period: Box::new(deduplication_period),
56 trace_context: None,
57 offset,
58 synchronizer_time: None,
59 }
60 }
61}
62