Skip to main content

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