Skip to main content

canton_api_client/models/
connected_synchronizer.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 for the latest Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.6.0
5 *
6 * The version of the OpenAPI document: 3.6.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 ConnectedSynchronizer {
16    /// The alias of the synchronizer  Required
17    #[serde(rename = "synchronizerAlias")]
18    pub synchronizer_alias: String,
19    /// The ID of the synchronizer  Required
20    #[serde(rename = "synchronizerId")]
21    pub synchronizer_id: String,
22    /// The permission on the synchronizer Set if a party was used in the request, otherwise unspecified.  Optional
23    #[serde(rename = "permission", skip_serializing_if = "Option::is_none")]
24    pub permission: Option<Permission>,
25}
26
27impl ConnectedSynchronizer {
28    pub fn new(synchronizer_alias: String, synchronizer_id: String) -> ConnectedSynchronizer {
29        ConnectedSynchronizer {
30            synchronizer_alias,
31            synchronizer_id,
32            permission: None,
33        }
34    }
35}
36/// The permission on the synchronizer Set if a party was used in the request, otherwise unspecified.  Optional
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Permission {
39    #[serde(rename = "PARTICIPANT_PERMISSION_UNSPECIFIED")]
40    ParticipantPermissionUnspecified,
41    #[serde(rename = "PARTICIPANT_PERMISSION_SUBMISSION")]
42    ParticipantPermissionSubmission,
43    #[serde(rename = "PARTICIPANT_PERMISSION_CONFIRMATION")]
44    ParticipantPermissionConfirmation,
45    #[serde(rename = "PARTICIPANT_PERMISSION_OBSERVATION")]
46    ParticipantPermissionObservation,
47}
48
49impl Default for Permission {
50    fn default() -> Permission {
51        Self::ParticipantPermissionUnspecified
52    }
53}
54