etcdv3client/pb/
authpb.rs

1// This file is @generated by prost-build.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct UserAddOptions {
5    #[prost(bool, tag = "1")]
6    pub no_password: bool,
7}
8/// User is a single entry in the bucket authUsers
9#[allow(clippy::derive_partial_eq_without_eq)]
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct User {
12    #[prost(bytes = "vec", tag = "1")]
13    pub name: ::prost::alloc::vec::Vec<u8>,
14    #[prost(bytes = "vec", tag = "2")]
15    pub password: ::prost::alloc::vec::Vec<u8>,
16    #[prost(string, repeated, tag = "3")]
17    pub roles: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
18    #[prost(message, optional, tag = "4")]
19    pub options: ::core::option::Option<UserAddOptions>,
20}
21/// Permission is a single entity
22#[allow(clippy::derive_partial_eq_without_eq)]
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct Permission {
25    #[prost(enumeration = "permission::Type", tag = "1")]
26    pub perm_type: i32,
27    #[prost(bytes = "vec", tag = "2")]
28    pub key: ::prost::alloc::vec::Vec<u8>,
29    #[prost(bytes = "vec", tag = "3")]
30    pub range_end: ::prost::alloc::vec::Vec<u8>,
31}
32/// Nested message and enum types in `Permission`.
33pub mod permission {
34    #[derive(
35        Clone,
36        Copy,
37        Debug,
38        PartialEq,
39        Eq,
40        Hash,
41        PartialOrd,
42        Ord,
43        ::prost::Enumeration
44    )]
45    #[repr(i32)]
46    pub enum Type {
47        Read = 0,
48        Write = 1,
49        Readwrite = 2,
50    }
51    impl Type {
52        /// String value of the enum field names used in the ProtoBuf definition.
53        ///
54        /// The values are not transformed in any way and thus are considered stable
55        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
56        pub fn as_str_name(&self) -> &'static str {
57            match self {
58                Type::Read => "READ",
59                Type::Write => "WRITE",
60                Type::Readwrite => "READWRITE",
61            }
62        }
63        /// Creates an enum from field names used in the ProtoBuf definition.
64        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
65            match value {
66                "READ" => Some(Self::Read),
67                "WRITE" => Some(Self::Write),
68                "READWRITE" => Some(Self::Readwrite),
69                _ => None,
70            }
71        }
72    }
73}
74/// Role is a single entry in the bucket authRoles
75#[allow(clippy::derive_partial_eq_without_eq)]
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct Role {
78    #[prost(bytes = "vec", tag = "1")]
79    pub name: ::prost::alloc::vec::Vec<u8>,
80    #[prost(message, repeated, tag = "2")]
81    pub key_permission: ::prost::alloc::vec::Vec<Permission>,
82}