canton-api-client 3.6.0-0.1.0

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

/// GetActiveContractsRequest : If the given offset is different than the ledger end, and there are (un)assignments in-flight at the given offset, the snapshot may fail with \"FAILED_PRECONDITION/PARTICIPANT_PRUNED_DATA_ACCESSED\". Note that it is ok to request acs snapshots for party migration with offsets other than ledger end, because party migration is not concerned with incomplete (un)assignments.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetActiveContractsRequest {
    #[serde(rename = "filter", skip_serializing_if = "Option::is_none")]
    pub filter: Option<Box<models::TransactionFilter>>,
    /// Provided for backwards compatibility, it will be removed in the Canton version 3.5.0. If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels for record fields. Optional, if specified event_format must be unset.
    #[serde(rename = "verbose", skip_serializing_if = "Option::is_none")]
    pub verbose: Option<bool>,
    /// The offset at which the snapshot of the active contracts will be computed. Must be no greater than the current ledger end offset. Must be greater than or equal to the last pruning offset. Must be a valid absolute offset (positive integer) or ledger begin offset (zero). If zero, the empty set will be returned.  Required
    #[serde(rename = "activeAtOffset")]
    pub active_at_offset: i64,
    #[serde(rename = "eventFormat", skip_serializing_if = "Option::is_none")]
    pub event_format: Option<Box<models::EventFormat>>,
    /// Opaque representation of a continuation token defining a position in the active contracts snapshot. The prefix of the active contracts snapshot will be omitted up to and including the element from which the continuation token was read. To reuse the continuation token from a `GetActiveContractsPageResponse`:  - subsequent request must be executed on the same participant with the same version of canton, - subsequent request must have the same active_at_offset, - subsequent request must have the same event_format - and the participant must not have been pruned after the active_at_offset.  If not specified, the whole active contracts snapshot will be returned.  Optional: can be empty
    #[serde(rename = "streamContinuationToken", skip_serializing_if = "Option::is_none")]
    pub stream_continuation_token: Option<String>,
}

impl GetActiveContractsRequest {
    /// If the given offset is different than the ledger end, and there are (un)assignments in-flight at the given offset, the snapshot may fail with \"FAILED_PRECONDITION/PARTICIPANT_PRUNED_DATA_ACCESSED\". Note that it is ok to request acs snapshots for party migration with offsets other than ledger end, because party migration is not concerned with incomplete (un)assignments.
    pub fn new(active_at_offset: i64) -> GetActiveContractsRequest {
        GetActiveContractsRequest {
            filter: None,
            verbose: None,
            active_at_offset,
            event_format: None,
            stream_continuation_token: None,
        }
    }
}