Skip to main content

nominal_api_proto/proto/
nominal.internalknowledge.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ListChunksRequest {
4    #[prost(string, tag = "1")]
5    pub source_rid: ::prost::alloc::string::String,
6    #[prost(int32, optional, tag = "2")]
7    pub limit: ::core::option::Option<i32>,
8    #[prost(string, tag = "3")]
9    pub workspace_rid: ::prost::alloc::string::String,
10    #[prost(int32, optional, tag = "4")]
11    pub page_size: ::core::option::Option<i32>,
12    #[prost(string, tag = "5")]
13    pub page_token: ::prost::alloc::string::String,
14}
15#[derive(Clone, PartialEq, ::prost::Message)]
16pub struct ListChunksResponse {
17    #[prost(message, repeated, tag = "1")]
18    pub chunks: ::prost::alloc::vec::Vec<super::super::knowledge::v1::KnowledgeChunk>,
19    #[prost(bool, tag = "2")]
20    pub truncated: bool,
21    #[prost(string, tag = "3")]
22    pub next_page_token: ::prost::alloc::string::String,
23}
24#[derive(Clone, PartialEq, ::prost::Message)]
25pub struct GetDriveIndexExecutionRequest {
26    #[prost(string, tag = "1")]
27    pub drive_index_job_id: ::prost::alloc::string::String,
28}
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct GetDriveIndexExecutionResponse {
31    #[prost(bool, tag = "1")]
32    pub found: bool,
33    #[prost(message, optional, tag = "2")]
34    pub execution: ::core::option::Option<KnowledgeIndexExecution>,
35}
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct KnowledgeIndexExecution {
38    #[prost(string, tag = "1")]
39    pub drive_index_job_id: ::prost::alloc::string::String,
40    #[prost(enumeration = "KnowledgeIndexExecutionState", tag = "2")]
41    pub state: i32,
42    #[prost(int64, tag = "3")]
43    pub completed_source_count: i64,
44    #[prost(int64, tag = "4")]
45    pub successful_chunk_count: i64,
46    #[prost(message, repeated, tag = "5")]
47    pub sources: ::prost::alloc::vec::Vec<KnowledgeSourceExecution>,
48    #[prost(enumeration = "KnowledgeIndexFailureCategory", repeated, tag = "6")]
49    pub safe_failure_categories: ::prost::alloc::vec::Vec<i32>,
50}
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct KnowledgeSourceExecution {
53    #[prost(string, tag = "1")]
54    pub source_rid: ::prost::alloc::string::String,
55    #[prost(enumeration = "KnowledgeSourceExecutionState", tag = "2")]
56    pub state: i32,
57}
58#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
59#[repr(i32)]
60pub enum KnowledgeIndexExecutionState {
61    Unspecified = 0,
62    Running = 1,
63    Succeeded = 2,
64    SucceededWithFailures = 3,
65}
66impl KnowledgeIndexExecutionState {
67    /// String value of the enum field names used in the ProtoBuf definition.
68    ///
69    /// The values are not transformed in any way and thus are considered stable
70    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
71    pub fn as_str_name(&self) -> &'static str {
72        match self {
73            Self::Unspecified => "KNOWLEDGE_INDEX_EXECUTION_STATE_UNSPECIFIED",
74            Self::Running => "KNOWLEDGE_INDEX_EXECUTION_STATE_RUNNING",
75            Self::Succeeded => "KNOWLEDGE_INDEX_EXECUTION_STATE_SUCCEEDED",
76            Self::SucceededWithFailures => {
77                "KNOWLEDGE_INDEX_EXECUTION_STATE_SUCCEEDED_WITH_FAILURES"
78            }
79        }
80    }
81    /// Creates an enum from field names used in the ProtoBuf definition.
82    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
83        match value {
84            "KNOWLEDGE_INDEX_EXECUTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
85            "KNOWLEDGE_INDEX_EXECUTION_STATE_RUNNING" => Some(Self::Running),
86            "KNOWLEDGE_INDEX_EXECUTION_STATE_SUCCEEDED" => Some(Self::Succeeded),
87            "KNOWLEDGE_INDEX_EXECUTION_STATE_SUCCEEDED_WITH_FAILURES" => {
88                Some(Self::SucceededWithFailures)
89            }
90            _ => None,
91        }
92    }
93}
94#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
95#[repr(i32)]
96pub enum KnowledgeSourceExecutionState {
97    Unspecified = 0,
98    Succeeded = 1,
99    PermanentlyFailed = 2,
100    Running = 3,
101}
102impl KnowledgeSourceExecutionState {
103    /// String value of the enum field names used in the ProtoBuf definition.
104    ///
105    /// The values are not transformed in any way and thus are considered stable
106    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
107    pub fn as_str_name(&self) -> &'static str {
108        match self {
109            Self::Unspecified => "KNOWLEDGE_SOURCE_EXECUTION_STATE_UNSPECIFIED",
110            Self::Succeeded => "KNOWLEDGE_SOURCE_EXECUTION_STATE_SUCCEEDED",
111            Self::PermanentlyFailed => {
112                "KNOWLEDGE_SOURCE_EXECUTION_STATE_PERMANENTLY_FAILED"
113            }
114            Self::Running => "KNOWLEDGE_SOURCE_EXECUTION_STATE_RUNNING",
115        }
116    }
117    /// Creates an enum from field names used in the ProtoBuf definition.
118    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
119        match value {
120            "KNOWLEDGE_SOURCE_EXECUTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
121            "KNOWLEDGE_SOURCE_EXECUTION_STATE_SUCCEEDED" => Some(Self::Succeeded),
122            "KNOWLEDGE_SOURCE_EXECUTION_STATE_PERMANENTLY_FAILED" => {
123                Some(Self::PermanentlyFailed)
124            }
125            "KNOWLEDGE_SOURCE_EXECUTION_STATE_RUNNING" => Some(Self::Running),
126            _ => None,
127        }
128    }
129}
130#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
131#[repr(i32)]
132pub enum KnowledgeIndexFailureCategory {
133    Unspecified = 0,
134    UnsupportedSource = 1,
135    RetryExhausted = 2,
136}
137impl KnowledgeIndexFailureCategory {
138    /// String value of the enum field names used in the ProtoBuf definition.
139    ///
140    /// The values are not transformed in any way and thus are considered stable
141    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
142    pub fn as_str_name(&self) -> &'static str {
143        match self {
144            Self::Unspecified => "KNOWLEDGE_INDEX_FAILURE_CATEGORY_UNSPECIFIED",
145            Self::UnsupportedSource => {
146                "KNOWLEDGE_INDEX_FAILURE_CATEGORY_UNSUPPORTED_SOURCE"
147            }
148            Self::RetryExhausted => "KNOWLEDGE_INDEX_FAILURE_CATEGORY_RETRY_EXHAUSTED",
149        }
150    }
151    /// Creates an enum from field names used in the ProtoBuf definition.
152    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
153        match value {
154            "KNOWLEDGE_INDEX_FAILURE_CATEGORY_UNSPECIFIED" => Some(Self::Unspecified),
155            "KNOWLEDGE_INDEX_FAILURE_CATEGORY_UNSUPPORTED_SOURCE" => {
156                Some(Self::UnsupportedSource)
157            }
158            "KNOWLEDGE_INDEX_FAILURE_CATEGORY_RETRY_EXHAUSTED" => {
159                Some(Self::RetryExhausted)
160            }
161            _ => None,
162        }
163    }
164}
165/// Generated client implementations.
166pub mod internal_knowledge_index_service_client {
167    #![allow(
168        unused_variables,
169        dead_code,
170        missing_docs,
171        clippy::wildcard_imports,
172        clippy::let_unit_value,
173    )]
174    use tonic::codegen::*;
175    use tonic::codegen::http::Uri;
176    #[derive(Debug, Clone)]
177    pub struct InternalKnowledgeIndexServiceClient<T> {
178        inner: tonic::client::Grpc<T>,
179    }
180    impl InternalKnowledgeIndexServiceClient<tonic::transport::Channel> {
181        /// Attempt to create a new client by connecting to a given endpoint.
182        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
183        where
184            D: TryInto<tonic::transport::Endpoint>,
185            D::Error: Into<StdError>,
186        {
187            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
188            Ok(Self::new(conn))
189        }
190    }
191    impl<T> InternalKnowledgeIndexServiceClient<T>
192    where
193        T: tonic::client::GrpcService<tonic::body::Body>,
194        T::Error: Into<StdError>,
195        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
196        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
197    {
198        pub fn new(inner: T) -> Self {
199            let inner = tonic::client::Grpc::new(inner);
200            Self { inner }
201        }
202        pub fn with_origin(inner: T, origin: Uri) -> Self {
203            let inner = tonic::client::Grpc::with_origin(inner, origin);
204            Self { inner }
205        }
206        pub fn with_interceptor<F>(
207            inner: T,
208            interceptor: F,
209        ) -> InternalKnowledgeIndexServiceClient<InterceptedService<T, F>>
210        where
211            F: tonic::service::Interceptor,
212            T::ResponseBody: Default,
213            T: tonic::codegen::Service<
214                http::Request<tonic::body::Body>,
215                Response = http::Response<
216                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
217                >,
218            >,
219            <T as tonic::codegen::Service<
220                http::Request<tonic::body::Body>,
221            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
222        {
223            InternalKnowledgeIndexServiceClient::new(
224                InterceptedService::new(inner, interceptor),
225            )
226        }
227        /// Compress requests with the given encoding.
228        ///
229        /// This requires the server to support it otherwise it might respond with an
230        /// error.
231        #[must_use]
232        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
233            self.inner = self.inner.send_compressed(encoding);
234            self
235        }
236        /// Enable decompressing responses.
237        #[must_use]
238        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
239            self.inner = self.inner.accept_compressed(encoding);
240            self
241        }
242        /// Limits the maximum size of a decoded message.
243        ///
244        /// Default: `4MB`
245        #[must_use]
246        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
247            self.inner = self.inner.max_decoding_message_size(limit);
248            self
249        }
250        /// Limits the maximum size of an encoded message.
251        ///
252        /// Default: `usize::MAX`
253        #[must_use]
254        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
255            self.inner = self.inner.max_encoding_message_size(limit);
256            self
257        }
258        pub async fn list_chunks(
259            &mut self,
260            request: impl tonic::IntoRequest<super::ListChunksRequest>,
261        ) -> std::result::Result<
262            tonic::Response<super::ListChunksResponse>,
263            tonic::Status,
264        > {
265            self.inner
266                .ready()
267                .await
268                .map_err(|e| {
269                    tonic::Status::unknown(
270                        format!("Service was not ready: {}", e.into()),
271                    )
272                })?;
273            let codec = tonic::codec::ProstCodec::default();
274            let path = http::uri::PathAndQuery::from_static(
275                "/nominal.internalknowledge.v1.InternalKnowledgeIndexService/ListChunks",
276            );
277            let mut req = request.into_request();
278            req.extensions_mut()
279                .insert(
280                    GrpcMethod::new(
281                        "nominal.internalknowledge.v1.InternalKnowledgeIndexService",
282                        "ListChunks",
283                    ),
284                );
285            self.inner.unary(req, path, codec).await
286        }
287        pub async fn get_drive_index_execution(
288            &mut self,
289            request: impl tonic::IntoRequest<super::GetDriveIndexExecutionRequest>,
290        ) -> std::result::Result<
291            tonic::Response<super::GetDriveIndexExecutionResponse>,
292            tonic::Status,
293        > {
294            self.inner
295                .ready()
296                .await
297                .map_err(|e| {
298                    tonic::Status::unknown(
299                        format!("Service was not ready: {}", e.into()),
300                    )
301                })?;
302            let codec = tonic::codec::ProstCodec::default();
303            let path = http::uri::PathAndQuery::from_static(
304                "/nominal.internalknowledge.v1.InternalKnowledgeIndexService/GetDriveIndexExecution",
305            );
306            let mut req = request.into_request();
307            req.extensions_mut()
308                .insert(
309                    GrpcMethod::new(
310                        "nominal.internalknowledge.v1.InternalKnowledgeIndexService",
311                        "GetDriveIndexExecution",
312                    ),
313                );
314            self.inner.unary(req, path, codec).await
315        }
316    }
317}