volcengine_sdk_protobuf/protobuf/
lb_instance.rs

1#[derive(serde::Serialize, serde::Deserialize)]
2#[serde(rename_all = "PascalCase")]
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct DescribeLoadBalancersReq {
6    #[prost(string, tag = "1")]
7    pub exclusive_cluster_id: ::prost::alloc::string::String,
8    #[prost(string, tag = "2")]
9    pub load_balancer_name: ::prost::alloc::string::String,
10    #[prost(string, tag = "3")]
11    pub master_zone_id: ::prost::alloc::string::String,
12    #[prost(string, tag = "4")]
13    pub address_ip_version: ::prost::alloc::string::String,
14    #[prost(string, tag = "5")]
15    pub r#type: ::prost::alloc::string::String,
16    #[prost(string, tag = "6")]
17    pub vpc_id: ::prost::alloc::string::String,
18    #[prost(string, tag = "7")]
19    pub eni_address: ::prost::alloc::string::String,
20    #[prost(string, tag = "8")]
21    pub eip_address: ::prost::alloc::string::String,
22    #[prost(string, tag = "9")]
23    pub status: ::prost::alloc::string::String,
24    #[prost(string, tag = "10")]
25    pub project_name: ::prost::alloc::string::String,
26    #[prost(int64, tag = "11")]
27    pub page_number: i64,
28    #[prost(int64, tag = "12")]
29    pub page_size: i64,
30    #[prost(string, repeated, tag = "13")]
31    pub load_balancer_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
32    #[prost(message, repeated, tag = "14")]
33    pub tag_filters: ::prost::alloc::vec::Vec<DescribeLoadBalancersTagFilterReq>,
34}
35#[derive(serde::Serialize, serde::Deserialize)]
36#[serde(rename_all = "PascalCase")]
37#[allow(clippy::derive_partial_eq_without_eq)]
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct DescribeLoadBalancersTagFilterReq {
40    #[prost(string, tag = "1")]
41    pub key: ::prost::alloc::string::String,
42    #[prost(string, repeated, tag = "2")]
43    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
44}
45#[derive(serde::Serialize, serde::Deserialize)]
46#[serde(rename_all = "PascalCase")]
47#[allow(clippy::derive_partial_eq_without_eq)]
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct DescribeLoadBalancersResp {
50    #[prost(message, optional, tag = "1")]
51    pub response_metadata: ::core::option::Option<ResponseMetadata>,
52    #[prost(message, optional, tag = "2")]
53    pub result: ::core::option::Option<DescribeLoadBalancersResultResp>,
54}
55#[derive(serde::Serialize, serde::Deserialize)]
56#[serde(rename_all = "PascalCase")]
57#[allow(clippy::derive_partial_eq_without_eq)]
58#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct DescribeLoadBalancersResultResp {
60    #[prost(string, tag = "1")]
61    pub request_id: ::prost::alloc::string::String,
62    #[prost(int64, tag = "2")]
63    pub total_count: i64,
64    #[prost(int64, tag = "3")]
65    pub page_number: i64,
66    #[prost(int64, tag = "4")]
67    pub page_size: i64,
68    #[prost(message, repeated, tag = "5")]
69    pub load_balancers: ::prost::alloc::vec::Vec<DescribeLoadBalancersResultLoadBalancerResp>,
70}
71#[derive(serde::Serialize, serde::Deserialize)]
72#[serde(rename_all = "PascalCase")]
73#[allow(clippy::derive_partial_eq_without_eq)]
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct DescribeLoadBalancersResultLoadBalancerResp {
76    #[prost(string, tag = "1")]
77    pub exclusive_cluster_id: ::prost::alloc::string::String,
78    #[prost(string, tag = "2")]
79    pub account_id: ::prost::alloc::string::String,
80    #[prost(string, tag = "3")]
81    pub load_balancer_id: ::prost::alloc::string::String,
82    #[prost(string, tag = "4")]
83    pub load_balancer_name: ::prost::alloc::string::String,
84    #[prost(string, tag = "5")]
85    pub description: ::prost::alloc::string::String,
86    #[prost(string, tag = "6")]
87    pub r#type: ::prost::alloc::string::String,
88    #[prost(string, tag = "7")]
89    pub address_ip_version: ::prost::alloc::string::String,
90    #[prost(int64, tag = "8")]
91    pub load_balancer_billing_type: i64,
92    #[prost(string, tag = "9")]
93    pub load_balancer_spec: ::prost::alloc::string::String,
94    #[prost(string, tag = "10")]
95    pub master_zone_id: ::prost::alloc::string::String,
96    #[prost(string, tag = "11")]
97    pub slave_zone_id: ::prost::alloc::string::String,
98    #[prost(string, tag = "12")]
99    pub vpc_id: ::prost::alloc::string::String,
100    #[prost(string, tag = "13")]
101    pub subnet_id: ::prost::alloc::string::String,
102    #[prost(string, tag = "14")]
103    pub eni_id: ::prost::alloc::string::String,
104    #[prost(string, tag = "15")]
105    pub eni_address: ::prost::alloc::string::String,
106    #[prost(int64, tag = "16")]
107    pub eni_address_num: i64,
108    #[prost(string, tag = "17")]
109    pub eip_id: ::prost::alloc::string::String,
110    #[prost(string, tag = "18")]
111    pub eip_address: ::prost::alloc::string::String,
112    #[prost(string, tag = "19")]
113    pub eni_ipv6_address: ::prost::alloc::string::String,
114    #[prost(string, tag = "20")]
115    pub ipv6_eip_id: ::prost::alloc::string::String,
116    #[prost(string, tag = "21")]
117    pub modification_protection_status: ::prost::alloc::string::String,
118    #[prost(string, tag = "22")]
119    pub modification_protection_reason: ::prost::alloc::string::String,
120    #[prost(bool, tag = "23")]
121    pub service_managed: bool,
122    #[prost(string, tag = "24")]
123    pub status: ::prost::alloc::string::String,
124    #[prost(string, tag = "25")]
125    pub business_status: ::prost::alloc::string::String,
126    #[prost(string, tag = "26")]
127    pub lock_reason: ::prost::alloc::string::String,
128    #[prost(string, tag = "27")]
129    pub project_name: ::prost::alloc::string::String,
130    #[prost(string, tag = "28")]
131    pub create_time: ::prost::alloc::string::String,
132    #[prost(string, tag = "29")]
133    pub update_time: ::prost::alloc::string::String,
134    #[prost(string, tag = "30")]
135    pub overdue_time: ::prost::alloc::string::String,
136    #[prost(string, tag = "31")]
137    pub deleted_time: ::prost::alloc::string::String,
138    #[prost(string, tag = "32")]
139    pub expired_time: ::prost::alloc::string::String,
140    #[prost(message, repeated, tag = "33")]
141    pub tags: ::prost::alloc::vec::Vec<DescribeLoadBalancersResultLoadBalancerTagResp>,
142    #[prost(message, optional, tag = "34")]
143    pub eni_addresses:
144        ::core::option::Option<DescribeLoadBalancersResultLoadBalancerEniAddresseResp>,
145}
146#[derive(serde::Serialize, serde::Deserialize)]
147#[serde(rename_all = "PascalCase")]
148#[allow(clippy::derive_partial_eq_without_eq)]
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct DescribeLoadBalancersResultLoadBalancerTagResp {
151    #[prost(string, tag = "1")]
152    pub key: ::prost::alloc::string::String,
153    #[prost(string, tag = "2")]
154    pub value: ::prost::alloc::string::String,
155}
156#[derive(serde::Serialize, serde::Deserialize)]
157#[serde(rename_all = "PascalCase")]
158#[allow(clippy::derive_partial_eq_without_eq)]
159#[derive(Clone, PartialEq, ::prost::Message)]
160pub struct DescribeLoadBalancersResultLoadBalancerEniAddresseResp {
161    #[prost(string, tag = "1")]
162    pub eni_address: ::prost::alloc::string::String,
163    #[prost(string, tag = "2")]
164    pub eip_id: ::prost::alloc::string::String,
165    #[prost(string, tag = "3")]
166    pub eip_address: ::prost::alloc::string::String,
167}
168#[derive(serde::Serialize, serde::Deserialize)]
169#[serde(rename_all = "PascalCase")]
170#[allow(clippy::derive_partial_eq_without_eq)]
171#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct ResponseMetadata {
173    #[prost(string, tag = "1")]
174    pub request_id: ::prost::alloc::string::String,
175    #[prost(string, tag = "2")]
176    pub action: ::prost::alloc::string::String,
177    #[prost(string, tag = "3")]
178    pub version: ::prost::alloc::string::String,
179    #[prost(string, tag = "4")]
180    pub service: ::prost::alloc::string::String,
181    #[prost(string, tag = "5")]
182    pub region: ::prost::alloc::string::String,
183    #[prost(message, optional, tag = "6")]
184    pub error: ::core::option::Option<ResponseMetadataErr>,
185}
186#[derive(serde::Serialize, serde::Deserialize)]
187#[serde(rename_all = "PascalCase")]
188#[allow(clippy::derive_partial_eq_without_eq)]
189#[derive(Clone, PartialEq, ::prost::Message)]
190pub struct ResponseMetadataErr {
191    #[prost(int64, optional, tag = "1")]
192    pub code_n: ::core::option::Option<i64>,
193    #[prost(string, tag = "2")]
194    pub code: ::prost::alloc::string::String,
195    #[prost(string, tag = "3")]
196    pub message: ::prost::alloc::string::String,
197}
198/// Generated client implementations.
199pub mod lb_instance_client {
200    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
201    use tonic::codegen::http::Uri;
202    use tonic::codegen::*;
203    #[derive(Debug, Clone)]
204    pub struct LbInstanceClient<T> {
205        inner: tonic::client::Grpc<T>,
206    }
207    impl LbInstanceClient<tonic::transport::Channel> {
208        /// Attempt to create a new client by connecting to a given endpoint.
209        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
210        where
211            D: TryInto<tonic::transport::Endpoint>,
212            D::Error: Into<StdError>,
213        {
214            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
215            Ok(Self::new(conn))
216        }
217    }
218    impl<T> LbInstanceClient<T>
219    where
220        T: tonic::client::GrpcService<tonic::body::BoxBody>,
221        T::Error: Into<StdError>,
222        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
223        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
224    {
225        pub fn new(inner: T) -> Self {
226            let inner = tonic::client::Grpc::new(inner);
227            Self { inner }
228        }
229        pub fn with_origin(inner: T, origin: Uri) -> Self {
230            let inner = tonic::client::Grpc::with_origin(inner, origin);
231            Self { inner }
232        }
233        pub fn with_interceptor<F>(
234            inner: T,
235            interceptor: F,
236        ) -> LbInstanceClient<InterceptedService<T, F>>
237        where
238            F: tonic::service::Interceptor,
239            T::ResponseBody: Default,
240            T: tonic::codegen::Service<
241                http::Request<tonic::body::BoxBody>,
242                Response = http::Response<
243                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
244                >,
245            >,
246            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
247                Into<StdError> + Send + Sync,
248        {
249            LbInstanceClient::new(InterceptedService::new(inner, interceptor))
250        }
251        /// Compress requests with the given encoding.
252        ///
253        /// This requires the server to support it otherwise it might respond with an
254        /// error.
255        #[must_use]
256        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
257            self.inner = self.inner.send_compressed(encoding);
258            self
259        }
260        /// Enable decompressing responses.
261        #[must_use]
262        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
263            self.inner = self.inner.accept_compressed(encoding);
264            self
265        }
266        /// Limits the maximum size of a decoded message.
267        ///
268        /// Default: `4MB`
269        #[must_use]
270        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
271            self.inner = self.inner.max_decoding_message_size(limit);
272            self
273        }
274        /// Limits the maximum size of an encoded message.
275        ///
276        /// Default: `usize::MAX`
277        #[must_use]
278        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
279            self.inner = self.inner.max_encoding_message_size(limit);
280            self
281        }
282        /// DescribeLoadBalancers
283        pub async fn describe_load_balancers(
284            &mut self,
285            request: impl tonic::IntoRequest<super::DescribeLoadBalancersReq>,
286        ) -> std::result::Result<tonic::Response<super::DescribeLoadBalancersResp>, tonic::Status>
287        {
288            self.inner.ready().await.map_err(|e| {
289                tonic::Status::new(
290                    tonic::Code::Unknown,
291                    format!("Service was not ready: {}", e.into()),
292                )
293            })?;
294            let codec = tonic::codec::ProstCodec::default();
295            let path = http::uri::PathAndQuery::from_static(
296                "/lb_instance.LbInstance/DescribeLoadBalancers",
297            );
298            let mut req = request.into_request();
299            req.extensions_mut().insert(GrpcMethod::new(
300                "lb_instance.LbInstance",
301                "DescribeLoadBalancers",
302            ));
303            self.inner.unary(req, path, codec).await
304        }
305    }
306}
307/// Generated server implementations.
308pub mod lb_instance_server {
309    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
310    use tonic::codegen::*;
311    /// Generated trait containing gRPC methods that should be implemented for use with LbInstanceServer.
312    #[async_trait]
313    pub trait LbInstance: Send + Sync + 'static {
314        /// DescribeLoadBalancers
315        async fn describe_load_balancers(
316            &self,
317            request: tonic::Request<super::DescribeLoadBalancersReq>,
318        ) -> std::result::Result<tonic::Response<super::DescribeLoadBalancersResp>, tonic::Status>;
319    }
320    #[derive(Debug)]
321    pub struct LbInstanceServer<T: LbInstance> {
322        inner: _Inner<T>,
323        accept_compression_encodings: EnabledCompressionEncodings,
324        send_compression_encodings: EnabledCompressionEncodings,
325        max_decoding_message_size: Option<usize>,
326        max_encoding_message_size: Option<usize>,
327    }
328    struct _Inner<T>(Arc<T>);
329    impl<T: LbInstance> LbInstanceServer<T> {
330        pub fn new(inner: T) -> Self {
331            Self::from_arc(Arc::new(inner))
332        }
333        pub fn from_arc(inner: Arc<T>) -> Self {
334            let inner = _Inner(inner);
335            Self {
336                inner,
337                accept_compression_encodings: Default::default(),
338                send_compression_encodings: Default::default(),
339                max_decoding_message_size: None,
340                max_encoding_message_size: None,
341            }
342        }
343        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
344        where
345            F: tonic::service::Interceptor,
346        {
347            InterceptedService::new(Self::new(inner), interceptor)
348        }
349        /// Enable decompressing requests with the given encoding.
350        #[must_use]
351        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
352            self.accept_compression_encodings.enable(encoding);
353            self
354        }
355        /// Compress responses with the given encoding, if the client supports it.
356        #[must_use]
357        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
358            self.send_compression_encodings.enable(encoding);
359            self
360        }
361        /// Limits the maximum size of a decoded message.
362        ///
363        /// Default: `4MB`
364        #[must_use]
365        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
366            self.max_decoding_message_size = Some(limit);
367            self
368        }
369        /// Limits the maximum size of an encoded message.
370        ///
371        /// Default: `usize::MAX`
372        #[must_use]
373        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
374            self.max_encoding_message_size = Some(limit);
375            self
376        }
377    }
378    impl<T, B> tonic::codegen::Service<http::Request<B>> for LbInstanceServer<T>
379    where
380        T: LbInstance,
381        B: Body + Send + 'static,
382        B::Error: Into<StdError> + Send + 'static,
383    {
384        type Response = http::Response<tonic::body::BoxBody>;
385        type Error = std::convert::Infallible;
386        type Future = BoxFuture<Self::Response, Self::Error>;
387        fn poll_ready(
388            &mut self,
389            _cx: &mut Context<'_>,
390        ) -> Poll<std::result::Result<(), Self::Error>> {
391            Poll::Ready(Ok(()))
392        }
393        fn call(&mut self, req: http::Request<B>) -> Self::Future {
394            let inner = self.inner.clone();
395            match req.uri().path() {
396                "/lb_instance.LbInstance/DescribeLoadBalancers" => {
397                    #[allow(non_camel_case_types)]
398                    struct DescribeLoadBalancersSvc<T: LbInstance>(pub Arc<T>);
399                    impl<T: LbInstance> tonic::server::UnaryService<super::DescribeLoadBalancersReq>
400                        for DescribeLoadBalancersSvc<T>
401                    {
402                        type Response = super::DescribeLoadBalancersResp;
403                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
404                        fn call(
405                            &mut self,
406                            request: tonic::Request<super::DescribeLoadBalancersReq>,
407                        ) -> Self::Future {
408                            let inner = Arc::clone(&self.0);
409                            let fut =
410                                async move { (*inner).describe_load_balancers(request).await };
411                            Box::pin(fut)
412                        }
413                    }
414                    let accept_compression_encodings = self.accept_compression_encodings;
415                    let send_compression_encodings = self.send_compression_encodings;
416                    let max_decoding_message_size = self.max_decoding_message_size;
417                    let max_encoding_message_size = self.max_encoding_message_size;
418                    let inner = self.inner.clone();
419                    let fut = async move {
420                        let inner = inner.0;
421                        let method = DescribeLoadBalancersSvc(inner);
422                        let codec = tonic::codec::ProstCodec::default();
423                        let mut grpc = tonic::server::Grpc::new(codec)
424                            .apply_compression_config(
425                                accept_compression_encodings,
426                                send_compression_encodings,
427                            )
428                            .apply_max_message_size_config(
429                                max_decoding_message_size,
430                                max_encoding_message_size,
431                            );
432                        let res = grpc.unary(method, req).await;
433                        Ok(res)
434                    };
435                    Box::pin(fut)
436                }
437                _ => Box::pin(async move {
438                    Ok(http::Response::builder()
439                        .status(200)
440                        .header("grpc-status", "12")
441                        .header("content-type", "application/grpc")
442                        .body(empty_body())
443                        .unwrap())
444                }),
445            }
446        }
447    }
448    impl<T: LbInstance> Clone for LbInstanceServer<T> {
449        fn clone(&self) -> Self {
450            let inner = self.inner.clone();
451            Self {
452                inner,
453                accept_compression_encodings: self.accept_compression_encodings,
454                send_compression_encodings: self.send_compression_encodings,
455                max_decoding_message_size: self.max_decoding_message_size,
456                max_encoding_message_size: self.max_encoding_message_size,
457            }
458        }
459    }
460    impl<T: LbInstance> Clone for _Inner<T> {
461        fn clone(&self) -> Self {
462            Self(Arc::clone(&self.0))
463        }
464    }
465    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
466        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
467            write!(f, "{:?}", self.0)
468        }
469    }
470    impl<T: LbInstance> tonic::server::NamedService for LbInstanceServer<T> {
471        const NAME: &'static str = "lb_instance.LbInstance";
472    }
473}