canton-api-client 3.6.0-0.1.0

Canton Ledger API rust client
Documentation
/*
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateVettedPackagesRequest {
    /// Changes to apply to the current vetting state of the participant on the specified synchronizer. The changes are applied in order. Any package not changed will keep their previous vetting state.  Required: must be non-empty
    #[serde(rename = "changes")]
    pub changes: Vec<models::VettedPackagesChange>,
    /// If dry_run is true, then the changes are only prepared, but not applied. If a request would trigger an error when run (e.g. TOPOLOGY_DEPENDENCIES_NOT_VETTED), it will also trigger an error when dry_run.  Use this flag to preview a change before applying it. Defaults to false.  Optional
    #[serde(rename = "dryRun", skip_serializing_if = "Option::is_none")]
    pub dry_run: Option<bool>,
    /// If set, the requested changes will take place on the specified synchronizer. If synchronizer_id is unset and the participant is only connected to a single synchronizer, that synchronizer will be used by default. If synchronizer_id is unset and the participant is connected to multiple synchronizers, the request will error out with PACKAGE_SERVICE_CANNOT_AUTODETECT_SYNCHRONIZER.  Optional
    #[serde(rename = "synchronizerId", skip_serializing_if = "Option::is_none")]
    pub synchronizer_id: Option<String>,
    #[serde(rename = "expectedTopologySerial", skip_serializing_if = "Option::is_none")]
    pub expected_topology_serial: Option<Box<models::PriorTopologySerial>>,
    /// Controls whether potentially unsafe vetting updates are allowed.  Optional: can be empty
    #[serde(rename = "updateVettedPackagesForceFlags", skip_serializing_if = "Option::is_none")]
    pub update_vetted_packages_force_flags: Option<Vec<UpdateVettedPackagesForceFlags>>,
}

impl UpdateVettedPackagesRequest {
    pub fn new(changes: Vec<models::VettedPackagesChange>) -> UpdateVettedPackagesRequest {
        UpdateVettedPackagesRequest {
            changes,
            dry_run: None,
            synchronizer_id: None,
            expected_topology_serial: None,
            update_vetted_packages_force_flags: None,
        }
    }
}
/// Controls whether potentially unsafe vetting updates are allowed.  Optional: can be empty
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum UpdateVettedPackagesForceFlags {
    #[serde(rename = "UPDATE_VETTED_PACKAGES_FORCE_FLAG_UNSPECIFIED")]
    UpdateVettedPackagesForceFlagUnspecified,
    #[serde(rename = "UPDATE_VETTED_PACKAGES_FORCE_FLAG_ALLOW_VET_INCOMPATIBLE_UPGRADES")]
    UpdateVettedPackagesForceFlagAllowVetIncompatibleUpgrades,
    #[serde(rename = "UPDATE_VETTED_PACKAGES_FORCE_FLAG_ALLOW_UNVETTED_DEPENDENCIES")]
    UpdateVettedPackagesForceFlagAllowUnvettedDependencies,
}

impl Default for UpdateVettedPackagesForceFlags {
    fn default() -> UpdateVettedPackagesForceFlags {
        Self::UpdateVettedPackagesForceFlagUnspecified
    }
}