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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CompletionStreamRequest {
    /// Only completions of commands submitted with the same user_id will be visible in the stream. 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,
    /// Non-empty list of parties whose data should be included. The stream shows only completions of commands for which at least one of the ``act_as`` parties is in the given set of parties. Must be a valid PartyIdString (as described in ``value.proto``). Required
    #[serde(rename = "parties", skip_serializing_if = "Option::is_none")]
    pub parties: Option<Vec<String>>,
    /// This optional field indicates the minimum offset for completions. This can be used to resume an earlier completion stream. If not set the ledger uses the ledger begin offset instead. If specified, it must be a valid absolute offset (positive integer) or zero (ledger begin offset). If the ledger has been pruned, this parameter must be specified and greater than the pruning offset.
    #[serde(rename = "beginExclusive")]
    pub begin_exclusive: i64,
}

impl CompletionStreamRequest {
    pub fn new(user_id: String, begin_exclusive: i64) -> CompletionStreamRequest {
        CompletionStreamRequest {
            user_id,
            parties: None,
            begin_exclusive,
        }
    }
}