canton-api-client 3.3.0-0.1.1

Canton Ledger API rust client
Documentation
/*
 * 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};

/// CreateCommand : Create a new contract instance based on a template.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateCommand {
    /// The template of contract the client wants to create. 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 arguments required for creating a contract from this template. Required
    #[serde(rename = "createArguments", deserialize_with = "Option::deserialize")]
    pub create_arguments: Option<serde_json::Value>,
}

impl CreateCommand {
    /// Create a new contract instance based on a template.
    pub fn new(template_id: String, create_arguments: Option<serde_json::Value>) -> CreateCommand {
        CreateCommand {
            template_id,
            create_arguments,
        }
    }
}