Skip to main content

nominal_api_proto/proto/
nominal.spatial.v2.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct PointCloudMetadata {
4    #[prost(string, optional, tag = "1")]
5    pub sensor_model: ::core::option::Option<::prost::alloc::string::String>,
6    #[prost(string, optional, tag = "2")]
7    pub coordinate_system: ::core::option::Option<::prost::alloc::string::String>,
8    #[prost(double, optional, tag = "3")]
9    pub resolution_mm: ::core::option::Option<f64>,
10    #[prost(string, optional, tag = "4")]
11    pub scan_pattern: ::core::option::Option<::prost::alloc::string::String>,
12}
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct SpatialTypeMetadata {
15    #[prost(oneof = "spatial_type_metadata::SpatialTypeMetadata", tags = "1")]
16    pub spatial_type_metadata: ::core::option::Option<
17        spatial_type_metadata::SpatialTypeMetadata,
18    >,
19}
20/// Nested message and enum types in `SpatialTypeMetadata`.
21pub mod spatial_type_metadata {
22    #[derive(Clone, PartialEq, ::prost::Oneof)]
23    pub enum SpatialTypeMetadata {
24        #[prost(message, tag = "1")]
25        PointCloud(super::PointCloudMetadata),
26    }
27}
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct Spatial {
30    #[prost(string, tag = "1")]
31    pub rid: ::prost::alloc::string::String,
32    #[prost(string, tag = "2")]
33    pub title: ::prost::alloc::string::String,
34    #[prost(string, optional, tag = "3")]
35    pub description: ::core::option::Option<::prost::alloc::string::String>,
36    #[prost(string, repeated, tag = "4")]
37    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
38    #[prost(map = "string, string", tag = "5")]
39    pub properties: ::std::collections::HashMap<
40        ::prost::alloc::string::String,
41        ::prost::alloc::string::String,
42    >,
43    #[prost(string, tag = "6")]
44    pub created_by: ::prost::alloc::string::String,
45    #[prost(message, optional, tag = "7")]
46    pub created_at: ::core::option::Option<
47        super::super::super::google::protobuf::Timestamp,
48    >,
49    #[prost(message, optional, tag = "8")]
50    pub updated_at: ::core::option::Option<
51        super::super::super::google::protobuf::Timestamp,
52    >,
53    #[prost(bool, tag = "9")]
54    pub is_archived: bool,
55    #[prost(string, tag = "10")]
56    pub dagger_model_uuid: ::prost::alloc::string::String,
57    #[prost(message, optional, tag = "11")]
58    pub type_metadata: ::core::option::Option<SpatialTypeMetadata>,
59    #[prost(message, optional, tag = "12")]
60    pub start_timestamp: ::core::option::Option<
61        super::super::super::google::protobuf::Timestamp,
62    >,
63    #[prost(message, optional, tag = "13")]
64    pub end_timestamp: ::core::option::Option<
65        super::super::super::google::protobuf::Timestamp,
66    >,
67    #[prost(message, optional, tag = "14")]
68    pub source_handle: ::core::option::Option<super::super::types::Handle>,
69}
70#[derive(Clone, Copy, PartialEq, ::prost::Message)]
71pub struct SpatialSortOptions {
72    #[prost(bool, tag = "1")]
73    pub is_descending: bool,
74    #[prost(enumeration = "SpatialSortField", tag = "2")]
75    pub field: i32,
76}
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct SearchSpatialsQueryList {
79    #[prost(message, repeated, tag = "1")]
80    pub queries: ::prost::alloc::vec::Vec<SearchSpatialsQuery>,
81}
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct SearchSpatialsQuery {
84    #[prost(oneof = "search_spatials_query::Query", tags = "1, 2, 3, 4, 5, 6, 7")]
85    pub query: ::core::option::Option<search_spatials_query::Query>,
86}
87/// Nested message and enum types in `SearchSpatialsQuery`.
88pub mod search_spatials_query {
89    #[derive(Clone, PartialEq, ::prost::Oneof)]
90    pub enum Query {
91        #[prost(string, tag = "1")]
92        SearchText(::prost::alloc::string::String),
93        #[prost(string, tag = "2")]
94        Label(::prost::alloc::string::String),
95        #[prost(message, tag = "3")]
96        Property(super::super::super::types::Property),
97        #[prost(message, tag = "4")]
98        And(super::SearchSpatialsQueryList),
99        #[prost(message, tag = "5")]
100        Or(super::SearchSpatialsQueryList),
101        #[prost(string, tag = "6")]
102        WorkspaceRid(::prost::alloc::string::String),
103        #[prost(enumeration = "super::SpatialType", tag = "7")]
104        SpatialType(i32),
105    }
106}
107#[derive(Clone, PartialEq, ::prost::Message)]
108pub struct GetSpatialRequest {
109    #[prost(string, tag = "1")]
110    pub spatial_rid: ::prost::alloc::string::String,
111}
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct GetSpatialResponse {
114    #[prost(message, optional, tag = "1")]
115    pub spatial: ::core::option::Option<Spatial>,
116}
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct BatchGetSpatialsRequest {
119    #[prost(string, repeated, tag = "1")]
120    pub spatial_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
121}
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct BatchGetSpatialsResponse {
124    #[prost(message, repeated, tag = "1")]
125    pub spatials: ::prost::alloc::vec::Vec<Spatial>,
126}
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct SearchSpatialsRequest {
129    #[prost(message, optional, tag = "1")]
130    pub query: ::core::option::Option<SearchSpatialsQuery>,
131    #[prost(int32, optional, tag = "2")]
132    pub page_size: ::core::option::Option<i32>,
133    #[prost(string, optional, tag = "3")]
134    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
135    #[prost(message, optional, tag = "4")]
136    pub sort_options: ::core::option::Option<SpatialSortOptions>,
137    #[prost(
138        enumeration = "super::super::types::ArchivedStatus",
139        repeated,
140        packed = "false",
141        tag = "5"
142    )]
143    pub archived_statuses: ::prost::alloc::vec::Vec<i32>,
144}
145#[derive(Clone, PartialEq, ::prost::Message)]
146pub struct SearchSpatialsResponse {
147    #[prost(message, repeated, tag = "1")]
148    pub spatials: ::prost::alloc::vec::Vec<Spatial>,
149    #[prost(string, optional, tag = "2")]
150    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
151}
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct CreateSpatialRequest {
154    #[prost(message, optional, tag = "1")]
155    pub spatial: ::core::option::Option<Spatial>,
156    #[prost(string, repeated, tag = "2")]
157    pub marking_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
158    #[prost(string, optional, tag = "3")]
159    pub workspace_rid: ::core::option::Option<::prost::alloc::string::String>,
160}
161#[derive(Clone, PartialEq, ::prost::Message)]
162pub struct CreateSpatialResponse {
163    #[prost(message, optional, tag = "1")]
164    pub spatial: ::core::option::Option<Spatial>,
165}
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct UpdateSpatialRequest {
168    #[prost(message, optional, tag = "1")]
169    pub spatial: ::core::option::Option<Spatial>,
170    #[prost(message, optional, tag = "2")]
171    pub update_mask: ::core::option::Option<
172        super::super::super::google::protobuf::FieldMask,
173    >,
174}
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct UpdateSpatialResponse {
177    #[prost(message, optional, tag = "1")]
178    pub spatial: ::core::option::Option<Spatial>,
179}
180#[derive(Clone, PartialEq, ::prost::Message)]
181pub struct ArchiveSpatialRequest {
182    #[prost(string, tag = "1")]
183    pub spatial_rid: ::prost::alloc::string::String,
184}
185#[derive(Clone, Copy, PartialEq, ::prost::Message)]
186pub struct ArchiveSpatialResponse {}
187#[derive(Clone, PartialEq, ::prost::Message)]
188pub struct UnarchiveSpatialRequest {
189    #[prost(string, tag = "1")]
190    pub spatial_rid: ::prost::alloc::string::String,
191}
192#[derive(Clone, Copy, PartialEq, ::prost::Message)]
193pub struct UnarchiveSpatialResponse {}
194#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
195#[repr(i32)]
196pub enum SpatialType {
197    Unspecified = 0,
198    PointCloud = 1,
199}
200impl SpatialType {
201    /// String value of the enum field names used in the ProtoBuf definition.
202    ///
203    /// The values are not transformed in any way and thus are considered stable
204    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
205    pub fn as_str_name(&self) -> &'static str {
206        match self {
207            Self::Unspecified => "SPATIAL_TYPE_UNSPECIFIED",
208            Self::PointCloud => "SPATIAL_TYPE_POINT_CLOUD",
209        }
210    }
211    /// Creates an enum from field names used in the ProtoBuf definition.
212    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
213        match value {
214            "SPATIAL_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
215            "SPATIAL_TYPE_POINT_CLOUD" => Some(Self::PointCloud),
216            _ => None,
217        }
218    }
219}
220#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
221#[repr(i32)]
222pub enum SpatialSortField {
223    Unspecified = 0,
224    CreatedAt = 1,
225}
226impl SpatialSortField {
227    /// String value of the enum field names used in the ProtoBuf definition.
228    ///
229    /// The values are not transformed in any way and thus are considered stable
230    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
231    pub fn as_str_name(&self) -> &'static str {
232        match self {
233            Self::Unspecified => "SPATIAL_SORT_FIELD_UNSPECIFIED",
234            Self::CreatedAt => "SPATIAL_SORT_FIELD_CREATED_AT",
235        }
236    }
237    /// Creates an enum from field names used in the ProtoBuf definition.
238    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
239        match value {
240            "SPATIAL_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
241            "SPATIAL_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
242            _ => None,
243        }
244    }
245}
246#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
247#[repr(i32)]
248pub enum SpatialError {
249    NotAuthorized = 0,
250    SpatialNotFound = 1,
251    InvalidRequest = 2,
252}
253impl SpatialError {
254    /// String value of the enum field names used in the ProtoBuf definition.
255    ///
256    /// The values are not transformed in any way and thus are considered stable
257    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
258    pub fn as_str_name(&self) -> &'static str {
259        match self {
260            Self::NotAuthorized => "SPATIAL_ERROR_NOT_AUTHORIZED",
261            Self::SpatialNotFound => "SPATIAL_ERROR_SPATIAL_NOT_FOUND",
262            Self::InvalidRequest => "SPATIAL_ERROR_INVALID_REQUEST",
263        }
264    }
265    /// Creates an enum from field names used in the ProtoBuf definition.
266    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
267        match value {
268            "SPATIAL_ERROR_NOT_AUTHORIZED" => Some(Self::NotAuthorized),
269            "SPATIAL_ERROR_SPATIAL_NOT_FOUND" => Some(Self::SpatialNotFound),
270            "SPATIAL_ERROR_INVALID_REQUEST" => Some(Self::InvalidRequest),
271            _ => None,
272        }
273    }
274}
275/// Generated client implementations.
276pub mod spatial_service_client {
277    #![allow(
278        unused_variables,
279        dead_code,
280        missing_docs,
281        clippy::wildcard_imports,
282        clippy::let_unit_value,
283    )]
284    use tonic::codegen::*;
285    use tonic::codegen::http::Uri;
286    #[derive(Debug, Clone)]
287    pub struct SpatialServiceClient<T> {
288        inner: tonic::client::Grpc<T>,
289    }
290    impl SpatialServiceClient<tonic::transport::Channel> {
291        /// Attempt to create a new client by connecting to a given endpoint.
292        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
293        where
294            D: TryInto<tonic::transport::Endpoint>,
295            D::Error: Into<StdError>,
296        {
297            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
298            Ok(Self::new(conn))
299        }
300    }
301    impl<T> SpatialServiceClient<T>
302    where
303        T: tonic::client::GrpcService<tonic::body::Body>,
304        T::Error: Into<StdError>,
305        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
306        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
307    {
308        pub fn new(inner: T) -> Self {
309            let inner = tonic::client::Grpc::new(inner);
310            Self { inner }
311        }
312        pub fn with_origin(inner: T, origin: Uri) -> Self {
313            let inner = tonic::client::Grpc::with_origin(inner, origin);
314            Self { inner }
315        }
316        pub fn with_interceptor<F>(
317            inner: T,
318            interceptor: F,
319        ) -> SpatialServiceClient<InterceptedService<T, F>>
320        where
321            F: tonic::service::Interceptor,
322            T::ResponseBody: Default,
323            T: tonic::codegen::Service<
324                http::Request<tonic::body::Body>,
325                Response = http::Response<
326                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
327                >,
328            >,
329            <T as tonic::codegen::Service<
330                http::Request<tonic::body::Body>,
331            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
332        {
333            SpatialServiceClient::new(InterceptedService::new(inner, interceptor))
334        }
335        /// Compress requests with the given encoding.
336        ///
337        /// This requires the server to support it otherwise it might respond with an
338        /// error.
339        #[must_use]
340        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
341            self.inner = self.inner.send_compressed(encoding);
342            self
343        }
344        /// Enable decompressing responses.
345        #[must_use]
346        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
347            self.inner = self.inner.accept_compressed(encoding);
348            self
349        }
350        /// Limits the maximum size of a decoded message.
351        ///
352        /// Default: `4MB`
353        #[must_use]
354        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
355            self.inner = self.inner.max_decoding_message_size(limit);
356            self
357        }
358        /// Limits the maximum size of an encoded message.
359        ///
360        /// Default: `usize::MAX`
361        #[must_use]
362        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
363            self.inner = self.inner.max_encoding_message_size(limit);
364            self
365        }
366        pub async fn get_spatial(
367            &mut self,
368            request: impl tonic::IntoRequest<super::GetSpatialRequest>,
369        ) -> std::result::Result<
370            tonic::Response<super::GetSpatialResponse>,
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.spatial.v2.SpatialService/GetSpatial",
384            );
385            let mut req = request.into_request();
386            req.extensions_mut()
387                .insert(
388                    GrpcMethod::new("nominal.spatial.v2.SpatialService", "GetSpatial"),
389                );
390            self.inner.unary(req, path, codec).await
391        }
392        pub async fn batch_get_spatials(
393            &mut self,
394            request: impl tonic::IntoRequest<super::BatchGetSpatialsRequest>,
395        ) -> std::result::Result<
396            tonic::Response<super::BatchGetSpatialsResponse>,
397            tonic::Status,
398        > {
399            self.inner
400                .ready()
401                .await
402                .map_err(|e| {
403                    tonic::Status::unknown(
404                        format!("Service was not ready: {}", e.into()),
405                    )
406                })?;
407            let codec = tonic::codec::ProstCodec::default();
408            let path = http::uri::PathAndQuery::from_static(
409                "/nominal.spatial.v2.SpatialService/BatchGetSpatials",
410            );
411            let mut req = request.into_request();
412            req.extensions_mut()
413                .insert(
414                    GrpcMethod::new(
415                        "nominal.spatial.v2.SpatialService",
416                        "BatchGetSpatials",
417                    ),
418                );
419            self.inner.unary(req, path, codec).await
420        }
421        pub async fn search_spatials(
422            &mut self,
423            request: impl tonic::IntoRequest<super::SearchSpatialsRequest>,
424        ) -> std::result::Result<
425            tonic::Response<super::SearchSpatialsResponse>,
426            tonic::Status,
427        > {
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.spatial.v2.SpatialService/SearchSpatials",
439            );
440            let mut req = request.into_request();
441            req.extensions_mut()
442                .insert(
443                    GrpcMethod::new(
444                        "nominal.spatial.v2.SpatialService",
445                        "SearchSpatials",
446                    ),
447                );
448            self.inner.unary(req, path, codec).await
449        }
450        pub async fn create_spatial(
451            &mut self,
452            request: impl tonic::IntoRequest<super::CreateSpatialRequest>,
453        ) -> std::result::Result<
454            tonic::Response<super::CreateSpatialResponse>,
455            tonic::Status,
456        > {
457            self.inner
458                .ready()
459                .await
460                .map_err(|e| {
461                    tonic::Status::unknown(
462                        format!("Service was not ready: {}", e.into()),
463                    )
464                })?;
465            let codec = tonic::codec::ProstCodec::default();
466            let path = http::uri::PathAndQuery::from_static(
467                "/nominal.spatial.v2.SpatialService/CreateSpatial",
468            );
469            let mut req = request.into_request();
470            req.extensions_mut()
471                .insert(
472                    GrpcMethod::new("nominal.spatial.v2.SpatialService", "CreateSpatial"),
473                );
474            self.inner.unary(req, path, codec).await
475        }
476        pub async fn update_spatial(
477            &mut self,
478            request: impl tonic::IntoRequest<super::UpdateSpatialRequest>,
479        ) -> std::result::Result<
480            tonic::Response<super::UpdateSpatialResponse>,
481            tonic::Status,
482        > {
483            self.inner
484                .ready()
485                .await
486                .map_err(|e| {
487                    tonic::Status::unknown(
488                        format!("Service was not ready: {}", e.into()),
489                    )
490                })?;
491            let codec = tonic::codec::ProstCodec::default();
492            let path = http::uri::PathAndQuery::from_static(
493                "/nominal.spatial.v2.SpatialService/UpdateSpatial",
494            );
495            let mut req = request.into_request();
496            req.extensions_mut()
497                .insert(
498                    GrpcMethod::new("nominal.spatial.v2.SpatialService", "UpdateSpatial"),
499                );
500            self.inner.unary(req, path, codec).await
501        }
502        pub async fn archive_spatial(
503            &mut self,
504            request: impl tonic::IntoRequest<super::ArchiveSpatialRequest>,
505        ) -> std::result::Result<
506            tonic::Response<super::ArchiveSpatialResponse>,
507            tonic::Status,
508        > {
509            self.inner
510                .ready()
511                .await
512                .map_err(|e| {
513                    tonic::Status::unknown(
514                        format!("Service was not ready: {}", e.into()),
515                    )
516                })?;
517            let codec = tonic::codec::ProstCodec::default();
518            let path = http::uri::PathAndQuery::from_static(
519                "/nominal.spatial.v2.SpatialService/ArchiveSpatial",
520            );
521            let mut req = request.into_request();
522            req.extensions_mut()
523                .insert(
524                    GrpcMethod::new(
525                        "nominal.spatial.v2.SpatialService",
526                        "ArchiveSpatial",
527                    ),
528                );
529            self.inner.unary(req, path, codec).await
530        }
531        pub async fn unarchive_spatial(
532            &mut self,
533            request: impl tonic::IntoRequest<super::UnarchiveSpatialRequest>,
534        ) -> std::result::Result<
535            tonic::Response<super::UnarchiveSpatialResponse>,
536            tonic::Status,
537        > {
538            self.inner
539                .ready()
540                .await
541                .map_err(|e| {
542                    tonic::Status::unknown(
543                        format!("Service was not ready: {}", e.into()),
544                    )
545                })?;
546            let codec = tonic::codec::ProstCodec::default();
547            let path = http::uri::PathAndQuery::from_static(
548                "/nominal.spatial.v2.SpatialService/UnarchiveSpatial",
549            );
550            let mut req = request.into_request();
551            req.extensions_mut()
552                .insert(
553                    GrpcMethod::new(
554                        "nominal.spatial.v2.SpatialService",
555                        "UnarchiveSpatial",
556                    ),
557                );
558            self.inner.unary(req, path, codec).await
559        }
560    }
561}