nominal_api/proto/
nominal.connect.download.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct GetLatestConnectUriRequest {
4    #[prost(string, tag = "1")]
5    pub platform: ::prost::alloc::string::String,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct GetLatestConnectUriResponse {
9    #[prost(string, tag = "1")]
10    pub uri: ::prost::alloc::string::String,
11}
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
13#[repr(i32)]
14pub enum ConnectDownloadServiceError {
15    Unspecified = 0,
16    ConnectNotAvailable = 1,
17}
18impl ConnectDownloadServiceError {
19    /// String value of the enum field names used in the ProtoBuf definition.
20    ///
21    /// The values are not transformed in any way and thus are considered stable
22    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
23    pub fn as_str_name(&self) -> &'static str {
24        match self {
25            Self::Unspecified => "CONNECT_DOWNLOAD_SERVICE_ERROR_UNSPECIFIED",
26            Self::ConnectNotAvailable => {
27                "CONNECT_DOWNLOAD_SERVICE_ERROR_CONNECT_NOT_AVAILABLE"
28            }
29        }
30    }
31    /// Creates an enum from field names used in the ProtoBuf definition.
32    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
33        match value {
34            "CONNECT_DOWNLOAD_SERVICE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
35            "CONNECT_DOWNLOAD_SERVICE_ERROR_CONNECT_NOT_AVAILABLE" => {
36                Some(Self::ConnectNotAvailable)
37            }
38            _ => None,
39        }
40    }
41}
42/// Generated client implementations.
43pub mod connect_download_service_client {
44    #![allow(
45        unused_variables,
46        dead_code,
47        missing_docs,
48        clippy::wildcard_imports,
49        clippy::let_unit_value,
50    )]
51    use tonic::codegen::*;
52    use tonic::codegen::http::Uri;
53    /// Service for downloading Connect binaries
54    #[derive(Debug, Clone)]
55    pub struct ConnectDownloadServiceClient<T> {
56        inner: tonic::client::Grpc<T>,
57    }
58    impl ConnectDownloadServiceClient<tonic::transport::Channel> {
59        /// Attempt to create a new client by connecting to a given endpoint.
60        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
61        where
62            D: TryInto<tonic::transport::Endpoint>,
63            D::Error: Into<StdError>,
64        {
65            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
66            Ok(Self::new(conn))
67        }
68    }
69    impl<T> ConnectDownloadServiceClient<T>
70    where
71        T: tonic::client::GrpcService<tonic::body::Body>,
72        T::Error: Into<StdError>,
73        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
74        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
75    {
76        pub fn new(inner: T) -> Self {
77            let inner = tonic::client::Grpc::new(inner);
78            Self { inner }
79        }
80        pub fn with_origin(inner: T, origin: Uri) -> Self {
81            let inner = tonic::client::Grpc::with_origin(inner, origin);
82            Self { inner }
83        }
84        pub fn with_interceptor<F>(
85            inner: T,
86            interceptor: F,
87        ) -> ConnectDownloadServiceClient<InterceptedService<T, F>>
88        where
89            F: tonic::service::Interceptor,
90            T::ResponseBody: Default,
91            T: tonic::codegen::Service<
92                http::Request<tonic::body::Body>,
93                Response = http::Response<
94                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
95                >,
96            >,
97            <T as tonic::codegen::Service<
98                http::Request<tonic::body::Body>,
99            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
100        {
101            ConnectDownloadServiceClient::new(
102                InterceptedService::new(inner, interceptor),
103            )
104        }
105        /// Compress requests with the given encoding.
106        ///
107        /// This requires the server to support it otherwise it might respond with an
108        /// error.
109        #[must_use]
110        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
111            self.inner = self.inner.send_compressed(encoding);
112            self
113        }
114        /// Enable decompressing responses.
115        #[must_use]
116        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
117            self.inner = self.inner.accept_compressed(encoding);
118            self
119        }
120        /// Limits the maximum size of a decoded message.
121        ///
122        /// Default: `4MB`
123        #[must_use]
124        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
125            self.inner = self.inner.max_decoding_message_size(limit);
126            self
127        }
128        /// Limits the maximum size of an encoded message.
129        ///
130        /// Default: `usize::MAX`
131        #[must_use]
132        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
133            self.inner = self.inner.max_encoding_message_size(limit);
134            self
135        }
136        /// Get a pre-signed URL for downloading the latest version of Connect for a given platform
137        pub async fn get_latest_connect_uri(
138            &mut self,
139            request: impl tonic::IntoRequest<super::GetLatestConnectUriRequest>,
140        ) -> std::result::Result<
141            tonic::Response<super::GetLatestConnectUriResponse>,
142            tonic::Status,
143        > {
144            self.inner
145                .ready()
146                .await
147                .map_err(|e| {
148                    tonic::Status::unknown(
149                        format!("Service was not ready: {}", e.into()),
150                    )
151                })?;
152            let codec = tonic::codec::ProstCodec::default();
153            let path = http::uri::PathAndQuery::from_static(
154                "/nominal.connect.download.v1.ConnectDownloadService/GetLatestConnectUri",
155            );
156            let mut req = request.into_request();
157            req.extensions_mut()
158                .insert(
159                    GrpcMethod::new(
160                        "nominal.connect.download.v1.ConnectDownloadService",
161                        "GetLatestConnectUri",
162                    ),
163                );
164            self.inner.unary(req, path, codec).await
165        }
166    }
167}