canton_api_client/models/create_user_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 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/// CreateUserRequest : RPC requests and responses /////////////////////////// Required authorization: ``HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(user.identity_provider_id)``
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CreateUserRequest {
17 #[serde(rename = "user")]
18 pub user: Box<models::User>,
19 /// The rights to be assigned to the user upon creation, which SHOULD include appropriate rights for the ``user.primary_party``. Optional: can be empty
20 #[serde(rename = "rights", skip_serializing_if = "Option::is_none")]
21 pub rights: Option<Vec<models::Right>>,
22}
23
24impl CreateUserRequest {
25 /// RPC requests and responses /////////////////////////// Required authorization: ``HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(user.identity_provider_id)``
26 pub fn new(user: models::User) -> CreateUserRequest {
27 CreateUserRequest {
28 user: Box::new(user),
29 rights: None,
30 }
31 }
32}
33