Skip to main content

canton_api_client/models/
js_execute_submission_request.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct JsExecuteSubmissionRequest {
16    /// the prepared transaction Typically this is the value of the `prepared_transaction` field in `PrepareSubmissionResponse` obtained from calling `prepareSubmission`.  Required
17    #[serde(rename = "preparedTransaction")]
18    pub prepared_transaction: String,
19    #[serde(rename = "partySignatures")]
20    pub party_signatures: Box<models::PartySignatures>,
21    #[serde(rename = "deduplicationPeriod", skip_serializing_if = "Option::is_none")]
22    pub deduplication_period: Option<Box<models::DeduplicationPeriod2>>,
23    /// A unique identifier to distinguish completions for different submissions with the same change ID. Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission with the same change ID. Must be a valid LedgerString (as described in ``value.proto``).  Required
24    #[serde(rename = "submissionId")]
25    pub submission_id: String,
26    /// See [PrepareSubmissionRequest.user_id]  Optional
27    #[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
28    pub user_id: Option<String>,
29    /// The hashing scheme version used when building the hash  Required
30    #[serde(rename = "hashingSchemeVersion")]
31    pub hashing_scheme_version: HashingSchemeVersion,
32    #[serde(rename = "minLedgerTime", skip_serializing_if = "Option::is_none")]
33    pub min_ledger_time: Option<Box<models::MinLedgerTime>>,
34}
35
36impl JsExecuteSubmissionRequest {
37    pub fn new(prepared_transaction: String, party_signatures: models::PartySignatures, submission_id: String, hashing_scheme_version: HashingSchemeVersion) -> JsExecuteSubmissionRequest {
38        JsExecuteSubmissionRequest {
39            prepared_transaction,
40            party_signatures: Box::new(party_signatures),
41            deduplication_period: None,
42            submission_id,
43            user_id: None,
44            hashing_scheme_version,
45            min_ledger_time: None,
46        }
47    }
48}
49/// The hashing scheme version used when building the hash  Required
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum HashingSchemeVersion {
52    #[serde(rename = "HASHING_SCHEME_VERSION_UNSPECIFIED")]
53    HashingSchemeVersionUnspecified,
54    #[serde(rename = "HASHING_SCHEME_VERSION_V2")]
55    HashingSchemeVersionV2,
56}
57
58impl Default for HashingSchemeVersion {
59    fn default() -> HashingSchemeVersion {
60        Self::HashingSchemeVersionUnspecified
61    }
62}
63