1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* JSON Ledger API HTTP endpoints
*
* 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
*
* The version of the OpenAPI document: 3.6.0-SNAPSHOT
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// User : Users and rights ///////////////// Users are used to dynamically manage the rights given to Daml applications. They are stored and managed per participant node.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct User {
/// 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
#[serde(rename = "id")]
pub id: String,
/// 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
#[serde(rename = "primaryParty", skip_serializing_if = "Option::is_none")]
pub primary_party: Option<String>,
/// 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
#[serde(rename = "isDeactivated", skip_serializing_if = "Option::is_none")]
pub is_deactivated: Option<bool>,
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<Box<models::ObjectMeta>>,
/// 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
#[serde(rename = "identityProviderId", skip_serializing_if = "Option::is_none")]
pub identity_provider_id: Option<String>,
/// If set to true, the user may authenticate against the Ledger API by signing a Party JWT using the primary party's signing key. Modifiable Optional
#[serde(rename = "primaryPartyAuthentication", skip_serializing_if = "Option::is_none")]
pub primary_party_authentication: Option<bool>,
}
impl User {
/// Users and rights ///////////////// Users are used to dynamically manage the rights given to Daml applications. They are stored and managed per participant node.
pub fn new(id: String) -> User {
User {
id,
primary_party: None,
is_deactivated: None,
metadata: None,
identity_provider_id: None,
primary_party_authentication: None,
}
}
}