1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* 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};
/// ExerciseCommand : Exercise a choice on an existing contract.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExerciseCommand {
/// The template or interface of the contract the client wants to exercise. 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. To exercise a choice on an interface, specify the interface identifier in the template_id field. Required
#[serde(rename = "templateId")]
pub template_id: String,
/// The ID of the contract the client wants to exercise upon. Must be a valid LedgerString (as described in ``value.proto``). Required
#[serde(rename = "contractId")]
pub contract_id: String,
/// The name of the choice the client wants to exercise. Must be a valid NameString (as described in ``value.proto``) Required
#[serde(rename = "choice")]
pub choice: String,
/// The argument for this choice. Required
#[serde(rename = "choiceArgument", deserialize_with = "Option::deserialize")]
pub choice_argument: Option<serde_json::Value>,
}
impl ExerciseCommand {
/// Exercise a choice on an existing contract.
pub fn new(template_id: String, contract_id: String, choice: String, choice_argument: Option<serde_json::Value>) -> ExerciseCommand {
ExerciseCommand {
template_id,
contract_id,
choice,
choice_argument,
}
}
}