Skip to main content

rust_types/ledger_models/
util.rs

1#[derive(Clone, PartialEq, ::prost::Message)]
2pub struct DecimalValueProto {
3    #[prost(uint32, tag = "1")]
4    pub scale: u32,
5    #[prost(uint32, tag = "2")]
6    pub precision: u32,
7    #[prost(bytes = "vec", tag = "3")]
8    pub value: ::prost::alloc::vec::Vec<u8>,
9}
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct LocalDateProto {
12    #[prost(uint32, tag = "1")]
13    pub year: u32,
14    #[prost(uint32, tag = "2")]
15    pub month: u32,
16    #[prost(uint32, tag = "3")]
17    pub day: u32,
18}
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct LocalTimestampProto {
21    #[prost(message, optional, tag = "1")]
22    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
23    /// TODO: Need to decide how to model this: <https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations>
24    /// <https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html>
25    #[prost(string, tag = "2")]
26    pub time_zone: ::prost::alloc::string::String,
27}
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct UuidProto {
30    #[prost(bytes = "vec", tag = "1")]
31    pub raw_uuid: ::prost::alloc::vec::Vec<u8>,
32}
33#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
34#[repr(i32)]
35pub enum RequestOperationTypeProto {
36    UnknownOperation = 0,
37    Validate = 1,
38    Create = 2,
39    Get = 3,
40    Search = 4,
41}
42impl RequestOperationTypeProto {
43    /// String value of the enum field names used in the ProtoBuf definition.
44    ///
45    /// The values are not transformed in any way and thus are considered stable
46    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
47    pub fn as_str_name(&self) -> &'static str {
48        match self {
49            RequestOperationTypeProto::UnknownOperation => "UNKNOWN_OPERATION",
50            RequestOperationTypeProto::Validate => "VALIDATE",
51            RequestOperationTypeProto::Create => "CREATE",
52            RequestOperationTypeProto::Get => "GET",
53            RequestOperationTypeProto::Search => "SEARCH",
54        }
55    }
56}