canton_api_client/models/
user.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/// User :  Users and rights /////////////////  Users are used to dynamically manage the rights given to Daml applications.  They are stored and managed per participant node.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct User {
17    /// The user identifier, which must be a non-empty string of at most 128 characters that are either alphanumeric ASCII characters or one of the symbols \"@^$.!`-#+'~_|:\". Required
18    #[serde(rename = "id")]
19    pub id: String,
20    /// The primary party as which this user reads and acts by default on the ledger *provided* it has the corresponding ``CanReadAs(primary_party)`` or ``CanActAs(primary_party)`` rights. Ledger API clients SHOULD set this field to a non-empty value for all users to enable the users to act on the ledger using their own Daml party. Users for participant administrators MAY have an associated primary party. Optional, Modifiable
21    #[serde(rename = "primaryParty")]
22    pub primary_party: String,
23    /// When set, then the user is denied all access to the Ledger API. Otherwise, the user has access to the Ledger API as per the user's rights. Optional, Modifiable
24    #[serde(rename = "isDeactivated")]
25    pub is_deactivated: bool,
26    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
27    pub metadata: Option<Box<models::ObjectMeta>>,
28    /// The ID of the identity provider configured by ``Identity Provider Config`` Optional, if not set, assume the user is managed by the default identity provider.
29    #[serde(rename = "identityProviderId")]
30    pub identity_provider_id: String,
31}
32
33impl User {
34    ///  Users and rights /////////////////  Users are used to dynamically manage the rights given to Daml applications.  They are stored and managed per participant node.
35    pub fn new(id: String, primary_party: String, is_deactivated: bool, identity_provider_id: String) -> User {
36        User {
37            id,
38            primary_party,
39            is_deactivated,
40            metadata: None,
41            identity_provider_id,
42        }
43    }
44}
45