use prost::Oneof;
#[derive(Clone, Eq, prost::Message, PartialEq)]
pub struct RegistryError {
#[prost(enumeration = "RegistryErrorCode", tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub reason: String,
#[prost(bytes = "vec", tag = "3")]
pub key: Vec<u8>,
}
#[derive(Clone, Copy, Debug, prost::Enumeration, Eq, PartialEq)]
#[repr(i32)]
pub enum RegistryErrorCode {
MalformedMessage = 0,
KeyNotPresent = 1,
KeyAlreadyPresent = 2,
VersionNotLatest = 3,
VersionBeyondLatest = 4,
Authorization = 5,
InternalError = 999,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
pub struct LargeValueChunkKeys {
#[prost(bytes = "vec", repeated, tag = "1")]
pub chunk_content_sha256s: Vec<Vec<u8>>,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
pub struct RegistryGetValueRequest {
#[prost(message, optional, tag = "1")]
pub version: Option<UInt64Value>,
#[prost(bytes = "vec", tag = "2")]
pub key: Vec<u8>,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
pub struct UInt64Value {
#[prost(uint64, tag = "1")]
pub value: u64,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
pub struct RegistryGetValueResponse {
#[prost(message, optional, tag = "1")]
pub error: Option<RegistryError>,
#[prost(uint64, tag = "2")]
pub version: u64,
#[prost(oneof = "registry_get_value_response::Content", tags = "3, 4")]
pub content: Option<registry_get_value_response::Content>,
#[prost(uint64, tag = "5")]
pub timestamp_nanoseconds: u64,
}
pub mod registry_get_value_response {
use super::{LargeValueChunkKeys, Oneof};
#[derive(Clone, Eq, Oneof, PartialEq)]
pub enum Content {
#[prost(bytes = "vec", tag = "3")]
Value(Vec<u8>),
#[prost(message, tag = "4")]
LargeValueChunkKeys(LargeValueChunkKeys),
}
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
pub struct RegistryGetLatestVersionResponse {
#[prost(uint64, tag = "1")]
pub version: u64,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
#[cfg(feature = "nns-host")]
pub struct RegistryGetChangesSinceRequest {
#[prost(uint64, tag = "1")]
pub version: u64,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
#[cfg(feature = "nns-host")]
pub struct HighCapacityRegistryAtomicMutateRequest {
#[prost(message, repeated, tag = "1")]
pub mutations: Vec<HighCapacityRegistryMutation>,
#[prost(message, repeated, tag = "5")]
pub preconditions: Vec<RegistryPrecondition>,
#[prost(uint64, tag = "6")]
pub timestamp_nanoseconds: u64,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
#[cfg(feature = "nns-host")]
pub struct HighCapacityRegistryMutation {
#[prost(int32, tag = "1")]
pub mutation_type: i32,
#[prost(bytes = "vec", tag = "2")]
pub key: Vec<u8>,
#[prost(oneof = "high_capacity_registry_mutation::Content", tags = "3, 4")]
pub content: Option<high_capacity_registry_mutation::Content>,
}
#[cfg(feature = "nns-host")]
pub mod high_capacity_registry_mutation {
use super::LargeValueChunkKeys;
use prost::Oneof;
#[derive(Clone, Eq, Oneof, PartialEq)]
pub enum Content {
#[prost(bytes = "vec", tag = "3")]
Value(Vec<u8>),
#[prost(message, tag = "4")]
LargeValueChunkKeys(LargeValueChunkKeys),
}
}
#[derive(Clone, Copy, Debug, prost::Enumeration, Eq, PartialEq)]
#[cfg(feature = "nns-host")]
#[repr(i32)]
pub enum RegistryMutationType {
Insert = 0,
Update = 1,
Delete = 2,
Upsert = 4,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
#[cfg(feature = "nns-host")]
pub struct RegistryPrecondition {
#[prost(bytes = "vec", tag = "1")]
pub key: Vec<u8>,
#[prost(uint64, tag = "2")]
pub expected_version: u64,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
#[cfg(feature = "nns-host")]
pub struct RegistryCertifiedResponse {
#[prost(message, optional, tag = "1")]
pub hash_tree: Option<RegistryMixedHashTree>,
#[prost(bytes = "vec", tag = "2")]
pub certificate: Vec<u8>,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
#[cfg(feature = "nns-host")]
pub struct RegistryMixedHashTree {
#[prost(oneof = "registry_mixed_hash_tree::Tree", tags = "1, 2, 3, 4, 5")]
pub tree: Option<registry_mixed_hash_tree::Tree>,
}
#[cfg(feature = "nns-host")]
pub mod registry_mixed_hash_tree {
use super::RegistryMixedHashTree;
use prost::Oneof;
#[derive(Clone, Eq, prost::Message, PartialEq)]
pub struct Fork {
#[prost(message, optional, boxed, tag = "1")]
pub left_tree: Option<Box<RegistryMixedHashTree>>,
#[prost(message, optional, boxed, tag = "2")]
pub right_tree: Option<Box<RegistryMixedHashTree>>,
}
#[derive(Clone, Eq, prost::Message, PartialEq)]
pub struct Labeled {
#[prost(bytes = "vec", tag = "1")]
pub label: Vec<u8>,
#[prost(message, optional, boxed, tag = "2")]
pub subtree: Option<Box<RegistryMixedHashTree>>,
}
#[derive(Clone, Eq, Oneof, PartialEq)]
pub enum Tree {
#[prost(message, tag = "1")]
Empty(()),
#[prost(message, tag = "2")]
Fork(Box<Fork>),
#[prost(message, tag = "3")]
Labeled(Box<Labeled>),
#[prost(bytes, tag = "4")]
LeafData(Vec<u8>),
#[prost(bytes, tag = "5")]
PrunedDigest(Vec<u8>),
}
}