canton_api_client/models/vetted_packages.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/// VettedPackages : The list of packages vetted on a given participant and synchronizer, modelled after ``VettedPackages`` in `topology.proto <https://github.com/digital-asset/canton/blob/main/community/base/src/main/protobuf/com/digitalasset/canton/protocol/v30/topology.proto#L206>`_. The list only contains packages that matched a filter in the query that originated it.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct VettedPackages {
17 /// Sorted by package_name and package_version where known, and package_id as a last resort. Required: must be non-empty
18 #[serde(rename = "packages")]
19 pub packages: Vec<models::VettedPackage>,
20 /// Participant on which these packages are vetted. Required
21 #[serde(rename = "participantId")]
22 pub participant_id: String,
23 /// Synchronizer on which these packages are vetted. Required
24 #[serde(rename = "synchronizerId")]
25 pub synchronizer_id: String,
26 /// Serial of last ``VettedPackages`` topology transaction of this participant and on this synchronizer. Required
27 #[serde(rename = "topologySerial")]
28 pub topology_serial: i32,
29}
30
31impl VettedPackages {
32 /// The list of packages vetted on a given participant and synchronizer, modelled after ``VettedPackages`` in `topology.proto <https://github.com/digital-asset/canton/blob/main/community/base/src/main/protobuf/com/digitalasset/canton/protocol/v30/topology.proto#L206>`_. The list only contains packages that matched a filter in the query that originated it.
33 pub fn new(packages: Vec<models::VettedPackage>, participant_id: String, synchronizer_id: String, topology_serial: i32) -> VettedPackages {
34 VettedPackages {
35 packages,
36 participant_id,
37 synchronizer_id,
38 topology_serial,
39 }
40 }
41}
42