canton_api_client/models/cost_estimation.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 for the latest Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.6.0
5 *
6 * The version of the OpenAPI document: 3.6.0-SNAPSHOT
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CostEstimation : Estimation of the cost of submitting the prepared transaction The estimation is done against the synchronizer chosen during preparation of the transaction (or the one explicitly requested). The cost of re-assigning contracts to another synchronizer when necessary is not included in the estimation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CostEstimation {
17 /// Timestamp at which the estimation was made Required
18 #[serde(rename = "estimationTimestamp")]
19 pub estimation_timestamp: String,
20 /// Estimated traffic cost of the confirmation request associated with the transaction Required
21 #[serde(rename = "confirmationRequestTrafficCostEstimation")]
22 pub confirmation_request_traffic_cost_estimation: i64,
23 /// Estimated traffic cost of the confirmation response associated with the transaction This field can also be used as an indication of the cost that other potential confirming nodes of the party will incur to approve or reject the transaction Required
24 #[serde(rename = "confirmationResponseTrafficCostEstimation")]
25 pub confirmation_response_traffic_cost_estimation: i64,
26 /// Sum of the fields above Required
27 #[serde(rename = "totalTrafficCostEstimation")]
28 pub total_traffic_cost_estimation: i64,
29}
30
31impl CostEstimation {
32 /// Estimation of the cost of submitting the prepared transaction The estimation is done against the synchronizer chosen during preparation of the transaction (or the one explicitly requested). The cost of re-assigning contracts to another synchronizer when necessary is not included in the estimation.
33 pub fn new(estimation_timestamp: String, confirmation_request_traffic_cost_estimation: i64, confirmation_response_traffic_cost_estimation: i64, total_traffic_cost_estimation: i64) -> CostEstimation {
34 CostEstimation {
35 estimation_timestamp,
36 confirmation_request_traffic_cost_estimation,
37 confirmation_response_traffic_cost_estimation,
38 total_traffic_cost_estimation,
39 }
40 }
41}
42