canton-api-client 3.6.0-0.1.0

Canton Ledger API rust client
Documentation
/*
 * JSON Ledger API HTTP endpoints
 *
 * 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 for the latest Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.6.0
 *
 * The version of the OpenAPI document: 3.6.0-SNAPSHOT
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JsExecuteSubmissionAndWaitRequest {
    /// the prepared transaction Typically this is the value of the `prepared_transaction` field in `PrepareSubmissionResponse` obtained from calling `prepareSubmission`.  Required
    #[serde(rename = "preparedTransaction")]
    pub prepared_transaction: String,
    #[serde(rename = "partySignatures")]
    pub party_signatures: Box<models::PartySignatures>,
    #[serde(rename = "deduplicationPeriod", skip_serializing_if = "Option::is_none")]
    pub deduplication_period: Option<Box<models::DeduplicationPeriod2>>,
    /// 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
    #[serde(rename = "submissionId")]
    pub submission_id: String,
    /// See [PrepareSubmissionRequest.user_id]  Optional
    #[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<String>,
    /// The hashing scheme version used when building the hash  Required
    #[serde(rename = "hashingSchemeVersion")]
    pub hashing_scheme_version: HashingSchemeVersion,
    #[serde(rename = "minLedgerTime", skip_serializing_if = "Option::is_none")]
    pub min_ledger_time: Option<Box<models::MinLedgerTime>>,
}

impl JsExecuteSubmissionAndWaitRequest {
    pub fn new(prepared_transaction: String, party_signatures: models::PartySignatures, submission_id: String, hashing_scheme_version: HashingSchemeVersion) -> JsExecuteSubmissionAndWaitRequest {
        JsExecuteSubmissionAndWaitRequest {
            prepared_transaction,
            party_signatures: Box::new(party_signatures),
            deduplication_period: None,
            submission_id,
            user_id: None,
            hashing_scheme_version,
            min_ledger_time: None,
        }
    }
}
/// The hashing scheme version used when building the hash  Required
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum HashingSchemeVersion {
    #[serde(rename = "HASHING_SCHEME_VERSION_UNSPECIFIED")]
    HashingSchemeVersionUnspecified,
    #[serde(rename = "HASHING_SCHEME_VERSION_V2")]
    HashingSchemeVersionV2,
    #[serde(rename = "HASHING_SCHEME_VERSION_V3")]
    HashingSchemeVersionV3,
}

impl Default for HashingSchemeVersion {
    fn default() -> HashingSchemeVersion {
        Self::HashingSchemeVersionUnspecified
    }
}