ledger_models/
fintekkers.requests.util.rs

1#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2#[repr(i32)]
3pub enum RequestOperationTypeProto {
4    UnknownOperation = 0,
5    /// Validate whether an object is well-formed. The proto schema provides the syntax, but validation
6    /// ensures semantic meaning is correct.
7    Validate = 1,
8    /// Create an object in the back-end
9    Create = 2,
10    /// Retrieve an object
11    Get = 3,
12    /// Search for an object
13    Search = 4,
14}
15impl RequestOperationTypeProto {
16    /// String value of the enum field names used in the ProtoBuf definition.
17    ///
18    /// The values are not transformed in any way and thus are considered stable
19    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
20    pub fn as_str_name(&self) -> &'static str {
21        match self {
22            RequestOperationTypeProto::UnknownOperation => "UNKNOWN_OPERATION",
23            RequestOperationTypeProto::Validate => "VALIDATE",
24            RequestOperationTypeProto::Create => "CREATE",
25            RequestOperationTypeProto::Get => "GET",
26            RequestOperationTypeProto::Search => "SEARCH",
27        }
28    }
29    /// Creates an enum from field names used in the ProtoBuf definition.
30    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
31        match value {
32            "UNKNOWN_OPERATION" => Some(Self::UnknownOperation),
33            "VALIDATE" => Some(Self::Validate),
34            "CREATE" => Some(Self::Create),
35            "GET" => Some(Self::Get),
36            "SEARCH" => Some(Self::Search),
37            _ => None,
38        }
39    }
40}