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
41
42
43
44
45
46
47
48
49
50
51
52
53
// This file is @generated by prost-build.
/// An enum to be used to mark the essential (for polling) fields in an
/// API-specific Operation object. A custom Operation object may contain many
/// different fields, but only few of them are essential to conduct a successful
/// polling process.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OperationResponseMapping {
/// Do not use.
Undefined = 0,
/// A field in an API-specific (custom) Operation object which carries the same
/// meaning as google.longrunning.Operation.name.
Name = 1,
/// A field in an API-specific (custom) Operation object which carries the same
/// meaning as google.longrunning.Operation.done. If the annotated field is of
/// an enum type, `annotated_field_name == EnumType.DONE` semantics should be
/// equivalent to `Operation.done == true`. If the annotated field is of type
/// boolean, then it should follow the same semantics as Operation.done.
/// Otherwise, a non-empty value should be treated as `Operation.done == true`.
Status = 2,
/// A field in an API-specific (custom) Operation object which carries the same
/// meaning as google.longrunning.Operation.error.code.
ErrorCode = 3,
/// A field in an API-specific (custom) Operation object which carries the same
/// meaning as google.longrunning.Operation.error.message.
ErrorMessage = 4,
}
impl OperationResponseMapping {
/// 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 {
Self::Undefined => "UNDEFINED",
Self::Name => "NAME",
Self::Status => "STATUS",
Self::ErrorCode => "ERROR_CODE",
Self::ErrorMessage => "ERROR_MESSAGE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNDEFINED" => Some(Self::Undefined),
"NAME" => Some(Self::Name),
"STATUS" => Some(Self::Status),
"ERROR_CODE" => Some(Self::ErrorCode),
"ERROR_MESSAGE" => Some(Self::ErrorMessage),
_ => None,
}
}
}