nominal_api_proto/proto/
nominal.internalsecrets.v1.rs1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct DecryptedSecret {
4 #[prost(string, tag = "1")]
5 pub rid: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub name: ::prost::alloc::string::String,
8 #[prost(string, tag = "3")]
9 pub description: ::prost::alloc::string::String,
10 #[prost(string, tag = "4")]
11 pub decrypted_value: ::prost::alloc::string::String,
12 #[prost(string, tag = "5")]
13 pub created_by: ::prost::alloc::string::String,
14 #[prost(map = "string, string", tag = "6")]
15 pub properties: ::std::collections::HashMap<
16 ::prost::alloc::string::String,
17 ::prost::alloc::string::String,
18 >,
19 #[prost(string, repeated, tag = "7")]
20 pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
21 #[prost(message, optional, tag = "8")]
22 pub created_at: ::core::option::Option<
23 super::super::super::google::protobuf::Timestamp,
24 >,
25 #[prost(bool, tag = "9")]
26 pub is_archived: bool,
27}
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct GetDecryptedRequest {
30 #[prost(string, tag = "1")]
31 pub rid: ::prost::alloc::string::String,
32}
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct GetDecryptedResponse {
35 #[prost(message, optional, tag = "1")]
36 pub decrypted_secret: ::core::option::Option<DecryptedSecret>,
37}
38pub mod internal_secret_service_client {
40 #![allow(
41 unused_variables,
42 dead_code,
43 missing_docs,
44 clippy::wildcard_imports,
45 clippy::let_unit_value,
46 )]
47 use tonic::codegen::*;
48 use tonic::codegen::http::Uri;
49 #[derive(Debug, Clone)]
50 pub struct InternalSecretServiceClient<T> {
51 inner: tonic::client::Grpc<T>,
52 }
53 impl InternalSecretServiceClient<tonic::transport::Channel> {
54 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
56 where
57 D: TryInto<tonic::transport::Endpoint>,
58 D::Error: Into<StdError>,
59 {
60 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
61 Ok(Self::new(conn))
62 }
63 }
64 impl<T> InternalSecretServiceClient<T>
65 where
66 T: tonic::client::GrpcService<tonic::body::Body>,
67 T::Error: Into<StdError>,
68 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
69 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
70 {
71 pub fn new(inner: T) -> Self {
72 let inner = tonic::client::Grpc::new(inner);
73 Self { inner }
74 }
75 pub fn with_origin(inner: T, origin: Uri) -> Self {
76 let inner = tonic::client::Grpc::with_origin(inner, origin);
77 Self { inner }
78 }
79 pub fn with_interceptor<F>(
80 inner: T,
81 interceptor: F,
82 ) -> InternalSecretServiceClient<InterceptedService<T, F>>
83 where
84 F: tonic::service::Interceptor,
85 T::ResponseBody: Default,
86 T: tonic::codegen::Service<
87 http::Request<tonic::body::Body>,
88 Response = http::Response<
89 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
90 >,
91 >,
92 <T as tonic::codegen::Service<
93 http::Request<tonic::body::Body>,
94 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
95 {
96 InternalSecretServiceClient::new(InterceptedService::new(inner, interceptor))
97 }
98 #[must_use]
103 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
104 self.inner = self.inner.send_compressed(encoding);
105 self
106 }
107 #[must_use]
109 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
110 self.inner = self.inner.accept_compressed(encoding);
111 self
112 }
113 #[must_use]
117 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
118 self.inner = self.inner.max_decoding_message_size(limit);
119 self
120 }
121 #[must_use]
125 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
126 self.inner = self.inner.max_encoding_message_size(limit);
127 self
128 }
129 pub async fn get_decrypted(
130 &mut self,
131 request: impl tonic::IntoRequest<super::GetDecryptedRequest>,
132 ) -> std::result::Result<
133 tonic::Response<super::GetDecryptedResponse>,
134 tonic::Status,
135 > {
136 self.inner
137 .ready()
138 .await
139 .map_err(|e| {
140 tonic::Status::unknown(
141 format!("Service was not ready: {}", e.into()),
142 )
143 })?;
144 let codec = tonic::codec::ProstCodec::default();
145 let path = http::uri::PathAndQuery::from_static(
146 "/nominal.internalsecrets.v1.InternalSecretService/GetDecrypted",
147 );
148 let mut req = request.into_request();
149 req.extensions_mut()
150 .insert(
151 GrpcMethod::new(
152 "nominal.internalsecrets.v1.InternalSecretService",
153 "GetDecrypted",
154 ),
155 );
156 self.inner.unary(req, path, codec).await
157 }
158 }
159}