Skip to main content

gaia_client/
proto.rs

1// This file is @generated by prost-build.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Secret {
5    #[prost(string, tag = "1")]
6    pub id: ::prost::alloc::string::String,
7    #[prost(string, tag = "2")]
8    pub value: ::prost::alloc::string::String,
9}
10/// A Namespace contains a collection of secrets.
11#[allow(clippy::derive_partial_eq_without_eq)]
12#[derive(Clone, PartialEq, ::prost::Message)]
13pub struct Namespace {
14    #[prost(string, tag = "1")]
15    pub name: ::prost::alloc::string::String,
16    #[prost(message, repeated, tag = "2")]
17    pub secrets: ::prost::alloc::vec::Vec<Secret>,
18}
19#[allow(clippy::derive_partial_eq_without_eq)]
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct GetSecretRequest {
22    /// Namespace to which the secret belongs
23    #[prost(string, tag = "1")]
24    pub namespace: ::prost::alloc::string::String,
25    #[prost(string, tag = "2")]
26    pub id: ::prost::alloc::string::String,
27}
28#[allow(clippy::derive_partial_eq_without_eq)]
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct ClientListSecretsRequest {
31    /// optional filter; empty => all client namespaces + common
32    #[prost(string, tag = "1")]
33    pub namespace: ::prost::alloc::string::String,
34}
35#[allow(clippy::derive_partial_eq_without_eq)]
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct ListSecretsResponse {
38    #[prost(message, repeated, tag = "1")]
39    pub namespaces: ::prost::alloc::vec::Vec<Namespace>,
40}
41/// Generated client implementations.
42pub mod gaia_client_client {
43    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
44    use tonic::codegen::*;
45    use tonic::codegen::http::Uri;
46    #[derive(Debug, Clone)]
47    pub struct GaiaClientClient<T> {
48        inner: tonic::client::Grpc<T>,
49    }
50    impl GaiaClientClient<tonic::transport::Channel> {
51        /// Attempt to create a new client by connecting to a given endpoint.
52        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
53        where
54            D: TryInto<tonic::transport::Endpoint>,
55            D::Error: Into<StdError>,
56        {
57            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
58            Ok(Self::new(conn))
59        }
60    }
61    impl<T> GaiaClientClient<T>
62    where
63        T: tonic::client::GrpcService<tonic::body::BoxBody>,
64        T::Error: Into<StdError>,
65        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
66        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
67    {
68        pub fn new(inner: T) -> Self {
69            let inner = tonic::client::Grpc::new(inner);
70            Self { inner }
71        }
72        pub fn with_origin(inner: T, origin: Uri) -> Self {
73            let inner = tonic::client::Grpc::with_origin(inner, origin);
74            Self { inner }
75        }
76        pub fn with_interceptor<F>(
77            inner: T,
78            interceptor: F,
79        ) -> GaiaClientClient<InterceptedService<T, F>>
80        where
81            F: tonic::service::Interceptor,
82            T::ResponseBody: Default,
83            T: tonic::codegen::Service<
84                http::Request<tonic::body::BoxBody>,
85                Response = http::Response<
86                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
87                >,
88            >,
89            <T as tonic::codegen::Service<
90                http::Request<tonic::body::BoxBody>,
91            >>::Error: Into<StdError> + Send + Sync,
92        {
93            GaiaClientClient::new(InterceptedService::new(inner, interceptor))
94        }
95        /// Compress requests with the given encoding.
96        ///
97        /// This requires the server to support it otherwise it might respond with an
98        /// error.
99        #[must_use]
100        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
101            self.inner = self.inner.send_compressed(encoding);
102            self
103        }
104        /// Enable decompressing responses.
105        #[must_use]
106        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
107            self.inner = self.inner.accept_compressed(encoding);
108            self
109        }
110        /// Limits the maximum size of a decoded message.
111        ///
112        /// Default: `4MB`
113        #[must_use]
114        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
115            self.inner = self.inner.max_decoding_message_size(limit);
116            self
117        }
118        /// Limits the maximum size of an encoded message.
119        ///
120        /// Default: `usize::MAX`
121        #[must_use]
122        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
123            self.inner = self.inner.max_encoding_message_size(limit);
124            self
125        }
126        pub async fn get_secret(
127            &mut self,
128            request: impl tonic::IntoRequest<super::GetSecretRequest>,
129        ) -> std::result::Result<tonic::Response<super::Secret>, tonic::Status> {
130            self.inner
131                .ready()
132                .await
133                .map_err(|e| {
134                    tonic::Status::new(
135                        tonic::Code::Unknown,
136                        format!("Service was not ready: {}", e.into()),
137                    )
138                })?;
139            let codec = tonic::codec::ProstCodec::default();
140            let path = http::uri::PathAndQuery::from_static(
141                "/gaia.GaiaClient/GetSecret",
142            );
143            let mut req = request.into_request();
144            req.extensions_mut().insert(GrpcMethod::new("gaia.GaiaClient", "GetSecret"));
145            self.inner.unary(req, path, codec).await
146        }
147        /// New: ListSecrets returns all secrets for the authenticated client plus common when not filtered.
148        pub async fn list_secrets(
149            &mut self,
150            request: impl tonic::IntoRequest<super::ClientListSecretsRequest>,
151        ) -> std::result::Result<
152            tonic::Response<super::ListSecretsResponse>,
153            tonic::Status,
154        > {
155            self.inner
156                .ready()
157                .await
158                .map_err(|e| {
159                    tonic::Status::new(
160                        tonic::Code::Unknown,
161                        format!("Service was not ready: {}", e.into()),
162                    )
163                })?;
164            let codec = tonic::codec::ProstCodec::default();
165            let path = http::uri::PathAndQuery::from_static(
166                "/gaia.GaiaClient/ListSecrets",
167            );
168            let mut req = request.into_request();
169            req.extensions_mut()
170                .insert(GrpcMethod::new("gaia.GaiaClient", "ListSecrets"));
171            self.inner.unary(req, path, codec).await
172        }
173    }
174}