canton_api_client/models/completion_stream_request.rs
1/*
2 * JSON Ledger API HTTP endpoints
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 3.3.0-SNAPSHOT
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CompletionStreamRequest {
16 /// 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.
17 #[serde(rename = "userId")]
18 pub user_id: String,
19 /// 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
20 #[serde(rename = "parties", skip_serializing_if = "Option::is_none")]
21 pub parties: Option<Vec<String>>,
22 /// 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.
23 #[serde(rename = "beginExclusive")]
24 pub begin_exclusive: i64,
25}
26
27impl CompletionStreamRequest {
28 pub fn new(user_id: String, begin_exclusive: i64) -> CompletionStreamRequest {
29 CompletionStreamRequest {
30 user_id,
31 parties: None,
32 begin_exclusive,
33 }
34 }
35}
36