Skip to main content

canton_api_client/models/
update_vetted_packages_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct UpdateVettedPackagesRequest {
16    /// 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
17    #[serde(rename = "changes")]
18    pub changes: Vec<models::VettedPackagesChange>,
19    /// 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
20    #[serde(rename = "dryRun", skip_serializing_if = "Option::is_none")]
21    pub dry_run: Option<bool>,
22    /// 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
23    #[serde(rename = "synchronizerId", skip_serializing_if = "Option::is_none")]
24    pub synchronizer_id: Option<String>,
25    #[serde(rename = "expectedTopologySerial", skip_serializing_if = "Option::is_none")]
26    pub expected_topology_serial: Option<Box<models::PriorTopologySerial>>,
27    /// Controls whether potentially unsafe vetting updates are allowed.  Optional: can be empty
28    #[serde(rename = "updateVettedPackagesForceFlags", skip_serializing_if = "Option::is_none")]
29    pub update_vetted_packages_force_flags: Option<Vec<UpdateVettedPackagesForceFlags>>,
30}
31
32impl UpdateVettedPackagesRequest {
33    pub fn new(changes: Vec<models::VettedPackagesChange>) -> UpdateVettedPackagesRequest {
34        UpdateVettedPackagesRequest {
35            changes,
36            dry_run: None,
37            synchronizer_id: None,
38            expected_topology_serial: None,
39            update_vetted_packages_force_flags: None,
40        }
41    }
42}
43/// Controls whether potentially unsafe vetting updates are allowed.  Optional: can be empty
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
45pub enum UpdateVettedPackagesForceFlags {
46    #[serde(rename = "UPDATE_VETTED_PACKAGES_FORCE_FLAG_UNSPECIFIED")]
47    UpdateVettedPackagesForceFlagUnspecified,
48    #[serde(rename = "UPDATE_VETTED_PACKAGES_FORCE_FLAG_ALLOW_VET_INCOMPATIBLE_UPGRADES")]
49    UpdateVettedPackagesForceFlagAllowVetIncompatibleUpgrades,
50    #[serde(rename = "UPDATE_VETTED_PACKAGES_FORCE_FLAG_ALLOW_UNVETTED_DEPENDENCIES")]
51    UpdateVettedPackagesForceFlagAllowUnvettedDependencies,
52}
53
54impl Default for UpdateVettedPackagesForceFlags {
55    fn default() -> UpdateVettedPackagesForceFlags {
56        Self::UpdateVettedPackagesForceFlagUnspecified
57    }
58}
59