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

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