Skip to main content

nominal_api_proto/proto/
nominal.mesh.v1.internal.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct UpdateRemoteConnectionStatusRequest {
4    #[prost(string, tag = "1")]
5    pub remote_connection_rid: ::prost::alloc::string::String,
6    #[prost(enumeration = "super::RemoteConnectionStatus", tag = "2")]
7    pub status: i32,
8}
9#[derive(Clone, Copy, PartialEq, ::prost::Message)]
10pub struct UpdateRemoteConnectionStatusResponse {}
11/// Generated client implementations.
12pub mod internal_mesh_service_client {
13    #![allow(
14        unused_variables,
15        dead_code,
16        missing_docs,
17        clippy::wildcard_imports,
18        clippy::let_unit_value,
19    )]
20    use tonic::codegen::*;
21    use tonic::codegen::http::Uri;
22    #[derive(Debug, Clone)]
23    pub struct InternalMeshServiceClient<T> {
24        inner: tonic::client::Grpc<T>,
25    }
26    impl InternalMeshServiceClient<tonic::transport::Channel> {
27        /// Attempt to create a new client by connecting to a given endpoint.
28        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
29        where
30            D: TryInto<tonic::transport::Endpoint>,
31            D::Error: Into<StdError>,
32        {
33            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
34            Ok(Self::new(conn))
35        }
36    }
37    impl<T> InternalMeshServiceClient<T>
38    where
39        T: tonic::client::GrpcService<tonic::body::Body>,
40        T::Error: Into<StdError>,
41        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
42        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
43    {
44        pub fn new(inner: T) -> Self {
45            let inner = tonic::client::Grpc::new(inner);
46            Self { inner }
47        }
48        pub fn with_origin(inner: T, origin: Uri) -> Self {
49            let inner = tonic::client::Grpc::with_origin(inner, origin);
50            Self { inner }
51        }
52        pub fn with_interceptor<F>(
53            inner: T,
54            interceptor: F,
55        ) -> InternalMeshServiceClient<InterceptedService<T, F>>
56        where
57            F: tonic::service::Interceptor,
58            T::ResponseBody: Default,
59            T: tonic::codegen::Service<
60                http::Request<tonic::body::Body>,
61                Response = http::Response<
62                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
63                >,
64            >,
65            <T as tonic::codegen::Service<
66                http::Request<tonic::body::Body>,
67            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
68        {
69            InternalMeshServiceClient::new(InterceptedService::new(inner, interceptor))
70        }
71        /// Compress requests with the given encoding.
72        ///
73        /// This requires the server to support it otherwise it might respond with an
74        /// error.
75        #[must_use]
76        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
77            self.inner = self.inner.send_compressed(encoding);
78            self
79        }
80        /// Enable decompressing responses.
81        #[must_use]
82        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
83            self.inner = self.inner.accept_compressed(encoding);
84            self
85        }
86        /// Limits the maximum size of a decoded message.
87        ///
88        /// Default: `4MB`
89        #[must_use]
90        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
91            self.inner = self.inner.max_decoding_message_size(limit);
92            self
93        }
94        /// Limits the maximum size of an encoded message.
95        ///
96        /// Default: `usize::MAX`
97        #[must_use]
98        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
99            self.inner = self.inner.max_encoding_message_size(limit);
100            self
101        }
102        pub async fn update_remote_connection_status(
103            &mut self,
104            request: impl tonic::IntoRequest<super::UpdateRemoteConnectionStatusRequest>,
105        ) -> std::result::Result<
106            tonic::Response<super::UpdateRemoteConnectionStatusResponse>,
107            tonic::Status,
108        > {
109            self.inner
110                .ready()
111                .await
112                .map_err(|e| {
113                    tonic::Status::unknown(
114                        format!("Service was not ready: {}", e.into()),
115                    )
116                })?;
117            let codec = tonic::codec::ProstCodec::default();
118            let path = http::uri::PathAndQuery::from_static(
119                "/nominal.mesh.v1.internal.InternalMeshService/UpdateRemoteConnectionStatus",
120            );
121            let mut req = request.into_request();
122            req.extensions_mut()
123                .insert(
124                    GrpcMethod::new(
125                        "nominal.mesh.v1.internal.InternalMeshService",
126                        "UpdateRemoteConnectionStatus",
127                    ),
128                );
129            self.inner.unary(req, path, codec).await
130        }
131    }
132}