canton-api-client 3.3.0-0.1.2

Canton Ledger API rust client
Documentation
/*
 * JSON Ledger API HTTP endpoints
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 3.3.0-SNAPSHOT
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// GrantUserRightsRequest : Add the rights to the set of rights granted to the user.  Required authorization: ``HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)``
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GrantUserRightsRequest {
    /// The user to whom to grant rights. Required
    #[serde(rename = "userId")]
    pub user_id: String,
    /// The rights to grant. Optional
    #[serde(rename = "rights", skip_serializing_if = "Option::is_none")]
    pub rights: Option<Vec<models::Right>>,
    /// The id of the ``Identity Provider`` Optional, if not set, assume the user is managed by the default identity provider.
    #[serde(rename = "identityProviderId")]
    pub identity_provider_id: String,
}

impl GrantUserRightsRequest {
    /// Add the rights to the set of rights granted to the user.  Required authorization: ``HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)``
    pub fn new(user_id: String, identity_provider_id: String) -> GrantUserRightsRequest {
        GrantUserRightsRequest {
            user_id,
            rights: None,
            identity_provider_id,
        }
    }
}