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};

/// AllocatePartyRequest : Required authorization: ``HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)``
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AllocatePartyRequest {
    /// A hint to the participant which party ID to allocate. It can be ignored. Must be a valid PartyIdString (as described in ``value.proto``). Optional
    #[serde(rename = "partyIdHint")]
    pub party_id_hint: String,
    #[serde(rename = "localMetadata", skip_serializing_if = "Option::is_none")]
    pub local_metadata: Option<Box<models::ObjectMeta>>,
    /// The id of the ``Identity Provider`` Optional, if not set, assume the party is managed by the default identity provider or party is not hosted by the participant.
    #[serde(rename = "identityProviderId")]
    pub identity_provider_id: String,
}

impl AllocatePartyRequest {
    /// Required authorization: ``HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)``
    pub fn new(party_id_hint: String, identity_provider_id: String) -> AllocatePartyRequest {
        AllocatePartyRequest {
            party_id_hint,
            local_metadata: None,
            identity_provider_id,
        }
    }
}