Skip to main content

canton_api_client/models/
user.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/// 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. Modifiable  Optional
21    #[serde(rename = "primaryParty", skip_serializing_if = "Option::is_none")]
22    pub primary_party: Option<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. Modifiable  Optional
24    #[serde(rename = "isDeactivated", skip_serializing_if = "Option::is_none")]
25    pub is_deactivated: Option<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`` If not set, assume the user is managed by the default identity provider.  Optional
29    #[serde(rename = "identityProviderId", skip_serializing_if = "Option::is_none")]
30    pub identity_provider_id: Option<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) -> User {
36        User {
37            id,
38            primary_party: None,
39            is_deactivated: None,
40            metadata: None,
41            identity_provider_id: None,
42        }
43    }
44}
45