canton-api-client 3.3.0-0.1.2

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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReassignmentCommands {
    /// Identifier of the on-ledger workflow that this command is a part of. Must be a valid LedgerString (as described in ``value.proto``). Optional
    #[serde(rename = "workflowId")]
    pub workflow_id: String,
    /// Uniquely identifies the participant user that issued the command. Must be a valid UserIdString (as described in ``value.proto``). Required unless authentication is used with a user token. In that case, the token's user-id will be used for the request's user_id.
    #[serde(rename = "userId")]
    pub user_id: String,
    /// Uniquely identifies the command. The triple (user_id, submitter, command_id) constitutes the change ID for the intended ledger change. The change ID can be used for matching the intended ledger changes with all their completions. Must be a valid LedgerString (as described in ``value.proto``). Required
    #[serde(rename = "commandId")]
    pub command_id: String,
    /// Party on whose behalf the command should be executed. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to act on behalf of the given party. Must be a valid PartyIdString (as described in ``value.proto``). Required
    #[serde(rename = "submitter")]
    pub submitter: String,
    /// A unique identifier to distinguish completions for different submissions with the same change ID. Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission with the same change ID. Must be a valid LedgerString (as described in ``value.proto``).  If omitted, the participant or the committer may set a value of their choice. Optional
    #[serde(rename = "submissionId")]
    pub submission_id: String,
    /// Individual elements of this reassignment. Must be non-empty.
    #[serde(rename = "commands", skip_serializing_if = "Option::is_none")]
    pub commands: Option<Vec<models::ReassignmentCommand>>,
}

impl ReassignmentCommands {
    pub fn new(workflow_id: String, user_id: String, command_id: String, submitter: String, submission_id: String) -> ReassignmentCommands {
        ReassignmentCommands {
            workflow_id,
            user_id,
            command_id,
            submitter,
            submission_id,
            commands: None,
        }
    }
}