nominal_api_proto/proto/
nominal.nominalinstro.v1.rs1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct GetPythonPackageRegistryRequest {}
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct GetPythonPackageRegistryResponse {
6 #[prost(string, tag = "1")]
7 pub registry_url: ::prost::alloc::string::String,
8 #[prost(string, optional, tag = "2")]
9 pub registry_token: ::core::option::Option<::prost::alloc::string::String>,
10}
11#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
12#[repr(i32)]
13pub enum NominalInstroPackageRegistryError {
14 Unspecified = 0,
15 NotAvailable = 1,
16}
17impl NominalInstroPackageRegistryError {
18 pub fn as_str_name(&self) -> &'static str {
23 match self {
24 Self::Unspecified => "NOMINAL_INSTRO_PACKAGE_REGISTRY_ERROR_UNSPECIFIED",
25 Self::NotAvailable => "NOMINAL_INSTRO_PACKAGE_REGISTRY_ERROR_NOT_AVAILABLE",
26 }
27 }
28 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
30 match value {
31 "NOMINAL_INSTRO_PACKAGE_REGISTRY_ERROR_UNSPECIFIED" => {
32 Some(Self::Unspecified)
33 }
34 "NOMINAL_INSTRO_PACKAGE_REGISTRY_ERROR_NOT_AVAILABLE" => {
35 Some(Self::NotAvailable)
36 }
37 _ => None,
38 }
39 }
40}
41pub mod nominal_instro_package_registry_service_client {
43 #![allow(
44 unused_variables,
45 dead_code,
46 missing_docs,
47 clippy::wildcard_imports,
48 clippy::let_unit_value,
49 )]
50 use tonic::codegen::*;
51 use tonic::codegen::http::Uri;
52 #[derive(Debug, Clone)]
53 pub struct NominalInstroPackageRegistryServiceClient<T> {
54 inner: tonic::client::Grpc<T>,
55 }
56 impl NominalInstroPackageRegistryServiceClient<tonic::transport::Channel> {
57 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
59 where
60 D: TryInto<tonic::transport::Endpoint>,
61 D::Error: Into<StdError>,
62 {
63 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
64 Ok(Self::new(conn))
65 }
66 }
67 impl<T> NominalInstroPackageRegistryServiceClient<T>
68 where
69 T: tonic::client::GrpcService<tonic::body::Body>,
70 T::Error: Into<StdError>,
71 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
72 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
73 {
74 pub fn new(inner: T) -> Self {
75 let inner = tonic::client::Grpc::new(inner);
76 Self { inner }
77 }
78 pub fn with_origin(inner: T, origin: Uri) -> Self {
79 let inner = tonic::client::Grpc::with_origin(inner, origin);
80 Self { inner }
81 }
82 pub fn with_interceptor<F>(
83 inner: T,
84 interceptor: F,
85 ) -> NominalInstroPackageRegistryServiceClient<InterceptedService<T, F>>
86 where
87 F: tonic::service::Interceptor,
88 T::ResponseBody: Default,
89 T: tonic::codegen::Service<
90 http::Request<tonic::body::Body>,
91 Response = http::Response<
92 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
93 >,
94 >,
95 <T as tonic::codegen::Service<
96 http::Request<tonic::body::Body>,
97 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
98 {
99 NominalInstroPackageRegistryServiceClient::new(
100 InterceptedService::new(inner, interceptor),
101 )
102 }
103 #[must_use]
108 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
109 self.inner = self.inner.send_compressed(encoding);
110 self
111 }
112 #[must_use]
114 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
115 self.inner = self.inner.accept_compressed(encoding);
116 self
117 }
118 #[must_use]
122 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
123 self.inner = self.inner.max_decoding_message_size(limit);
124 self
125 }
126 #[must_use]
130 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
131 self.inner = self.inner.max_encoding_message_size(limit);
132 self
133 }
134 pub async fn get_python_package_registry(
135 &mut self,
136 request: impl tonic::IntoRequest<super::GetPythonPackageRegistryRequest>,
137 ) -> std::result::Result<
138 tonic::Response<super::GetPythonPackageRegistryResponse>,
139 tonic::Status,
140 > {
141 self.inner
142 .ready()
143 .await
144 .map_err(|e| {
145 tonic::Status::unknown(
146 format!("Service was not ready: {}", e.into()),
147 )
148 })?;
149 let codec = tonic::codec::ProstCodec::default();
150 let path = http::uri::PathAndQuery::from_static(
151 "/nominal.nominalinstro.v1.NominalInstroPackageRegistryService/GetPythonPackageRegistry",
152 );
153 let mut req = request.into_request();
154 req.extensions_mut()
155 .insert(
156 GrpcMethod::new(
157 "nominal.nominalinstro.v1.NominalInstroPackageRegistryService",
158 "GetPythonPackageRegistry",
159 ),
160 );
161 self.inner.unary(req, path, codec).await
162 }
163 }
164}