Skip to main content

nominal_api/proto/
nominal.internal.servicemetadata.v1.rs

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