Skip to main content

nominal_api/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    /// Internal service for inter-service RPCs. Uses a separate package so that
23    /// the gRPC path (nominal.mesh.v1.internal.*) is excluded from public ingress.
24    #[derive(Debug, Clone)]
25    pub struct InternalMeshServiceClient<T> {
26        inner: tonic::client::Grpc<T>,
27    }
28    impl InternalMeshServiceClient<tonic::transport::Channel> {
29        /// Attempt to create a new client by connecting to a given endpoint.
30        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
31        where
32            D: TryInto<tonic::transport::Endpoint>,
33            D::Error: Into<StdError>,
34        {
35            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
36            Ok(Self::new(conn))
37        }
38    }
39    impl<T> InternalMeshServiceClient<T>
40    where
41        T: tonic::client::GrpcService<tonic::body::Body>,
42        T::Error: Into<StdError>,
43        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
44        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
45    {
46        pub fn new(inner: T) -> Self {
47            let inner = tonic::client::Grpc::new(inner);
48            Self { inner }
49        }
50        pub fn with_origin(inner: T, origin: Uri) -> Self {
51            let inner = tonic::client::Grpc::with_origin(inner, origin);
52            Self { inner }
53        }
54        pub fn with_interceptor<F>(
55            inner: T,
56            interceptor: F,
57        ) -> InternalMeshServiceClient<InterceptedService<T, F>>
58        where
59            F: tonic::service::Interceptor,
60            T::ResponseBody: Default,
61            T: tonic::codegen::Service<
62                http::Request<tonic::body::Body>,
63                Response = http::Response<
64                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
65                >,
66            >,
67            <T as tonic::codegen::Service<
68                http::Request<tonic::body::Body>,
69            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
70        {
71            InternalMeshServiceClient::new(InterceptedService::new(inner, interceptor))
72        }
73        /// Compress requests with the given encoding.
74        ///
75        /// This requires the server to support it otherwise it might respond with an
76        /// error.
77        #[must_use]
78        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
79            self.inner = self.inner.send_compressed(encoding);
80            self
81        }
82        /// Enable decompressing responses.
83        #[must_use]
84        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
85            self.inner = self.inner.accept_compressed(encoding);
86            self
87        }
88        /// Limits the maximum size of a decoded message.
89        ///
90        /// Default: `4MB`
91        #[must_use]
92        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
93            self.inner = self.inner.max_decoding_message_size(limit);
94            self
95        }
96        /// Limits the maximum size of an encoded message.
97        ///
98        /// Default: `usize::MAX`
99        #[must_use]
100        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
101            self.inner = self.inner.max_encoding_message_size(limit);
102            self
103        }
104        /// Updates the health status of a remote connection. Internal-only (service-token auth).
105        pub async fn update_remote_connection_status(
106            &mut self,
107            request: impl tonic::IntoRequest<super::UpdateRemoteConnectionStatusRequest>,
108        ) -> std::result::Result<
109            tonic::Response<super::UpdateRemoteConnectionStatusResponse>,
110            tonic::Status,
111        > {
112            self.inner
113                .ready()
114                .await
115                .map_err(|e| {
116                    tonic::Status::unknown(
117                        format!("Service was not ready: {}", e.into()),
118                    )
119                })?;
120            let codec = tonic::codec::ProstCodec::default();
121            let path = http::uri::PathAndQuery::from_static(
122                "/nominal.mesh.v1.internal.InternalMeshService/UpdateRemoteConnectionStatus",
123            );
124            let mut req = request.into_request();
125            req.extensions_mut()
126                .insert(
127                    GrpcMethod::new(
128                        "nominal.mesh.v1.internal.InternalMeshService",
129                        "UpdateRemoteConnectionStatus",
130                    ),
131                );
132            self.inner.unary(req, path, codec).await
133        }
134    }
135}