Skip to main content

googleapis_tonic_google_cloud/vec_u8_hash_map/
google.cloud.rs

1// This file is @generated by prost-build.
2/// An enum to be used to mark the essential (for polling) fields in an
3/// API-specific Operation object. A custom Operation object may contain many
4/// different fields, but only few of them are essential to conduct a successful
5/// polling process.
6#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
7#[repr(i32)]
8pub enum OperationResponseMapping {
9    /// Do not use.
10    Undefined = 0,
11    /// A field in an API-specific (custom) Operation object which carries the same
12    /// meaning as google.longrunning.Operation.name.
13    Name = 1,
14    /// A field in an API-specific (custom) Operation object which carries the same
15    /// meaning as google.longrunning.Operation.done. If the annotated field is of
16    /// an enum type, `annotated_field_name == EnumType.DONE` semantics should be
17    /// equivalent to `Operation.done == true`. If the annotated field is of type
18    /// boolean, then it should follow the same semantics as Operation.done.
19    /// Otherwise, a non-empty value should be treated as `Operation.done == true`.
20    Status = 2,
21    /// A field in an API-specific (custom) Operation object which carries the same
22    /// meaning as google.longrunning.Operation.error.code.
23    ErrorCode = 3,
24    /// A field in an API-specific (custom) Operation object which carries the same
25    /// meaning as google.longrunning.Operation.error.message.
26    ErrorMessage = 4,
27}
28impl OperationResponseMapping {
29    /// String value of the enum field names used in the ProtoBuf definition.
30    ///
31    /// The values are not transformed in any way and thus are considered stable
32    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
33    pub fn as_str_name(&self) -> &'static str {
34        match self {
35            Self::Undefined => "UNDEFINED",
36            Self::Name => "NAME",
37            Self::Status => "STATUS",
38            Self::ErrorCode => "ERROR_CODE",
39            Self::ErrorMessage => "ERROR_MESSAGE",
40        }
41    }
42    /// Creates an enum from field names used in the ProtoBuf definition.
43    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
44        match value {
45            "UNDEFINED" => Some(Self::Undefined),
46            "NAME" => Some(Self::Name),
47            "STATUS" => Some(Self::Status),
48            "ERROR_CODE" => Some(Self::ErrorCode),
49            "ERROR_MESSAGE" => Some(Self::ErrorMessage),
50            _ => None,
51        }
52    }
53}