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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JsGetActiveContractsPageResponse {
    /// The collection of active contracts for this page response.  Required: must be non-empty
    #[serde(rename = "activeContracts")]
    pub active_contracts: Vec<models::JsGetActiveContractsResponse>,
    /// The active_at_offset which was specified in the request, or the calculated active_at_offset from the actual ledger end from at the evaluation of the request.  Required
    #[serde(rename = "activeAtOffset")]
    pub active_at_offset: i64,
    /// If not present this is the last page. If present, this token must be used to get the next page.  Optional: can be empty
    #[serde(rename = "nextPageToken", skip_serializing_if = "Option::is_none")]
    pub next_page_token: Option<String>,
}

impl JsGetActiveContractsPageResponse {
    pub fn new(active_contracts: Vec<models::JsGetActiveContractsResponse>, active_at_offset: i64) -> JsGetActiveContractsPageResponse {
        JsGetActiveContractsPageResponse {
            active_contracts,
            active_at_offset,
            next_page_token: None,
        }
    }
}