canton_api_client/models/completion_stream_request.rs
1/*
2 * JSON Ledger API HTTP endpoints
3 *
4 * 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 from the previous Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.4.12
5 *
6 * The version of the OpenAPI document: 3.4.12-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. Optional
17 #[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
18 pub user_id: Option<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: must be non-empty
20 #[serde(rename = "parties")]
21 pub parties: 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. Optional
23 #[serde(rename = "beginExclusive", skip_serializing_if = "Option::is_none")]
24 pub begin_exclusive: Option<i64>,
25}
26
27impl CompletionStreamRequest {
28 pub fn new(parties: Vec<String>) -> CompletionStreamRequest {
29 CompletionStreamRequest {
30 user_id: None,
31 parties,
32 begin_exclusive: None,
33 }
34 }
35}
36