Skip to main content

nominal_api_proto/proto/
nominal.knowledge.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct CreateDriveIndexJobRequest {
4    #[prost(string, tag = "1")]
5    pub drive_rid: ::prost::alloc::string::String,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct CreateDriveIndexJobResponse {
9    #[prost(message, optional, tag = "1")]
10    pub drive_index_job: ::core::option::Option<DriveIndexJob>,
11}
12#[derive(Clone, PartialEq, ::prost::Message)]
13pub struct GetDriveIndexJobRequest {
14    #[prost(string, tag = "1")]
15    pub drive_index_job_rid: ::prost::alloc::string::String,
16}
17#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct GetDriveIndexJobResponse {
19    #[prost(message, optional, tag = "1")]
20    pub drive_index_job: ::core::option::Option<DriveIndexJob>,
21}
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct ListDriveIndexJobsRequest {
24    #[prost(int32, optional, tag = "1")]
25    pub page_size: ::core::option::Option<i32>,
26    #[prost(string, tag = "2")]
27    pub page_token: ::prost::alloc::string::String,
28}
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct ListDriveIndexJobsResponse {
31    #[prost(message, repeated, tag = "1")]
32    pub drive_index_jobs: ::prost::alloc::vec::Vec<DriveIndexJobSummary>,
33    #[prost(string, tag = "2")]
34    pub next_page_token: ::prost::alloc::string::String,
35}
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct ListDriveIndexJobSourcesRequest {
38    #[prost(string, tag = "1")]
39    pub drive_index_job_rid: ::prost::alloc::string::String,
40    #[prost(int32, optional, tag = "2")]
41    pub page_size: ::core::option::Option<i32>,
42    #[prost(string, tag = "3")]
43    pub page_token: ::prost::alloc::string::String,
44}
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct ListDriveIndexJobSourcesResponse {
47    #[prost(message, repeated, tag = "1")]
48    pub sources: ::prost::alloc::vec::Vec<DriveIndexSourceExecution>,
49    #[prost(string, tag = "2")]
50    pub next_page_token: ::prost::alloc::string::String,
51}
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct DriveIndexJobSummary {
54    #[prost(string, tag = "1")]
55    pub drive_index_job_rid: ::prost::alloc::string::String,
56    #[prost(string, tag = "2")]
57    pub drive_rid: ::prost::alloc::string::String,
58    #[prost(enumeration = "DriveIndexJobState", tag = "3")]
59    pub state: i32,
60    #[prost(uint64, tag = "4")]
61    pub completed_source_count: u64,
62    #[prost(uint64, tag = "5")]
63    pub successful_chunk_count: u64,
64    #[prost(message, optional, tag = "6")]
65    pub created_at: ::core::option::Option<
66        super::super::super::google::protobuf::Timestamp,
67    >,
68    #[prost(uint64, tag = "7")]
69    pub admitted_source_count: u64,
70    #[prost(bool, tag = "8")]
71    pub enumeration_complete: bool,
72}
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct DriveIndexJob {
75    #[prost(string, tag = "1")]
76    pub drive_index_job_rid: ::prost::alloc::string::String,
77    #[prost(string, tag = "2")]
78    pub drive_rid: ::prost::alloc::string::String,
79    #[prost(enumeration = "DriveIndexJobState", tag = "3")]
80    pub state: i32,
81    #[prost(uint64, tag = "4")]
82    pub completed_source_count: u64,
83    #[prost(uint64, tag = "5")]
84    pub successful_chunk_count: u64,
85    #[prost(message, repeated, tag = "6")]
86    pub sources: ::prost::alloc::vec::Vec<DriveIndexSourceExecution>,
87    #[prost(bool, tag = "7")]
88    pub sources_truncated: bool,
89    #[prost(uint64, tag = "8")]
90    pub admitted_source_count: u64,
91    #[prost(bool, tag = "9")]
92    pub enumeration_complete: bool,
93    #[prost(string, repeated, tag = "10")]
94    pub run_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
95    #[prost(bool, tag = "11")]
96    pub temporal_history_available: bool,
97}
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct DriveIndexSourceExecution {
100    #[prost(string, tag = "1")]
101    pub source_rid: ::prost::alloc::string::String,
102    #[prost(enumeration = "DriveIndexSourceExecutionState", tag = "2")]
103    pub state: i32,
104    #[prost(string, tag = "3")]
105    pub failure_category: ::prost::alloc::string::String,
106    #[prost(string, tag = "4")]
107    pub revision_rid: ::prost::alloc::string::String,
108    #[prost(string, tag = "5")]
109    pub child_workflow_id: ::prost::alloc::string::String,
110    #[prost(string, tag = "6")]
111    pub child_run_id: ::prost::alloc::string::String,
112}
113#[derive(Clone, PartialEq, ::prost::Message)]
114pub struct KnowledgeChunk {
115    #[prost(string, tag = "1")]
116    pub sample_rid: ::prost::alloc::string::String,
117    #[prost(string, tag = "2")]
118    pub source_rid: ::prost::alloc::string::String,
119    #[prost(string, tag = "3")]
120    pub source_locator: ::prost::alloc::string::String,
121    #[prost(string, tag = "4")]
122    pub partition_key: ::prost::alloc::string::String,
123}
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct QueryRequest {
126    #[prost(string, tag = "1")]
127    pub query: ::prost::alloc::string::String,
128    #[prost(string, tag = "4")]
129    pub drive_rid: ::prost::alloc::string::String,
130    #[prost(int32, optional, tag = "2")]
131    pub page_size: ::core::option::Option<i32>,
132    #[prost(string, tag = "3")]
133    pub page_token: ::prost::alloc::string::String,
134}
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct QueryResponse {
137    #[prost(message, repeated, tag = "1")]
138    pub chunks: ::prost::alloc::vec::Vec<KnowledgeChunk>,
139    #[prost(string, tag = "2")]
140    pub next_page_token: ::prost::alloc::string::String,
141}
142#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
143#[repr(i32)]
144pub enum DriveIndexJobState {
145    Unspecified = 0,
146    Queued = 1,
147    Running = 2,
148    Succeeded = 3,
149    SucceededWithFailures = 4,
150}
151impl DriveIndexJobState {
152    /// String value of the enum field names used in the ProtoBuf definition.
153    ///
154    /// The values are not transformed in any way and thus are considered stable
155    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
156    pub fn as_str_name(&self) -> &'static str {
157        match self {
158            Self::Unspecified => "DRIVE_INDEX_JOB_STATE_UNSPECIFIED",
159            Self::Queued => "DRIVE_INDEX_JOB_STATE_QUEUED",
160            Self::Running => "DRIVE_INDEX_JOB_STATE_RUNNING",
161            Self::Succeeded => "DRIVE_INDEX_JOB_STATE_SUCCEEDED",
162            Self::SucceededWithFailures => {
163                "DRIVE_INDEX_JOB_STATE_SUCCEEDED_WITH_FAILURES"
164            }
165        }
166    }
167    /// Creates an enum from field names used in the ProtoBuf definition.
168    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
169        match value {
170            "DRIVE_INDEX_JOB_STATE_UNSPECIFIED" => Some(Self::Unspecified),
171            "DRIVE_INDEX_JOB_STATE_QUEUED" => Some(Self::Queued),
172            "DRIVE_INDEX_JOB_STATE_RUNNING" => Some(Self::Running),
173            "DRIVE_INDEX_JOB_STATE_SUCCEEDED" => Some(Self::Succeeded),
174            "DRIVE_INDEX_JOB_STATE_SUCCEEDED_WITH_FAILURES" => {
175                Some(Self::SucceededWithFailures)
176            }
177            _ => None,
178        }
179    }
180}
181#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
182#[repr(i32)]
183pub enum DriveIndexSourceExecutionState {
184    Unspecified = 0,
185    Succeeded = 1,
186    PermanentlyFailed = 2,
187    Running = 3,
188}
189impl DriveIndexSourceExecutionState {
190    /// String value of the enum field names used in the ProtoBuf definition.
191    ///
192    /// The values are not transformed in any way and thus are considered stable
193    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
194    pub fn as_str_name(&self) -> &'static str {
195        match self {
196            Self::Unspecified => "DRIVE_INDEX_SOURCE_EXECUTION_STATE_UNSPECIFIED",
197            Self::Succeeded => "DRIVE_INDEX_SOURCE_EXECUTION_STATE_SUCCEEDED",
198            Self::PermanentlyFailed => {
199                "DRIVE_INDEX_SOURCE_EXECUTION_STATE_PERMANENTLY_FAILED"
200            }
201            Self::Running => "DRIVE_INDEX_SOURCE_EXECUTION_STATE_RUNNING",
202        }
203    }
204    /// Creates an enum from field names used in the ProtoBuf definition.
205    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
206        match value {
207            "DRIVE_INDEX_SOURCE_EXECUTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
208            "DRIVE_INDEX_SOURCE_EXECUTION_STATE_SUCCEEDED" => Some(Self::Succeeded),
209            "DRIVE_INDEX_SOURCE_EXECUTION_STATE_PERMANENTLY_FAILED" => {
210                Some(Self::PermanentlyFailed)
211            }
212            "DRIVE_INDEX_SOURCE_EXECUTION_STATE_RUNNING" => Some(Self::Running),
213            _ => None,
214        }
215    }
216}
217/// Generated client implementations.
218pub mod knowledge_service_client {
219    #![allow(
220        unused_variables,
221        dead_code,
222        missing_docs,
223        clippy::wildcard_imports,
224        clippy::let_unit_value,
225    )]
226    use tonic::codegen::*;
227    use tonic::codegen::http::Uri;
228    #[derive(Debug, Clone)]
229    pub struct KnowledgeServiceClient<T> {
230        inner: tonic::client::Grpc<T>,
231    }
232    impl KnowledgeServiceClient<tonic::transport::Channel> {
233        /// Attempt to create a new client by connecting to a given endpoint.
234        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
235        where
236            D: TryInto<tonic::transport::Endpoint>,
237            D::Error: Into<StdError>,
238        {
239            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
240            Ok(Self::new(conn))
241        }
242    }
243    impl<T> KnowledgeServiceClient<T>
244    where
245        T: tonic::client::GrpcService<tonic::body::Body>,
246        T::Error: Into<StdError>,
247        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
248        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
249    {
250        pub fn new(inner: T) -> Self {
251            let inner = tonic::client::Grpc::new(inner);
252            Self { inner }
253        }
254        pub fn with_origin(inner: T, origin: Uri) -> Self {
255            let inner = tonic::client::Grpc::with_origin(inner, origin);
256            Self { inner }
257        }
258        pub fn with_interceptor<F>(
259            inner: T,
260            interceptor: F,
261        ) -> KnowledgeServiceClient<InterceptedService<T, F>>
262        where
263            F: tonic::service::Interceptor,
264            T::ResponseBody: Default,
265            T: tonic::codegen::Service<
266                http::Request<tonic::body::Body>,
267                Response = http::Response<
268                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
269                >,
270            >,
271            <T as tonic::codegen::Service<
272                http::Request<tonic::body::Body>,
273            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
274        {
275            KnowledgeServiceClient::new(InterceptedService::new(inner, interceptor))
276        }
277        /// Compress requests with the given encoding.
278        ///
279        /// This requires the server to support it otherwise it might respond with an
280        /// error.
281        #[must_use]
282        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
283            self.inner = self.inner.send_compressed(encoding);
284            self
285        }
286        /// Enable decompressing responses.
287        #[must_use]
288        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
289            self.inner = self.inner.accept_compressed(encoding);
290            self
291        }
292        /// Limits the maximum size of a decoded message.
293        ///
294        /// Default: `4MB`
295        #[must_use]
296        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
297            self.inner = self.inner.max_decoding_message_size(limit);
298            self
299        }
300        /// Limits the maximum size of an encoded message.
301        ///
302        /// Default: `usize::MAX`
303        #[must_use]
304        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
305            self.inner = self.inner.max_encoding_message_size(limit);
306            self
307        }
308        pub async fn create_drive_index_job(
309            &mut self,
310            request: impl tonic::IntoRequest<super::CreateDriveIndexJobRequest>,
311        ) -> std::result::Result<
312            tonic::Response<super::CreateDriveIndexJobResponse>,
313            tonic::Status,
314        > {
315            self.inner
316                .ready()
317                .await
318                .map_err(|e| {
319                    tonic::Status::unknown(
320                        format!("Service was not ready: {}", e.into()),
321                    )
322                })?;
323            let codec = tonic::codec::ProstCodec::default();
324            let path = http::uri::PathAndQuery::from_static(
325                "/nominal.knowledge.v1.KnowledgeService/CreateDriveIndexJob",
326            );
327            let mut req = request.into_request();
328            req.extensions_mut()
329                .insert(
330                    GrpcMethod::new(
331                        "nominal.knowledge.v1.KnowledgeService",
332                        "CreateDriveIndexJob",
333                    ),
334                );
335            self.inner.unary(req, path, codec).await
336        }
337        pub async fn get_drive_index_job(
338            &mut self,
339            request: impl tonic::IntoRequest<super::GetDriveIndexJobRequest>,
340        ) -> std::result::Result<
341            tonic::Response<super::GetDriveIndexJobResponse>,
342            tonic::Status,
343        > {
344            self.inner
345                .ready()
346                .await
347                .map_err(|e| {
348                    tonic::Status::unknown(
349                        format!("Service was not ready: {}", e.into()),
350                    )
351                })?;
352            let codec = tonic::codec::ProstCodec::default();
353            let path = http::uri::PathAndQuery::from_static(
354                "/nominal.knowledge.v1.KnowledgeService/GetDriveIndexJob",
355            );
356            let mut req = request.into_request();
357            req.extensions_mut()
358                .insert(
359                    GrpcMethod::new(
360                        "nominal.knowledge.v1.KnowledgeService",
361                        "GetDriveIndexJob",
362                    ),
363                );
364            self.inner.unary(req, path, codec).await
365        }
366        pub async fn list_drive_index_jobs(
367            &mut self,
368            request: impl tonic::IntoRequest<super::ListDriveIndexJobsRequest>,
369        ) -> std::result::Result<
370            tonic::Response<super::ListDriveIndexJobsResponse>,
371            tonic::Status,
372        > {
373            self.inner
374                .ready()
375                .await
376                .map_err(|e| {
377                    tonic::Status::unknown(
378                        format!("Service was not ready: {}", e.into()),
379                    )
380                })?;
381            let codec = tonic::codec::ProstCodec::default();
382            let path = http::uri::PathAndQuery::from_static(
383                "/nominal.knowledge.v1.KnowledgeService/ListDriveIndexJobs",
384            );
385            let mut req = request.into_request();
386            req.extensions_mut()
387                .insert(
388                    GrpcMethod::new(
389                        "nominal.knowledge.v1.KnowledgeService",
390                        "ListDriveIndexJobs",
391                    ),
392                );
393            self.inner.unary(req, path, codec).await
394        }
395        pub async fn list_drive_index_job_sources(
396            &mut self,
397            request: impl tonic::IntoRequest<super::ListDriveIndexJobSourcesRequest>,
398        ) -> std::result::Result<
399            tonic::Response<super::ListDriveIndexJobSourcesResponse>,
400            tonic::Status,
401        > {
402            self.inner
403                .ready()
404                .await
405                .map_err(|e| {
406                    tonic::Status::unknown(
407                        format!("Service was not ready: {}", e.into()),
408                    )
409                })?;
410            let codec = tonic::codec::ProstCodec::default();
411            let path = http::uri::PathAndQuery::from_static(
412                "/nominal.knowledge.v1.KnowledgeService/ListDriveIndexJobSources",
413            );
414            let mut req = request.into_request();
415            req.extensions_mut()
416                .insert(
417                    GrpcMethod::new(
418                        "nominal.knowledge.v1.KnowledgeService",
419                        "ListDriveIndexJobSources",
420                    ),
421                );
422            self.inner.unary(req, path, codec).await
423        }
424        pub async fn query(
425            &mut self,
426            request: impl tonic::IntoRequest<super::QueryRequest>,
427        ) -> std::result::Result<tonic::Response<super::QueryResponse>, tonic::Status> {
428            self.inner
429                .ready()
430                .await
431                .map_err(|e| {
432                    tonic::Status::unknown(
433                        format!("Service was not ready: {}", e.into()),
434                    )
435                })?;
436            let codec = tonic::codec::ProstCodec::default();
437            let path = http::uri::PathAndQuery::from_static(
438                "/nominal.knowledge.v1.KnowledgeService/Query",
439            );
440            let mut req = request.into_request();
441            req.extensions_mut()
442                .insert(
443                    GrpcMethod::new("nominal.knowledge.v1.KnowledgeService", "Query"),
444                );
445            self.inner.unary(req, path, codec).await
446        }
447    }
448}