canton_api_client/models/prefetch_contract_key.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/// PrefetchContractKey : Preload contracts
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PrefetchContractKey {
17 /// The template of contract the client wants to prefetch. Both package-name and package-id reference identifier formats for the template-id are supported. Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4. Required
18 #[serde(rename = "templateId")]
19 pub template_id: String,
20 /// The key of the contract the client wants to prefetch. Required
21 #[serde(rename = "contractKey", deserialize_with = "Option::deserialize")]
22 pub contract_key: Option<serde_json::Value>,
23 /// The number of contracts to prefetch for this key, if available. This is in addition to disclosed contracts. - for backward compatibility reason, absence is interpreted as 1 - 0 is forbidden - capped at 2^31 - 1. The system may impose further limits. Optional
24 #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
25 pub limit: Option<i32>,
26}
27
28impl PrefetchContractKey {
29 /// Preload contracts
30 pub fn new(template_id: String, contract_key: Option<serde_json::Value>) -> PrefetchContractKey {
31 PrefetchContractKey {
32 template_id,
33 contract_key,
34 limit: None,
35 }
36 }
37}
38