#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointCloudMetadata {
#[prost(string, optional, tag = "1")]
pub sensor_model: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub coordinate_system: ::core::option::Option<::prost::alloc::string::String>,
#[prost(double, optional, tag = "3")]
pub resolution_mm: ::core::option::Option<f64>,
#[prost(string, optional, tag = "4")]
pub scan_pattern: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpatialTypeMetadata {
#[prost(oneof = "spatial_type_metadata::SpatialTypeMetadata", tags = "1")]
pub spatial_type_metadata: ::core::option::Option<
spatial_type_metadata::SpatialTypeMetadata,
>,
}
pub mod spatial_type_metadata {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SpatialTypeMetadata {
#[prost(message, tag = "1")]
PointCloud(super::PointCloudMetadata),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Spatial {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub title: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "4")]
pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "5")]
pub properties: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "6")]
pub created_by: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub created_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "8")]
pub updated_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(bool, tag = "9")]
pub is_archived: bool,
#[prost(string, tag = "10")]
pub dagger_model_uuid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "11")]
pub type_metadata: ::core::option::Option<SpatialTypeMetadata>,
#[prost(message, optional, tag = "12")]
pub start_timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "13")]
pub end_timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "14")]
pub source_handle: ::core::option::Option<super::super::types::Handle>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SpatialSortOptions {
#[prost(bool, tag = "1")]
pub is_descending: bool,
#[prost(enumeration = "SpatialSortField", tag = "2")]
pub field: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSpatialsQueryList {
#[prost(message, repeated, tag = "1")]
pub queries: ::prost::alloc::vec::Vec<SearchSpatialsQuery>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSpatialsQuery {
#[prost(oneof = "search_spatials_query::Query", tags = "1, 2, 3, 4, 5, 6, 7")]
pub query: ::core::option::Option<search_spatials_query::Query>,
}
pub mod search_spatials_query {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Query {
#[prost(string, tag = "1")]
SearchText(::prost::alloc::string::String),
#[prost(string, tag = "2")]
Label(::prost::alloc::string::String),
#[prost(message, tag = "3")]
Property(super::super::super::types::Property),
#[prost(message, tag = "4")]
And(super::SearchSpatialsQueryList),
#[prost(message, tag = "5")]
Or(super::SearchSpatialsQueryList),
#[prost(string, tag = "6")]
WorkspaceRid(::prost::alloc::string::String),
#[prost(enumeration = "super::SpatialType", tag = "7")]
SpatialType(i32),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSpatialRequest {
#[prost(string, tag = "1")]
pub spatial_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSpatialResponse {
#[prost(message, optional, tag = "1")]
pub spatial: ::core::option::Option<Spatial>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetSpatialsRequest {
#[prost(string, repeated, tag = "1")]
pub spatial_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetSpatialsResponse {
#[prost(message, repeated, tag = "1")]
pub spatials: ::prost::alloc::vec::Vec<Spatial>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSpatialsRequest {
#[prost(message, optional, tag = "1")]
pub query: ::core::option::Option<SearchSpatialsQuery>,
#[prost(int32, optional, tag = "2")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub sort_options: ::core::option::Option<SpatialSortOptions>,
#[prost(
enumeration = "super::super::types::ArchivedStatus",
repeated,
packed = "false",
tag = "5"
)]
pub archived_statuses: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSpatialsResponse {
#[prost(message, repeated, tag = "1")]
pub spatials: ::prost::alloc::vec::Vec<Spatial>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSpatialRequest {
#[prost(message, optional, tag = "1")]
pub spatial: ::core::option::Option<Spatial>,
#[prost(string, repeated, tag = "2")]
pub marking_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub workspace_rid: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSpatialResponse {
#[prost(message, optional, tag = "1")]
pub spatial: ::core::option::Option<Spatial>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSpatialRequest {
#[prost(message, optional, tag = "1")]
pub spatial: ::core::option::Option<Spatial>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<
super::super::super::google::protobuf::FieldMask,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSpatialResponse {
#[prost(message, optional, tag = "1")]
pub spatial: ::core::option::Option<Spatial>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArchiveSpatialRequest {
#[prost(string, tag = "1")]
pub spatial_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ArchiveSpatialResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnarchiveSpatialRequest {
#[prost(string, tag = "1")]
pub spatial_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UnarchiveSpatialResponse {}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpatialType {
Unspecified = 0,
PointCloud = 1,
}
impl SpatialType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SPATIAL_TYPE_UNSPECIFIED",
Self::PointCloud => "SPATIAL_TYPE_POINT_CLOUD",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SPATIAL_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SPATIAL_TYPE_POINT_CLOUD" => Some(Self::PointCloud),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpatialSortField {
Unspecified = 0,
CreatedAt = 1,
}
impl SpatialSortField {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SPATIAL_SORT_FIELD_UNSPECIFIED",
Self::CreatedAt => "SPATIAL_SORT_FIELD_CREATED_AT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SPATIAL_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
"SPATIAL_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpatialError {
NotAuthorized = 0,
SpatialNotFound = 1,
InvalidRequest = 2,
}
impl SpatialError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NotAuthorized => "SPATIAL_ERROR_NOT_AUTHORIZED",
Self::SpatialNotFound => "SPATIAL_ERROR_SPATIAL_NOT_FOUND",
Self::InvalidRequest => "SPATIAL_ERROR_INVALID_REQUEST",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SPATIAL_ERROR_NOT_AUTHORIZED" => Some(Self::NotAuthorized),
"SPATIAL_ERROR_SPATIAL_NOT_FOUND" => Some(Self::SpatialNotFound),
"SPATIAL_ERROR_INVALID_REQUEST" => Some(Self::InvalidRequest),
_ => None,
}
}
}
pub mod spatial_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct SpatialServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SpatialServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SpatialServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SpatialServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
SpatialServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_spatial(
&mut self,
request: impl tonic::IntoRequest<super::GetSpatialRequest>,
) -> std::result::Result<
tonic::Response<super::GetSpatialResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.spatial.v2.SpatialService/GetSpatial",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.spatial.v2.SpatialService", "GetSpatial"),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_spatials(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetSpatialsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetSpatialsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.spatial.v2.SpatialService/BatchGetSpatials",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.spatial.v2.SpatialService",
"BatchGetSpatials",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_spatials(
&mut self,
request: impl tonic::IntoRequest<super::SearchSpatialsRequest>,
) -> std::result::Result<
tonic::Response<super::SearchSpatialsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.spatial.v2.SpatialService/SearchSpatials",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.spatial.v2.SpatialService",
"SearchSpatials",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create_spatial(
&mut self,
request: impl tonic::IntoRequest<super::CreateSpatialRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSpatialResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.spatial.v2.SpatialService/CreateSpatial",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.spatial.v2.SpatialService", "CreateSpatial"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_spatial(
&mut self,
request: impl tonic::IntoRequest<super::UpdateSpatialRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateSpatialResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.spatial.v2.SpatialService/UpdateSpatial",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.spatial.v2.SpatialService", "UpdateSpatial"),
);
self.inner.unary(req, path, codec).await
}
pub async fn archive_spatial(
&mut self,
request: impl tonic::IntoRequest<super::ArchiveSpatialRequest>,
) -> std::result::Result<
tonic::Response<super::ArchiveSpatialResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.spatial.v2.SpatialService/ArchiveSpatial",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.spatial.v2.SpatialService",
"ArchiveSpatial",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn unarchive_spatial(
&mut self,
request: impl tonic::IntoRequest<super::UnarchiveSpatialRequest>,
) -> std::result::Result<
tonic::Response<super::UnarchiveSpatialResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.spatial.v2.SpatialService/UnarchiveSpatial",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.spatial.v2.SpatialService",
"UnarchiveSpatial",
),
);
self.inner.unary(req, path, codec).await
}
}
}