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
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.3.0-SNAPSHOT
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// ExerciseByKeyCommand : Exercise a choice on an existing contract specified by its key.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExerciseByKeyCommand {
/// The template of 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. Required
#[serde(rename = "templateId")]
pub template_id: String,
/// The key of the contract the client wants to exercise upon. Required
#[serde(rename = "contractKey", deserialize_with = "Option::deserialize")]
pub contract_key: Option<serde_json::Value>,
/// 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 ExerciseByKeyCommand {
/// Exercise a choice on an existing contract specified by its key.
pub fn new(template_id: String, contract_key: Option<serde_json::Value>, choice: String, choice_argument: Option<serde_json::Value>) -> ExerciseByKeyCommand {
ExerciseByKeyCommand {
template_id,
contract_key,
choice,
choice_argument,
}
}
}