From 4ae3dc73ce5847b1fbff0ff0ea3f6f28c1d047f3 Mon Sep 17 00:00:00 2001 From: viambot Date: Thu, 11 Apr 2024 15:47:17 +0000 Subject: [PATCH] [WORKFLOW] Updating protos from viamrobotics/api, commit: f02f6ccccc48872a061127a12e6fbd5f5b4f647d --- src/gen/google.api.expr.v1alpha1.rs | 105 +- src/gen/google.api.rs | 100 + src/gen/proto.stream.v1.rs | 38 + src/gen/proto.stream.v1.tonic.rs | 450 ++++ src/gen/viam.app.agent.v1.rs | 163 ++ src/gen/viam.app.agent.v1.tonic.rs | 681 +++++ src/gen/viam.app.build.v1.rs | 119 + src/gen/viam.app.build.v1.tonic.rs | 448 ++++ src/gen/viam.app.cloudslam.v1.rs | 108 +- src/gen/viam.app.cloudslam.v1.tonic.rs | 88 + src/gen/viam.app.data.v1.rs | 221 +- src/gen/viam.app.data.v1.tonic.rs | 542 +++- src/gen/viam.app.dataset.v1.rs | 83 + src/gen/viam.app.dataset.v1.tonic.rs | 636 +++++ src/gen/viam.app.datasync.v1.rs | 47 + src/gen/viam.app.datasync.v1.tonic.rs | 90 + src/gen/viam.app.mltraining.v1.rs | 75 +- src/gen/viam.app.mltraining.v1.tonic.rs | 88 + src/gen/viam.app.packages.v1.rs | 5 + src/gen/viam.app.v1.rs | 716 +++-- src/gen/viam.app.v1.tonic.rs | 2371 ++++++++++++----- src/gen/viam.common.v1.rs | 44 + src/gen/viam.component.base.v1.rs | 2 + src/gen/viam.component.board.v1.rs | 45 + src/gen/viam.component.board.v1.tonic.rs | 173 ++ src/gen/viam.component.camera.v1.rs | 12 + src/gen/viam.component.generic.v1.tonic.rs | 4 +- src/gen/viam.component.movementsensor.v1.rs | 14 +- .../viam.component.movementsensor.v1.tonic.rs | 90 + src/gen/viam.component.powersensor.v1.rs | 59 + .../viam.component.powersensor.v1.tonic.rs | 638 +++++ src/gen/viam.component.sensor.v1.rs | 18 - src/gen/viam.component.sensor.v1.tonic.rs | 31 +- src/gen/viam.module.v1.rs | 4 + src/gen/viam.provisioning.v1.rs | 93 + src/gen/viam.provisioning.v1.tonic.rs | 554 ++++ src/gen/viam.robot.v1.rs | 30 + src/gen/viam.robot.v1.tonic.rs | 148 + src/gen/viam.service.generic.v1.tonic.rs | 304 +++ src/gen/viam.service.mlmodel.v1.rs | 127 +- src/gen/viam.service.motion.v1.rs | 293 +- src/gen/viam.service.motion.v1.tonic.rs | 217 +- src/gen/viam.service.navigation.v1.rs | 80 + src/gen/viam.service.navigation.v1.tonic.rs | 164 ++ src/gen/viam.service.sensors.v1.rs | 9 + src/gen/viam.service.slam.v1.rs | 94 +- src/gen/viam.service.slam.v1.tonic.rs | 35 +- 47 files changed, 9437 insertions(+), 1019 deletions(-) create mode 100644 src/gen/proto.stream.v1.rs create mode 100644 src/gen/proto.stream.v1.tonic.rs create mode 100644 src/gen/viam.app.agent.v1.rs create mode 100644 src/gen/viam.app.agent.v1.tonic.rs create mode 100644 src/gen/viam.app.build.v1.rs create mode 100644 src/gen/viam.app.build.v1.tonic.rs create mode 100644 src/gen/viam.app.dataset.v1.rs create mode 100644 src/gen/viam.app.dataset.v1.tonic.rs create mode 100644 src/gen/viam.component.powersensor.v1.rs create mode 100644 src/gen/viam.component.powersensor.v1.tonic.rs delete mode 100644 src/gen/viam.component.sensor.v1.rs create mode 100644 src/gen/viam.provisioning.v1.rs create mode 100644 src/gen/viam.provisioning.v1.tonic.rs create mode 100644 src/gen/viam.service.generic.v1.tonic.rs diff --git a/src/gen/google.api.expr.v1alpha1.rs b/src/gen/google.api.expr.v1alpha1.rs index 3d6c6f8..a9c2ac7 100644 --- a/src/gen/google.api.expr.v1alpha1.rs +++ b/src/gen/google.api.expr.v1alpha1.rs @@ -19,14 +19,16 @@ pub struct ParsedExpr { /// operators with the exception of the '.' operator are modelled as function /// calls. This makes it easy to represent new operators into the existing AST. /// -/// All references within expressions must resolve to a \[Decl][google.api.expr.v1alpha1.Decl\] provided at -/// type-check for an expression to be valid. A reference may either be a bare -/// identifier `name` or a qualified identifier `google.api.name`. References -/// may either refer to a value or a function declaration. +/// All references within expressions must resolve to a +/// \[Decl][google.api.expr.v1alpha1.Decl\] provided at type-check for an +/// expression to be valid. A reference may either be a bare identifier `name` or +/// a qualified identifier `google.api.name`. References may either refer to a +/// value or a function declaration. /// /// For example, the expression `google.api.name.startsWith('expr')` references -/// the declaration `google.api.name` within a \[Expr.Select][google.api.expr.v1alpha1.Expr.Select\] expression, and -/// the function declaration `startsWith`. +/// the declaration `google.api.name` within a +/// \[Expr.Select][google.api.expr.v1alpha1.Expr.Select\] expression, and the +/// function declaration `startsWith`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Expr { @@ -48,7 +50,8 @@ pub mod expr { /// Required. Holds a single, unqualified identifier, possibly preceded by a /// '.'. /// - /// Qualified names are represented by the \[Expr.Select][google.api.expr.v1alpha1.Expr.Select\] expression. + /// Qualified names are represented by the + /// \[Expr.Select][google.api.expr.v1alpha1.Expr.Select\] expression. #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, } @@ -260,7 +263,8 @@ pub mod expr { /// primitives. /// /// Lists and structs are not included as constants as these aggregate types may -/// contain \[Expr][google.api.expr.v1alpha1.Expr\] elements which require evaluation and are thus not constant. +/// contain \[Expr][google.api.expr.v1alpha1.Expr\] elements which require +/// evaluation and are thus not constant. /// /// Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, /// `true`, `null`. @@ -346,6 +350,91 @@ pub struct SourceInfo { /// value is the call `Expr` that was replaced. #[prost(map="int64, message", tag="5")] pub macro_calls: ::std::collections::HashMap, + /// A list of tags for extensions that were used while parsing or type checking + /// the source expression. For example, optimizations that require special + /// runtime support may be specified. + /// + /// These are used to check feature support between components in separate + /// implementations. This can be used to either skip redundant work or + /// report an error if the extension is unsupported. + #[prost(message, repeated, tag="6")] + pub extensions: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `SourceInfo`. +pub mod source_info { + /// An extension that was requested for the source expression. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Extension { + /// Identifier for the extension. Example: constant_folding + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// If set, the listed components must understand the extension for the + /// expression to evaluate correctly. + /// + /// This field has set semantics, repeated values should be deduplicated. + #[prost(enumeration="extension::Component", repeated, tag="2")] + pub affected_components: ::prost::alloc::vec::Vec, + /// Version info. May be skipped if it isn't meaningful for the extension. + /// (for example constant_folding might always be v0.0). + #[prost(message, optional, tag="3")] + pub version: ::core::option::Option, + } + /// Nested message and enum types in `Extension`. + pub mod extension { + /// Version + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Version { + /// Major version changes indicate different required support level from + /// the required components. + #[prost(int64, tag="1")] + pub major: i64, + /// Minor version changes must not change the observed behavior from + /// existing implementations, but may be provided informationally. + #[prost(int64, tag="2")] + pub minor: i64, + } + /// CEL component specifier. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Component { + /// Unspecified, default. + Unspecified = 0, + /// Parser. Converts a CEL string to an AST. + Parser = 1, + /// Type checker. Checks that references in an AST are defined and types + /// agree. + TypeChecker = 2, + /// Runtime. Evaluates a parsed and optionally checked CEL AST against a + /// context. + Runtime = 3, + } + impl Component { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Component::Unspecified => "COMPONENT_UNSPECIFIED", + Component::Parser => "COMPONENT_PARSER", + Component::TypeChecker => "COMPONENT_TYPE_CHECKER", + Component::Runtime => "COMPONENT_RUNTIME", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "COMPONENT_UNSPECIFIED" => Some(Self::Unspecified), + "COMPONENT_PARSER" => Some(Self::Parser), + "COMPONENT_TYPE_CHECKER" => Some(Self::TypeChecker), + "COMPONENT_RUNTIME" => Some(Self::Runtime), + _ => None, + } + } + } + } } /// A specific position in source. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/src/gen/google.api.rs b/src/gen/google.api.rs index f2a91d5..200c2b4 100644 --- a/src/gen/google.api.rs +++ b/src/gen/google.api.rs @@ -545,6 +545,10 @@ pub struct Publishing { /// #[prost(string, tag="110")] pub proto_reference_documentation_uri: ::prost::alloc::string::String, + /// Optional link to REST reference documentation. Example: + /// + #[prost(string, tag="111")] + pub rest_reference_documentation_uri: ::prost::alloc::string::String, } /// Settings for Java client libraries. #[allow(clippy::derive_partial_eq_without_eq)] @@ -696,6 +700,19 @@ pub struct MethodSettings { /// seconds: 54000 # 90 minutes #[prost(message, optional, tag="2")] pub long_running: ::core::option::Option, + /// List of top-level fields of the request message, that should be + /// automatically populated by the client libraries based on their + /// (google.api.field_info).format. Currently supported format: UUID4. + /// + /// Example of a YAML configuration: + /// + /// publishing: + /// method_settings: + /// - selector: google.example.v1.ExampleService.CreateExample + /// auto_populated_fields: + /// - request_id + #[prost(string, repeated, tag="3")] + pub auto_populated_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// Nested message and enum types in `MethodSettings`. pub mod method_settings { @@ -857,6 +874,19 @@ pub enum FieldBehavior { /// a non-empty value will be returned. The user will not be aware of what /// non-empty value to expect. NonEmptyDefault = 7, + /// Denotes that the field in a resource (a message annotated with + /// google.api.resource) is used in the resource name to uniquely identify the + /// resource. For AIP-compliant APIs, this should only be applied to the + /// `name` field on the resource. + /// + /// This behavior should not be applied to references to other resources within + /// the message. + /// + /// The identifier field of resources often have different field behavior + /// depending on the request it is embedded in (e.g. for Create methods name + /// is optional and unused, while for Update methods it is required). Instead + /// of method-specific annotations, only `IDENTIFIER` is required. + Identifier = 8, } impl FieldBehavior { /// String value of the enum field names used in the ProtoBuf definition. @@ -873,6 +903,7 @@ impl FieldBehavior { FieldBehavior::Immutable => "IMMUTABLE", FieldBehavior::UnorderedList => "UNORDERED_LIST", FieldBehavior::NonEmptyDefault => "NON_EMPTY_DEFAULT", + FieldBehavior::Identifier => "IDENTIFIER", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -886,10 +917,79 @@ impl FieldBehavior { "IMMUTABLE" => Some(Self::Immutable), "UNORDERED_LIST" => Some(Self::UnorderedList), "NON_EMPTY_DEFAULT" => Some(Self::NonEmptyDefault), + "IDENTIFIER" => Some(Self::Identifier), _ => None, } } } +/// Rich semantic information of an API field beyond basic typing. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FieldInfo { + /// The standard format of a field value. This does not explicitly configure + /// any API consumer, just documents the API's format for the field it is + /// applied to. + #[prost(enumeration="field_info::Format", tag="1")] + pub format: i32, +} +/// Nested message and enum types in `FieldInfo`. +pub mod field_info { + /// The standard format of a field value. The supported formats are all backed + /// by either an RFC defined by the IETF or a Google-defined AIP. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Format { + /// Default, unspecified value. + Unspecified = 0, + /// Universally Unique Identifier, version 4, value as defined by + /// The value may be + /// normalized to entirely lowercase letters. For example, the value + /// `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + /// `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + Uuid4 = 1, + /// Internet Protocol v4 value as defined by [RFC + /// 791](). The value may be + /// condensed, with leading zeros in each octet stripped. For example, + /// `001.022.233.040` would be condensed to `1.22.233.40`. + Ipv4 = 2, + /// Internet Protocol v6 value as defined by [RFC + /// 2460](). The value may be + /// normalized to entirely lowercase letters with zeros compressed, following + /// [RFC 5952](). For example, + /// the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + Ipv6 = 3, + /// An IP address in either v4 or v6 format as described by the individual + /// values defined herein. See the comments on the IPV4 and IPV6 types for + /// allowed normalizations of each. + Ipv4OrIpv6 = 4, + } + impl Format { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Format::Unspecified => "FORMAT_UNSPECIFIED", + Format::Uuid4 => "UUID4", + Format::Ipv4 => "IPV4", + Format::Ipv6 => "IPV6", + Format::Ipv4OrIpv6 => "IPV4_OR_IPV6", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FORMAT_UNSPECIFIED" => Some(Self::Unspecified), + "UUID4" => Some(Self::Uuid4), + "IPV4" => Some(Self::Ipv4), + "IPV6" => Some(Self::Ipv6), + "IPV4_OR_IPV6" => Some(Self::Ipv4OrIpv6), + _ => None, + } + } + } +} /// Message that represents an arbitrary HTTP body. It should only be used for /// payload formats that can't be represented as JSON, such as raw binary or /// an HTML page. diff --git a/src/gen/proto.stream.v1.rs b/src/gen/proto.stream.v1.rs new file mode 100644 index 0000000..0da69a3 --- /dev/null +++ b/src/gen/proto.stream.v1.rs @@ -0,0 +1,38 @@ +// @generated +/// ListStreamsRequest requests all streams registered. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListStreamsRequest { +} +/// A ListStreamsResponse details streams registered. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListStreamsResponse { + #[prost(string, repeated, tag="1")] + pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// A AddStreamRequest requests the given stream be added to the connection. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddStreamRequest { + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, +} +/// AddStreamResponse is returned after a successful AddStreamRequest. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddStreamResponse { +} +/// A RemoveStreamRequest requests the given stream be removed from the connection. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveStreamRequest { + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, +} +/// RemoveStreamResponse is returned after a successful RemoveStreamRequest. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveStreamResponse { +} +// @@protoc_insertion_point(module) diff --git a/src/gen/proto.stream.v1.tonic.rs b/src/gen/proto.stream.v1.tonic.rs new file mode 100644 index 0000000..61d8269 --- /dev/null +++ b/src/gen/proto.stream.v1.tonic.rs @@ -0,0 +1,450 @@ +// @generated +/// Generated client implementations. +pub mod stream_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct StreamServiceClient { + inner: tonic::client::Grpc, + } + impl StreamServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl StreamServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> StreamServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + StreamServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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 list_streams( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/proto.stream.v1.StreamService/ListStreams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("proto.stream.v1.StreamService", "ListStreams")); + self.inner.unary(req, path, codec).await + } + pub async fn add_stream( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/proto.stream.v1.StreamService/AddStream", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("proto.stream.v1.StreamService", "AddStream")); + self.inner.unary(req, path, codec).await + } + pub async fn remove_stream( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/proto.stream.v1.StreamService/RemoveStream", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("proto.stream.v1.StreamService", "RemoveStream"), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod stream_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with StreamServiceServer. + #[async_trait] + pub trait StreamService: Send + Sync + 'static { + async fn list_streams( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn add_stream( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn remove_stream( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct StreamServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl StreamServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for StreamServiceServer + where + T: StreamService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/proto.stream.v1.StreamService/ListStreams" => { + #[allow(non_camel_case_types)] + struct ListStreamsSvc(pub Arc); + impl< + T: StreamService, + > tonic::server::UnaryService + for ListStreamsSvc { + type Response = super::ListStreamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).list_streams(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListStreamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/proto.stream.v1.StreamService/AddStream" => { + #[allow(non_camel_case_types)] + struct AddStreamSvc(pub Arc); + impl< + T: StreamService, + > tonic::server::UnaryService + for AddStreamSvc { + type Response = super::AddStreamResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).add_stream(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddStreamSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/proto.stream.v1.StreamService/RemoveStream" => { + #[allow(non_camel_case_types)] + struct RemoveStreamSvc(pub Arc); + impl< + T: StreamService, + > tonic::server::UnaryService + for RemoveStreamSvc { + type Response = super::RemoveStreamResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).remove_stream(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RemoveStreamSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for StreamServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for StreamServiceServer { + const NAME: &'static str = "proto.stream.v1.StreamService"; + } +} diff --git a/src/gen/viam.app.agent.v1.rs b/src/gen/viam.app.agent.v1.rs new file mode 100644 index 0000000..dd89224 --- /dev/null +++ b/src/gen/viam.app.agent.v1.rs @@ -0,0 +1,163 @@ +// @generated +/// App side +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAgentConfigRequest { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAgentConfigResponse { + #[prost(message, optional, tag="1")] + pub agent_config: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateAgentConfigRequest { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(message, optional, tag="2")] + pub agent_config: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateAgentConfigResponse { + #[prost(message, optional, tag="1")] + pub agent_config: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AppAgentConfig { + #[prost(map="string, message", tag="1")] + pub subsystem_configs: ::std::collections::HashMap<::prost::alloc::string::String, AppSubsystemConfig>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AppSubsystemConfig { + #[prost(string, tag="1")] + pub release_channel: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub pin_version: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub pin_url: ::prost::alloc::string::String, + #[prost(bool, tag="4")] + pub disable_subsystem: bool, + #[prost(message, optional, tag="5")] + pub attributes: ::core::option::Option<::prost_types::Struct>, +} +/// Device side +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeviceAgentConfigRequest { + /// robot partID + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// info about the host system + #[prost(message, optional, tag="2")] + pub host_info: ::core::option::Option, + /// current subsystems and versions + #[prost(map="string, string", tag="3")] + pub subsystem_versions: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeviceAgentConfigResponse { + /// subsystems to be installed/configured/updated + /// note: previously installed subsystems will be removed from the system if removed from this list + #[prost(map="string, message", tag="1")] + pub subsystem_configs: ::std::collections::HashMap<::prost::alloc::string::String, DeviceSubsystemConfig>, + /// how often this request should be repeated + #[prost(message, optional, tag="2")] + pub check_interval: ::core::option::Option<::prost_types::Duration>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeviceSubsystemConfig { + /// data needed to download/validate the subsystem + #[prost(message, optional, tag="1")] + pub update_info: ::core::option::Option, + /// if this subsystem is disabled and should not be started by the agent + #[prost(bool, tag="2")] + pub disable: bool, + /// force_restart will restart the subsystem, even if no updates are available + #[prost(bool, tag="3")] + pub force_restart: bool, + /// arbitrary config sections + #[prost(message, optional, tag="4")] + pub attributes: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HostInfo { + /// platform is the docker styled combination of kernel and architecture. Ex: linux/amd64, darwin/arm64 + #[prost(string, tag="1")] + pub platform: ::prost::alloc::string::String, + /// ID and VERSION_ID fields from /etc/os-release, colon seperated. Ex: ubuntu:22.04, debian:11 + #[prost(string, tag="2")] + pub distro: ::prost::alloc::string::String, + /// additional tags for specific hardware or software that's present and may affect software selection + /// ex: "jetson", "rpi4", "systemd", etc. + #[prost(string, repeated, tag="3")] + pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SubsystemUpdateInfo { + /// unpacked filename as it is expected on disk (regardless of url) + #[prost(string, tag="1")] + pub filename: ::prost::alloc::string::String, + /// url to download from + #[prost(string, tag="2")] + pub url: ::prost::alloc::string::String, + /// version expected at the url + #[prost(string, tag="3")] + pub version: ::prost::alloc::string::String, + /// sha256 sum of file as downloaded + #[prost(bytes="vec", tag="4")] + pub sha256: ::prost::alloc::vec::Vec, + /// determines if decompression or executable permissions are needed + #[prost(enumeration="PackageFormat", tag="5")] + pub format: i32, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum PackageFormat { + /// unknown/unset (autodetection may be attempted) + Unspecified = 0, + /// do nothing + Raw = 1, + /// decompress .xz file + Xz = 2, + /// set executable permissions + Executable = 3, + /// decompress and set executable + XzExecutable = 4, +} +impl PackageFormat { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + PackageFormat::Unspecified => "PACKAGE_FORMAT_UNSPECIFIED", + PackageFormat::Raw => "PACKAGE_FORMAT_RAW", + PackageFormat::Xz => "PACKAGE_FORMAT_XZ", + PackageFormat::Executable => "PACKAGE_FORMAT_EXECUTABLE", + PackageFormat::XzExecutable => "PACKAGE_FORMAT_XZ_EXECUTABLE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PACKAGE_FORMAT_UNSPECIFIED" => Some(Self::Unspecified), + "PACKAGE_FORMAT_RAW" => Some(Self::Raw), + "PACKAGE_FORMAT_XZ" => Some(Self::Xz), + "PACKAGE_FORMAT_EXECUTABLE" => Some(Self::Executable), + "PACKAGE_FORMAT_XZ_EXECUTABLE" => Some(Self::XzExecutable), + _ => None, + } + } +} +// @@protoc_insertion_point(module) diff --git a/src/gen/viam.app.agent.v1.tonic.rs b/src/gen/viam.app.agent.v1.tonic.rs new file mode 100644 index 0000000..9844987 --- /dev/null +++ b/src/gen/viam.app.agent.v1.tonic.rs @@ -0,0 +1,681 @@ +// @generated +/// Generated client implementations. +pub mod agent_app_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct AgentAppServiceClient { + inner: tonic::client::Grpc, + } + impl AgentAppServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl AgentAppServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> AgentAppServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + AgentAppServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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_agent_config( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.agent.v1.AgentAppService/GetAgentConfig", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.agent.v1.AgentAppService", + "GetAgentConfig", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn update_agent_config( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.agent.v1.AgentAppService/UpdateAgentConfig", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.agent.v1.AgentAppService", + "UpdateAgentConfig", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod agent_app_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with AgentAppServiceServer. + #[async_trait] + pub trait AgentAppService: Send + Sync + 'static { + async fn get_agent_config( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn update_agent_config( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct AgentAppServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl AgentAppServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for AgentAppServiceServer + where + T: AgentAppService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/viam.app.agent.v1.AgentAppService/GetAgentConfig" => { + #[allow(non_camel_case_types)] + struct GetAgentConfigSvc(pub Arc); + impl< + T: AgentAppService, + > tonic::server::UnaryService + for GetAgentConfigSvc { + type Response = super::GetAgentConfigResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_agent_config(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAgentConfigSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.agent.v1.AgentAppService/UpdateAgentConfig" => { + #[allow(non_camel_case_types)] + struct UpdateAgentConfigSvc(pub Arc); + impl< + T: AgentAppService, + > tonic::server::UnaryService + for UpdateAgentConfigSvc { + type Response = super::UpdateAgentConfigResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).update_agent_config(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateAgentConfigSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for AgentAppServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for AgentAppServiceServer { + const NAME: &'static str = "viam.app.agent.v1.AgentAppService"; + } +} +/// Generated client implementations. +pub mod agent_device_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct AgentDeviceServiceClient { + inner: tonic::client::Grpc, + } + impl AgentDeviceServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl AgentDeviceServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> AgentDeviceServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + AgentDeviceServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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 device_agent_config( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.agent.v1.AgentDeviceService", + "DeviceAgentConfig", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod agent_device_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with AgentDeviceServiceServer. + #[async_trait] + pub trait AgentDeviceService: Send + Sync + 'static { + async fn device_agent_config( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct AgentDeviceServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl AgentDeviceServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for AgentDeviceServiceServer + where + T: AgentDeviceService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig" => { + #[allow(non_camel_case_types)] + struct DeviceAgentConfigSvc(pub Arc); + impl< + T: AgentDeviceService, + > tonic::server::UnaryService + for DeviceAgentConfigSvc { + type Response = super::DeviceAgentConfigResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).device_agent_config(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeviceAgentConfigSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for AgentDeviceServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for AgentDeviceServiceServer { + const NAME: &'static str = "viam.app.agent.v1.AgentDeviceService"; + } +} diff --git a/src/gen/viam.app.build.v1.rs b/src/gen/viam.app.build.v1.rs new file mode 100644 index 0000000..01647a5 --- /dev/null +++ b/src/gen/viam.app.build.v1.rs @@ -0,0 +1,119 @@ +// @generated +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StartBuildRequest { + /// repo to build + #[prost(string, tag="1")] + pub repo: ::prost::alloc::string::String, + /// optional git ref; defaults to 'main' + #[prost(string, optional, tag="2")] + pub r#ref: ::core::option::Option<::prost::alloc::string::String>, + /// list of platforms to build + #[prost(string, repeated, tag="3")] + pub platforms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// module_id as prefix:name pair + #[prost(string, tag="4")] + pub module_id: ::prost::alloc::string::String, + /// version of the module to publish + /// must be valid semver2.0 string (ex: 1.2.3-rc0) + #[prost(string, tag="5")] + pub module_version: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StartBuildResponse { + #[prost(string, tag="1")] + pub build_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLogsRequest { + #[prost(string, tag="1")] + pub build_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub platform: ::prost::alloc::string::String, +} +/// GetLogsResponse is a streaming endpoint that may have multiple messages that belong +/// to the same build_step if there are too many bytes to fit into a single gRPC +/// response. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLogsResponse { + #[prost(string, tag="1")] + pub build_step: ::prost::alloc::string::String, + /// includes multiple lines delimited by \n\r + #[prost(string, tag="2")] + pub data: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct JobInfo { + #[prost(string, tag="1")] + pub build_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub platform: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub version: ::prost::alloc::string::String, + #[prost(enumeration="JobStatus", tag="4")] + pub status: i32, + #[prost(message, optional, tag="5")] + pub start_time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, optional, tag="6")] + pub end_time: ::core::option::Option<::prost_types::Timestamp>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListJobsRequest { + /// module_id as prefix:name pair + #[prost(string, tag="1")] + pub module_id: ::prost::alloc::string::String, + /// don't return more than max_jobs_length jobs + /// if not present, return all jobs. + #[prost(int32, optional, tag="2")] + pub max_jobs_length: ::core::option::Option, + /// only return jobs that match this build id + /// if not present, return all jobs. + #[prost(string, optional, tag="3")] + pub build_id: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListJobsResponse { + /// jobs is ordered by (build start time, alphabetical platform). + #[prost(message, repeated, tag="1")] + pub jobs: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum JobStatus { + Unspecified = 0, + /// IN_PROGRESS = pending or executing on cloud infra. Artifact has not been uploaded. + InProgress = 1, + Failed = 2, + Done = 3, +} +impl JobStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + JobStatus::Unspecified => "JOB_STATUS_UNSPECIFIED", + JobStatus::InProgress => "JOB_STATUS_IN_PROGRESS", + JobStatus::Failed => "JOB_STATUS_FAILED", + JobStatus::Done => "JOB_STATUS_DONE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "JOB_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "JOB_STATUS_IN_PROGRESS" => Some(Self::InProgress), + "JOB_STATUS_FAILED" => Some(Self::Failed), + "JOB_STATUS_DONE" => Some(Self::Done), + _ => None, + } + } +} +// @@protoc_insertion_point(module) diff --git a/src/gen/viam.app.build.v1.tonic.rs b/src/gen/viam.app.build.v1.tonic.rs new file mode 100644 index 0000000..5eb4ddd --- /dev/null +++ b/src/gen/viam.app.build.v1.tonic.rs @@ -0,0 +1,448 @@ +// @generated +/// Generated client implementations. +pub mod build_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct BuildServiceClient { + inner: tonic::client::Grpc, + } + impl BuildServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl BuildServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> BuildServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + BuildServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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 start_build( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.build.v1.BuildService/StartBuild", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.build.v1.BuildService", "StartBuild")); + self.inner.unary(req, path, codec).await + } + pub async fn get_logs( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response>, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.build.v1.BuildService/GetLogs", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.build.v1.BuildService", "GetLogs")); + self.inner.server_streaming(req, path, codec).await + } + pub async fn list_jobs( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.build.v1.BuildService/ListJobs", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.build.v1.BuildService", "ListJobs")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod build_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with BuildServiceServer. + #[async_trait] + pub trait BuildService: Send + Sync + 'static { + async fn start_build( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the GetLogs method. + type GetLogsStream: futures_core::Stream< + Item = std::result::Result, + > + + Send + + 'static; + async fn get_logs( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn list_jobs( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct BuildServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl BuildServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for BuildServiceServer + where + T: BuildService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/viam.app.build.v1.BuildService/StartBuild" => { + #[allow(non_camel_case_types)] + struct StartBuildSvc(pub Arc); + impl< + T: BuildService, + > tonic::server::UnaryService + for StartBuildSvc { + type Response = super::StartBuildResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).start_build(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = StartBuildSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.build.v1.BuildService/GetLogs" => { + #[allow(non_camel_case_types)] + struct GetLogsSvc(pub Arc); + impl< + T: BuildService, + > tonic::server::ServerStreamingService + for GetLogsSvc { + type Response = super::GetLogsResponse; + type ResponseStream = T::GetLogsStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_logs(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetLogsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.server_streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.build.v1.BuildService/ListJobs" => { + #[allow(non_camel_case_types)] + struct ListJobsSvc(pub Arc); + impl< + T: BuildService, + > tonic::server::UnaryService + for ListJobsSvc { + type Response = super::ListJobsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).list_jobs(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListJobsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for BuildServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for BuildServiceServer { + const NAME: &'static str = "viam.app.build.v1.BuildService"; + } +} diff --git a/src/gen/viam.app.cloudslam.v1.rs b/src/gen/viam.app.cloudslam.v1.rs index 5440241..ab2f22a 100644 --- a/src/gen/viam.app.cloudslam.v1.rs +++ b/src/gen/viam.app.cloudslam.v1.rs @@ -4,12 +4,12 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StartMappingSessionRequest { - /// The given config contains details such as sensor, map package and algorithm-specific fields required to run slam. - #[prost(message, optional, tag="1")] - pub slam_config: ::core::option::Option<::prost_types::Struct>, /// Version to use for slam, defaults stable - #[prost(string, tag="2")] + #[prost(string, tag="1")] pub slam_version: ::prost::alloc::string::String, + /// Version to use for viam, defaults stable + #[prost(string, tag="2")] + pub viam_server_version: ::prost::alloc::string::String, #[prost(string, tag="3")] pub map_name: ::prost::alloc::string::String, #[prost(string, tag="4")] @@ -18,9 +18,46 @@ pub struct StartMappingSessionRequest { pub location_id: ::prost::alloc::string::String, #[prost(string, tag="6")] pub robot_id: ::prost::alloc::string::String, - /// Version to use for viam, defaults stable - #[prost(string, tag="7")] - pub viam_server_version: ::prost::alloc::string::String, + #[prost(message, optional, tag="7")] + pub capture_interval: ::core::option::Option, + #[prost(message, repeated, tag="8")] + pub sensors: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="10")] + pub slam_config: ::core::option::Option<::prost_types::Struct>, + #[prost(string, tag="11")] + pub existing_map_version: ::prost::alloc::string::String, + #[prost(message, optional, tag="12")] + pub module: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub module_id: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub version: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SensorInfo { + #[prost(string, tag="1")] + pub source_component_name: ::prost::alloc::string::String, + /// type is the RDK component type + #[prost(string, tag="2")] + pub r#type: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub data_frequency_hz: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CaptureInterval { + #[prost(message, optional, tag="1")] + pub start_time: ::core::option::Option<::prost_types::Timestamp>, + /// if no end_time specified cloud slam will be run using live sensors + #[prost(message, optional, tag="2")] + pub end_time: ::core::option::Option<::prost_types::Timestamp>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -84,8 +121,6 @@ pub struct ListMappingSessionsResponse { pub struct StopMappingSessionRequest { #[prost(string, tag="1")] pub session_id: ::prost::alloc::string::String, - #[prost(bool, tag="2")] - pub save_map: bool, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -95,6 +130,20 @@ pub struct StopMappingSessionResponse { #[prost(string, tag="2")] pub version: ::prost::alloc::string::String, } +// GetMappingSessionMetadataByID + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetMappingSessionMetadataByIdRequest { + #[prost(string, tag="1")] + pub session_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetMappingSessionMetadataByIdResponse { + #[prost(message, optional, tag="1")] + pub session_metadata: ::core::option::Option, +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MappingMetadata { @@ -119,9 +168,9 @@ pub struct MappingMetadata { /// time the cloud run job ended #[prost(message, optional, tag="7")] pub time_cloud_run_job_ended: ::core::option::Option<::prost_types::Timestamp>, - /// “success”, “failed to start”, etc - #[prost(string, tag="8")] - pub end_status: ::prost::alloc::string::String, + /// enums that represent “success”, “failed”, etc + #[prost(enumeration="EndStatus", tag="8")] + pub end_status: i32, /// initially unset #[prost(string, tag="9")] pub cloud_run_job_id: ::prost::alloc::string::String, @@ -137,5 +186,40 @@ pub struct MappingMetadata { /// a robot config for a slam session #[prost(string, tag="13")] pub config: ::prost::alloc::string::String, + /// additional details on the end status if needed, such as errors + #[prost(string, tag="14")] + pub error_msg: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum EndStatus { + Unspecified = 0, + Success = 1, + Timeout = 2, + Fail = 3, +} +impl EndStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + EndStatus::Unspecified => "END_STATUS_UNSPECIFIED", + EndStatus::Success => "END_STATUS_SUCCESS", + EndStatus::Timeout => "END_STATUS_TIMEOUT", + EndStatus::Fail => "END_STATUS_FAIL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "END_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "END_STATUS_SUCCESS" => Some(Self::Success), + "END_STATUS_TIMEOUT" => Some(Self::Timeout), + "END_STATUS_FAIL" => Some(Self::Fail), + _ => None, + } + } } // @@protoc_insertion_point(module) diff --git a/src/gen/viam.app.cloudslam.v1.tonic.rs b/src/gen/viam.app.cloudslam.v1.tonic.rs index 8e94ad0..a292056 100644 --- a/src/gen/viam.app.cloudslam.v1.tonic.rs +++ b/src/gen/viam.app.cloudslam.v1.tonic.rs @@ -236,6 +236,36 @@ pub mod cloud_slam_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn get_mapping_session_metadata_by_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.cloudslam.v1.CloudSLAMService/GetMappingSessionMetadataByID", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.cloudslam.v1.CloudSLAMService", + "GetMappingSessionMetadataByID", + ), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -280,6 +310,13 @@ pub mod cloud_slam_service_server { tonic::Response, tonic::Status, >; + async fn get_mapping_session_metadata_by_id( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct CloudSlamServiceServer { @@ -602,6 +639,57 @@ pub mod cloud_slam_service_server { }; Box::pin(fut) } + "/viam.app.cloudslam.v1.CloudSLAMService/GetMappingSessionMetadataByID" => { + #[allow(non_camel_case_types)] + struct GetMappingSessionMetadataByIDSvc( + pub Arc, + ); + impl< + T: CloudSlamService, + > tonic::server::UnaryService< + super::GetMappingSessionMetadataByIdRequest, + > for GetMappingSessionMetadataByIDSvc { + type Response = super::GetMappingSessionMetadataByIdResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::GetMappingSessionMetadataByIdRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_mapping_session_metadata_by_id(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetMappingSessionMetadataByIDSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { Ok( diff --git a/src/gen/viam.app.data.v1.rs b/src/gen/viam.app.data.v1.rs index d309480..c21fc2c 100644 --- a/src/gen/viam.app.data.v1.rs +++ b/src/gen/viam.app.data.v1.rs @@ -1,4 +1,10 @@ // @generated +/// DataRequest encapsulates the filter for the data, a limit on the maximum results returned, +/// a last string associated with the last returned document, and the sorting order by time. +/// last is returned in the responses TabularDataByFilterResponse and BinaryDataByFilterResponse +/// from the API calls TabularDataByFilter and BinaryDataByFilter, respectively. +/// We can then use the last string from the previous API calls in the subsequent request +/// to get the next set of ordered documents. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DataRequest { @@ -11,6 +17,11 @@ pub struct DataRequest { #[prost(enumeration="Order", tag="4")] pub sort_order: i32, } +/// Filter defines the fields over which we can filter data using a logic AND. +/// For example, if component_type and robot_id are specified, only data from that `robot_id` of +/// type `component_type` is returned. However, we logical OR over the specified tags and bounding +/// box labels, such that if component_type, robot_id, tagA, tagB are specified, +/// we return data from that `robot_id` of type `component_type` with `tagA` or `tagB`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Filter { @@ -38,19 +49,23 @@ pub struct Filter { pub interval: ::core::option::Option, #[prost(message, optional, tag="14")] pub tags_filter: ::core::option::Option, + /// bbox_labels are used to match documents with the specified bounding box labels (using logical OR). #[prost(string, repeated, tag="15")] pub bbox_labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag="16")] + pub dataset_id: ::prost::alloc::string::String, } +/// TagsFilter defines the type of filtering and, if applicable, over which tags to perform a logical OR. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TagsFilter { #[prost(enumeration="TagsFilterType", tag="1")] pub r#type: i32, - /// Tags are used to match documents if `type` is UNSPECIFIED or MATCH_BY_ORG + /// Tags are used to match documents if `type` is UNSPECIFIED or MATCH_BY_OR. #[prost(string, repeated, tag="2")] pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// CaptureMetadata contains information on the settings used for the data capture +/// CaptureMetadata contains information on the settings used for the data capture. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptureMetadata { @@ -79,7 +94,7 @@ pub struct CaptureMetadata { #[prost(string, tag="13")] pub mime_type: ::prost::alloc::string::String, } -/// CaptureInterval describes the start and end time of the capture in this file +/// CaptureInterval describes the start and end time of the capture in this file. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptureInterval { @@ -88,7 +103,7 @@ pub struct CaptureInterval { #[prost(message, optional, tag="2")] pub end: ::core::option::Option<::prost_types::Timestamp>, } -/// TabularDataByFilterRequest requests tabular data based on filter values +/// TabularDataByFilterRequest requests tabular data based on filter values. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TabularDataByFilterRequest { @@ -96,8 +111,10 @@ pub struct TabularDataByFilterRequest { pub data_request: ::core::option::Option, #[prost(bool, tag="2")] pub count_only: bool, + #[prost(bool, tag="3")] + pub include_internal_data: bool, } -/// TabularDataByFilterResponse provides the data and metadata of tabular data +/// TabularDataByFilterResponse provides the data and metadata of tabular data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TabularDataByFilterResponse { @@ -112,6 +129,7 @@ pub struct TabularDataByFilterResponse { #[prost(uint64, tag="5")] pub total_size_bytes: u64, } +/// TabularData contains data and metadata associated with tabular data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TabularData { @@ -124,6 +142,45 @@ pub struct TabularData { #[prost(message, optional, tag="4")] pub time_received: ::core::option::Option<::prost_types::Timestamp>, } +/// TabularDataBySQLRequest requests tabular data using a SQL query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TabularDataBySqlRequest { + #[prost(string, tag="1")] + pub organization_id: ::prost::alloc::string::String, + /// sql_query accepts any valid SQL SELECT statement. Tabular data is held in a database + /// called "sensorData" and a table called readings, so queries should select from "readings" + /// or "sensorData.readings". + #[prost(string, tag="2")] + pub sql_query: ::prost::alloc::string::String, +} +/// TabularDataBySQLResponse provides unified tabular data and metadata, queried with SQL. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TabularDataBySqlResponse { + #[prost(message, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec<::prost_types::Struct>, +} +/// TabularDataByMQLRequest requests tabular data using an MQL query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TabularDataByMqlRequest { + #[prost(string, tag="1")] + pub organization_id: ::prost::alloc::string::String, + /// mql_binary accepts a MongoDB aggregation pipeline as a list of BSON documents, where each + /// document is one stage in the pipeline. The pipeline is run on the "sensorData.readings" + /// namespace, which holds the Viam organization's tabular data. + #[prost(bytes="vec", repeated, tag="3")] + pub mql_binary: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// TabularDataByMQLResponse provides unified tabular data and metadata, queried with MQL. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TabularDataByMqlResponse { + #[prost(message, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec<::prost_types::Struct>, +} +/// BinaryData contains data and metadata associated with binary data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BinaryData { @@ -132,7 +189,7 @@ pub struct BinaryData { #[prost(message, optional, tag="2")] pub metadata: ::core::option::Option, } -/// BinaryDataByFilterRequest requests the data and metadata of binary (image + file) data when a filter is provided +/// BinaryDataByFilterRequest requests the data and metadata of binary (image + file) data when a filter is provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BinaryDataByFilterRequest { @@ -142,8 +199,10 @@ pub struct BinaryDataByFilterRequest { pub include_binary: bool, #[prost(bool, tag="3")] pub count_only: bool, + #[prost(bool, tag="4")] + pub include_internal_data: bool, } -/// BinaryDataByFilterResponse provides the data and metadata of binary (image + file) data when a filter is provided +/// BinaryDataByFilterResponse provides the data and metadata of binary (image + file) data when a filter is provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BinaryDataByFilterResponse { @@ -156,6 +215,7 @@ pub struct BinaryDataByFilterResponse { #[prost(uint64, tag="4")] pub total_size_bytes: u64, } +/// BinaryID is the unique identifier for a file that one can request to be retrieved or modified. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BinaryId { @@ -166,7 +226,7 @@ pub struct BinaryId { #[prost(string, tag="3")] pub location_id: ::prost::alloc::string::String, } -/// BinaryDataByFilterRequest requests the data and metadata of binary (image + file) data by binary ids +/// BinaryDataByFilterRequest requests the data and metadata of binary (image + file) data by binary ids. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BinaryDataByIDsRequest { @@ -174,12 +234,8 @@ pub struct BinaryDataByIDsRequest { pub include_binary: bool, #[prost(message, repeated, tag="3")] pub binary_ids: ::prost::alloc::vec::Vec, - /// Replaced by binary_ids - #[deprecated] - #[prost(string, repeated, tag="1")] - pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// BinaryDataByIDsResponse provides the data and metadata of binary (image + file) data when a filter is provided +/// BinaryDataByIDsResponse provides the data and metadata of binary (image + file) data when a filter is provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BinaryDataByIDsResponse { @@ -213,6 +269,7 @@ pub struct Annotations { #[prost(message, repeated, tag="1")] pub bboxes: ::prost::alloc::vec::Vec, } +/// BinaryMetadata is the metadata associated with binary data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BinaryMetadata { @@ -232,54 +289,58 @@ pub struct BinaryMetadata { pub uri: ::prost::alloc::string::String, #[prost(message, optional, tag="8")] pub annotations: ::core::option::Option, + #[prost(string, repeated, tag="9")] + pub dataset_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// DeleteTabularDataByFilterRequest deletes the data and metadata of tabular data when a filter is provided +/// DeleteTabularDataRequest deletes the data from the organization that is older than `delete_older_than_days`. +/// For example if `delete_older_than_days` is 10, this deletes any data that was captured up to 10 days ago. +/// If it is 0, all existing data is deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteTabularDataByFilterRequest { - #[prost(message, optional, tag="1")] - pub filter: ::core::option::Option, +pub struct DeleteTabularDataRequest { + #[prost(string, tag="1")] + pub organization_id: ::prost::alloc::string::String, + #[prost(uint32, tag="2")] + pub delete_older_than_days: u32, } -/// DeleteBinaryDataByFilterResponse returns the number of tabular datapoints deleted when a filter is provided +/// DeleteBinaryDataResponse returns the number of tabular datapoints deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteTabularDataByFilterResponse { +pub struct DeleteTabularDataResponse { #[prost(uint64, tag="1")] pub deleted_count: u64, } -/// DeleteBinaryDataByFilterRequest deletes the data and metadata of binary data when a filter is provided +/// DeleteBinaryDataByFilterRequest deletes the data and metadata of binary data when a filter is provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteBinaryDataByFilterRequest { #[prost(message, optional, tag="1")] pub filter: ::core::option::Option, + #[prost(bool, tag="2")] + pub include_internal_data: bool, } -/// DeleteBinaryDataByFilterResponse returns the number of binary files deleted when a filter is provided +/// DeleteBinaryDataByFilterResponse returns the number of binary files deleted when a filter is provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteBinaryDataByFilterResponse { #[prost(uint64, tag="1")] pub deleted_count: u64, } -/// DeleteBinaryDataByIDsRequest deletes the data and metadata of binary data when binary ids are provided +/// DeleteBinaryDataByIDsRequest deletes the data and metadata of binary data when binary ids are provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteBinaryDataByIDsRequest { #[prost(message, repeated, tag="2")] pub binary_ids: ::prost::alloc::vec::Vec, - /// Replaced by binary_ids - #[deprecated] - #[prost(string, repeated, tag="1")] - pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// DeleteBinaryDataByIDsResponse returns the number of binary files deleted when binary ids are provided +/// DeleteBinaryDataByIDsResponse returns the number of binary files deleted when binary ids are provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteBinaryDataByIDsResponse { #[prost(uint64, tag="1")] pub deleted_count: u64, } -/// AddTagsToBinaryDataByIDsRequest requests adding all specified tags to each of the files when binary ids are provided +/// AddTagsToBinaryDataByIDsRequest requests adding all specified tags to each of the files when binary ids are provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddTagsToBinaryDataByIDsRequest { @@ -287,16 +348,12 @@ pub struct AddTagsToBinaryDataByIDsRequest { pub binary_ids: ::prost::alloc::vec::Vec, #[prost(string, repeated, tag="2")] pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Replaced by binary_ids - #[deprecated] - #[prost(string, repeated, tag="1")] - pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddTagsToBinaryDataByIDsResponse { } -/// AddTagsToBinaryDataByFilterRequest requests adding all specified tags to each of the files when a filter is provided +/// AddTagsToBinaryDataByFilterRequest requests adding all specified tags to each of the files when a filter is provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddTagsToBinaryDataByFilterRequest { @@ -309,7 +366,7 @@ pub struct AddTagsToBinaryDataByFilterRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddTagsToBinaryDataByFilterResponse { } -/// RemoveTagsFromBinaryDataByIDsRequest requests removing the given tags value from each file when binary ids are provided +/// RemoveTagsFromBinaryDataByIDsRequest requests removing the given tags value from each file when binary ids are provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoveTagsFromBinaryDataByIDsRequest { @@ -317,10 +374,6 @@ pub struct RemoveTagsFromBinaryDataByIDsRequest { pub binary_ids: ::prost::alloc::vec::Vec, #[prost(string, repeated, tag="2")] pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Replaced by binary_ids - #[deprecated] - #[prost(string, repeated, tag="1")] - pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// RemoveTagsFromBinaryDataByIDsResponse returns the number of binary files which had tags removed #[allow(clippy::derive_partial_eq_without_eq)] @@ -329,7 +382,7 @@ pub struct RemoveTagsFromBinaryDataByIDsResponse { #[prost(uint64, tag="1")] pub deleted_count: u64, } -/// RemoveTagsFromBinaryDataByFilterRequest requests removing the given tags value from each file when a filter is provided +/// RemoveTagsFromBinaryDataByFilterRequest requests removing the given tags value from each file when a filter is provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoveTagsFromBinaryDataByFilterRequest { @@ -338,27 +391,29 @@ pub struct RemoveTagsFromBinaryDataByFilterRequest { #[prost(string, repeated, tag="2")] pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -/// RemoveTagsFromBinaryDataByFilterResponse returns the number of binary files which had tags removed +/// RemoveTagsFromBinaryDataByFilterResponse returns the number of binary files which had tags removed. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoveTagsFromBinaryDataByFilterResponse { #[prost(uint64, tag="1")] pub deleted_count: u64, } -/// TagsByFilterRequest requests the unique tags from data based on given filter +/// TagsByFilterRequest requests the unique tags from data based on given filter. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TagsByFilterRequest { #[prost(message, optional, tag="1")] pub filter: ::core::option::Option, } -/// TagsByFilterResponse returns the unique tags from data based on given filter +/// TagsByFilterResponse returns the unique tags from data based on given filter. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TagsByFilterResponse { #[prost(string, repeated, tag="1")] pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// AddBoundingBoxToImageByIDRequest specifies the binary ID to which a bounding box +/// with the associated label and position in normalized coordinates will be added. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddBoundingBoxToImageByIdRequest { @@ -374,17 +429,15 @@ pub struct AddBoundingBoxToImageByIdRequest { pub x_max_normalized: f64, #[prost(double, tag="6")] pub y_max_normalized: f64, - /// Replaced by binary_id - #[deprecated] - #[prost(string, tag="1")] - pub file_id: ::prost::alloc::string::String, } +/// AddBoundingBoxToImageByIDResponse returns the bounding box ID of the successfully added bounding box. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddBoundingBoxToImageByIdResponse { #[prost(string, tag="1")] pub bbox_id: ::prost::alloc::string::String, } +/// RemoveBoundingBoxFromImageByIDRequest removes the bounding box with specified bbox ID for the file represented by the binary id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoveBoundingBoxFromImageByIdRequest { @@ -392,27 +445,87 @@ pub struct RemoveBoundingBoxFromImageByIdRequest { pub binary_id: ::core::option::Option, #[prost(string, tag="2")] pub bbox_id: ::prost::alloc::string::String, - /// Replaced by binary_id - #[deprecated] - #[prost(string, tag="1")] - pub file_id: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoveBoundingBoxFromImageByIdResponse { } +/// BoundingBoxLabelsByFilterRequest requests all the labels of the bounding boxes from files from a given filter. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BoundingBoxLabelsByFilterRequest { #[prost(message, optional, tag="1")] pub filter: ::core::option::Option, } +/// BoundingBoxLabelsByFilterRequest returns all the labels of the bounding boxes from files from a given filter. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BoundingBoxLabelsByFilterResponse { #[prost(string, repeated, tag="1")] pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// ConfigureDatabaseUserRequest accepts a Viam organization ID and a password for the database user +/// being configured. Viam uses gRPC over TLS, so the entire request will be encrypted while in +/// flight, including the password. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigureDatabaseUserRequest { + #[prost(string, tag="1")] + pub organization_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub password: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigureDatabaseUserResponse { +} +/// GetDatabaseConnectionRequest requests the database connection hostname. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDatabaseConnectionRequest { + #[prost(string, tag="1")] + pub organization_id: ::prost::alloc::string::String, +} +/// GetDatabaseConnectionResponse returns the database connection hostname endpoint. It also returns +/// a URI that can be used to connect to the database instance through MongoDB clients, as well as +/// information on whether the Viam organization has a database user configured. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDatabaseConnectionResponse { + #[prost(string, tag="1")] + pub hostname: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub mongodb_uri: ::prost::alloc::string::String, + #[prost(bool, tag="3")] + pub has_database_user: bool, +} +/// AddBinaryDataToDatasetByIDsRequest adds the binary data with the given binary IDs to a dataset with dataset_id. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddBinaryDataToDatasetByIDsRequest { + #[prost(message, repeated, tag="1")] + pub binary_ids: ::prost::alloc::vec::Vec, + #[prost(string, tag="2")] + pub dataset_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddBinaryDataToDatasetByIDsResponse { +} +/// RemoveBinaryDataFromDatasetByIDsRequest removes the specified binary IDs from a dataset with dataset_id. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveBinaryDataFromDatasetByIDsRequest { + #[prost(message, repeated, tag="1")] + pub binary_ids: ::prost::alloc::vec::Vec, + #[prost(string, tag="2")] + pub dataset_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveBinaryDataFromDatasetByIDsResponse { +} +/// Order specifies the order in which data is returned. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum Order { @@ -442,16 +555,16 @@ impl Order { } } } -/// TagsFilterType specifies how data can be filtered based on tags +/// TagsFilterType specifies how data can be filtered based on tags. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum TagsFilterType { Unspecified = 0, - /// TAGS_FILTER_TYPE_MATCH_BY_OR specifies documents matched (using logical OR) on the tags field in the TagsFilter + /// TAGS_FILTER_TYPE_MATCH_BY_OR specifies documents matched (using logical OR) on the tags field in the TagsFilter. MatchByOr = 1, - /// TAGS_FILTER_TYPE_TAGGED specifies that all tagged documents should be returned + /// TAGS_FILTER_TYPE_TAGGED specifies that all tagged documents should be returned. Tagged = 2, - /// TAGS_FILTER_TYPE_UNTAGGED specifes that all untagged documents should be returned + /// TAGS_FILTER_TYPE_UNTAGGED specifes that all untagged documents should be returned. Untagged = 3, } impl TagsFilterType { diff --git a/src/gen/viam.app.data.v1.tonic.rs b/src/gen/viam.app.data.v1.tonic.rs index f79a4dc..1dc8215 100644 --- a/src/gen/viam.app.data.v1.tonic.rs +++ b/src/gen/viam.app.data.v1.tonic.rs @@ -114,6 +114,60 @@ pub mod data_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn tabular_data_by_sql( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.data.v1.DataService/TabularDataBySQL", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("viam.app.data.v1.DataService", "TabularDataBySQL"), + ); + self.inner.unary(req, path, codec).await + } + pub async fn tabular_data_by_mql( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.data.v1.DataService/TabularDataByMQL", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("viam.app.data.v1.DataService", "TabularDataByMQL"), + ); + self.inner.unary(req, path, codec).await + } pub async fn binary_data_by_filter( &mut self, request: impl tonic::IntoRequest, @@ -168,11 +222,11 @@ pub mod data_service_client { ); self.inner.unary(req, path, codec).await } - pub async fn delete_tabular_data_by_filter( + pub async fn delete_tabular_data( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -186,15 +240,12 @@ pub mod data_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/viam.app.data.v1.DataService/DeleteTabularDataByFilter", + "/viam.app.data.v1.DataService/DeleteTabularData", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new( - "viam.app.data.v1.DataService", - "DeleteTabularDataByFilter", - ), + GrpcMethod::new("viam.app.data.v1.DataService", "DeleteTabularData"), ); self.inner.unary(req, path, codec).await } @@ -497,6 +548,128 @@ pub mod data_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn get_database_connection( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.data.v1.DataService/GetDatabaseConnection", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.data.v1.DataService", + "GetDatabaseConnection", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn configure_database_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.data.v1.DataService/ConfigureDatabaseUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.data.v1.DataService", + "ConfigureDatabaseUser", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn add_binary_data_to_dataset_by_i_ds( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.data.v1.DataService/AddBinaryDataToDatasetByIDs", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.data.v1.DataService", + "AddBinaryDataToDatasetByIDs", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn remove_binary_data_from_dataset_by_i_ds( + &mut self, + request: impl tonic::IntoRequest< + super::RemoveBinaryDataFromDatasetByIDsRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.data.v1.DataService/RemoveBinaryDataFromDatasetByIDs", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.data.v1.DataService", + "RemoveBinaryDataFromDatasetByIDs", + ), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -513,6 +686,20 @@ pub mod data_service_server { tonic::Response, tonic::Status, >; + async fn tabular_data_by_sql( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn tabular_data_by_mql( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn binary_data_by_filter( &self, request: tonic::Request, @@ -527,11 +714,11 @@ pub mod data_service_server { tonic::Response, tonic::Status, >; - async fn delete_tabular_data_by_filter( + async fn delete_tabular_data( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; async fn delete_binary_data_by_filter( @@ -604,6 +791,34 @@ pub mod data_service_server { tonic::Response, tonic::Status, >; + async fn get_database_connection( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn configure_database_user( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn add_binary_data_to_dataset_by_i_ds( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn remove_binary_data_from_dataset_by_i_ds( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct DataServiceServer { @@ -730,6 +945,98 @@ pub mod data_service_server { }; Box::pin(fut) } + "/viam.app.data.v1.DataService/TabularDataBySQL" => { + #[allow(non_camel_case_types)] + struct TabularDataBySQLSvc(pub Arc); + impl< + T: DataService, + > tonic::server::UnaryService + for TabularDataBySQLSvc { + type Response = super::TabularDataBySqlResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).tabular_data_by_sql(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TabularDataBySQLSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.data.v1.DataService/TabularDataByMQL" => { + #[allow(non_camel_case_types)] + struct TabularDataByMQLSvc(pub Arc); + impl< + T: DataService, + > tonic::server::UnaryService + for TabularDataByMQLSvc { + type Response = super::TabularDataByMqlResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).tabular_data_by_mql(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TabularDataByMQLSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/viam.app.data.v1.DataService/BinaryDataByFilter" => { #[allow(non_camel_case_types)] struct BinaryDataByFilterSvc(pub Arc); @@ -822,28 +1129,25 @@ pub mod data_service_server { }; Box::pin(fut) } - "/viam.app.data.v1.DataService/DeleteTabularDataByFilter" => { + "/viam.app.data.v1.DataService/DeleteTabularData" => { #[allow(non_camel_case_types)] - struct DeleteTabularDataByFilterSvc(pub Arc); + struct DeleteTabularDataSvc(pub Arc); impl< T: DataService, - > tonic::server::UnaryService< - super::DeleteTabularDataByFilterRequest, - > for DeleteTabularDataByFilterSvc { - type Response = super::DeleteTabularDataByFilterResponse; + > tonic::server::UnaryService + for DeleteTabularDataSvc { + type Response = super::DeleteTabularDataResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::DeleteTabularDataByFilterRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).delete_tabular_data_by_filter(request).await + (*inner).delete_tabular_data(request).await }; Box::pin(fut) } @@ -855,7 +1159,7 @@ pub mod data_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteTabularDataByFilterSvc(inner); + let method = DeleteTabularDataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1357,6 +1661,200 @@ pub mod data_service_server { }; Box::pin(fut) } + "/viam.app.data.v1.DataService/GetDatabaseConnection" => { + #[allow(non_camel_case_types)] + struct GetDatabaseConnectionSvc(pub Arc); + impl< + T: DataService, + > tonic::server::UnaryService + for GetDatabaseConnectionSvc { + type Response = super::GetDatabaseConnectionResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_database_connection(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetDatabaseConnectionSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.data.v1.DataService/ConfigureDatabaseUser" => { + #[allow(non_camel_case_types)] + struct ConfigureDatabaseUserSvc(pub Arc); + impl< + T: DataService, + > tonic::server::UnaryService + for ConfigureDatabaseUserSvc { + type Response = super::ConfigureDatabaseUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).configure_database_user(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ConfigureDatabaseUserSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.data.v1.DataService/AddBinaryDataToDatasetByIDs" => { + #[allow(non_camel_case_types)] + struct AddBinaryDataToDatasetByIDsSvc(pub Arc); + impl< + T: DataService, + > tonic::server::UnaryService< + super::AddBinaryDataToDatasetByIDsRequest, + > for AddBinaryDataToDatasetByIDsSvc { + type Response = super::AddBinaryDataToDatasetByIDsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::AddBinaryDataToDatasetByIDsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).add_binary_data_to_dataset_by_i_ds(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddBinaryDataToDatasetByIDsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.data.v1.DataService/RemoveBinaryDataFromDatasetByIDs" => { + #[allow(non_camel_case_types)] + struct RemoveBinaryDataFromDatasetByIDsSvc( + pub Arc, + ); + impl< + T: DataService, + > tonic::server::UnaryService< + super::RemoveBinaryDataFromDatasetByIDsRequest, + > for RemoveBinaryDataFromDatasetByIDsSvc { + type Response = super::RemoveBinaryDataFromDatasetByIDsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::RemoveBinaryDataFromDatasetByIDsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner) + .remove_binary_data_from_dataset_by_i_ds(request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RemoveBinaryDataFromDatasetByIDsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { Ok( diff --git a/src/gen/viam.app.dataset.v1.rs b/src/gen/viam.app.dataset.v1.rs new file mode 100644 index 0000000..0426556 --- /dev/null +++ b/src/gen/viam.app.dataset.v1.rs @@ -0,0 +1,83 @@ +// @generated +/// Dataset stores the metadata of a dataset. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Dataset { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub organization_id: ::prost::alloc::string::String, + #[prost(message, optional, tag="4")] + pub time_created: ::core::option::Option<::prost_types::Timestamp>, +} +/// CreateDatasetRequest defines the name and organization ID of a dataset. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateDatasetRequest { + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub organization_id: ::prost::alloc::string::String, +} +/// CreateDatasetResponse returns the dataset ID of the created dataset. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateDatasetResponse { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, +} +/// DeleteDatasetRequest deletes the dataset specified by the dataset ID. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteDatasetRequest { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteDatasetResponse { +} +/// RenameDatasetRequest applies the new name to the dataset specified by the dataset ID. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RenameDatasetRequest { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RenameDatasetResponse { +} +/// ListDatasetsByOrganizationIDRequest requests all of the datasets for an organization. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListDatasetsByOrganizationIdRequest { + #[prost(string, tag="1")] + pub organization_id: ::prost::alloc::string::String, +} +/// ListDatasetsByOrganizationIDResponse returns all the dataset metadata for the organization. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListDatasetsByOrganizationIdResponse { + #[prost(message, repeated, tag="1")] + pub datasets: ::prost::alloc::vec::Vec, +} +/// ListDatasetsByIDsRequest requests all of the datasets by their dataset IDs. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListDatasetsByIDsRequest { + #[prost(string, repeated, tag="1")] + pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// ListDatasetsByIDsResponse returns all the dataset metadata for the associated dataset IDs. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListDatasetsByIDsResponse { + #[prost(message, repeated, tag="1")] + pub datasets: ::prost::alloc::vec::Vec, +} +// @@protoc_insertion_point(module) diff --git a/src/gen/viam.app.dataset.v1.tonic.rs b/src/gen/viam.app.dataset.v1.tonic.rs new file mode 100644 index 0000000..508edae --- /dev/null +++ b/src/gen/viam.app.dataset.v1.tonic.rs @@ -0,0 +1,636 @@ +// @generated +/// Generated client implementations. +pub mod dataset_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct DatasetServiceClient { + inner: tonic::client::Grpc, + } + impl DatasetServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl DatasetServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> DatasetServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + DatasetServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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 create_dataset( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.dataset.v1.DatasetService/CreateDataset", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.dataset.v1.DatasetService", + "CreateDataset", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn delete_dataset( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.dataset.v1.DatasetService/DeleteDataset", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.dataset.v1.DatasetService", + "DeleteDataset", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn rename_dataset( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.dataset.v1.DatasetService/RenameDataset", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.dataset.v1.DatasetService", + "RenameDataset", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn list_datasets_by_organization_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.dataset.v1.DatasetService/ListDatasetsByOrganizationID", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.dataset.v1.DatasetService", + "ListDatasetsByOrganizationID", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn list_datasets_by_i_ds( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.dataset.v1.DatasetService/ListDatasetsByIDs", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.dataset.v1.DatasetService", + "ListDatasetsByIDs", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod dataset_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with DatasetServiceServer. + #[async_trait] + pub trait DatasetService: Send + Sync + 'static { + async fn create_dataset( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn delete_dataset( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn rename_dataset( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn list_datasets_by_organization_id( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn list_datasets_by_i_ds( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct DatasetServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl DatasetServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for DatasetServiceServer + where + T: DatasetService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/viam.app.dataset.v1.DatasetService/CreateDataset" => { + #[allow(non_camel_case_types)] + struct CreateDatasetSvc(pub Arc); + impl< + T: DatasetService, + > tonic::server::UnaryService + for CreateDatasetSvc { + type Response = super::CreateDatasetResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).create_dataset(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateDatasetSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.dataset.v1.DatasetService/DeleteDataset" => { + #[allow(non_camel_case_types)] + struct DeleteDatasetSvc(pub Arc); + impl< + T: DatasetService, + > tonic::server::UnaryService + for DeleteDatasetSvc { + type Response = super::DeleteDatasetResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).delete_dataset(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteDatasetSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.dataset.v1.DatasetService/RenameDataset" => { + #[allow(non_camel_case_types)] + struct RenameDatasetSvc(pub Arc); + impl< + T: DatasetService, + > tonic::server::UnaryService + for RenameDatasetSvc { + type Response = super::RenameDatasetResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).rename_dataset(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RenameDatasetSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.dataset.v1.DatasetService/ListDatasetsByOrganizationID" => { + #[allow(non_camel_case_types)] + struct ListDatasetsByOrganizationIDSvc( + pub Arc, + ); + impl< + T: DatasetService, + > tonic::server::UnaryService< + super::ListDatasetsByOrganizationIdRequest, + > for ListDatasetsByOrganizationIDSvc { + type Response = super::ListDatasetsByOrganizationIdResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::ListDatasetsByOrganizationIdRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).list_datasets_by_organization_id(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListDatasetsByOrganizationIDSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.dataset.v1.DatasetService/ListDatasetsByIDs" => { + #[allow(non_camel_case_types)] + struct ListDatasetsByIDsSvc(pub Arc); + impl< + T: DatasetService, + > tonic::server::UnaryService + for ListDatasetsByIDsSvc { + type Response = super::ListDatasetsByIDsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).list_datasets_by_i_ds(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListDatasetsByIDsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for DatasetServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for DatasetServiceServer { + const NAME: &'static str = "viam.app.dataset.v1.DatasetService"; + } +} diff --git a/src/gen/viam.app.datasync.v1.rs b/src/gen/viam.app.datasync.v1.rs index 778e471..c091891 100644 --- a/src/gen/viam.app.datasync.v1.rs +++ b/src/gen/viam.app.datasync.v1.rs @@ -1,4 +1,5 @@ // @generated +/// DataCaptureUploadRequest requests to upload the contents and metadata for tabular data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DataCaptureUploadRequest { @@ -7,12 +8,15 @@ pub struct DataCaptureUploadRequest { #[prost(message, repeated, tag="2")] pub sensor_contents: ::prost::alloc::vec::Vec, } +/// DataCaptureUploadResponse returns the file id of the uploaded contents and metadata for tabular data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DataCaptureUploadResponse { #[prost(string, tag="1")] pub file_id: ::prost::alloc::string::String, } +/// FileUploadRequest requests to upload the contents and metadata for binary (image + file) data. +/// The first packet must be the UploadMetadata associated with the binary data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileUploadRequest { @@ -30,12 +34,40 @@ pub mod file_upload_request { FileContents(super::FileData), } } +/// FileUploadResponse returns the file id of the uploaded contents and metadata for binary (image + file) data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileUploadResponse { #[prost(string, tag="1")] pub file_id: ::prost::alloc::string::String, } +/// StreamingDataCaptureUploadRequest requests to upload the contents and metadata for streaming binary (image + file) data. +/// The first packet must be the DataCaptureUploadMetadata associated with the data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamingDataCaptureUploadRequest { + #[prost(oneof="streaming_data_capture_upload_request::UploadPacket", tags="1, 2")] + pub upload_packet: ::core::option::Option, +} +/// Nested message and enum types in `StreamingDataCaptureUploadRequest`. +pub mod streaming_data_capture_upload_request { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum UploadPacket { + #[prost(message, tag="1")] + Metadata(super::DataCaptureUploadMetadata), + #[prost(bytes, tag="2")] + Data(::prost::alloc::vec::Vec), + } +} +/// StreamingDataCaptureUploadResponse returns the file id of the uploaded contents and metadata for streaming binary (image + file) data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamingDataCaptureUploadResponse { + #[prost(string, tag="1")] + pub file_id: ::prost::alloc::string::String, +} +/// SensorMetadata contains the time the sensor data was requested and was received. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SensorMetadata { @@ -44,6 +76,7 @@ pub struct SensorMetadata { #[prost(message, optional, tag="2")] pub time_received: ::core::option::Option<::prost_types::Timestamp>, } +/// SensorData contains the contents and metadata for tabular data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SensorData { @@ -63,12 +96,14 @@ pub mod sensor_data { Binary(::prost::alloc::vec::Vec), } } +/// FileData contains the contents of binary (image + file) data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileData { #[prost(bytes="vec", tag="1")] pub data: ::prost::alloc::vec::Vec, } +/// UploadMetadata contains the metadata for binary (image + file) data. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UploadMetadata { @@ -91,6 +126,7 @@ pub struct UploadMetadata { #[prost(string, repeated, tag="10")] pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// CaptureInterval specifies the start and end times of the data capture. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptureInterval { @@ -99,6 +135,7 @@ pub struct CaptureInterval { #[prost(message, optional, tag="2")] pub end: ::core::option::Option<::prost_types::Timestamp>, } +/// DataCaptureMetadata contains the metadata for data captured by collectors. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DataCaptureMetadata { @@ -117,6 +154,16 @@ pub struct DataCaptureMetadata { #[prost(string, repeated, tag="8")] pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// DataCaptureUploadMetadata contains the metadata for streaming binary (image + file) data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DataCaptureUploadMetadata { + #[prost(message, optional, tag="1")] + pub upload_metadata: ::core::option::Option, + #[prost(message, optional, tag="2")] + pub sensor_metadata: ::core::option::Option, +} +/// DataType specifies the type of data uploaded. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum DataType { diff --git a/src/gen/viam.app.datasync.v1.tonic.rs b/src/gen/viam.app.datasync.v1.tonic.rs index 0791c99..bf8b75b 100644 --- a/src/gen/viam.app.datasync.v1.tonic.rs +++ b/src/gen/viam.app.datasync.v1.tonic.rs @@ -141,6 +141,38 @@ pub mod data_sync_service_client { ); self.inner.client_streaming(req, path, codec).await } + pub async fn streaming_data_capture_upload( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::StreamingDataCaptureUploadRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.datasync.v1.DataSyncService/StreamingDataCaptureUpload", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.datasync.v1.DataSyncService", + "StreamingDataCaptureUpload", + ), + ); + self.inner.client_streaming(req, path, codec).await + } } } /// Generated server implementations. @@ -164,6 +196,15 @@ pub mod data_sync_service_server { tonic::Response, tonic::Status, >; + async fn streaming_data_capture_upload( + &self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct DataSyncServiceServer { @@ -336,6 +377,55 @@ pub mod data_sync_service_server { }; Box::pin(fut) } + "/viam.app.datasync.v1.DataSyncService/StreamingDataCaptureUpload" => { + #[allow(non_camel_case_types)] + struct StreamingDataCaptureUploadSvc(pub Arc); + impl< + T: DataSyncService, + > tonic::server::ClientStreamingService< + super::StreamingDataCaptureUploadRequest, + > for StreamingDataCaptureUploadSvc { + type Response = super::StreamingDataCaptureUploadResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).streaming_data_capture_upload(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = StreamingDataCaptureUploadSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.client_streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { Ok( diff --git a/src/gen/viam.app.mltraining.v1.rs b/src/gen/viam.app.mltraining.v1.rs index 378210f..cd12927 100644 --- a/src/gen/viam.app.mltraining.v1.rs +++ b/src/gen/viam.app.mltraining.v1.rs @@ -2,8 +2,8 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubmitTrainingJobRequest { - #[prost(message, optional, tag="1")] - pub filter: ::core::option::Option, + #[prost(string, tag="7")] + pub dataset_id: ::prost::alloc::string::String, #[prost(string, tag="2")] pub organization_id: ::prost::alloc::string::String, #[prost(string, tag="3")] @@ -52,20 +52,34 @@ pub struct ListTrainingJobsResponse { pub struct TrainingJobMetadata { #[prost(message, optional, tag="1")] pub request: ::core::option::Option, + #[prost(string, tag="7")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag="11")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(string, tag="12")] + pub organization_id: ::prost::alloc::string::String, + #[prost(string, tag="13")] + pub model_name: ::prost::alloc::string::String, + #[prost(string, tag="14")] + pub model_version: ::prost::alloc::string::String, + #[prost(enumeration="ModelType", tag="15")] + pub model_type: i32, #[prost(enumeration="TrainingStatus", tag="2")] pub status: i32, + #[prost(message, optional, tag="8")] + pub error_status: ::core::option::Option, #[prost(message, optional, tag="3")] pub created_on: ::core::option::Option<::prost_types::Timestamp>, #[prost(message, optional, tag="4")] pub last_modified: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, optional, tag="9")] + pub training_started: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, optional, tag="10")] + pub training_ended: ::core::option::Option<::prost_types::Timestamp>, #[prost(string, tag="5")] pub synced_model_id: ::prost::alloc::string::String, - #[prost(string, tag="6")] - pub user_email: ::prost::alloc::string::String, - #[prost(string, tag="7")] - pub id: ::prost::alloc::string::String, - #[prost(message, optional, tag="8")] - pub error_status: ::core::option::Option, + #[prost(string, repeated, tag="16")] + pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -77,6 +91,16 @@ pub struct CancelTrainingJobRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelTrainingJobResponse { } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteCompletedTrainingJobRequest { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteCompletedTrainingJobResponse { +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ModelType { @@ -111,6 +135,41 @@ impl ModelType { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] +pub enum ModelFramework { + Unspecified = 0, + Tflite = 1, + Tensorflow = 2, + Pytorch = 3, + Onnx = 4, +} +impl ModelFramework { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ModelFramework::Unspecified => "MODEL_FRAMEWORK_UNSPECIFIED", + ModelFramework::Tflite => "MODEL_FRAMEWORK_TFLITE", + ModelFramework::Tensorflow => "MODEL_FRAMEWORK_TENSORFLOW", + ModelFramework::Pytorch => "MODEL_FRAMEWORK_PYTORCH", + ModelFramework::Onnx => "MODEL_FRAMEWORK_ONNX", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MODEL_FRAMEWORK_UNSPECIFIED" => Some(Self::Unspecified), + "MODEL_FRAMEWORK_TFLITE" => Some(Self::Tflite), + "MODEL_FRAMEWORK_TENSORFLOW" => Some(Self::Tensorflow), + "MODEL_FRAMEWORK_PYTORCH" => Some(Self::Pytorch), + "MODEL_FRAMEWORK_ONNX" => Some(Self::Onnx), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] pub enum TrainingStatus { Unspecified = 0, Pending = 1, diff --git a/src/gen/viam.app.mltraining.v1.tonic.rs b/src/gen/viam.app.mltraining.v1.tonic.rs index 89c7213..b767759 100644 --- a/src/gen/viam.app.mltraining.v1.tonic.rs +++ b/src/gen/viam.app.mltraining.v1.tonic.rs @@ -204,6 +204,36 @@ pub mod ml_training_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn delete_completed_training_job( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.mltraining.v1.MLTrainingService/DeleteCompletedTrainingJob", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.mltraining.v1.MLTrainingService", + "DeleteCompletedTrainingJob", + ), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -241,6 +271,13 @@ pub mod ml_training_service_server { tonic::Response, tonic::Status, >; + async fn delete_completed_training_job( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct MlTrainingServiceServer { @@ -505,6 +542,57 @@ pub mod ml_training_service_server { }; Box::pin(fut) } + "/viam.app.mltraining.v1.MLTrainingService/DeleteCompletedTrainingJob" => { + #[allow(non_camel_case_types)] + struct DeleteCompletedTrainingJobSvc( + pub Arc, + ); + impl< + T: MlTrainingService, + > tonic::server::UnaryService< + super::DeleteCompletedTrainingJobRequest, + > for DeleteCompletedTrainingJobSvc { + type Response = super::DeleteCompletedTrainingJobResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::DeleteCompletedTrainingJobRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).delete_completed_training_job(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteCompletedTrainingJobSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { Ok( diff --git a/src/gen/viam.app.packages.v1.rs b/src/gen/viam.app.packages.v1.rs index 4b795fc..573906a 100644 --- a/src/gen/viam.app.packages.v1.rs +++ b/src/gen/viam.app.packages.v1.rs @@ -60,6 +60,8 @@ pub struct DeletePackageRequest { pub id: ::prost::alloc::string::String, #[prost(string, tag="2")] pub version: ::prost::alloc::string::String, + #[prost(enumeration="PackageType", tag="3")] + pub r#type: i32, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -127,6 +129,7 @@ pub enum PackageType { MlModel = 2, Module = 3, SlamMap = 4, + MlTraining = 5, } impl PackageType { /// String value of the enum field names used in the ProtoBuf definition. @@ -140,6 +143,7 @@ impl PackageType { PackageType::MlModel => "PACKAGE_TYPE_ML_MODEL", PackageType::Module => "PACKAGE_TYPE_MODULE", PackageType::SlamMap => "PACKAGE_TYPE_SLAM_MAP", + PackageType::MlTraining => "PACKAGE_TYPE_ML_TRAINING", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -150,6 +154,7 @@ impl PackageType { "PACKAGE_TYPE_ML_MODEL" => Some(Self::MlModel), "PACKAGE_TYPE_MODULE" => Some(Self::Module), "PACKAGE_TYPE_SLAM_MAP" => Some(Self::SlamMap), + "PACKAGE_TYPE_ML_TRAINING" => Some(Self::MlTraining), _ => None, } } diff --git a/src/gen/viam.app.v1.rs b/src/gen/viam.app.v1.rs index ae5c526..91b328f 100644 --- a/src/gen/viam.app.v1.rs +++ b/src/gen/viam.app.v1.rs @@ -80,6 +80,8 @@ pub struct Organization { /// associated with this org will be stored in this region. #[prost(string, tag="5")] pub default_region: ::prost::alloc::string::String, + #[prost(string, optional, tag="6")] + pub cid: ::core::option::Option<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -90,6 +92,8 @@ pub struct OrganizationMember { pub emails: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(message, optional, tag="3")] pub date_added: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, optional, tag="4")] + pub last_login: ::core::option::Option<::prost_types::Timestamp>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -106,8 +110,8 @@ pub struct OrganizationInvite { pub email: ::prost::alloc::string::String, #[prost(message, optional, tag="3")] pub created_on: ::core::option::Option<::prost_types::Timestamp>, - #[prost(int64, tag="4")] - pub robot_count: i64, + #[prost(message, repeated, tag="4")] + pub authorizations: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -157,6 +161,8 @@ pub struct UpdateOrganizationRequest { /// The new GCS region to associate the org with. #[prost(string, optional, tag="4")] pub region: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="5")] + pub cid: ::core::option::Option<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -199,6 +205,10 @@ pub struct CreateOrganizationInviteRequest { pub email: ::prost::alloc::string::String, #[prost(message, repeated, tag="3")] pub authorizations: ::prost::alloc::vec::Vec, + /// Set to true (the default) to send an email to the recipient of an invite. The user must accept the email to be added to the associated authorizations. + /// When set to false, the user automatically receives the associated authorization on the next login of the user with the associated email address. + #[prost(bool, optional, tag="4")] + pub send_email_invite: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -265,6 +275,18 @@ pub struct DeleteOrganizationMemberResponse { // Location // +/// Used for rendering an organization's information on the frontend (limited +/// to id, name, or both). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct OrganizationIdentity { + /// Organization ID. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// Organization name. + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LocationOrganization { @@ -445,6 +467,18 @@ pub struct DeleteLocationResponse { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetOrganizationsWithAccessToLocationRequest { + #[prost(string, tag="1")] + pub location_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetOrganizationsWithAccessToLocationResponse { + #[prost(message, repeated, tag="1")] + pub organization_identities: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ListLocationsRequest { /// Organization ID under which to list all locations. #[prost(string, tag="1")] @@ -589,38 +623,23 @@ pub struct GetRobotPartResponse { pub struct GetRobotPartLogsRequest { #[prost(string, tag="1")] pub id: ::prost::alloc::string::String, + /// TODO(): Remove this field + #[deprecated] #[prost(bool, tag="2")] pub errors_only: bool, #[prost(string, optional, tag="3")] pub filter: ::core::option::Option<::prost::alloc::string::String>, #[prost(string, optional, tag="4")] pub page_token: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LogEntry { - #[prost(string, tag="1")] - pub host: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub level: ::prost::alloc::string::String, - #[prost(message, optional, tag="3")] - pub time: ::core::option::Option<::prost_types::Timestamp>, - #[prost(string, tag="4")] - pub logger_name: ::prost::alloc::string::String, - #[prost(string, tag="5")] - pub message: ::prost::alloc::string::String, - #[prost(message, optional, tag="6")] - pub caller: ::core::option::Option<::prost_types::Struct>, - #[prost(string, tag="7")] - pub stack: ::prost::alloc::string::String, - #[prost(message, repeated, tag="8")] - pub fields: ::prost::alloc::vec::Vec<::prost_types::Struct>, + /// logs of all levels are returned when the levels field is empty + #[prost(string, repeated, tag="5")] + pub levels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetRobotPartLogsResponse { #[prost(message, repeated, tag="1")] - pub logs: ::prost::alloc::vec::Vec, + pub logs: ::prost::alloc::vec::Vec, #[prost(string, tag="2")] pub next_page_token: ::prost::alloc::string::String, } @@ -638,7 +657,7 @@ pub struct TailRobotPartLogsRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct TailRobotPartLogsResponse { #[prost(message, repeated, tag="1")] - pub logs: ::prost::alloc::vec::Vec, + pub logs: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -690,6 +709,30 @@ pub struct DeleteRobotPartRequest { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetRobotApiKeysRequest { + #[prost(string, tag="1")] + pub robot_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ApiKey { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag="4")] + pub created_on: ::core::option::Option<::prost_types::Timestamp>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetRobotApiKeysResponse { + #[prost(message, repeated, tag="1")] + pub api_keys: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteRobotPartResponse { } #[allow(clippy::derive_partial_eq_without_eq)] @@ -902,6 +945,8 @@ pub struct Authorization { pub identity_id: ::prost::alloc::string::String, #[prost(string, tag="6")] pub organization_id: ::prost::alloc::string::String, + #[prost(string, tag="7")] + pub identity_type: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -925,6 +970,18 @@ pub struct RemoveRoleResponse { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct ChangeRoleRequest { + #[prost(message, optional, tag="1")] + pub old_authorization: ::core::option::Option, + #[prost(message, optional, tag="2")] + pub new_authorization: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ChangeRoleResponse { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ListAuthorizationsRequest { #[prost(string, tag="1")] pub organization_id: ::prost::alloc::string::String, @@ -960,6 +1017,203 @@ pub struct CheckPermissionsResponse { #[prost(message, repeated, tag="1")] pub authorized_permissions: ::prost::alloc::vec::Vec, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleVersion { + /// The semver string that represents the major/minor/patch version of the module + #[prost(string, tag="1")] + pub version: ::prost::alloc::string::String, + /// The uploads that are available for this module version + #[prost(message, repeated, tag="2")] + pub files: ::prost::alloc::vec::Vec, + /// The models that this verion of the module provides + #[prost(message, repeated, tag="3")] + pub models: ::prost::alloc::vec::Vec, + /// The entrypoint for this version of the module + #[prost(string, tag="4")] + pub entrypoint: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleMetadata { + /// A list of models that are available in the module + #[prost(message, repeated, tag="1")] + pub models: ::prost::alloc::vec::Vec, + /// A list of versions of the module that are available + /// When this is returned from the backend, the versions are sorted in ascending order by the semver version + #[prost(message, repeated, tag="2")] + pub versions: ::prost::alloc::vec::Vec, + /// The executable to run to start the module program + #[prost(string, tag="3")] + pub entrypoint: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MlModelMetadata { + /// A list of package versions for a ML model + #[prost(string, repeated, tag="1")] + pub versions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MlTrainingMetadata { + /// A list of package versions for ML training source distribution + #[prost(string, repeated, tag="1")] + pub versions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(enumeration="super::mltraining::v1::ModelType", tag="2")] + pub model_type: i32, + #[prost(enumeration="super::mltraining::v1::ModelFramework", tag="3")] + pub model_framework: i32, + #[prost(bool, tag="4")] + pub draft: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegistryItem { + /// The id of the item, containing either: + /// namespace:item_name when a namespace exists on the org. + /// org_id:item_name when a namespace does not exist. + #[prost(string, tag="1")] + pub item_id: ::prost::alloc::string::String, + /// The id of the organization that owns the item + #[prost(string, tag="2")] + pub organization_id: ::prost::alloc::string::String, + /// The public namespace of the organization that owns the module + /// This is empty if no public namespace is set + #[prost(string, tag="3")] + pub public_namespace: ::prost::alloc::string::String, + /// The name of the registry item + #[prost(string, tag="4")] + pub name: ::prost::alloc::string::String, + /// The type of the item in the registry + #[prost(enumeration="super::packages::v1::PackageType", tag="5")] + pub r#type: i32, + /// The visibility of the registry item + #[prost(enumeration="Visibility", tag="6")] + pub visibility: i32, + /// The url to reference for documentation, code, etc. + #[prost(string, tag="7")] + pub url: ::prost::alloc::string::String, + /// A short description of the item that explains its purpose + #[prost(string, tag="8")] + pub description: ::prost::alloc::string::String, + /// The total number of robots using this item + #[prost(int64, tag="9")] + pub total_robot_usage: i64, + /// The total number of robots using this item outside of the owning org + #[prost(int64, tag="13")] + pub total_external_robot_usage: i64, + /// The total number of organizations using this item + #[prost(int64, tag="10")] + pub total_organization_usage: i64, + /// The total number of organizations using this item outside of the owning org + #[prost(int64, tag="14")] + pub total_external_organization_usage: i64, + /// When the item was created + #[prost(message, optional, tag="15")] + pub created_at: ::core::option::Option<::prost_types::Timestamp>, + /// When the item was last updated, either through an update or upload. + #[prost(message, optional, tag="16")] + pub updated_at: ::core::option::Option<::prost_types::Timestamp>, + /// Type-specific metadata + #[prost(oneof="registry_item::Metadata", tags="11, 12, 18")] + pub metadata: ::core::option::Option, +} +/// Nested message and enum types in `RegistryItem`. +pub mod registry_item { + /// Type-specific metadata + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Metadata { + #[prost(message, tag="11")] + ModuleMetadata(super::ModuleMetadata), + #[prost(message, tag="12")] + MlModelMetadata(super::MlModelMetadata), + #[prost(message, tag="18")] + MlTrainingMetadata(super::MlTrainingMetadata), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetRegistryItemRequest { + #[prost(string, tag="1")] + pub item_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetRegistryItemResponse { + #[prost(message, optional, tag="1")] + pub item: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateRegistryItemRequest { + /// The organization to create the registry item under + #[prost(string, tag="1")] + pub organization_id: ::prost::alloc::string::String, + /// The name of the registry item, which must be unique within your org + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, + /// The type of the item in the registry + #[prost(enumeration="super::packages::v1::PackageType", tag="3")] + pub r#type: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateRegistryItemResponse { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateRegistryItemRequest { + #[prost(string, tag="1")] + pub item_id: ::prost::alloc::string::String, + #[prost(enumeration="super::packages::v1::PackageType", tag="2")] + pub r#type: i32, + #[prost(string, tag="3")] + pub description: ::prost::alloc::string::String, + #[prost(enumeration="Visibility", tag="4")] + pub visibility: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateRegistryItemResponse { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListRegistryItemsRequest { + /// The id of the organization to return registry items for. + #[prost(string, optional, tag="1")] + pub organization_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(enumeration="super::packages::v1::PackageType", repeated, tag="2")] + pub types: ::prost::alloc::vec::Vec, + #[prost(enumeration="Visibility", repeated, tag="3")] + pub visibilities: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag="4")] + pub platforms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(enumeration="RegistryItemStatus", repeated, tag="5")] + pub statuses: ::prost::alloc::vec::Vec, + #[prost(string, optional, tag="6")] + pub search_term: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag="7")] + pub page_token: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListRegistryItemsResponse { + #[prost(message, repeated, tag="1")] + pub items: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteRegistryItemRequest { + /// The id of the item (formatted as prefix:name where prefix is the owner's orgid or namespace) + #[prost(string, tag="1")] + pub item_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteRegistryItemResponse { +} /// Modules #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -974,7 +1228,7 @@ pub struct CreateModuleRequest { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateModuleResponse { - /// The id of the module containing the namespace and name + /// The id of the module (formatted as prefix:name where prefix is the module owner's orgid or namespace) #[prost(string, tag="1")] pub module_id: ::prost::alloc::string::String, /// The detail page of the module @@ -984,12 +1238,9 @@ pub struct CreateModuleResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateModuleRequest { - /// The id of the module being updated, containing module name or namespace and module name + /// The id of the module (formatted as prefix:name where prefix is the module owner's orgid or namespace) #[prost(string, tag="1")] pub module_id: ::prost::alloc::string::String, - /// The organization of the module being updated, required if no namespace exists in the module_id - #[prost(string, optional, tag="7")] - pub organization_id: ::core::option::Option<::prost::alloc::string::String>, /// The visibility that should be set for the module #[prost(enumeration="Visibility", tag="2")] pub visibility: i32, @@ -1026,12 +1277,9 @@ pub struct Model { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleFileInfo { - /// The id of the module being uploaded, containing module name or namespace and module name + /// The id of the module (formatted as prefix:name where prefix is the module owner's orgid or namespace) #[prost(string, tag="1")] pub module_id: ::prost::alloc::string::String, - /// The organization of the module being updated, required if no namespace exists in the module_id - #[prost(string, optional, tag="4")] - pub organization_id: ::core::option::Option<::prost::alloc::string::String>, /// The semver string that represents the new major/minor/patch version of the module #[prost(string, tag="2")] pub version: ::prost::alloc::string::String, @@ -1068,12 +1316,9 @@ pub struct UploadModuleFileResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetModuleRequest { - /// The id of the module being retrieved, containing module name or namespace and module name + /// The id of the module (formatted as prefix:name where prefix is the module owner's orgid or namespace) #[prost(string, tag="1")] pub module_id: ::prost::alloc::string::String, - /// The organization of the module being updated, required if no namespace exists in the module_id - #[prost(string, optional, tag="2")] - pub organization_id: ::core::option::Option<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1085,12 +1330,9 @@ pub struct GetModuleResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { - /// The id of the module, containing module name or namespace and module name + /// The id of the module (formatted as prefix:name where prefix is the module owner's orgid or namespace) #[prost(string, tag="1")] pub module_id: ::prost::alloc::string::String, - /// The id of the organization that owns the module - #[prost(string, tag="10")] - pub organization_id: ::prost::alloc::string::String, /// The name of the module #[prost(string, tag="2")] pub name: ::prost::alloc::string::String, @@ -1098,6 +1340,7 @@ pub struct Module { #[prost(enumeration="Visibility", tag="3")] pub visibility: i32, /// The versions of the module that are available + /// When this is returned from the backend, the versions are sorted in ascending order by the semver version #[prost(message, repeated, tag="4")] pub versions: ::prost::alloc::vec::Vec, /// The url to reference for documentation, code, etc. @@ -1109,15 +1352,22 @@ pub struct Module { /// A list of models that are available in the module #[prost(message, repeated, tag="7")] pub models: ::prost::alloc::vec::Vec, - /// The executable to run to start the module program - #[prost(string, tag="11")] - pub entrypoint: ::prost::alloc::string::String, /// The total number of robots using this module #[prost(int64, tag="8")] pub total_robot_usage: i64, /// The total number of organizations using this module #[prost(int64, tag="9")] pub total_organization_usage: i64, + /// The id of the organization that owns the module + #[prost(string, tag="10")] + pub organization_id: ::prost::alloc::string::String, + /// The executable to run to start the module program + #[prost(string, tag="11")] + pub entrypoint: ::prost::alloc::string::String, + /// The public namespace of the organization that owns the module + /// This is empty if no public namespace is set + #[prost(string, tag="12")] + pub public_namespace: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1128,6 +1378,12 @@ pub struct VersionHistory { /// The uploads that are available for this module version #[prost(message, repeated, tag="2")] pub files: ::prost::alloc::vec::Vec, + /// The models that this verion of the module provides + #[prost(message, repeated, tag="3")] + pub models: ::prost::alloc::vec::Vec, + /// The entrypoint for this version of the module + #[prost(string, tag="4")] + pub entrypoint: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1185,6 +1441,123 @@ pub struct ListOrganizationsByUserResponse { #[prost(message, repeated, tag="1")] pub orgs: ::prost::alloc::vec::Vec, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateKeyRequest { + #[prost(message, repeated, tag="1")] + pub authorizations: ::prost::alloc::vec::Vec, + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateKeyResponse { + #[prost(string, tag="1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteKeyRequest { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteKeyResponse { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AuthorizationDetails { + #[prost(string, tag="1")] + pub authorization_type: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub authorization_id: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub resource_type: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag="5")] + pub org_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ApiKeyWithAuthorizations { + #[prost(message, optional, tag="1")] + pub api_key: ::core::option::Option, + #[prost(message, repeated, tag="2")] + pub authorizations: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListKeysRequest { + #[prost(string, tag="1")] + pub org_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListKeysResponse { + #[prost(message, repeated, tag="1")] + pub api_keys: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RotateKeyRequest { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RotateKeyResponse { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub key: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateKeyFromExistingKeyAuthorizationsRequest { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateKeyFromExistingKeyAuthorizationsResponse { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub key: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum RegistryItemStatus { + Unspecified = 0, + Published = 1, + InDevelopment = 2, +} +impl RegistryItemStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + RegistryItemStatus::Unspecified => "REGISTRY_ITEM_STATUS_UNSPECIFIED", + RegistryItemStatus::Published => "REGISTRY_ITEM_STATUS_PUBLISHED", + RegistryItemStatus::InDevelopment => "REGISTRY_ITEM_STATUS_IN_DEVELOPMENT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REGISTRY_ITEM_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "REGISTRY_ITEM_STATUS_PUBLISHED" => Some(Self::Published), + "REGISTRY_ITEM_STATUS_IN_DEVELOPMENT" => Some(Self::InDevelopment), + _ => None, + } + } +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum Visibility { @@ -1216,35 +1589,6 @@ impl Visibility { } } } -/// TODO(APP-1865) should be deprecated/removed in favor of GetCurrentMonthUsage -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CurrentMonthUsageSummary { - #[prost(double, tag="1")] - pub cloud_storage_usage: f64, - #[prost(double, tag="2")] - pub cloud_storage_usage_cost: f64, - #[prost(double, tag="3")] - pub data_upload_usage_cost: f64, - #[prost(double, tag="4")] - pub data_upload_usage_quantity: f64, - #[prost(double, tag="5")] - pub data_egres_usage_cost: f64, - #[prost(double, tag="6")] - pub data_egres_usage_quantity: f64, - #[prost(double, tag="7")] - pub standard_compute_usage_cost: f64, - #[prost(double, tag="8")] - pub standard_compute_usage_quantity: f64, - #[prost(double, tag="9")] - pub total_usage_quantity: f64, - /// returns amt with any discounts applied - #[prost(double, tag="10")] - pub total_usage_with_discount: f64, - /// returns amt without any discounts applied - #[prost(double, tag="11")] - pub total_usage_without_discount: f64, -} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InvoiceSummary { @@ -1305,42 +1649,6 @@ pub struct PaymentMethodCard { #[prost(string, tag="2")] pub last_four_digits: ::prost::alloc::string::String, } -/// TODO(APP-1865) should be deprecated/removed in favor of GetCurrentMonthUsage -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCurrentMonthUsageSummaryRequest { - #[prost(string, tag="1")] - pub org_id: ::prost::alloc::string::String, -} -/// TODO(APP-1865) should be deprecated/removed in favor of GetCurrentMonthUsage -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCurrentMonthUsageSummaryResponse { - #[prost(double, tag="1")] - pub cloud_storage_usage: f64, - #[prost(double, tag="2")] - pub cloud_storage_usage_cost: f64, - #[prost(double, tag="3")] - pub data_upload_usage_cost: f64, - #[prost(double, tag="4")] - pub data_upload_usage_quantity: f64, - #[prost(double, tag="5")] - pub data_egres_usage_cost: f64, - #[prost(double, tag="6")] - pub data_egres_usage_quantity: f64, - #[prost(double, tag="7")] - pub standard_compute_usage_cost: f64, - #[prost(double, tag="8")] - pub standard_compute_usage_quantity: f64, - #[prost(double, tag="9")] - pub total_usage_quantity: f64, - /// returns amt with any discounts applied - #[prost(double, tag="10")] - pub total_usage_with_discount: f64, - /// returns amt without any discounts applied - #[prost(double, tag="11")] - pub total_usage_without_discount: f64, -} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetCurrentMonthUsageRequest { @@ -1371,50 +1679,6 @@ pub struct GetCurrentMonthUsageResponse { #[prost(double, tag="10")] pub total_usage_without_discount: f64, } -/// TODO(APP-1865) may want to remove -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUnpaidBalanceRequest { - #[prost(string, tag="1")] - pub org_id: ::prost::alloc::string::String, -} -/// TODO(APP-1865) may want to remove -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUnpaidBalanceResponse { - #[prost(double, tag="1")] - pub unpaid_balance: f64, - #[prost(message, optional, tag="2")] - pub unpaid_balance_due_date: ::core::option::Option<::prost_types::Timestamp>, -} -/// TODO(APP-1865) may want to remove -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetInvoiceHistoryRequest { - #[prost(string, tag="1")] - pub org_id: ::prost::alloc::string::String, -} -/// TODO(APP-1865) may want to remove -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetInvoiceHistoryResponse { - #[prost(message, repeated, tag="1")] - pub invoices: ::prost::alloc::vec::Vec, -} -/// TODO(APP-1865) may want to remove -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetItemizedInvoiceRequest { - #[prost(string, tag="1")] - pub id: ::prost::alloc::string::String, -} -/// TODO(APP-1865) may want to remove -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetItemizedInvoiceResponse { - #[prost(message, optional, tag="1")] - pub invoice: ::core::option::Option, -} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetOrgBillingInformationRequest { @@ -1431,6 +1695,9 @@ pub struct GetOrgBillingInformationResponse { /// defined if type is PAYMENT_METHOD_TYPE_CARD #[prost(message, optional, tag="3")] pub method: ::core::option::Option, + /// Only return billing_tier for billing dashboard admin users + #[prost(string, optional, tag="4")] + pub billing_tier: ::core::option::Option<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1448,38 +1715,6 @@ pub struct GetInvoicesSummaryResponse { #[prost(message, repeated, tag="2")] pub invoices: ::prost::alloc::vec::Vec, } -/// TODO(APP-1865) should be deprecated/removed -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetBillingSummaryRequest { - #[prost(string, tag="1")] - pub org_id: ::prost::alloc::string::String, -} -/// TODO(APP-1865) should be deprecated/removed -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetBillingSummaryResponse { - #[prost(message, optional, tag="1")] - pub usage_summary: ::core::option::Option, - #[prost(message, repeated, tag="2")] - pub invoices: ::prost::alloc::vec::Vec, - /// all unpaid balances at the end of the last billing cycle - #[prost(double, tag="3")] - pub statement_balance: f64, - /// statement_balance + current_month_usage - #[prost(double, tag="4")] - pub current_balance: f64, - /// current_month_usage_cost - #[prost(double, tag="5")] - pub current_month_balance: f64, - /// due date for current month usage - #[prost(message, optional, tag="7")] - pub current_month_due_date: ::core::option::Option<::prost_types::Timestamp>, - #[prost(string, tag="8")] - pub invoice_email: ::prost::alloc::string::String, - #[prost(message, optional, tag="9")] - pub payment_method: ::core::option::Option, -} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetInvoicePdfRequest { @@ -1522,6 +1757,73 @@ impl PaymentMethodType { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct IsLegalAcceptedRequest { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IsLegalAcceptedResponse { + /// If false, the user should not be able to use the application. + #[prost(bool, tag="1")] + pub accepted_legal: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AcceptLegalRequest { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AcceptLegalResponse { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisterAuthApplicationRequest { + #[prost(string, tag="1")] + pub application_name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub org_id: ::prost::alloc::string::String, + #[prost(string, repeated, tag="3")] + pub origin_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, repeated, tag="4")] + pub redirect_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag="5")] + pub logout_uri: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisterAuthApplicationResponse { + #[prost(string, tag="1")] + pub application_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub application_name: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub secret: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateAuthApplicationRequest { + #[prost(string, tag="1")] + pub org_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub application_id: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub application_name: ::prost::alloc::string::String, + #[prost(string, repeated, tag="4")] + pub origin_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, repeated, tag="5")] + pub redirect_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag="6")] + pub logout_uri: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateAuthApplicationResponse { + #[prost(string, tag="1")] + pub application_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub application_name: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RobotConfig { #[prost(message, optional, tag="1")] pub cloud: ::core::option::Option, @@ -1546,6 +1848,8 @@ pub struct RobotConfig { pub disable_partial_start: ::core::option::Option, #[prost(message, repeated, tag="11")] pub packages: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="12")] + pub overwrite_fragment_status: ::prost::alloc::vec::Vec, } /// Valid location secret that can be used for authentication to the robot. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1559,6 +1863,12 @@ pub struct LocationSecret { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct AppValidationStatus { + #[prost(string, tag="1")] + pub error: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CloudConfig { /// Robot part id. #[prost(string, tag="1")] @@ -1583,6 +1893,12 @@ pub struct CloudConfig { /// All valid location secrets. #[prost(message, repeated, tag="9")] pub location_secrets: ::prost::alloc::vec::Vec, + #[prost(string, tag="10")] + pub primary_org_id: ::prost::alloc::string::String, + #[prost(string, tag="11")] + pub location_id: ::prost::alloc::string::String, + #[prost(string, tag="12")] + pub machine_id: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1607,6 +1923,8 @@ pub struct ComponentConfig { pub attributes: ::core::option::Option<::prost_types::Struct>, #[prost(string, tag="9")] pub api: ::prost::alloc::string::String, + #[prost(message, optional, tag="10")] + pub log_configuration: ::core::option::Option, } /// A ResourceLevelServiceConfig describes component or remote configuration for a service. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1638,6 +1956,9 @@ pub struct ProcessConfig { pub stop_signal: i32, #[prost(message, optional, tag="8")] pub stop_timeout: ::core::option::Option<::prost_types::Duration>, + /// additional environment variables passed to the process + #[prost(map="string, string", tag="9")] + pub env: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1658,6 +1979,8 @@ pub struct ServiceConfig { pub model: ::prost::alloc::string::String, #[prost(string, tag="9")] pub api: ::prost::alloc::string::String, + #[prost(message, repeated, tag="10")] + pub service_configs: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1727,6 +2050,12 @@ pub struct Frame { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct LogConfiguration { + #[prost(string, tag="1")] + pub level: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Translation { #[prost(double, tag="1")] pub x: f64, @@ -1957,7 +2286,7 @@ pub struct LogRequest { #[prost(string, tag="1")] pub id: ::prost::alloc::string::String, #[prost(message, repeated, tag="2")] - pub logs: ::prost::alloc::vec::Vec, + pub logs: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1993,6 +2322,18 @@ pub struct ModuleConfig { /// log level for module #[prost(string, tag="3")] pub log_level: ::prost::alloc::string::String, + /// type of the module ("local" or "registry") + #[prost(string, tag="4")] + pub r#type: ::prost::alloc::string::String, + /// the id of the module if it is a registry module + #[prost(string, tag="5")] + pub module_id: ::prost::alloc::string::String, + /// additional environment variables passed to the module process + #[prost(map="string, string", tag="6")] + pub env: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + /// info about the validity of the module + #[prost(message, optional, tag="7")] + pub status: ::core::option::Option, } /// PackageConfig is the configration for deployed Packages. #[allow(clippy::derive_partial_eq_without_eq)] @@ -2010,6 +2351,9 @@ pub struct PackageConfig { /// type of the package #[prost(string, tag="4")] pub r#type: ::prost::alloc::string::String, + /// info about the validity of the package + #[prost(message, optional, tag="5")] + pub status: ::core::option::Option, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] diff --git a/src/gen/viam.app.v1.tonic.rs b/src/gen/viam.app.v1.tonic.rs index 8a3f12b..89f9cb0 100644 --- a/src/gen/viam.app.v1.tonic.rs +++ b/src/gen/viam.app.v1.tonic.rs @@ -159,6 +159,38 @@ pub mod app_service_client { .insert(GrpcMethod::new("viam.app.v1.AppService", "ListOrganizations")); self.inner.unary(req, path, codec).await } + pub async fn get_organizations_with_access_to_location( + &mut self, + request: impl tonic::IntoRequest< + super::GetOrganizationsWithAccessToLocationRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/GetOrganizationsWithAccessToLocation", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.v1.AppService", + "GetOrganizationsWithAccessToLocation", + ), + ); + self.inner.unary(req, path, codec).await + } pub async fn list_organizations_by_user( &mut self, request: impl tonic::IntoRequest, @@ -968,6 +1000,31 @@ pub mod app_service_client { .insert(GrpcMethod::new("viam.app.v1.AppService", "DeleteRobotPart")); self.inner.unary(req, path, codec).await } + pub async fn get_robot_api_keys( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/GetRobotAPIKeys", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "GetRobotAPIKeys")); + self.inner.unary(req, path, codec).await + } pub async fn mark_part_as_main( &mut self, request: impl tonic::IntoRequest, @@ -1347,6 +1404,31 @@ pub mod app_service_client { .insert(GrpcMethod::new("viam.app.v1.AppService", "RemoveRole")); self.inner.unary(req, path, codec).await } + pub async fn change_role( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/ChangeRole", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "ChangeRole")); + self.inner.unary(req, path, codec).await + } pub async fn list_authorizations( &mut self, request: impl tonic::IntoRequest, @@ -1397,6 +1479,131 @@ pub mod app_service_client { .insert(GrpcMethod::new("viam.app.v1.AppService", "CheckPermissions")); self.inner.unary(req, path, codec).await } + pub async fn get_registry_item( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/GetRegistryItem", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "GetRegistryItem")); + self.inner.unary(req, path, codec).await + } + pub async fn create_registry_item( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/CreateRegistryItem", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "CreateRegistryItem")); + self.inner.unary(req, path, codec).await + } + pub async fn update_registry_item( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/UpdateRegistryItem", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "UpdateRegistryItem")); + self.inner.unary(req, path, codec).await + } + pub async fn list_registry_items( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/ListRegistryItems", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "ListRegistryItems")); + self.inner.unary(req, path, codec).await + } + pub async fn delete_registry_item( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/DeleteRegistryItem", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "DeleteRegistryItem")); + self.inner.unary(req, path, codec).await + } pub async fn create_module( &mut self, request: impl tonic::IntoRequest, @@ -1524,48 +1731,187 @@ pub mod app_service_client { .insert(GrpcMethod::new("viam.app.v1.AppService", "ListModules")); self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -pub mod app_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with AppServiceServer. - #[async_trait] - pub trait AppService: Send + Sync + 'static { - async fn get_user_id_by_email( - &self, - request: tonic::Request, + pub async fn create_key( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - async fn create_organization( - &self, - request: tonic::Request, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/CreateKey", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "CreateKey")); + self.inner.unary(req, path, codec).await + } + pub async fn delete_key( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - async fn list_organizations( - &self, - request: tonic::Request, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/DeleteKey", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "DeleteKey")); + self.inner.unary(req, path, codec).await + } + pub async fn list_keys( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - async fn list_organizations_by_user( - &self, - request: tonic::Request, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/ListKeys", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "ListKeys")); + self.inner.unary(req, path, codec).await + } + pub async fn rotate_key( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - async fn get_organization( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/RotateKey", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.AppService", "RotateKey")); + self.inner.unary(req, path, codec).await + } + pub async fn create_key_from_existing_key_authorizations( + &mut self, + request: impl tonic::IntoRequest< + super::CreateKeyFromExistingKeyAuthorizationsRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.AppService/CreateKeyFromExistingKeyAuthorizations", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.v1.AppService", + "CreateKeyFromExistingKeyAuthorizations", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod app_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with AppServiceServer. + #[async_trait] + pub trait AppService: Send + Sync + 'static { + async fn get_user_id_by_email( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn create_organization( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn list_organizations( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_organizations_with_access_to_location( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn list_organizations_by_user( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_organization( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; async fn get_organization_namespace_availability( @@ -1780,6 +2126,13 @@ pub mod app_service_server { tonic::Response, tonic::Status, >; + async fn get_robot_api_keys( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn mark_part_as_main( &self, request: tonic::Request, @@ -1882,6 +2235,13 @@ pub mod app_service_server { tonic::Response, tonic::Status, >; + async fn change_role( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn list_authorizations( &self, request: tonic::Request, @@ -1896,6 +2256,41 @@ pub mod app_service_server { tonic::Response, tonic::Status, >; + async fn get_registry_item( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn create_registry_item( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn update_registry_item( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn list_registry_items( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn delete_registry_item( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn create_module( &self, request: tonic::Request, @@ -1931,6 +2326,41 @@ pub mod app_service_server { tonic::Response, tonic::Status, >; + async fn create_key( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn delete_key( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn list_keys( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn rotate_key( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn create_key_from_existing_key_authorizations( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct AppServiceServer { @@ -2149,6 +2579,59 @@ pub mod app_service_server { }; Box::pin(fut) } + "/viam.app.v1.AppService/GetOrganizationsWithAccessToLocation" => { + #[allow(non_camel_case_types)] + struct GetOrganizationsWithAccessToLocationSvc( + pub Arc, + ); + impl< + T: AppService, + > tonic::server::UnaryService< + super::GetOrganizationsWithAccessToLocationRequest, + > for GetOrganizationsWithAccessToLocationSvc { + type Response = super::GetOrganizationsWithAccessToLocationResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::GetOrganizationsWithAccessToLocationRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner) + .get_organizations_with_access_to_location(request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetOrganizationsWithAccessToLocationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/viam.app.v1.AppService/ListOrganizationsByUser" => { #[allow(non_camel_case_types)] struct ListOrganizationsByUserSvc(pub Arc); @@ -3601,6 +4084,52 @@ pub mod app_service_server { }; Box::pin(fut) } + "/viam.app.v1.AppService/GetRobotAPIKeys" => { + #[allow(non_camel_case_types)] + struct GetRobotAPIKeysSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for GetRobotAPIKeysSvc { + type Response = super::GetRobotApiKeysResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_robot_api_keys(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetRobotAPIKeysSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/viam.app.v1.AppService/MarkPartAsMain" => { #[allow(non_camel_case_types)] struct MarkPartAsMainSvc(pub Arc); @@ -4283,26 +4812,24 @@ pub mod app_service_server { }; Box::pin(fut) } - "/viam.app.v1.AppService/ListAuthorizations" => { + "/viam.app.v1.AppService/ChangeRole" => { #[allow(non_camel_case_types)] - struct ListAuthorizationsSvc(pub Arc); + struct ChangeRoleSvc(pub Arc); impl< T: AppService, - > tonic::server::UnaryService - for ListAuthorizationsSvc { - type Response = super::ListAuthorizationsResponse; + > tonic::server::UnaryService + for ChangeRoleSvc { + type Response = super::ChangeRoleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).list_authorizations(request).await - }; + let fut = async move { (*inner).change_role(request).await }; Box::pin(fut) } } @@ -4313,7 +4840,7 @@ pub mod app_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ListAuthorizationsSvc(inner); + let method = ChangeRoleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4329,25 +4856,25 @@ pub mod app_service_server { }; Box::pin(fut) } - "/viam.app.v1.AppService/CheckPermissions" => { + "/viam.app.v1.AppService/ListAuthorizations" => { #[allow(non_camel_case_types)] - struct CheckPermissionsSvc(pub Arc); + struct ListAuthorizationsSvc(pub Arc); impl< T: AppService, - > tonic::server::UnaryService - for CheckPermissionsSvc { - type Response = super::CheckPermissionsResponse; + > tonic::server::UnaryService + for ListAuthorizationsSvc { + type Response = super::ListAuthorizationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).check_permissions(request).await + (*inner).list_authorizations(request).await }; Box::pin(fut) } @@ -4359,7 +4886,7 @@ pub mod app_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CheckPermissionsSvc(inner); + let method = ListAuthorizationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4375,16 +4902,292 @@ pub mod app_service_server { }; Box::pin(fut) } - "/viam.app.v1.AppService/CreateModule" => { + "/viam.app.v1.AppService/CheckPermissions" => { #[allow(non_camel_case_types)] - struct CreateModuleSvc(pub Arc); + struct CheckPermissionsSvc(pub Arc); impl< T: AppService, - > tonic::server::UnaryService - for CreateModuleSvc { - type Response = super::CreateModuleResponse; - type Future = BoxFuture< - tonic::Response, + > tonic::server::UnaryService + for CheckPermissionsSvc { + type Response = super::CheckPermissionsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).check_permissions(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CheckPermissionsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/GetRegistryItem" => { + #[allow(non_camel_case_types)] + struct GetRegistryItemSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for GetRegistryItemSvc { + type Response = super::GetRegistryItemResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_registry_item(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetRegistryItemSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/CreateRegistryItem" => { + #[allow(non_camel_case_types)] + struct CreateRegistryItemSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for CreateRegistryItemSvc { + type Response = super::CreateRegistryItemResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).create_registry_item(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateRegistryItemSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/UpdateRegistryItem" => { + #[allow(non_camel_case_types)] + struct UpdateRegistryItemSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for UpdateRegistryItemSvc { + type Response = super::UpdateRegistryItemResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).update_registry_item(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateRegistryItemSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/ListRegistryItems" => { + #[allow(non_camel_case_types)] + struct ListRegistryItemsSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for ListRegistryItemsSvc { + type Response = super::ListRegistryItemsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).list_registry_items(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListRegistryItemsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/DeleteRegistryItem" => { + #[allow(non_camel_case_types)] + struct DeleteRegistryItemSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for DeleteRegistryItemSvc { + type Response = super::DeleteRegistryItemResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).delete_registry_item(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteRegistryItemSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/CreateModule" => { + #[allow(non_camel_case_types)] + struct CreateModuleSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for CreateModuleSvc { + type Response = super::CreateModuleResponse; + type Future = BoxFuture< + tonic::Response, tonic::Status, >; fn call( @@ -4423,23 +5226,795 @@ pub mod app_service_server { } "/viam.app.v1.AppService/UpdateModule" => { #[allow(non_camel_case_types)] - struct UpdateModuleSvc(pub Arc); + struct UpdateModuleSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for UpdateModuleSvc { + type Response = super::UpdateModuleResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).update_module(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateModuleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/UploadModuleFile" => { + #[allow(non_camel_case_types)] + struct UploadModuleFileSvc(pub Arc); + impl< + T: AppService, + > tonic::server::ClientStreamingService< + super::UploadModuleFileRequest, + > for UploadModuleFileSvc { + type Response = super::UploadModuleFileResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).upload_module_file(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UploadModuleFileSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.client_streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/GetModule" => { + #[allow(non_camel_case_types)] + struct GetModuleSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for GetModuleSvc { + type Response = super::GetModuleResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_module(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetModuleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/ListModules" => { + #[allow(non_camel_case_types)] + struct ListModulesSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for ListModulesSvc { + type Response = super::ListModulesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).list_modules(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListModulesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/CreateKey" => { + #[allow(non_camel_case_types)] + struct CreateKeySvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for CreateKeySvc { + type Response = super::CreateKeyResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).create_key(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateKeySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/DeleteKey" => { + #[allow(non_camel_case_types)] + struct DeleteKeySvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for DeleteKeySvc { + type Response = super::DeleteKeyResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).delete_key(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteKeySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/ListKeys" => { + #[allow(non_camel_case_types)] + struct ListKeysSvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for ListKeysSvc { + type Response = super::ListKeysResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).list_keys(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListKeysSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/RotateKey" => { + #[allow(non_camel_case_types)] + struct RotateKeySvc(pub Arc); + impl< + T: AppService, + > tonic::server::UnaryService + for RotateKeySvc { + type Response = super::RotateKeyResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).rotate_key(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RotateKeySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.app.v1.AppService/CreateKeyFromExistingKeyAuthorizations" => { + #[allow(non_camel_case_types)] + struct CreateKeyFromExistingKeyAuthorizationsSvc( + pub Arc, + ); + impl< + T: AppService, + > tonic::server::UnaryService< + super::CreateKeyFromExistingKeyAuthorizationsRequest, + > for CreateKeyFromExistingKeyAuthorizationsSvc { + type Response = super::CreateKeyFromExistingKeyAuthorizationsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::CreateKeyFromExistingKeyAuthorizationsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner) + .create_key_from_existing_key_authorizations(request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateKeyFromExistingKeyAuthorizationsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for AppServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for AppServiceServer { + const NAME: &'static str = "viam.app.v1.AppService"; + } +} +/// Generated client implementations. +pub mod billing_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct BillingServiceClient { + inner: tonic::client::Grpc, + } + impl BillingServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl BillingServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> BillingServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + BillingServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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_current_month_usage( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.BillingService/GetCurrentMonthUsage", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("viam.app.v1.BillingService", "GetCurrentMonthUsage"), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_org_billing_information( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.BillingService/GetOrgBillingInformation", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.app.v1.BillingService", + "GetOrgBillingInformation", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_invoices_summary( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.BillingService/GetInvoicesSummary", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("viam.app.v1.BillingService", "GetInvoicesSummary"), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_invoice_pdf( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response>, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.app.v1.BillingService/GetInvoicePdf", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.app.v1.BillingService", "GetInvoicePdf")); + self.inner.server_streaming(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod billing_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with BillingServiceServer. + #[async_trait] + pub trait BillingService: Send + Sync + 'static { + async fn get_current_month_usage( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_org_billing_information( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_invoices_summary( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the GetInvoicePdf method. + type GetInvoicePdfStream: futures_core::Stream< + Item = std::result::Result, + > + + Send + + 'static; + async fn get_invoice_pdf( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct BillingServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl BillingServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for BillingServiceServer + where + T: BillingService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/viam.app.v1.BillingService/GetCurrentMonthUsage" => { + #[allow(non_camel_case_types)] + struct GetCurrentMonthUsageSvc(pub Arc); impl< - T: AppService, - > tonic::server::UnaryService - for UpdateModuleSvc { - type Response = super::UpdateModuleResponse; + T: BillingService, + > tonic::server::UnaryService + for GetCurrentMonthUsageSvc { + type Response = super::GetCurrentMonthUsageResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).update_module(request).await + (*inner).get_current_month_usage(request).await }; Box::pin(fut) } @@ -4451,7 +6026,7 @@ pub mod app_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateModuleSvc(inner); + let method = GetCurrentMonthUsageSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4467,15 +6042,14 @@ pub mod app_service_server { }; Box::pin(fut) } - "/viam.app.v1.AppService/UploadModuleFile" => { + "/viam.app.v1.BillingService/GetOrgBillingInformation" => { #[allow(non_camel_case_types)] - struct UploadModuleFileSvc(pub Arc); + struct GetOrgBillingInformationSvc(pub Arc); impl< - T: AppService, - > tonic::server::ClientStreamingService< - super::UploadModuleFileRequest, - > for UploadModuleFileSvc { - type Response = super::UploadModuleFileResponse; + T: BillingService, + > tonic::server::UnaryService + for GetOrgBillingInformationSvc { + type Response = super::GetOrgBillingInformationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -4483,12 +6057,12 @@ pub mod app_service_server { fn call( &mut self, request: tonic::Request< - tonic::Streaming, + super::GetOrgBillingInformationRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).upload_module_file(request).await + (*inner).get_org_billing_information(request).await }; Box::pin(fut) } @@ -4500,7 +6074,7 @@ pub mod app_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UploadModuleFileSvc(inner); + let method = GetOrgBillingInformationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4511,29 +6085,31 @@ pub mod app_service_server { max_decoding_message_size, max_encoding_message_size, ); - let res = grpc.client_streaming(method, req).await; + let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - "/viam.app.v1.AppService/GetModule" => { + "/viam.app.v1.BillingService/GetInvoicesSummary" => { #[allow(non_camel_case_types)] - struct GetModuleSvc(pub Arc); + struct GetInvoicesSummarySvc(pub Arc); impl< - T: AppService, - > tonic::server::UnaryService - for GetModuleSvc { - type Response = super::GetModuleResponse; + T: BillingService, + > tonic::server::UnaryService + for GetInvoicesSummarySvc { + type Response = super::GetInvoicesSummaryResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).get_module(request).await }; + let fut = async move { + (*inner).get_invoices_summary(request).await + }; Box::pin(fut) } } @@ -4544,7 +6120,7 @@ pub mod app_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetModuleSvc(inner); + let method = GetInvoicesSummarySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4560,25 +6136,26 @@ pub mod app_service_server { }; Box::pin(fut) } - "/viam.app.v1.AppService/ListModules" => { + "/viam.app.v1.BillingService/GetInvoicePdf" => { #[allow(non_camel_case_types)] - struct ListModulesSvc(pub Arc); + struct GetInvoicePdfSvc(pub Arc); impl< - T: AppService, - > tonic::server::UnaryService - for ListModulesSvc { - type Response = super::ListModulesResponse; + T: BillingService, + > tonic::server::ServerStreamingService + for GetInvoicePdfSvc { + type Response = super::GetInvoicePdfResponse; + type ResponseStream = T::GetInvoicePdfStream; type Future = BoxFuture< - tonic::Response, + tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).list_modules(request).await + (*inner).get_invoice_pdf(request).await }; Box::pin(fut) } @@ -4590,7 +6167,7 @@ pub mod app_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ListModulesSvc(inner); + let method = GetInvoicePdfSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4601,7 +6178,7 @@ pub mod app_service_server { max_decoding_message_size, max_encoding_message_size, ); - let res = grpc.unary(method, req).await; + let res = grpc.server_streaming(method, req).await; Ok(res) }; Box::pin(fut) @@ -4621,7 +6198,7 @@ pub mod app_service_server { } } } - impl Clone for AppServiceServer { + impl Clone for BillingServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -4633,7 +6210,7 @@ pub mod app_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -4643,20 +6220,20 @@ pub mod app_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for AppServiceServer { - const NAME: &'static str = "viam.app.v1.AppService"; + impl tonic::server::NamedService for BillingServiceServer { + const NAME: &'static str = "viam.app.v1.BillingService"; } } /// Generated client implementations. -pub mod billing_service_client { +pub mod end_user_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] - pub struct BillingServiceClient { + pub struct EndUserServiceClient { inner: tonic::client::Grpc, } - impl BillingServiceClient { + impl EndUserServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -4667,7 +6244,7 @@ pub mod billing_service_client { Ok(Self::new(conn)) } } - impl BillingServiceClient + impl EndUserServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -4685,7 +6262,7 @@ pub mod billing_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> BillingServiceClient> + ) -> EndUserServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -4699,7 +6276,7 @@ pub mod billing_service_client { http::Request, >>::Error: Into + Send + Sync, { - BillingServiceClient::new(InterceptedService::new(inner, interceptor)) + EndUserServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -4732,122 +6309,11 @@ pub mod billing_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - pub async fn get_current_month_usage_summary( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/viam.app.v1.BillingService/GetCurrentMonthUsageSummary", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "viam.app.v1.BillingService", - "GetCurrentMonthUsageSummary", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn get_unpaid_balance( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/viam.app.v1.BillingService/GetUnpaidBalance", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("viam.app.v1.BillingService", "GetUnpaidBalance"), - ); - self.inner.unary(req, path, codec).await - } - pub async fn get_invoice_history( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/viam.app.v1.BillingService/GetInvoiceHistory", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("viam.app.v1.BillingService", "GetInvoiceHistory"), - ); - self.inner.unary(req, path, codec).await - } - pub async fn get_itemized_invoice( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/viam.app.v1.BillingService/GetItemizedInvoice", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("viam.app.v1.BillingService", "GetItemizedInvoice"), - ); - self.inner.unary(req, path, codec).await - } - pub async fn get_billing_summary( + pub async fn is_legal_accepted( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4861,20 +6327,20 @@ pub mod billing_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/viam.app.v1.BillingService/GetBillingSummary", + "/viam.app.v1.EndUserService/IsLegalAccepted", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("viam.app.v1.BillingService", "GetBillingSummary"), + GrpcMethod::new("viam.app.v1.EndUserService", "IsLegalAccepted"), ); self.inner.unary(req, path, codec).await } - pub async fn get_current_month_usage( + pub async fn accept_legal( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4888,20 +6354,18 @@ pub mod billing_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/viam.app.v1.BillingService/GetCurrentMonthUsage", + "/viam.app.v1.EndUserService/AcceptLegal", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("viam.app.v1.BillingService", "GetCurrentMonthUsage"), - ); + .insert(GrpcMethod::new("viam.app.v1.EndUserService", "AcceptLegal")); self.inner.unary(req, path, codec).await } - pub async fn get_org_billing_information( + pub async fn register_auth_application( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4915,23 +6379,23 @@ pub mod billing_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/viam.app.v1.BillingService/GetOrgBillingInformation", + "/viam.app.v1.EndUserService/RegisterAuthApplication", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "viam.app.v1.BillingService", - "GetOrgBillingInformation", + "viam.app.v1.EndUserService", + "RegisterAuthApplication", ), ); self.inner.unary(req, path, codec).await } - pub async fn get_invoices_summary( + pub async fn update_auth_application( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4945,121 +6409,58 @@ pub mod billing_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/viam.app.v1.BillingService/GetInvoicesSummary", + "/viam.app.v1.EndUserService/UpdateAuthApplication", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("viam.app.v1.BillingService", "GetInvoicesSummary"), + GrpcMethod::new( + "viam.app.v1.EndUserService", + "UpdateAuthApplication", + ), ); self.inner.unary(req, path, codec).await } - pub async fn get_invoice_pdf( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/viam.app.v1.BillingService/GetInvoicePdf", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("viam.app.v1.BillingService", "GetInvoicePdf")); - self.inner.server_streaming(req, path, codec).await - } } } /// Generated server implementations. -pub mod billing_service_server { +pub mod end_user_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with BillingServiceServer. - #[async_trait] - pub trait BillingService: Send + Sync + 'static { - async fn get_current_month_usage_summary( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn get_unpaid_balance( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn get_invoice_history( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn get_itemized_invoice( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn get_billing_summary( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn get_current_month_usage( + /// Generated trait containing gRPC methods that should be implemented for use with EndUserServiceServer. + #[async_trait] + pub trait EndUserService: Send + Sync + 'static { + async fn is_legal_accepted( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - async fn get_org_billing_information( + async fn accept_legal( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - async fn get_invoices_summary( + async fn register_auth_application( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Server streaming response type for the GetInvoicePdf method. - type GetInvoicePdfStream: futures_core::Stream< - Item = std::result::Result, - > - + Send - + 'static; - async fn get_invoice_pdf( + async fn update_auth_application( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } #[derive(Debug)] - pub struct BillingServiceServer { + pub struct EndUserServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -5067,7 +6468,7 @@ pub mod billing_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl BillingServiceServer { + impl EndUserServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -5119,9 +6520,9 @@ pub mod billing_service_server { self } } - impl tonic::codegen::Service> for BillingServiceServer + impl tonic::codegen::Service> for EndUserServiceServer where - T: BillingService, + T: EndUserService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -5137,212 +6538,25 @@ pub mod billing_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/viam.app.v1.BillingService/GetCurrentMonthUsageSummary" => { - #[allow(non_camel_case_types)] - struct GetCurrentMonthUsageSummarySvc(pub Arc); - impl< - T: BillingService, - > tonic::server::UnaryService< - super::GetCurrentMonthUsageSummaryRequest, - > for GetCurrentMonthUsageSummarySvc { - type Response = super::GetCurrentMonthUsageSummaryResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::GetCurrentMonthUsageSummaryRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).get_current_month_usage_summary(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetCurrentMonthUsageSummarySvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/viam.app.v1.BillingService/GetUnpaidBalance" => { - #[allow(non_camel_case_types)] - struct GetUnpaidBalanceSvc(pub Arc); - impl< - T: BillingService, - > tonic::server::UnaryService - for GetUnpaidBalanceSvc { - type Response = super::GetUnpaidBalanceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).get_unpaid_balance(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetUnpaidBalanceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/viam.app.v1.BillingService/GetInvoiceHistory" => { - #[allow(non_camel_case_types)] - struct GetInvoiceHistorySvc(pub Arc); - impl< - T: BillingService, - > tonic::server::UnaryService - for GetInvoiceHistorySvc { - type Response = super::GetInvoiceHistoryResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).get_invoice_history(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetInvoiceHistorySvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/viam.app.v1.BillingService/GetItemizedInvoice" => { - #[allow(non_camel_case_types)] - struct GetItemizedInvoiceSvc(pub Arc); - impl< - T: BillingService, - > tonic::server::UnaryService - for GetItemizedInvoiceSvc { - type Response = super::GetItemizedInvoiceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).get_itemized_invoice(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetItemizedInvoiceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/viam.app.v1.BillingService/GetBillingSummary" => { + "/viam.app.v1.EndUserService/IsLegalAccepted" => { #[allow(non_camel_case_types)] - struct GetBillingSummarySvc(pub Arc); + struct IsLegalAcceptedSvc(pub Arc); impl< - T: BillingService, - > tonic::server::UnaryService - for GetBillingSummarySvc { - type Response = super::GetBillingSummaryResponse; + T: EndUserService, + > tonic::server::UnaryService + for IsLegalAcceptedSvc { + type Response = super::IsLegalAcceptedResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).get_billing_summary(request).await + (*inner).is_legal_accepted(request).await }; Box::pin(fut) } @@ -5354,7 +6568,7 @@ pub mod billing_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetBillingSummarySvc(inner); + let method = IsLegalAcceptedSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5370,25 +6584,25 @@ pub mod billing_service_server { }; Box::pin(fut) } - "/viam.app.v1.BillingService/GetCurrentMonthUsage" => { + "/viam.app.v1.EndUserService/AcceptLegal" => { #[allow(non_camel_case_types)] - struct GetCurrentMonthUsageSvc(pub Arc); + struct AcceptLegalSvc(pub Arc); impl< - T: BillingService, - > tonic::server::UnaryService - for GetCurrentMonthUsageSvc { - type Response = super::GetCurrentMonthUsageResponse; + T: EndUserService, + > tonic::server::UnaryService + for AcceptLegalSvc { + type Response = super::AcceptLegalResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).get_current_month_usage(request).await + (*inner).accept_legal(request).await }; Box::pin(fut) } @@ -5400,7 +6614,7 @@ pub mod billing_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetCurrentMonthUsageSvc(inner); + let method = AcceptLegalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5416,14 +6630,14 @@ pub mod billing_service_server { }; Box::pin(fut) } - "/viam.app.v1.BillingService/GetOrgBillingInformation" => { + "/viam.app.v1.EndUserService/RegisterAuthApplication" => { #[allow(non_camel_case_types)] - struct GetOrgBillingInformationSvc(pub Arc); + struct RegisterAuthApplicationSvc(pub Arc); impl< - T: BillingService, - > tonic::server::UnaryService - for GetOrgBillingInformationSvc { - type Response = super::GetOrgBillingInformationResponse; + T: EndUserService, + > tonic::server::UnaryService + for RegisterAuthApplicationSvc { + type Response = super::RegisterAuthApplicationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -5431,12 +6645,12 @@ pub mod billing_service_server { fn call( &mut self, request: tonic::Request< - super::GetOrgBillingInformationRequest, + super::RegisterAuthApplicationRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).get_org_billing_information(request).await + (*inner).register_auth_application(request).await }; Box::pin(fut) } @@ -5448,7 +6662,7 @@ pub mod billing_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetOrgBillingInformationSvc(inner); + let method = RegisterAuthApplicationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5464,25 +6678,25 @@ pub mod billing_service_server { }; Box::pin(fut) } - "/viam.app.v1.BillingService/GetInvoicesSummary" => { + "/viam.app.v1.EndUserService/UpdateAuthApplication" => { #[allow(non_camel_case_types)] - struct GetInvoicesSummarySvc(pub Arc); + struct UpdateAuthApplicationSvc(pub Arc); impl< - T: BillingService, - > tonic::server::UnaryService - for GetInvoicesSummarySvc { - type Response = super::GetInvoicesSummaryResponse; + T: EndUserService, + > tonic::server::UnaryService + for UpdateAuthApplicationSvc { + type Response = super::UpdateAuthApplicationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).get_invoices_summary(request).await + (*inner).update_auth_application(request).await }; Box::pin(fut) } @@ -5494,7 +6708,7 @@ pub mod billing_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetInvoicesSummarySvc(inner); + let method = UpdateAuthApplicationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5510,53 +6724,6 @@ pub mod billing_service_server { }; Box::pin(fut) } - "/viam.app.v1.BillingService/GetInvoicePdf" => { - #[allow(non_camel_case_types)] - struct GetInvoicePdfSvc(pub Arc); - impl< - T: BillingService, - > tonic::server::ServerStreamingService - for GetInvoicePdfSvc { - type Response = super::GetInvoicePdfResponse; - type ResponseStream = T::GetInvoicePdfStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).get_invoice_pdf(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetInvoicePdfSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.server_streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } _ => { Box::pin(async move { Ok( @@ -5572,7 +6739,7 @@ pub mod billing_service_server { } } } - impl Clone for BillingServiceServer { + impl Clone for EndUserServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -5584,7 +6751,7 @@ pub mod billing_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -5594,8 +6761,8 @@ pub mod billing_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for BillingServiceServer { - const NAME: &'static str = "viam.app.v1.BillingService"; + impl tonic::server::NamedService for EndUserServiceServer { + const NAME: &'static str = "viam.app.v1.EndUserService"; } } /// Generated client implementations. diff --git a/src/gen/viam.common.v1.rs b/src/gen/viam.common.v1.rs index 5847aad..885946f 100644 --- a/src/gen/viam.common.v1.rs +++ b/src/gen/viam.common.v1.rs @@ -10,6 +10,8 @@ pub struct ResourceName { pub subtype: ::prost::alloc::string::String, #[prost(string, tag="4")] pub name: ::prost::alloc::string::String, + #[prost(string, optional, tag="5")] + pub machine_part_id: ::core::option::Option<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -262,6 +264,9 @@ pub struct GetKinematicsRequest { /// The component name #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -280,6 +285,9 @@ pub struct GetGeometriesRequest { /// The component name #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -288,6 +296,42 @@ pub struct GetGeometriesResponse { #[prost(message, repeated, tag="1")] pub geometries: ::prost::alloc::vec::Vec, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetReadingsRequest { + /// Name of a sensor + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetReadingsResponse { + #[prost(map="string, message", tag="1")] + pub readings: ::std::collections::HashMap<::prost::alloc::string::String, ::prost_types::Value>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LogEntry { + #[prost(string, tag="1")] + pub host: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub level: ::prost::alloc::string::String, + #[prost(message, optional, tag="3")] + pub time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(string, tag="4")] + pub logger_name: ::prost::alloc::string::String, + #[prost(string, tag="5")] + pub message: ::prost::alloc::string::String, + #[prost(message, optional, tag="6")] + pub caller: ::core::option::Option<::prost_types::Struct>, + #[prost(string, tag="7")] + pub stack: ::prost::alloc::string::String, + #[prost(message, repeated, tag="8")] + pub fields: ::prost::alloc::vec::Vec<::prost_types::Struct>, +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum KinematicsFileFormat { diff --git a/src/gen/viam.component.base.v1.rs b/src/gen/viam.component.base.v1.rs index 24af7ba..cf4ca53 100644 --- a/src/gen/viam.component.base.v1.rs +++ b/src/gen/viam.component.base.v1.rs @@ -121,5 +121,7 @@ pub struct GetPropertiesResponse { pub width_meters: f64, #[prost(double, tag="2")] pub turning_radius_meters: f64, + #[prost(double, tag="3")] + pub wheel_circumference_meters: f64, } // @@protoc_insertion_point(module) diff --git a/src/gen/viam.component.board.v1.rs b/src/gen/viam.component.board.v1.rs index 5ca12c5..21a47e4 100644 --- a/src/gen/viam.component.board.v1.rs +++ b/src/gen/viam.component.board.v1.rs @@ -137,6 +137,25 @@ pub struct ReadAnalogReaderResponse { #[prost(int32, tag="1")] pub value: i32, } +// Analog Writer + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WriteAnalogRequest { + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub pin: ::prost::alloc::string::String, + #[prost(int32, tag="3")] + pub value: i32, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WriteAnalogResponse { +} // Digital Interrupt #[allow(clippy::derive_partial_eq_without_eq)] @@ -158,6 +177,32 @@ pub struct GetDigitalInterruptValueResponse { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamTicksRequest { + /// Board name + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// Name of digital interrupts to recieve ticks from + #[prost(string, repeated, tag="2")] + pub pin_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamTicksResponse { + /// name of interrupt + #[prost(string, tag="1")] + pub pin_name: ::prost::alloc::string::String, + /// Time in nanoseconds of a tick + #[prost(uint64, tag="2")] + pub time: u64, + /// Value high or low of the tick + #[prost(bool, tag="3")] + pub high: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SetPowerModeRequest { /// name of board #[prost(string, tag="1")] diff --git a/src/gen/viam.component.board.v1.tonic.rs b/src/gen/viam.component.board.v1.tonic.rs index 8893ea7..8d49ac0 100644 --- a/src/gen/viam.component.board.v1.tonic.rs +++ b/src/gen/viam.component.board.v1.tonic.rs @@ -327,6 +327,36 @@ pub mod board_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn write_analog( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.component.board.v1.BoardService/WriteAnalog", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.component.board.v1.BoardService", + "WriteAnalog", + ), + ); + self.inner.unary(req, path, codec).await + } pub async fn get_digital_interrupt_value( &mut self, request: impl tonic::IntoRequest, @@ -357,6 +387,36 @@ pub mod board_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn stream_ticks( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response>, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.component.board.v1.BoardService/StreamTicks", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.component.board.v1.BoardService", + "StreamTicks", + ), + ); + self.inner.server_streaming(req, path, codec).await + } pub async fn set_power_mode( &mut self, request: impl tonic::IntoRequest, @@ -480,6 +540,13 @@ pub mod board_service_server { tonic::Response, tonic::Status, >; + async fn write_analog( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn get_digital_interrupt_value( &self, request: tonic::Request, @@ -487,6 +554,19 @@ pub mod board_service_server { tonic::Response, tonic::Status, >; + /// Server streaming response type for the StreamTicks method. + type StreamTicksStream: futures_core::Stream< + Item = std::result::Result, + > + + Send + + 'static; + async fn stream_ticks( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn set_power_mode( &self, request: tonic::Request, @@ -988,6 +1068,52 @@ pub mod board_service_server { }; Box::pin(fut) } + "/viam.component.board.v1.BoardService/WriteAnalog" => { + #[allow(non_camel_case_types)] + struct WriteAnalogSvc(pub Arc); + impl< + T: BoardService, + > tonic::server::UnaryService + for WriteAnalogSvc { + type Response = super::WriteAnalogResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).write_analog(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WriteAnalogSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/viam.component.board.v1.BoardService/GetDigitalInterruptValue" => { #[allow(non_camel_case_types)] struct GetDigitalInterruptValueSvc(pub Arc); @@ -1036,6 +1162,53 @@ pub mod board_service_server { }; Box::pin(fut) } + "/viam.component.board.v1.BoardService/StreamTicks" => { + #[allow(non_camel_case_types)] + struct StreamTicksSvc(pub Arc); + impl< + T: BoardService, + > tonic::server::ServerStreamingService + for StreamTicksSvc { + type Response = super::StreamTicksResponse; + type ResponseStream = T::StreamTicksStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).stream_ticks(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = StreamTicksSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.server_streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/viam.component.board.v1.BoardService/SetPowerMode" => { #[allow(non_camel_case_types)] struct SetPowerModeSvc(pub Arc); diff --git a/src/gen/viam.component.camera.v1.rs b/src/gen/viam.component.camera.v1.rs index b1e462e..e62faa9 100644 --- a/src/gen/viam.component.camera.v1.rs +++ b/src/gen/viam.component.camera.v1.rs @@ -8,6 +8,9 @@ pub struct GetImageRequest { /// Requested MIME type of response #[prost(string, tag="2")] pub mime_type: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -58,6 +61,9 @@ pub struct RenderFrameRequest { /// Requested MIME type of response #[prost(string, tag="2")] pub mime_type: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -68,6 +74,9 @@ pub struct GetPointCloudRequest { /// Requested MIME type of response #[prost(string, tag="2")] pub mime_type: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -102,6 +111,9 @@ pub struct GetPropertiesResponse { /// Initializing the parameters with 0-values is considered an error #[prost(message, optional, tag="3")] pub distortion_parameters: ::core::option::Option, + /// Supported MIME types by the camera + #[prost(string, repeated, tag="4")] + pub mime_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/gen/viam.component.generic.v1.tonic.rs b/src/gen/viam.component.generic.v1.tonic.rs index b3c515a..7e1d921 100644 --- a/src/gen/viam.component.generic.v1.tonic.rs +++ b/src/gen/viam.component.generic.v1.tonic.rs @@ -84,7 +84,7 @@ pub mod generic_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /** DoCommand sends/recieves arbitrary commands + /** DoCommand sends/receives arbitrary commands */ pub async fn do_command( &mut self, @@ -163,7 +163,7 @@ pub mod generic_service_server { /// Generated trait containing gRPC methods that should be implemented for use with GenericServiceServer. #[async_trait] pub trait GenericService: Send + Sync + 'static { - /** DoCommand sends/recieves arbitrary commands + /** DoCommand sends/receives arbitrary commands */ async fn do_command( &self, diff --git a/src/gen/viam.component.movementsensor.v1.rs b/src/gen/viam.component.movementsensor.v1.rs index fa3d2ff..755f1e4 100644 --- a/src/gen/viam.component.movementsensor.v1.rs +++ b/src/gen/viam.component.movementsensor.v1.rs @@ -46,7 +46,7 @@ pub struct GetCompassHeadingRequest { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetCompassHeadingResponse { - /// A number from 0-359 where + /// A number from 0-359 in degrees where /// 0 is North, 90 is East, 180 is South, and 270 is West #[prost(double, tag="1")] pub value: f64, @@ -64,6 +64,8 @@ pub struct GetOrientationRequest { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetOrientationResponse { + /// Orientation is returned as an orientation message with + /// OX OY OZ as unit-normalized components of the axis of the vector, and Theta in degrees #[prost(message, optional, tag="1")] pub orientation: ::core::option::Option, } @@ -80,6 +82,8 @@ pub struct GetPositionRequest { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetPositionResponse { + /// Position is returned in a coordinate of latitute and longitude + /// and an altidue in meters #[prost(message, optional, tag="1")] pub coordinate: ::core::option::Option, #[prost(float, tag="2")] @@ -126,6 +130,14 @@ pub struct GetAccuracyRequest { pub struct GetAccuracyResponse { #[prost(map="string, float", tag="1")] pub accuracy: ::std::collections::HashMap<::prost::alloc::string::String, f32>, + #[prost(float, optional, tag="2")] + pub position_hdop: ::core::option::Option, + #[prost(float, optional, tag="3")] + pub position_vdop: ::core::option::Option, + #[prost(int32, optional, tag="4")] + pub position_nmea_gga_fix: ::core::option::Option, + #[prost(float, optional, tag="5")] + pub compass_degrees_error: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/gen/viam.component.movementsensor.v1.tonic.rs b/src/gen/viam.component.movementsensor.v1.tonic.rs index cc71bc7..8bcad44 100644 --- a/src/gen/viam.component.movementsensor.v1.tonic.rs +++ b/src/gen/viam.component.movementsensor.v1.tonic.rs @@ -390,6 +390,38 @@ pub mod movement_sensor_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn get_readings( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::super::common::v1::GetReadingsRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.component.movementsensor.v1.MovementSensorService/GetReadings", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.component.movementsensor.v1.MovementSensorService", + "GetReadings", + ), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -475,6 +507,15 @@ pub mod movement_sensor_service_server { >, tonic::Status, >; + async fn get_readings( + &self, + request: tonic::Request< + super::super::super::super::common::v1::GetReadingsRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct MovementSensorServiceServer { @@ -1022,6 +1063,55 @@ pub mod movement_sensor_service_server { }; Box::pin(fut) } + "/viam.component.movementsensor.v1.MovementSensorService/GetReadings" => { + #[allow(non_camel_case_types)] + struct GetReadingsSvc(pub Arc); + impl< + T: MovementSensorService, + > tonic::server::UnaryService< + super::super::super::super::common::v1::GetReadingsRequest, + > for GetReadingsSvc { + type Response = super::super::super::super::common::v1::GetReadingsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::super::common::v1::GetReadingsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_readings(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetReadingsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { Ok( diff --git a/src/gen/viam.component.powersensor.v1.rs b/src/gen/viam.component.powersensor.v1.rs new file mode 100644 index 0000000..262451f --- /dev/null +++ b/src/gen/viam.component.powersensor.v1.rs @@ -0,0 +1,59 @@ +// @generated +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetVoltageRequest { + /// Name of a power sensor + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetVoltageResponse { + /// Voltage in volts + #[prost(double, tag="1")] + pub volts: f64, + /// Bool describing whether the voltage is DC or AC + #[prost(bool, tag="2")] + pub is_ac: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCurrentRequest { + /// Name of a power sensor + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCurrentResponse { + /// Current in amperes + #[prost(double, tag="1")] + pub amperes: f64, + /// Bool descibing whether the current is DC or AC + #[prost(bool, tag="2")] + pub is_ac: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPowerRequest { + /// Name of a power sensor + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPowerResponse { + /// Power in watts + #[prost(double, tag="1")] + pub watts: f64, +} +// @@protoc_insertion_point(module) diff --git a/src/gen/viam.component.powersensor.v1.tonic.rs b/src/gen/viam.component.powersensor.v1.tonic.rs new file mode 100644 index 0000000..9cbb577 --- /dev/null +++ b/src/gen/viam.component.powersensor.v1.tonic.rs @@ -0,0 +1,638 @@ +// @generated +/// Generated client implementations. +pub mod power_sensor_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct PowerSensorServiceClient { + inner: tonic::client::Grpc, + } + impl PowerSensorServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl PowerSensorServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> PowerSensorServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + PowerSensorServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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_voltage( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.component.powersensor.v1.PowerSensorService/GetVoltage", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.component.powersensor.v1.PowerSensorService", + "GetVoltage", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_current( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.component.powersensor.v1.PowerSensorService/GetCurrent", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.component.powersensor.v1.PowerSensorService", + "GetCurrent", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_power( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.component.powersensor.v1.PowerSensorService/GetPower", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.component.powersensor.v1.PowerSensorService", + "GetPower", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_readings( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::super::common::v1::GetReadingsRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.component.powersensor.v1.PowerSensorService/GetReadings", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.component.powersensor.v1.PowerSensorService", + "GetReadings", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn do_command( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::super::common::v1::DoCommandRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.component.powersensor.v1.PowerSensorService/DoCommand", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.component.powersensor.v1.PowerSensorService", + "DoCommand", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod power_sensor_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with PowerSensorServiceServer. + #[async_trait] + pub trait PowerSensorService: Send + Sync + 'static { + async fn get_voltage( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_current( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_power( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_readings( + &self, + request: tonic::Request< + super::super::super::super::common::v1::GetReadingsRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn do_command( + &self, + request: tonic::Request< + super::super::super::super::common::v1::DoCommandRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct PowerSensorServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl PowerSensorServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for PowerSensorServiceServer + where + T: PowerSensorService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/viam.component.powersensor.v1.PowerSensorService/GetVoltage" => { + #[allow(non_camel_case_types)] + struct GetVoltageSvc(pub Arc); + impl< + T: PowerSensorService, + > tonic::server::UnaryService + for GetVoltageSvc { + type Response = super::GetVoltageResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_voltage(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetVoltageSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.component.powersensor.v1.PowerSensorService/GetCurrent" => { + #[allow(non_camel_case_types)] + struct GetCurrentSvc(pub Arc); + impl< + T: PowerSensorService, + > tonic::server::UnaryService + for GetCurrentSvc { + type Response = super::GetCurrentResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_current(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetCurrentSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.component.powersensor.v1.PowerSensorService/GetPower" => { + #[allow(non_camel_case_types)] + struct GetPowerSvc(pub Arc); + impl< + T: PowerSensorService, + > tonic::server::UnaryService + for GetPowerSvc { + type Response = super::GetPowerResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_power(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetPowerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.component.powersensor.v1.PowerSensorService/GetReadings" => { + #[allow(non_camel_case_types)] + struct GetReadingsSvc(pub Arc); + impl< + T: PowerSensorService, + > tonic::server::UnaryService< + super::super::super::super::common::v1::GetReadingsRequest, + > for GetReadingsSvc { + type Response = super::super::super::super::common::v1::GetReadingsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::super::common::v1::GetReadingsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_readings(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetReadingsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.component.powersensor.v1.PowerSensorService/DoCommand" => { + #[allow(non_camel_case_types)] + struct DoCommandSvc(pub Arc); + impl< + T: PowerSensorService, + > tonic::server::UnaryService< + super::super::super::super::common::v1::DoCommandRequest, + > for DoCommandSvc { + type Response = super::super::super::super::common::v1::DoCommandResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::super::common::v1::DoCommandRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).do_command(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DoCommandSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for PowerSensorServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for PowerSensorServiceServer { + const NAME: &'static str = "viam.component.powersensor.v1.PowerSensorService"; + } +} diff --git a/src/gen/viam.component.sensor.v1.rs b/src/gen/viam.component.sensor.v1.rs deleted file mode 100644 index bac7d58..0000000 --- a/src/gen/viam.component.sensor.v1.rs +++ /dev/null @@ -1,18 +0,0 @@ -// @generated -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetReadingsRequest { - /// Name of a sensor - #[prost(string, tag="1")] - pub name: ::prost::alloc::string::String, - /// Additional arguments to the method - #[prost(message, optional, tag="99")] - pub extra: ::core::option::Option<::prost_types::Struct>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetReadingsResponse { - #[prost(map="string, message", tag="1")] - pub readings: ::std::collections::HashMap<::prost::alloc::string::String, ::prost_types::Value>, -} -// @@protoc_insertion_point(module) diff --git a/src/gen/viam.component.sensor.v1.tonic.rs b/src/gen/viam.component.sensor.v1.tonic.rs index 3bb9f92..d091066 100644 --- a/src/gen/viam.component.sensor.v1.tonic.rs +++ b/src/gen/viam.component.sensor.v1.tonic.rs @@ -84,13 +84,13 @@ pub mod sensor_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /** GetReadings returns the readings of a sensor of the underlying robot. -*/ pub async fn get_readings( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest< + super::super::super::super::common::v1::GetReadingsRequest, + >, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -150,6 +150,8 @@ pub mod sensor_service_client { ); self.inner.unary(req, path, codec).await } + /** GetGeometries returns the geometries of the component in their current configuration +*/ pub async fn get_geometries( &mut self, request: impl tonic::IntoRequest< @@ -193,13 +195,13 @@ pub mod sensor_service_server { /// Generated trait containing gRPC methods that should be implemented for use with SensorServiceServer. #[async_trait] pub trait SensorService: Send + Sync + 'static { - /** GetReadings returns the readings of a sensor of the underlying robot. -*/ async fn get_readings( &self, - request: tonic::Request, + request: tonic::Request< + super::super::super::super::common::v1::GetReadingsRequest, + >, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; /** DoCommand sends/receives arbitrary commands @@ -213,6 +215,8 @@ pub mod sensor_service_server { tonic::Response, tonic::Status, >; + /** GetGeometries returns the geometries of the component in their current configuration +*/ async fn get_geometries( &self, request: tonic::Request< @@ -309,16 +313,19 @@ pub mod sensor_service_server { struct GetReadingsSvc(pub Arc); impl< T: SensorService, - > tonic::server::UnaryService - for GetReadingsSvc { - type Response = super::GetReadingsResponse; + > tonic::server::UnaryService< + super::super::super::super::common::v1::GetReadingsRequest, + > for GetReadingsSvc { + type Response = super::super::super::super::common::v1::GetReadingsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::super::common::v1::GetReadingsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { diff --git a/src/gen/viam.module.v1.rs b/src/gen/viam.module.v1.rs index 76361fe..2518b51 100644 --- a/src/gen/viam.module.v1.rs +++ b/src/gen/viam.module.v1.rs @@ -52,6 +52,8 @@ pub struct HandlerMap { pub struct ReadyRequest { #[prost(string, tag="1")] pub parent_address: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub webrtc_offer: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -60,6 +62,8 @@ pub struct ReadyResponse { pub ready: bool, #[prost(message, optional, tag="2")] pub handlermap: ::core::option::Option, + #[prost(string, tag="3")] + pub webrtc_answer: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/gen/viam.provisioning.v1.rs b/src/gen/viam.provisioning.v1.rs new file mode 100644 index 0000000..4e145d9 --- /dev/null +++ b/src/gen/viam.provisioning.v1.rs @@ -0,0 +1,93 @@ +// @generated +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSmartMachineStatusRequest { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSmartMachineStatusResponse { + #[prost(message, optional, tag="1")] + pub provisioning_info: ::core::option::Option, + #[prost(bool, tag="2")] + pub has_smart_machine_credentials: bool, + #[prost(bool, tag="3")] + pub is_online: bool, + #[prost(message, optional, tag="4")] + pub latest_connection_attempt: ::core::option::Option, + #[prost(string, repeated, tag="5")] + pub errors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetNetworkCredentialsRequest { + #[prost(string, tag="1")] + pub r#type: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub ssid: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub psk: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetNetworkCredentialsResponse { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetSmartMachineCredentialsRequest { + #[prost(message, optional, tag="1")] + pub cloud: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetSmartMachineCredentialsResponse { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNetworkListRequest { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNetworkListResponse { + #[prost(message, repeated, tag="1")] + pub networks: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ProvisioningInfo { + #[prost(string, tag="1")] + pub fragment_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub model: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub manufacturer: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NetworkInfo { + #[prost(string, tag="1")] + pub r#type: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub ssid: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub security: ::prost::alloc::string::String, + #[prost(int32, tag="4")] + pub signal: i32, + #[prost(bool, tag="5")] + pub connected: bool, + #[prost(string, tag="6")] + pub last_error: ::prost::alloc::string::String, +} +/// minimal CloudConfig to create /etc/viam.json +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CloudConfig { + /// SmartMachine part id + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// SmartMachine part secret + #[prost(string, tag="2")] + pub secret: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub app_address: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/src/gen/viam.provisioning.v1.tonic.rs b/src/gen/viam.provisioning.v1.tonic.rs new file mode 100644 index 0000000..02df45d --- /dev/null +++ b/src/gen/viam.provisioning.v1.tonic.rs @@ -0,0 +1,554 @@ +// @generated +/// Generated client implementations. +pub mod provisioning_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct ProvisioningServiceClient { + inner: tonic::client::Grpc, + } + impl ProvisioningServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl ProvisioningServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> ProvisioningServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + ProvisioningServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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_smart_machine_status( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.provisioning.v1.ProvisioningService/GetSmartMachineStatus", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.provisioning.v1.ProvisioningService", + "GetSmartMachineStatus", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn set_network_credentials( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.provisioning.v1.ProvisioningService/SetNetworkCredentials", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.provisioning.v1.ProvisioningService", + "SetNetworkCredentials", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn set_smart_machine_credentials( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.provisioning.v1.ProvisioningService/SetSmartMachineCredentials", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.provisioning.v1.ProvisioningService", + "SetSmartMachineCredentials", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_network_list( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.provisioning.v1.ProvisioningService/GetNetworkList", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.provisioning.v1.ProvisioningService", + "GetNetworkList", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod provisioning_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with ProvisioningServiceServer. + #[async_trait] + pub trait ProvisioningService: Send + Sync + 'static { + async fn get_smart_machine_status( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn set_network_credentials( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn set_smart_machine_credentials( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_network_list( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct ProvisioningServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl ProvisioningServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for ProvisioningServiceServer + where + T: ProvisioningService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/viam.provisioning.v1.ProvisioningService/GetSmartMachineStatus" => { + #[allow(non_camel_case_types)] + struct GetSmartMachineStatusSvc(pub Arc); + impl< + T: ProvisioningService, + > tonic::server::UnaryService + for GetSmartMachineStatusSvc { + type Response = super::GetSmartMachineStatusResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_smart_machine_status(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetSmartMachineStatusSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.provisioning.v1.ProvisioningService/SetNetworkCredentials" => { + #[allow(non_camel_case_types)] + struct SetNetworkCredentialsSvc(pub Arc); + impl< + T: ProvisioningService, + > tonic::server::UnaryService + for SetNetworkCredentialsSvc { + type Response = super::SetNetworkCredentialsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).set_network_credentials(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetNetworkCredentialsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.provisioning.v1.ProvisioningService/SetSmartMachineCredentials" => { + #[allow(non_camel_case_types)] + struct SetSmartMachineCredentialsSvc( + pub Arc, + ); + impl< + T: ProvisioningService, + > tonic::server::UnaryService< + super::SetSmartMachineCredentialsRequest, + > for SetSmartMachineCredentialsSvc { + type Response = super::SetSmartMachineCredentialsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::SetSmartMachineCredentialsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).set_smart_machine_credentials(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetSmartMachineCredentialsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.provisioning.v1.ProvisioningService/GetNetworkList" => { + #[allow(non_camel_case_types)] + struct GetNetworkListSvc(pub Arc); + impl< + T: ProvisioningService, + > tonic::server::UnaryService + for GetNetworkListSvc { + type Response = super::GetNetworkListResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_network_list(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetNetworkListSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for ProvisioningServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for ProvisioningServiceServer { + const NAME: &'static str = "viam.provisioning.v1.ProvisioningService"; + } +} diff --git a/src/gen/viam.robot.v1.rs b/src/gen/viam.robot.v1.rs index 31c5a1d..7ffaec5 100644 --- a/src/gen/viam.robot.v1.rs +++ b/src/gen/viam.robot.v1.rs @@ -203,6 +203,8 @@ pub struct Status { pub name: ::core::option::Option, #[prost(message, optional, tag="2")] pub status: ::core::option::Option<::prost_types::Struct>, + #[prost(message, optional, tag="3")] + pub last_reconfigured: ::core::option::Option<::prost_types::Timestamp>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -275,6 +277,34 @@ pub struct SendSessionHeartbeatRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendSessionHeartbeatResponse { } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LogRequest { + #[prost(message, repeated, tag="1")] + pub logs: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LogResponse { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCloudMetadataRequest { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCloudMetadataResponse { + #[prost(string, tag="1")] + pub robot_part_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub primary_org_id: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub location_id: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub machine_id: ::prost::alloc::string::String, + #[prost(string, tag="5")] + pub machine_part_id: ::prost::alloc::string::String, +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum PeerConnectionType { diff --git a/src/gen/viam.robot.v1.tonic.rs b/src/gen/viam.robot.v1.tonic.rs index 9e7d349..a5333e2 100644 --- a/src/gen/viam.robot.v1.tonic.rs +++ b/src/gen/viam.robot.v1.tonic.rs @@ -471,6 +471,55 @@ pub mod robot_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn log( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.robot.v1.RobotService/Log", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("viam.robot.v1.RobotService", "Log")); + self.inner.unary(req, path, codec).await + } + pub async fn get_cloud_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.robot.v1.RobotService/GetCloudMetadata", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("viam.robot.v1.RobotService", "GetCloudMetadata"), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -588,6 +637,17 @@ pub mod robot_service_server { tonic::Response, tonic::Status, >; + async fn log( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn get_cloud_metadata( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct RobotServiceServer { @@ -1355,6 +1415,94 @@ pub mod robot_service_server { }; Box::pin(fut) } + "/viam.robot.v1.RobotService/Log" => { + #[allow(non_camel_case_types)] + struct LogSvc(pub Arc); + impl tonic::server::UnaryService + for LogSvc { + type Response = super::LogResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).log(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = LogSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.robot.v1.RobotService/GetCloudMetadata" => { + #[allow(non_camel_case_types)] + struct GetCloudMetadataSvc(pub Arc); + impl< + T: RobotService, + > tonic::server::UnaryService + for GetCloudMetadataSvc { + type Response = super::GetCloudMetadataResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_cloud_metadata(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetCloudMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { Ok( diff --git a/src/gen/viam.service.generic.v1.tonic.rs b/src/gen/viam.service.generic.v1.tonic.rs new file mode 100644 index 0000000..8a10458 --- /dev/null +++ b/src/gen/viam.service.generic.v1.tonic.rs @@ -0,0 +1,304 @@ +// @generated +/// Generated client implementations. +pub mod generic_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct GenericServiceClient { + inner: tonic::client::Grpc, + } + impl GenericServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl GenericServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + 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( + inner: T, + interceptor: F, + ) -> GenericServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + GenericServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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 do_command( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::super::common::v1::DoCommandRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.service.generic.v1.GenericService/DoCommand", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.service.generic.v1.GenericService", + "DoCommand", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod generic_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with GenericServiceServer. + #[async_trait] + pub trait GenericService: Send + Sync + 'static { + async fn do_command( + &self, + request: tonic::Request< + super::super::super::super::common::v1::DoCommandRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct GenericServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl GenericServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for GenericServiceServer + where + T: GenericService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/viam.service.generic.v1.GenericService/DoCommand" => { + #[allow(non_camel_case_types)] + struct DoCommandSvc(pub Arc); + impl< + T: GenericService, + > tonic::server::UnaryService< + super::super::super::super::common::v1::DoCommandRequest, + > for DoCommandSvc { + type Response = super::super::super::super::common::v1::DoCommandResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::super::common::v1::DoCommandRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).do_command(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DoCommandSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for GenericServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for GenericServiceServer { + const NAME: &'static str = "viam.service.generic.v1.GenericService"; + } +} diff --git a/src/gen/viam.service.mlmodel.v1.rs b/src/gen/viam.service.mlmodel.v1.rs index 19db1e0..a5c939d 100644 --- a/src/gen/viam.service.mlmodel.v1.rs +++ b/src/gen/viam.service.mlmodel.v1.rs @@ -5,16 +5,19 @@ pub struct InferRequest { /// name of the model service #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, - /// this is a struct of input arrays/tensors as specified in the metadata - #[prost(message, optional, tag="2")] - pub input_data: ::core::option::Option<::prost_types::Struct>, + /// the input data is provided as set of named flat tensors + #[prost(message, optional, tag="3")] + pub input_tensors: ::core::option::Option, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InferResponse { - /// this is a struct of output arrays/tensors as specified in the metadata - #[prost(message, optional, tag="2")] - pub output_data: ::core::option::Option<::prost_types::Struct>, + /// the output data is provided as a set of named flat tensors + #[prost(message, optional, tag="3")] + pub output_tensors: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -22,6 +25,9 @@ pub struct MetadataRequest { /// name of the model service #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -84,6 +90,115 @@ pub struct File { #[prost(enumeration="LabelType", tag="3")] pub label_type: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataInt8 { + #[prost(bytes="vec", tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataUInt8 { + #[prost(bytes="vec", tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataInt16 { + /// packs two 16-bit numbers per entry - explicitly little-endian + /// so big-endian producers/consumers must compensate + #[prost(fixed32, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataUInt16 { + /// packs two 16-bit numbers per entry - explicitly little-endian + /// so big-endian producers/consumers must compensate + #[prost(fixed32, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataInt32 { + #[prost(sfixed32, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataUInt32 { + #[prost(fixed32, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataInt64 { + #[prost(sfixed64, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataUInt64 { + #[prost(fixed64, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataFloat { + #[prost(float, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensorDataDouble { + #[prost(double, repeated, tag="1")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensor { + /// the shape of the provided tensor as a list of integer extents + #[prost(fixed64, repeated, tag="1")] + pub shape: ::prost::alloc::vec::Vec, + /// the flat data to be interpreted per the above shape information + #[prost(oneof="flat_tensor::Tensor", tags="2, 3, 4, 5, 6, 7, 8, 9, 10, 11")] + pub tensor: ::core::option::Option, +} +/// Nested message and enum types in `FlatTensor`. +pub mod flat_tensor { + /// the flat data to be interpreted per the above shape information + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Tensor { + #[prost(message, tag="2")] + Int8Tensor(super::FlatTensorDataInt8), + #[prost(message, tag="3")] + Uint8Tensor(super::FlatTensorDataUInt8), + #[prost(message, tag="4")] + Int16Tensor(super::FlatTensorDataInt16), + #[prost(message, tag="5")] + Uint16Tensor(super::FlatTensorDataUInt16), + #[prost(message, tag="6")] + Int32Tensor(super::FlatTensorDataInt32), + #[prost(message, tag="7")] + Uint32Tensor(super::FlatTensorDataUInt32), + #[prost(message, tag="8")] + Int64Tensor(super::FlatTensorDataInt64), + #[prost(message, tag="9")] + Uint64Tensor(super::FlatTensorDataUInt64), + #[prost(message, tag="10")] + FloatTensor(super::FlatTensorDataFloat), + #[prost(message, tag="11")] + DoubleTensor(super::FlatTensorDataDouble), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlatTensors { + /// A name-indexed collection of flat tensor objects + #[prost(map="string, message", tag="1")] + pub tensors: ::std::collections::HashMap<::prost::alloc::string::String, FlatTensor>, +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum LabelType { diff --git a/src/gen/viam.service.motion.v1.rs b/src/gen/viam.service.motion.v1.rs index 0e742f1..429537a 100644 --- a/src/gen/viam.service.motion.v1.rs +++ b/src/gen/viam.service.motion.v1.rs @@ -44,6 +44,12 @@ pub struct MoveOnMapRequest { /// Name of the slam service from which the SLAM map is requested #[prost(message, optional, tag="4")] pub slam_service_name: ::core::option::Option, + /// Optional set of motion configuration options + #[prost(message, optional, tag="5")] + pub motion_configuration: ::core::option::Option, + /// Obstacles to be considered for motion planning + #[prost(message, repeated, tag="6")] + pub obstacles: ::prost::alloc::vec::Vec, /// Additional arguments to the method #[prost(message, optional, tag="99")] pub extra: ::core::option::Option<::prost_types::Struct>, @@ -51,8 +57,42 @@ pub struct MoveOnMapRequest { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MoveOnMapResponse { - #[prost(bool, tag="1")] - pub success: bool, + /// The unique ID which identifies the execution. + /// Multiple plans will share the same execution_id if they were + /// generated due to replanning. + #[prost(string, tag="1")] + pub execution_id: ::prost::alloc::string::String, +} +/// Pairs a vision service with a camera, informing the service about which camera it may use +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ObstacleDetector { + #[prost(message, optional, tag="1")] + pub vision_service: ::core::option::Option, + #[prost(message, optional, tag="2")] + pub camera: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MotionConfiguration { + /// The ObstacleDetectors that will be used for transient obstacle avoidance + #[prost(message, repeated, tag="1")] + pub obstacle_detectors: ::prost::alloc::vec::Vec, + /// Sets the frequency to poll for the position of the robot + #[prost(double, optional, tag="2")] + pub position_polling_frequency_hz: ::core::option::Option, + /// Sets the frequency to poll the vision service(s) for new obstacles + #[prost(double, optional, tag="3")] + pub obstacle_polling_frequency_hz: ::core::option::Option, + /// Sets the distance in meters that a robot is allowed to deviate from the motion plan + #[prost(double, optional, tag="4")] + pub plan_deviation_m: ::core::option::Option, + /// Optional linear velocity to target when moving + #[prost(double, optional, tag="5")] + pub linear_m_per_sec: ::core::option::Option, + /// Optional angular velocity to target when turning + #[prost(double, optional, tag="6")] + pub angular_degs_per_sec: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -75,12 +115,9 @@ pub struct MoveOnGlobeRequest { /// Obstacles to be considered for motion planning #[prost(message, repeated, tag="6")] pub obstacles: ::prost::alloc::vec::Vec, - /// Optional linear velocity to target when moving - #[prost(float, optional, tag="7")] - pub linear_meters_per_sec: ::core::option::Option, - /// Optional angular velocity to target when turning - #[prost(float, optional, tag="8")] - pub angular_deg_per_sec: ::core::option::Option, + /// Optional set of motion configuration options + #[prost(message, optional, tag="7")] + pub motion_configuration: ::core::option::Option, /// Additional arguments to the method #[prost(message, optional, tag="99")] pub extra: ::core::option::Option<::prost_types::Struct>, @@ -88,29 +125,11 @@ pub struct MoveOnGlobeRequest { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MoveOnGlobeResponse { - #[prost(bool, tag="1")] - pub success: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MoveSingleComponentRequest { + /// The unique ID which identifies the execution. + /// Multiple plans will share the same execution_id if they were + /// generated due to replanning. #[prost(string, tag="1")] - pub name: ::prost::alloc::string::String, - #[prost(message, optional, tag="2")] - pub destination: ::core::option::Option, - #[prost(message, optional, tag="3")] - pub component_name: ::core::option::Option, - #[prost(message, optional, tag="4")] - pub world_state: ::core::option::Option, - /// Additional arguments to the method - #[prost(message, optional, tag="99")] - pub extra: ::core::option::Option<::prost_types::Struct>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MoveSingleComponentResponse { - #[prost(bool, tag="1")] - pub success: bool, + pub execution_id: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -139,6 +158,79 @@ pub struct GetPoseResponse { #[prost(message, optional, tag="1")] pub pose: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StopPlanRequest { + /// The name of the motion service + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The component of the currently executing plan to stop + #[prost(message, optional, tag="2")] + pub component_name: ::core::option::Option, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StopPlanResponse { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListPlanStatusesRequest { + /// The name of the motion service + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// If supplied, the response will filter the + /// plan results for the supplied state + #[prost(bool, tag="2")] + pub only_active_plans: bool, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +/// Status of all executed / executing plan statuses with associated IDs within the 24 hour TTL +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListPlanStatusesResponse { + /// List of last known statuses with the associated IDs of all plans within the TTL + /// ordered by timestamp in ascending order + #[prost(message, repeated, tag="1")] + pub plan_statuses_with_ids: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPlanRequest { + /// The name of the motion service + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// The name of the component which was requested to be moved. + #[prost(message, optional, tag="2")] + pub component_name: ::core::option::Option, + /// If supplied, the response will only return + /// the the last plan for the component / execution + #[prost(bool, tag="3")] + pub last_plan_only: bool, + /// If you want to know about the plans of a previous execution + #[prost(string, optional, tag="4")] + pub execution_id: ::core::option::Option<::prost::alloc::string::String>, + /// Additional arguments to the method + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPlanResponse { + /// The current plan and status that matches the request query + #[prost(message, optional, tag="1")] + pub current_plan_with_status: ::core::option::Option, + /// Returns the history of all previous plans that were + /// generated in ascending order. + /// This field will be empty if the motion service + /// did not need to re-plan. + #[prost(message, repeated, tag="2")] + pub replan_history: ::prost::alloc::vec::Vec, +} /// Constraints specifies all enumerated constraints to be passed to Viam's motion planning, along with any optional parameters #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -152,7 +244,8 @@ pub struct Constraints { #[prost(message, repeated, tag="3")] pub collision_specification: ::prost::alloc::vec::Vec, } -/// LinearConstraint specifies that the component being moved should move linearly relative to its goal. It does not constrain the motion of components other than the `component_name` specified in motion.Move +/// LinearConstraint specifies that the component being moved should move linearly relative to its goal. +/// It does not constrain the motion of components other than the `component_name` specified in motion.Move #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LinearConstraint { @@ -163,7 +256,8 @@ pub struct LinearConstraint { #[prost(float, optional, tag="2")] pub orientation_tolerance_degs: ::core::option::Option, } -/// OrientationConstraint specifies that the component being moved will not deviate its orientation beyond some threshold relative to the goal. It does not constrain the motion of components other than the `component_name` specified in motion.Move +/// OrientationConstraint specifies that the component being moved will not deviate its orientation beyond some threshold relative +/// to the goal. It does not constrain the motion of components other than the `component_name` specified in motion.Move #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrientationConstraint { @@ -190,4 +284,139 @@ pub mod collision_specification { pub frame2: ::prost::alloc::string::String, } } +/// Describes a plan, its current status & all status changes +/// that have occured previously on that plan +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PlanWithStatus { + /// The plan + #[prost(message, optional, tag="1")] + pub plan: ::core::option::Option, + /// The current status of the plan + #[prost(message, optional, tag="2")] + pub status: ::core::option::Option, + /// The prior status changes that have happened during plan execution + #[prost(message, repeated, tag="3")] + pub status_history: ::prost::alloc::vec::Vec, +} +/// PlanStatusWithID describes the state of a given plan at a +/// point in time plus the plan_id, component_name and execution_id +/// the status is associated with +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PlanStatusWithId { + /// The unique ID of the plan + #[prost(string, tag="1")] + pub plan_id: ::prost::alloc::string::String, + /// The component to be moved. + /// Used for tracking & stopping. + /// NOTE: A plan may move more components than just the + /// component_name. + #[prost(message, optional, tag="2")] + pub component_name: ::core::option::Option, + /// The unique ID which identifies the plan execution. + /// Multiple plans will share the same execution_id if they were + /// generated due to replanning. + #[prost(string, tag="3")] + pub execution_id: ::prost::alloc::string::String, + #[prost(message, optional, tag="4")] + pub status: ::core::option::Option, +} +/// Plan status describes the state of a given plan at a +/// point in time +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PlanStatus { + /// The state of the plan execution + #[prost(enumeration="PlanState", tag="1")] + pub state: i32, + /// The time the executing plan transtioned to the state + #[prost(message, optional, tag="2")] + pub timestamp: ::core::option::Option<::prost_types::Timestamp>, + /// The reason for the state change. If motion plan failed + /// this will return the error message. + /// If motion needed to re-plan, this will return + /// the re-plan reason. + #[prost(string, optional, tag="3")] + pub reason: ::core::option::Option<::prost::alloc::string::String>, +} +/// A plan describes a motion plan +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Plan { + /// The plan's unique ID + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The component requested to be moved. + /// Used for tracking & stopping. + /// NOTE: A plan may move more components than just the + /// root component. + #[prost(message, optional, tag="2")] + pub component_name: ::core::option::Option, + /// The unique ID which identifies the execution. + /// Multiple plans will share the same execution_id if they were + /// generated due to replanning + #[prost(string, tag="3")] + pub execution_id: ::prost::alloc::string::String, + /// The steps of a plan is an ordered list of plan steps + #[prost(message, repeated, tag="4")] + pub steps: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PlanStep { + /// A step is the component state each + /// component resource should reach while executing + /// that step of the plan. + /// Keys are the fully qualified component name. + #[prost(map="string, message", tag="1")] + pub step: ::std::collections::HashMap<::prost::alloc::string::String, ComponentState>, +} +/// A pose +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ComponentState { + #[prost(message, optional, tag="1")] + pub pose: ::core::option::Option, +} +/// The states that a plan can be in. +/// InProgress if the plan is executing. +/// Stopped if the plan was stopped. +/// Suceeded if the robot reached its destination successfully. +/// Failed if the robot did not reach its destination. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum PlanState { + Unspecified = 0, + InProgress = 1, + Stopped = 2, + Succeeded = 3, + Failed = 4, +} +impl PlanState { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + PlanState::Unspecified => "PLAN_STATE_UNSPECIFIED", + PlanState::InProgress => "PLAN_STATE_IN_PROGRESS", + PlanState::Stopped => "PLAN_STATE_STOPPED", + PlanState::Succeeded => "PLAN_STATE_SUCCEEDED", + PlanState::Failed => "PLAN_STATE_FAILED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PLAN_STATE_UNSPECIFIED" => Some(Self::Unspecified), + "PLAN_STATE_IN_PROGRESS" => Some(Self::InProgress), + "PLAN_STATE_STOPPED" => Some(Self::Stopped), + "PLAN_STATE_SUCCEEDED" => Some(Self::Succeeded), + "PLAN_STATE_FAILED" => Some(Self::Failed), + _ => None, + } + } +} // @@protoc_insertion_point(module) diff --git a/src/gen/viam.service.motion.v1.tonic.rs b/src/gen/viam.service.motion.v1.tonic.rs index fbb1bc6..0e0bc2c 100644 --- a/src/gen/viam.service.motion.v1.tonic.rs +++ b/src/gen/viam.service.motion.v1.tonic.rs @@ -163,11 +163,11 @@ pub mod motion_service_client { ); self.inner.unary(req, path, codec).await } - pub async fn move_single_component( + pub async fn get_pose( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -181,23 +181,77 @@ pub mod motion_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/viam.service.motion.v1.MotionService/MoveSingleComponent", + "/viam.service.motion.v1.MotionService/GetPose", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("viam.service.motion.v1.MotionService", "GetPose"), + ); + self.inner.unary(req, path, codec).await + } + pub async fn stop_plan( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.service.motion.v1.MotionService/StopPlan", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("viam.service.motion.v1.MotionService", "StopPlan"), + ); + self.inner.unary(req, path, codec).await + } + pub async fn list_plan_statuses( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.service.motion.v1.MotionService/ListPlanStatuses", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "viam.service.motion.v1.MotionService", - "MoveSingleComponent", + "ListPlanStatuses", ), ); self.inner.unary(req, path, codec).await } - pub async fn get_pose( + pub async fn get_plan( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -211,12 +265,12 @@ pub mod motion_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/viam.service.motion.v1.MotionService/GetPose", + "/viam.service.motion.v1.MotionService/GetPlan", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("viam.service.motion.v1.MotionService", "GetPose"), + GrpcMethod::new("viam.service.motion.v1.MotionService", "GetPlan"), ); self.inner.unary(req, path, codec).await } @@ -276,17 +330,28 @@ pub mod motion_service_server { tonic::Response, tonic::Status, >; - async fn move_single_component( + async fn get_pose( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn stop_plan( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn list_plan_statuses( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - async fn get_pose( + async fn get_plan( &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; async fn do_command( &self, request: tonic::Request< @@ -509,25 +574,113 @@ pub mod motion_service_server { }; Box::pin(fut) } - "/viam.service.motion.v1.MotionService/MoveSingleComponent" => { + "/viam.service.motion.v1.MotionService/GetPose" => { #[allow(non_camel_case_types)] - struct MoveSingleComponentSvc(pub Arc); + struct GetPoseSvc(pub Arc); impl< T: MotionService, - > tonic::server::UnaryService - for MoveSingleComponentSvc { - type Response = super::MoveSingleComponentResponse; + > tonic::server::UnaryService + for GetPoseSvc { + type Response = super::GetPoseResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_pose(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetPoseSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.service.motion.v1.MotionService/StopPlan" => { + #[allow(non_camel_case_types)] + struct StopPlanSvc(pub Arc); + impl< + T: MotionService, + > tonic::server::UnaryService + for StopPlanSvc { + type Response = super::StopPlanResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).stop_plan(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = StopPlanSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.service.motion.v1.MotionService/ListPlanStatuses" => { + #[allow(non_camel_case_types)] + struct ListPlanStatusesSvc(pub Arc); + impl< + T: MotionService, + > tonic::server::UnaryService + for ListPlanStatusesSvc { + type Response = super::ListPlanStatusesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).move_single_component(request).await + (*inner).list_plan_statuses(request).await }; Box::pin(fut) } @@ -539,7 +692,7 @@ pub mod motion_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = MoveSingleComponentSvc(inner); + let method = ListPlanStatusesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -555,24 +708,24 @@ pub mod motion_service_server { }; Box::pin(fut) } - "/viam.service.motion.v1.MotionService/GetPose" => { + "/viam.service.motion.v1.MotionService/GetPlan" => { #[allow(non_camel_case_types)] - struct GetPoseSvc(pub Arc); + struct GetPlanSvc(pub Arc); impl< T: MotionService, - > tonic::server::UnaryService - for GetPoseSvc { - type Response = super::GetPoseResponse; + > tonic::server::UnaryService + for GetPlanSvc { + type Response = super::GetPlanResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { (*inner).get_pose(request).await }; + let fut = async move { (*inner).get_plan(request).await }; Box::pin(fut) } } @@ -583,7 +736,7 @@ pub mod motion_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetPoseSvc(inner); + let method = GetPlanSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( diff --git a/src/gen/viam.service.navigation.v1.rs b/src/gen/viam.service.navigation.v1.rs index eb61df6..55d0c5d 100644 --- a/src/gen/viam.service.navigation.v1.rs +++ b/src/gen/viam.service.navigation.v1.rs @@ -51,6 +51,10 @@ pub struct GetLocationRequest { pub struct GetLocationResponse { #[prost(message, optional, tag="1")] pub location: ::core::option::Option, + /// A number from [0-360) where 0 is north + /// 90 is east, 180 is south, 270 is west + #[prost(double, tag="2")] + pub compass_heading: f64, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -117,12 +121,86 @@ pub struct GetObstaclesResponse { #[prost(message, repeated, tag="1")] pub obstacles: ::prost::alloc::vec::Vec, } +/// A user provided destination and the set of geopoints that +/// the robot is expected to take to get there +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Path { + /// The id of the user specified waypoint + #[prost(string, tag="1")] + pub destination_waypoint_id: ::prost::alloc::string::String, + /// List of geopoints that the motion planner output to reach the destination + /// The first geopoint is the starting position of the robot for that path + #[prost(message, repeated, tag="2")] + pub geopoints: ::prost::alloc::vec::Vec, +} +/// Returns all the paths known to the navigation service +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPathsRequest { + /// Name of the navigation service + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag="99")] + pub extra: ::core::option::Option<::prost_types::Struct>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPathsResponse { + #[prost(message, repeated, tag="1")] + pub paths: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPropertiesRequest { + /// Name of the navigation service + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, +} +/// Returns properties information for the named navigation service +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPropertiesResponse { + #[prost(enumeration="MapType", tag="1")] + pub map_type: i32, +} +/// MapType represents the various types of maps the navigation service can ingest. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum MapType { + Unspecified = 0, + None = 1, + Gps = 2, +} +impl MapType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + MapType::Unspecified => "MAP_TYPE_UNSPECIFIED", + MapType::None => "MAP_TYPE_NONE", + MapType::Gps => "MAP_TYPE_GPS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MAP_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "MAP_TYPE_NONE" => Some(Self::None), + "MAP_TYPE_GPS" => Some(Self::Gps), + _ => None, + } + } +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum Mode { Unspecified = 0, Manual = 1, Waypoint = 2, + Explore = 3, } impl Mode { /// String value of the enum field names used in the ProtoBuf definition. @@ -134,6 +212,7 @@ impl Mode { Mode::Unspecified => "MODE_UNSPECIFIED", Mode::Manual => "MODE_MANUAL", Mode::Waypoint => "MODE_WAYPOINT", + Mode::Explore => "MODE_EXPLORE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -142,6 +221,7 @@ impl Mode { "MODE_UNSPECIFIED" => Some(Self::Unspecified), "MODE_MANUAL" => Some(Self::Manual), "MODE_WAYPOINT" => Some(Self::Waypoint), + "MODE_EXPLORE" => Some(Self::Explore), _ => None, } } diff --git a/src/gen/viam.service.navigation.v1.tonic.rs b/src/gen/viam.service.navigation.v1.tonic.rs index 9e2fecb..e7fbe3c 100644 --- a/src/gen/viam.service.navigation.v1.tonic.rs +++ b/src/gen/viam.service.navigation.v1.tonic.rs @@ -294,6 +294,66 @@ pub mod navigation_service_client { ); self.inner.unary(req, path, codec).await } + pub async fn get_paths( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.service.navigation.v1.NavigationService/GetPaths", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.service.navigation.v1.NavigationService", + "GetPaths", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_properties( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/viam.service.navigation.v1.NavigationService/GetProperties", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "viam.service.navigation.v1.NavigationService", + "GetProperties", + ), + ); + self.inner.unary(req, path, codec).await + } pub async fn do_command( &mut self, request: impl tonic::IntoRequest< @@ -378,6 +438,20 @@ pub mod navigation_service_server { tonic::Response, tonic::Status, >; + async fn get_paths( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn get_properties( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn do_command( &self, request: tonic::Request< @@ -785,6 +859,96 @@ pub mod navigation_service_server { }; Box::pin(fut) } + "/viam.service.navigation.v1.NavigationService/GetPaths" => { + #[allow(non_camel_case_types)] + struct GetPathsSvc(pub Arc); + impl< + T: NavigationService, + > tonic::server::UnaryService + for GetPathsSvc { + type Response = super::GetPathsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_paths(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetPathsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/viam.service.navigation.v1.NavigationService/GetProperties" => { + #[allow(non_camel_case_types)] + struct GetPropertiesSvc(pub Arc); + impl< + T: NavigationService, + > tonic::server::UnaryService + for GetPropertiesSvc { + type Response = super::GetPropertiesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_properties(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetPropertiesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/viam.service.navigation.v1.NavigationService/DoCommand" => { #[allow(non_camel_case_types)] struct DoCommandSvc(pub Arc); diff --git a/src/gen/viam.service.sensors.v1.rs b/src/gen/viam.service.sensors.v1.rs index ff5ecc1..ec5798c 100644 --- a/src/gen/viam.service.sensors.v1.rs +++ b/src/gen/viam.service.sensors.v1.rs @@ -1,33 +1,41 @@ // @generated +/// The sensors service messages are deprecated #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSensorsRequest { + #[deprecated] #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, /// Additional arguments to the method + #[deprecated] #[prost(message, optional, tag="99")] pub extra: ::core::option::Option<::prost_types::Struct>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSensorsResponse { + #[deprecated] #[prost(message, repeated, tag="1")] pub sensor_names: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetReadingsRequest { + #[deprecated] #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, + #[deprecated] #[prost(message, repeated, tag="2")] pub sensor_names: ::prost::alloc::vec::Vec, /// Additional arguments to the method + #[deprecated] #[prost(message, optional, tag="99")] pub extra: ::core::option::Option<::prost_types::Struct>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Readings { + #[deprecated] #[prost(message, optional, tag="1")] pub name: ::core::option::Option, #[prost(map="string, message", tag="2")] @@ -36,6 +44,7 @@ pub struct Readings { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetReadingsResponse { + #[deprecated] #[prost(message, repeated, tag="1")] pub readings: ::prost::alloc::vec::Vec, } diff --git a/src/gen/viam.service.slam.v1.rs b/src/gen/viam.service.slam.v1.rs index 984ff91..7eac477 100644 --- a/src/gen/viam.service.slam.v1.rs +++ b/src/gen/viam.service.slam.v1.rs @@ -25,6 +25,11 @@ pub struct GetPointCloudMapRequest { /// Name of slam service #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, + /// For SLAM services that implement handling an edited map, this boolean + /// should indicate whether to return that edited map. If the SLAM service + /// does not handle edited maps, the unedited map will be returned instead. + #[prost(bool, optional, tag="2")] + pub return_edited_map: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -67,15 +72,94 @@ pub struct GetInternalStateResponse { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLatestMapInfoRequest { - /// Name of the SLAM algo +pub struct GetPropertiesRequest { + /// Name of the slam service #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, } +/// Returns properties information for the named slam service #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLatestMapInfoResponse { - #[prost(message, optional, tag="1")] - pub last_map_update: ::core::option::Option<::prost_types::Timestamp>, +pub struct GetPropertiesResponse { + #[prost(bool, tag="1")] + pub cloud_slam: bool, + #[prost(enumeration="MappingMode", tag="2")] + pub mapping_mode: i32, + #[prost(string, optional, tag="3")] + pub internal_state_file_type: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag="4")] + pub sensor_info: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SensorInfo { + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + #[prost(enumeration="SensorType", tag="2")] + pub r#type: i32, +} +/// MappingMode represnts the various form of mapping and localizing SLAM can perform. +/// These include, creating a new map, localizing on an existiing map and updating an +/// exisiting map. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum MappingMode { + Unspecified = 0, + CreateNewMap = 1, + LocalizeOnly = 2, + UpdateExistingMap = 3, +} +impl MappingMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + MappingMode::Unspecified => "MAPPING_MODE_UNSPECIFIED", + MappingMode::CreateNewMap => "MAPPING_MODE_CREATE_NEW_MAP", + MappingMode::LocalizeOnly => "MAPPING_MODE_LOCALIZE_ONLY", + MappingMode::UpdateExistingMap => "MAPPING_MODE_UPDATE_EXISTING_MAP", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MAPPING_MODE_UNSPECIFIED" => Some(Self::Unspecified), + "MAPPING_MODE_CREATE_NEW_MAP" => Some(Self::CreateNewMap), + "MAPPING_MODE_LOCALIZE_ONLY" => Some(Self::LocalizeOnly), + "MAPPING_MODE_UPDATE_EXISTING_MAP" => Some(Self::UpdateExistingMap), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum SensorType { + Unspecified = 0, + Camera = 1, + MovementSensor = 2, +} +impl SensorType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + SensorType::Unspecified => "SENSOR_TYPE_UNSPECIFIED", + SensorType::Camera => "SENSOR_TYPE_CAMERA", + SensorType::MovementSensor => "SENSOR_TYPE_MOVEMENT_SENSOR", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SENSOR_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "SENSOR_TYPE_CAMERA" => Some(Self::Camera), + "SENSOR_TYPE_MOVEMENT_SENSOR" => Some(Self::MovementSensor), + _ => None, + } + } } // @@protoc_insertion_point(module) diff --git a/src/gen/viam.service.slam.v1.tonic.rs b/src/gen/viam.service.slam.v1.tonic.rs index 2b93496..71589e5 100644 --- a/src/gen/viam.service.slam.v1.tonic.rs +++ b/src/gen/viam.service.slam.v1.tonic.rs @@ -171,11 +171,11 @@ pub mod slam_service_client { ); self.inner.server_streaming(req, path, codec).await } - pub async fn get_latest_map_info( + pub async fn get_properties( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -189,15 +189,12 @@ pub mod slam_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/viam.service.slam.v1.SLAMService/GetLatestMapInfo", + "/viam.service.slam.v1.SLAMService/GetProperties", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new( - "viam.service.slam.v1.SLAMService", - "GetLatestMapInfo", - ), + GrpcMethod::new("viam.service.slam.v1.SLAMService", "GetProperties"), ); self.inner.unary(req, path, codec).await } @@ -278,11 +275,11 @@ pub mod slam_service_server { tonic::Response, tonic::Status, >; - async fn get_latest_map_info( + async fn get_properties( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; async fn do_command( @@ -516,25 +513,25 @@ pub mod slam_service_server { }; Box::pin(fut) } - "/viam.service.slam.v1.SLAMService/GetLatestMapInfo" => { + "/viam.service.slam.v1.SLAMService/GetProperties" => { #[allow(non_camel_case_types)] - struct GetLatestMapInfoSvc(pub Arc); + struct GetPropertiesSvc(pub Arc); impl< T: SlamService, - > tonic::server::UnaryService - for GetLatestMapInfoSvc { - type Response = super::GetLatestMapInfoResponse; + > tonic::server::UnaryService + for GetPropertiesSvc { + type Response = super::GetPropertiesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - (*inner).get_latest_map_info(request).await + (*inner).get_properties(request).await }; Box::pin(fut) } @@ -546,7 +543,7 @@ pub mod slam_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetLatestMapInfoSvc(inner); + let method = GetPropertiesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config(