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