// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChainsRequest {
    /// ISD-AS of Subject in the AS certificate.
    #[prost(uint64, tag = "1")]
    pub isd_as: u64,
    /// SubjectKeyID in the AS certificate.
    #[prost(bytes = "vec", tag = "2")]
    pub subject_key_id: ::prost::alloc::vec::Vec<u8>,
    /// Point in time at which the AS certificate must still be valid. In seconds
    /// since UNIX epoch.
    #[prost(message, optional, tag = "3")]
    pub at_least_valid_until: ::core::option::Option<::prost_types::Timestamp>,
    /// Point in time at which the AS certificate must be or must have been
    /// valid. In seconds since UNIX epoch.
    #[prost(message, optional, tag = "4")]
    pub at_least_valid_since: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainsResponse {
    /// List of chains that match the request.
    #[prost(message, repeated, tag = "1")]
    pub chains: ::prost::alloc::vec::Vec<Chain>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Chain {
    /// AS certificate in the chain.
    #[prost(bytes = "vec", tag = "1")]
    pub as_cert: ::prost::alloc::vec::Vec<u8>,
    /// CA certificate in the chain.
    #[prost(bytes = "vec", tag = "2")]
    pub ca_cert: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TrcRequest {
    /// ISD of the TRC.
    #[prost(uint32, tag = "1")]
    pub isd: u32,
    /// BaseNumber of the TRC.
    #[prost(uint64, tag = "2")]
    pub base: u64,
    /// SerialNumber of the TRC.
    #[prost(uint64, tag = "3")]
    pub serial: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TrcResponse {
    /// Raw TRC.
    #[prost(bytes = "vec", tag = "1")]
    pub trc: ::prost::alloc::vec::Vec<u8>,
}
/// VerificationKeyID is used to identify certificates that authenticate the
/// verification key used to verify signatures.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct VerificationKeyId {
    /// ISD-AS of the subject.
    #[prost(uint64, tag = "1")]
    pub isd_as: u64,
    /// SubjectKeyID referenced in the certificate.
    #[prost(bytes = "vec", tag = "2")]
    pub subject_key_id: ::prost::alloc::vec::Vec<u8>,
    /// Base number of the latest TRC available to the signer at the time of
    /// signature creation.
    #[prost(uint64, tag = "3")]
    pub trc_base: u64,
    /// Serial number of the latest TRC available to the signer at the time of
    /// signature creation.
    #[prost(uint64, tag = "4")]
    pub trc_serial: u64,
}
/// Generated client implementations.
pub mod trust_material_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct TrustMaterialServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl TrustMaterialServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> TrustMaterialServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> TrustMaterialServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            TrustMaterialServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Return the certificate chains that match the request.
        pub async fn chains(
            &mut self,
            request: impl tonic::IntoRequest<super::ChainsRequest>,
        ) -> std::result::Result<tonic::Response<super::ChainsResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.TrustMaterialService/Chains",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.TrustMaterialService",
                        "Chains",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Return a specific TRC that matches the request.
        pub async fn trc(
            &mut self,
            request: impl tonic::IntoRequest<super::TrcRequest>,
        ) -> std::result::Result<tonic::Response<super::TrcResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.TrustMaterialService/TRC",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("proto.control_plane.v1.TrustMaterialService", "TRC"),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod trust_material_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with TrustMaterialServiceServer.
    #[async_trait]
    pub trait TrustMaterialService: std::marker::Send + std::marker::Sync + 'static {
        /// Return the certificate chains that match the request.
        async fn chains(
            &self,
            request: tonic::Request<super::ChainsRequest>,
        ) -> std::result::Result<tonic::Response<super::ChainsResponse>, tonic::Status>;
        /// Return a specific TRC that matches the request.
        async fn trc(
            &self,
            request: tonic::Request<super::TrcRequest>,
        ) -> std::result::Result<tonic::Response<super::TrcResponse>, tonic::Status>;
    }
    #[derive(Debug)]
    pub struct TrustMaterialServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> TrustMaterialServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>>
    for TrustMaterialServiceServer<T>
    where
        T: TrustMaterialService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/proto.control_plane.v1.TrustMaterialService/Chains" => {
                    #[allow(non_camel_case_types)]
                    struct ChainsSvc<T: TrustMaterialService>(pub Arc<T>);
                    impl<
                        T: TrustMaterialService,
                    > tonic::server::UnaryService<super::ChainsRequest>
                    for ChainsSvc<T> {
                        type Response = super::ChainsResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ChainsRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as TrustMaterialService>::chains(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ChainsSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/proto.control_plane.v1.TrustMaterialService/TRC" => {
                    #[allow(non_camel_case_types)]
                    struct TRCSvc<T: TrustMaterialService>(pub Arc<T>);
                    impl<
                        T: TrustMaterialService,
                    > tonic::server::UnaryService<super::TrcRequest> for TRCSvc<T> {
                        type Response = super::TrcResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::TrcRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as TrustMaterialService>::trc(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = TRCSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for TrustMaterialServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "proto.control_plane.v1.TrustMaterialService";
    impl<T> tonic::server::NamedService for TrustMaterialServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeySecretValueRequest {
    /// Point in time when the requested key is valid.
    #[prost(message, optional, tag = "1")]
    pub val_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Protocol value.
    #[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
    pub protocol_id: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeySecretValueResponse {
    /// Begin of the validity period.
    #[prost(message, optional, tag = "1")]
    pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
    /// End of the validity period.
    #[prost(message, optional, tag = "2")]
    pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
    /// SecretValue key.
    #[prost(bytes = "vec", tag = "3")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
/// DRKeyLevel1Request leaves out the 'dstIA' field which can be extracted from
/// the transport itself (ideally from authenticated information).
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyLevel1Request {
    /// Point in time where requested key is valid.
    #[prost(message, optional, tag = "1")]
    pub val_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Protocol value.
    #[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
    pub protocol_id: i32,
}
/// DRKeyLevel1Response leaves out the 'dstIA' and 'srcIA' fields which can be
/// extracted from the transport itself (ideally from authenticated information).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyLevel1Response {
    /// Begin of the validity period
    #[prost(message, optional, tag = "1")]
    pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
    /// End of the validity period
    #[prost(message, optional, tag = "2")]
    pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
    /// Level1 key
    #[prost(bytes = "vec", tag = "3")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyIntraLevel1Request {
    /// Point in time where requested key is valid.
    #[prost(message, optional, tag = "1")]
    pub val_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Protocol value.
    #[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
    pub protocol_id: i32,
    /// Src ISD-AS of the requested DRKey.
    #[prost(uint64, tag = "3")]
    pub src_ia: u64,
    /// Dst ISD-AS of the requested DRKey.
    #[prost(uint64, tag = "4")]
    pub dst_ia: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyIntraLevel1Response {
    /// Begin of validity period of DRKey.
    #[prost(message, optional, tag = "1")]
    pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
    /// End of validity period of DRKey.
    #[prost(message, optional, tag = "2")]
    pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
    /// Level1 key.
    #[prost(bytes = "vec", tag = "3")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyHostAsRequest {
    /// Point in time where requested key is valid.
    #[prost(message, optional, tag = "1")]
    pub val_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Protocol value.
    #[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
    pub protocol_id: i32,
    /// Src ISD-AS of the requested DRKey.
    #[prost(uint64, tag = "3")]
    pub src_ia: u64,
    /// Dst ISD-AS of the requested DRKey.
    #[prost(uint64, tag = "4")]
    pub dst_ia: u64,
    /// Src Host of the request DRKey.
    #[prost(string, tag = "5")]
    pub src_host: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyHostAsResponse {
    /// Begin of validity period of DRKey.
    #[prost(message, optional, tag = "1")]
    pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
    /// End of validity period of DRKey.
    #[prost(message, optional, tag = "2")]
    pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
    /// Level2 key.
    #[prost(bytes = "vec", tag = "3")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyAsHostRequest {
    /// Point in time where requested key is valid.
    #[prost(message, optional, tag = "1")]
    pub val_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Protocol value.
    #[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
    pub protocol_id: i32,
    /// Src ISD-AS of the requested DRKey.
    #[prost(uint64, tag = "3")]
    pub src_ia: u64,
    /// Dst ISD-AS of the requested DRKey.
    #[prost(uint64, tag = "4")]
    pub dst_ia: u64,
    /// Dst Host of the request DRKey.
    #[prost(string, tag = "5")]
    pub dst_host: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyAsHostResponse {
    /// Begin of validity period of DRKey.
    #[prost(message, optional, tag = "1")]
    pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
    /// End of validity period of DRKey.
    #[prost(message, optional, tag = "2")]
    pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
    /// Level2 key.
    #[prost(bytes = "vec", tag = "3")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyHostHostRequest {
    /// Point in time where requested key is valid.
    #[prost(message, optional, tag = "1")]
    pub val_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Protocol value.
    #[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
    pub protocol_id: i32,
    /// Src ISD-AS of the requested DRKey.
    #[prost(uint64, tag = "3")]
    pub src_ia: u64,
    /// Dst ISD-AS of the requested DRKey.
    #[prost(uint64, tag = "4")]
    pub dst_ia: u64,
    /// Src Host of the request DRKey.
    #[prost(string, tag = "5")]
    pub src_host: ::prost::alloc::string::String,
    /// Dst Host of the request DRKey.
    #[prost(string, tag = "6")]
    pub dst_host: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrKeyHostHostResponse {
    /// Begin of validity period of DRKey.
    #[prost(message, optional, tag = "1")]
    pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
    /// End of validity period of DRKey.
    #[prost(message, optional, tag = "2")]
    pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
    /// Level2 key.
    #[prost(bytes = "vec", tag = "3")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
/// Generated client implementations.
pub mod dr_key_inter_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct DrKeyInterServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl DrKeyInterServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> DrKeyInterServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> DrKeyInterServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            DrKeyInterServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Return the Level1Key that matches the request
        pub async fn dr_key_level1(
            &mut self,
            request: impl tonic::IntoRequest<super::DrKeyLevel1Request>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyLevel1Response>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.DRKeyInterService/DRKeyLevel1",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.DRKeyInterService",
                        "DRKeyLevel1",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod dr_key_inter_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with DrKeyInterServiceServer.
    #[async_trait]
    pub trait DrKeyInterService: std::marker::Send + std::marker::Sync + 'static {
        /// Return the Level1Key that matches the request
        async fn dr_key_level1(
            &self,
            request: tonic::Request<super::DrKeyLevel1Request>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyLevel1Response>,
            tonic::Status,
        >;
    }
    #[derive(Debug)]
    pub struct DrKeyInterServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> DrKeyInterServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for DrKeyInterServiceServer<T>
    where
        T: DrKeyInterService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/proto.control_plane.v1.DRKeyInterService/DRKeyLevel1" => {
                    #[allow(non_camel_case_types)]
                    struct DRKeyLevel1Svc<T: DrKeyInterService>(pub Arc<T>);
                    impl<
                        T: DrKeyInterService,
                    > tonic::server::UnaryService<super::DrKeyLevel1Request>
                    for DRKeyLevel1Svc<T> {
                        type Response = super::DrKeyLevel1Response;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DrKeyLevel1Request>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DrKeyInterService>::dr_key_level1(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DRKeyLevel1Svc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for DrKeyInterServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "proto.control_plane.v1.DRKeyInterService";
    impl<T> tonic::server::NamedService for DrKeyInterServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
/// Generated client implementations.
pub mod dr_key_intra_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct DrKeyIntraServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl DrKeyIntraServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> DrKeyIntraServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> DrKeyIntraServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            DrKeyIntraServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Return the ASAS that matches the request
        pub async fn dr_key_intra_level1(
            &mut self,
            request: impl tonic::IntoRequest<super::DrKeyIntraLevel1Request>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyIntraLevel1Response>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.DRKeyIntraService/DRKeyIntraLevel1",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.DRKeyIntraService",
                        "DRKeyIntraLevel1",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Return the AS-Host that matches the request
        pub async fn dr_key_as_host(
            &mut self,
            request: impl tonic::IntoRequest<super::DrKeyAsHostRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyAsHostResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.DRKeyIntraService/DRKeyASHost",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.DRKeyIntraService",
                        "DRKeyASHost",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Return the Host-AS that matches the request
        pub async fn dr_key_host_as(
            &mut self,
            request: impl tonic::IntoRequest<super::DrKeyHostAsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyHostAsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.DRKeyIntraService/DRKeyHostAS",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.DRKeyIntraService",
                        "DRKeyHostAS",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Return the Host-Host that matches the request
        pub async fn dr_key_host_host(
            &mut self,
            request: impl tonic::IntoRequest<super::DrKeyHostHostRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyHostHostResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.DRKeyIntraService/DRKeyHostHost",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.DRKeyIntraService",
                        "DRKeyHostHost",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Return the SecretValue that matches the request
        pub async fn dr_key_secret_value(
            &mut self,
            request: impl tonic::IntoRequest<super::DrKeySecretValueRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeySecretValueResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.DRKeyIntraService/DRKeySecretValue",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.DRKeyIntraService",
                        "DRKeySecretValue",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod dr_key_intra_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with DrKeyIntraServiceServer.
    #[async_trait]
    pub trait DrKeyIntraService: std::marker::Send + std::marker::Sync + 'static {
        /// Return the ASAS that matches the request
        async fn dr_key_intra_level1(
            &self,
            request: tonic::Request<super::DrKeyIntraLevel1Request>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyIntraLevel1Response>,
            tonic::Status,
        >;
        /// Return the AS-Host that matches the request
        async fn dr_key_as_host(
            &self,
            request: tonic::Request<super::DrKeyAsHostRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyAsHostResponse>,
            tonic::Status,
        >;
        /// Return the Host-AS that matches the request
        async fn dr_key_host_as(
            &self,
            request: tonic::Request<super::DrKeyHostAsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyHostAsResponse>,
            tonic::Status,
        >;
        /// Return the Host-Host that matches the request
        async fn dr_key_host_host(
            &self,
            request: tonic::Request<super::DrKeyHostHostRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeyHostHostResponse>,
            tonic::Status,
        >;
        /// Return the SecretValue that matches the request
        async fn dr_key_secret_value(
            &self,
            request: tonic::Request<super::DrKeySecretValueRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DrKeySecretValueResponse>,
            tonic::Status,
        >;
    }
    #[derive(Debug)]
    pub struct DrKeyIntraServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> DrKeyIntraServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for DrKeyIntraServiceServer<T>
    where
        T: DrKeyIntraService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/proto.control_plane.v1.DRKeyIntraService/DRKeyIntraLevel1" => {
                    #[allow(non_camel_case_types)]
                    struct DRKeyIntraLevel1Svc<T: DrKeyIntraService>(pub Arc<T>);
                    impl<
                        T: DrKeyIntraService,
                    > tonic::server::UnaryService<super::DrKeyIntraLevel1Request>
                    for DRKeyIntraLevel1Svc<T> {
                        type Response = super::DrKeyIntraLevel1Response;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DrKeyIntraLevel1Request>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DrKeyIntraService>::dr_key_intra_level1(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DRKeyIntraLevel1Svc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/proto.control_plane.v1.DRKeyIntraService/DRKeyASHost" => {
                    #[allow(non_camel_case_types)]
                    struct DRKeyASHostSvc<T: DrKeyIntraService>(pub Arc<T>);
                    impl<
                        T: DrKeyIntraService,
                    > tonic::server::UnaryService<super::DrKeyAsHostRequest>
                    for DRKeyASHostSvc<T> {
                        type Response = super::DrKeyAsHostResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DrKeyAsHostRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DrKeyIntraService>::dr_key_as_host(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DRKeyASHostSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/proto.control_plane.v1.DRKeyIntraService/DRKeyHostAS" => {
                    #[allow(non_camel_case_types)]
                    struct DRKeyHostASSvc<T: DrKeyIntraService>(pub Arc<T>);
                    impl<
                        T: DrKeyIntraService,
                    > tonic::server::UnaryService<super::DrKeyHostAsRequest>
                    for DRKeyHostASSvc<T> {
                        type Response = super::DrKeyHostAsResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DrKeyHostAsRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DrKeyIntraService>::dr_key_host_as(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DRKeyHostASSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/proto.control_plane.v1.DRKeyIntraService/DRKeyHostHost" => {
                    #[allow(non_camel_case_types)]
                    struct DRKeyHostHostSvc<T: DrKeyIntraService>(pub Arc<T>);
                    impl<
                        T: DrKeyIntraService,
                    > tonic::server::UnaryService<super::DrKeyHostHostRequest>
                    for DRKeyHostHostSvc<T> {
                        type Response = super::DrKeyHostHostResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DrKeyHostHostRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DrKeyIntraService>::dr_key_host_host(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DRKeyHostHostSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/proto.control_plane.v1.DRKeyIntraService/DRKeySecretValue" => {
                    #[allow(non_camel_case_types)]
                    struct DRKeySecretValueSvc<T: DrKeyIntraService>(pub Arc<T>);
                    impl<
                        T: DrKeyIntraService,
                    > tonic::server::UnaryService<super::DrKeySecretValueRequest>
                    for DRKeySecretValueSvc<T> {
                        type Response = super::DrKeySecretValueResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DrKeySecretValueRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DrKeyIntraService>::dr_key_secret_value(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DRKeySecretValueSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for DrKeyIntraServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "proto.control_plane.v1.DRKeyIntraService";
    impl<T> tonic::server::NamedService for DrKeyIntraServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChainRenewalRequest {
    /// The signed certificate chain renewal requests. The body of the
    /// SignedMessage is the serialized ChainRenewalRequestBody.
    #[prost(message, optional, tag = "1")]
    pub signed_request: ::core::option::Option<super::super::crypto::v1::SignedMessage>,
    /// The certificate signing request. The content is an ASN.1 DER
    /// encoded CMS SignedData structure that contains an ASN.1 DER
    /// encoded PKCS #10 request.
    #[prost(bytes = "vec", tag = "2")]
    pub cms_signed_request: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChainRenewalRequestBody {
    /// The raw certificate signature request (PKCS #10).
    #[prost(bytes = "vec", tag = "1")]
    pub csr: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChainRenewalResponse {
    /// The signed certificate chain renewal response. The body of the
    /// SignedMessage is the serialized ChainRenewalResponseBody.
    #[prost(message, optional, tag = "1")]
    pub signed_response: ::core::option::Option<super::super::crypto::v1::SignedMessage>,
    /// The renewed certificate chain. The content is an ASN.1 DER
    /// encoded CMS SignedData structure that contains the certificate chain.
    /// The chain is the concatenation of the ASN.1 DER encoded certificates.
    #[prost(bytes = "vec", tag = "2")]
    pub cms_signed_response: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChainRenewalResponseBody {
    /// The renewed certificate chain.
    #[prost(message, optional, tag = "1")]
    pub chain: ::core::option::Option<Chain>,
}
/// Generated client implementations.
pub mod chain_renewal_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct ChainRenewalServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ChainRenewalServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> ChainRenewalServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> ChainRenewalServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            ChainRenewalServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// RenewChain creates a chain from the chain request.
        pub async fn chain_renewal(
            &mut self,
            request: impl tonic::IntoRequest<super::ChainRenewalRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ChainRenewalResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.ChainRenewalService/ChainRenewal",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.ChainRenewalService",
                        "ChainRenewal",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod chain_renewal_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with ChainRenewalServiceServer.
    #[async_trait]
    pub trait ChainRenewalService: std::marker::Send + std::marker::Sync + 'static {
        /// RenewChain creates a chain from the chain request.
        async fn chain_renewal(
            &self,
            request: tonic::Request<super::ChainRenewalRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ChainRenewalResponse>,
            tonic::Status,
        >;
    }
    #[derive(Debug)]
    pub struct ChainRenewalServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> ChainRenewalServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for ChainRenewalServiceServer<T>
    where
        T: ChainRenewalService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/proto.control_plane.v1.ChainRenewalService/ChainRenewal" => {
                    #[allow(non_camel_case_types)]
                    struct ChainRenewalSvc<T: ChainRenewalService>(pub Arc<T>);
                    impl<
                        T: ChainRenewalService,
                    > tonic::server::UnaryService<super::ChainRenewalRequest>
                    for ChainRenewalSvc<T> {
                        type Response = super::ChainRenewalResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ChainRenewalRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as ChainRenewalService>::chain_renewal(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ChainRenewalSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for ChainRenewalServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "proto.control_plane.v1.ChainRenewalService";
    impl<T> tonic::server::NamedService for ChainRenewalServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PathSegmentExtensions {
    /// Optional static info extension.
    #[prost(message, optional, tag = "1")]
    pub static_info: ::core::option::Option<StaticInfoExtension>,
    /// Optional hidden path extension.
    #[prost(message, optional, tag = "2")]
    pub hidden_path: ::core::option::Option<HiddenPathExtension>,
    /// Optional digests of detached extensions.
    #[prost(message, optional, tag = "1000")]
    pub digests: ::core::option::Option<DigestExtension>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HiddenPathExtension {
    /// Indicate if this is a hidden path.
    #[prost(bool, tag = "1")]
    pub is_hidden: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StaticInfoExtension {
    /// Approximate, lower-bound latency for paths based on this ASEntry.
    #[prost(message, optional, tag = "1")]
    pub latency: ::core::option::Option<LatencyInfo>,
    /// Approximate, maximum bandwidth for paths based on this ASEntry.
    #[prost(message, optional, tag = "2")]
    pub bandwidth: ::core::option::Option<BandwidthInfo>,
    /// Geographical coordinates describing the location of the routers for
    /// relevant interfaces of this AS. The key is the interface identifier.
    #[prost(map = "uint64, message", tag = "3")]
    pub geo: ::std::collections::HashMap<u64, GeoCoordinates>,
    /// Description of the underlying network for the inter-AS links, for the
    /// relevant interfaces of this AS. The key is the interface identifier.
    #[prost(map = "uint64, enumeration(LinkType)", tag = "4")]
    pub link_type: ::std::collections::HashMap<u64, i32>,
    /// Number of AS internal hops between the construction-egress and the
    /// relevant other interfaces. These are:
    ///
    /// * construction-ingress interface (if any)
    /// * sibling child interfaces,
    /// * core interfaces, at start or end of a segment
    /// * peer interfaces
    ///
    /// The key is the interface identifier of the other interface.
    #[prost(map = "uint64, uint32", tag = "5")]
    pub internal_hops: ::std::collections::HashMap<u64, u32>,
    /// Generic note
    #[prost(string, tag = "6")]
    pub note: ::prost::alloc::string::String,
}
/// LatencyInfo specifies approximate lower-bound latency values.
/// The separate intra and inter AS latency information allows to reconstruct
/// latency values for all paths (cross-over, shortcut, peering) based on this
/// ASEntry.
/// All values are in microseconds.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LatencyInfo {
    /// Latency between construction-egress interface and the relevant other
    /// interfaces. These are:
    ///
    /// * construction-ingress interface (if any)
    /// * sibling child interfaces,
    /// * core interfaces, at start or end of a segment
    /// * peer interfaces
    ///
    /// The key is the interface identifier of the other interface.
    #[prost(map = "uint64, uint32", tag = "1")]
    pub intra: ::std::collections::HashMap<u64, u32>,
    /// Latency between the local interface and the interface in the neighbor AS
    /// for the relevant links. These are:
    ///
    /// * link at construction-egress interface (if any)
    /// * peer links
    ///
    /// The key is the interface identifier of the local interface associated
    /// with the link.
    #[prost(map = "uint64, uint32", tag = "2")]
    pub inter: ::std::collections::HashMap<u64, u32>,
}
/// BandwidthInfo specifies approximate maximum link bandwidth.
/// The separate intra and inter AS bandwidth information allows to reconstruct
/// bandwidth values for all paths (cross-over, shortcut, peering) based on this
/// ASEntry.
/// All values are in Kbit/s.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BandwidthInfo {
    /// Bandwidth between construction-egress interface and the relevant other
    /// interfaces. These are:
    ///
    /// * construction-ingress interface (if any)
    /// * sibling child interfaces,
    /// * core interfaces, if this is the start of a segment, or the end of a core segment
    /// * peer interfaces
    ///
    /// The key is the interface identifier of the other interface.
    #[prost(map = "uint64, uint64", tag = "1")]
    pub intra: ::std::collections::HashMap<u64, u64>,
    /// Bandwidth between the local interface and the interface in the neighbor AS
    /// for the relevant links. These are:
    ///
    /// * link at construction-egress interface (if any)
    /// * peer links
    ///
    /// The key is the interface identifier of the local interface associated
    /// with the link.
    #[prost(map = "uint64, uint64", tag = "2")]
    pub inter: ::std::collections::HashMap<u64, u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoCoordinates {
    /// Latitude of the geographic coordinate, in the WGS 84 datum.
    #[prost(float, tag = "1")]
    pub latitude: f32,
    /// Longitude of the geographic coordinate, in the WGS 84 datum.
    #[prost(float, tag = "2")]
    pub longitude: f32,
    /// Civic address of the location.
    #[prost(string, tag = "3")]
    pub address: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DigestExtension {
    /// The digest of the detached EPIC extension. The hash input is defined as follows:
    ///
    /// input = totalLen ||
    /// epic.Detached.AuthHopEntry ||
    /// epic.Detached.AuthPeerEntries\[0\] ||
    /// epic.Detached.AuthPeerEntries\[1\] ||
    /// ...
    /// epic.Detached.AuthPeerEntries\[n-1\]
    ///
    /// Here, 'n' denotes the number of peer entries.
    ///
    /// 'totalLen' is equal to (n+1), and therefore encodes the
    /// total number of authenticators used in the hash.
    #[prost(message, optional, tag = "1000")]
    pub epic: ::core::option::Option<digest_extension::Digest>,
}
/// Nested message and enum types in `DigestExtension`.
pub mod digest_extension {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct Digest {
        /// Raw digest of the metadata.
        #[prost(bytes = "vec", tag = "1")]
        pub digest: ::prost::alloc::vec::Vec<u8>,
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PathSegmentUnsignedExtensions {
    /// Optional EPIC extension.
    #[prost(message, optional, tag = "1000")]
    pub epic: ::core::option::Option<super::experimental::v1::EpicDetachedExtension>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LinkType {
    /// Unspecified link type.
    Unspecified = 0,
    /// Direct physical connection.
    Direct = 1,
    /// Connection with local routing/switching.
    MultiHop = 2,
    /// Connection overlayed over publicly routed Internet.
    OpenNet = 3,
}
impl LinkType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "LINK_TYPE_UNSPECIFIED",
            Self::Direct => "LINK_TYPE_DIRECT",
            Self::MultiHop => "LINK_TYPE_MULTI_HOP",
            Self::OpenNet => "LINK_TYPE_OPEN_NET",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "LINK_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "LINK_TYPE_DIRECT" => Some(Self::Direct),
            "LINK_TYPE_MULTI_HOP" => Some(Self::MultiHop),
            "LINK_TYPE_OPEN_NET" => Some(Self::OpenNet),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SegmentsRequest {
    /// The source ISD-AS of the segment.
    #[prost(uint64, tag = "1")]
    pub src_isd_as: u64,
    /// The destination ISD-AS of the segment.
    #[prost(uint64, tag = "2")]
    pub dst_isd_as: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SegmentsResponse {
    /// Mapping from path segment type to path segments. The key is the integer
    /// representation of the SegmentType enum.
    #[prost(map = "int32, message", tag = "1")]
    pub segments: ::std::collections::HashMap<i32, segments_response::Segments>,
    /// Deprecated list of signed revocations. Will be removed with header v1.
    #[prost(bytes = "vec", repeated, tag = "1000")]
    pub deprecated_signed_revocations: ::prost::alloc::vec::Vec<
        ::prost::alloc::vec::Vec<u8>,
    >,
}
/// Nested message and enum types in `SegmentsResponse`.
pub mod segments_response {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Segments {
        /// List of path segments.
        #[prost(message, repeated, tag = "1")]
        pub segments: ::prost::alloc::vec::Vec<super::PathSegment>,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SegmentsRegistrationRequest {
    /// Mapping from path segment type to path segments. The key is the integer
    /// representation of the SegmentType enum.
    #[prost(map = "int32, message", tag = "1")]
    pub segments: ::std::collections::HashMap<
        i32,
        segments_registration_request::Segments,
    >,
}
/// Nested message and enum types in `SegmentsRegistrationRequest`.
pub mod segments_registration_request {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Segments {
        /// List of path segments.
        #[prost(message, repeated, tag = "1")]
        pub segments: ::prost::alloc::vec::Vec<super::PathSegment>,
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SegmentsRegistrationResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BeaconRequest {
    /// Beacon in form of a partial path segment.
    #[prost(message, optional, tag = "1")]
    pub segment: ::core::option::Option<PathSegment>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BeaconResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PathSegment {
    /// The encoded SegmentInformation. It is used for signature input.
    #[prost(bytes = "vec", tag = "1")]
    pub segment_info: ::prost::alloc::vec::Vec<u8>,
    /// Entries of ASes on the path.
    #[prost(message, repeated, tag = "2")]
    pub as_entries: ::prost::alloc::vec::Vec<AsEntry>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SegmentInformation {
    /// Segment creation time set by the originating AS. Segment expiration time
    /// is computed relative to this timestamp. The timestamp is encoded as
    /// number of seconds elapsed since January 1, 1970 UTC.
    #[prost(int64, tag = "1")]
    pub timestamp: i64,
    /// The 16-bit segment ID integer used for MAC computation.
    #[prost(uint32, tag = "2")]
    pub segment_id: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AsEntry {
    /// The signed part of the AS entry. The body of the SignedMessage is the
    /// serialized ASEntrySignedBody. The signature input is defined as following:
    ///
    /// input(ps, i) = signed.header_and_body || associated_data(ps, i)
    ///
    /// associated_data(ps, i) = ps.segment_info ||
    /// ps.as_entries\[1\].signed.header_and_body ||
    /// ps.as_entries\[1\].signed.signature ||
    /// ...
    /// ps.as_entries\[i-1\].signed.header_and_body ||
    /// ps.as_entries\[i-1\].signed.signature
    #[prost(message, optional, tag = "1")]
    pub signed: ::core::option::Option<super::super::crypto::v1::SignedMessage>,
    /// The unsigned part of the AS entry.
    #[prost(message, optional, tag = "2")]
    pub unsigned: ::core::option::Option<PathSegmentUnsignedExtensions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AsEntrySignedBody {
    /// ISD-AS of the AS that created this AS entry.
    #[prost(uint64, tag = "1")]
    pub isd_as: u64,
    /// ISD-AS of the downstream AS.
    #[prost(uint64, tag = "2")]
    pub next_isd_as: u64,
    /// The required regular hop entry.
    #[prost(message, optional, tag = "3")]
    pub hop_entry: ::core::option::Option<HopEntry>,
    /// Optional peer entries.
    #[prost(message, repeated, tag = "4")]
    pub peer_entries: ::prost::alloc::vec::Vec<PeerEntry>,
    /// Intra AS MTU.
    #[prost(uint32, tag = "5")]
    pub mtu: u32,
    /// Optional extensions.
    #[prost(message, optional, tag = "6")]
    pub extensions: ::core::option::Option<PathSegmentExtensions>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HopEntry {
    /// Material to create the data-plane hop field.
    #[prost(message, optional, tag = "1")]
    pub hop_field: ::core::option::Option<HopField>,
    /// MTU on the ingress link.
    #[prost(uint32, tag = "2")]
    pub ingress_mtu: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PeerEntry {
    /// ISD-AS of peer AS. This is used to match peering segments during path
    /// construction.
    #[prost(uint64, tag = "1")]
    pub peer_isd_as: u64,
    /// Remote peer interface identifier. This is used to match peering segments
    /// during path construction.
    #[prost(uint64, tag = "2")]
    pub peer_interface: u64,
    /// MTU on the peering link.
    #[prost(uint32, tag = "3")]
    pub peer_mtu: u32,
    /// Material to create the data-plane hop field
    #[prost(message, optional, tag = "4")]
    pub hop_field: ::core::option::Option<HopField>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HopField {
    /// Ingress interface identifier.
    #[prost(uint64, tag = "1")]
    pub ingress: u64,
    /// Egress interface identifier.
    #[prost(uint64, tag = "2")]
    pub egress: u64,
    /// 8-bit encoded expiration offset relative to the segment creation
    /// timestamp.
    #[prost(uint32, tag = "3")]
    pub exp_time: u32,
    /// MAC used in the data plane to verify the hop field.
    #[prost(bytes = "vec", tag = "4")]
    pub mac: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SegmentType {
    /// Unknown segemnt type.
    Unspecified = 0,
    /// Up segment.
    Up = 1,
    /// Down segment.
    Down = 2,
    /// Core segment.
    Core = 3,
}
impl SegmentType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "SEGMENT_TYPE_UNSPECIFIED",
            Self::Up => "SEGMENT_TYPE_UP",
            Self::Down => "SEGMENT_TYPE_DOWN",
            Self::Core => "SEGMENT_TYPE_CORE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SEGMENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "SEGMENT_TYPE_UP" => Some(Self::Up),
            "SEGMENT_TYPE_DOWN" => Some(Self::Down),
            "SEGMENT_TYPE_CORE" => Some(Self::Core),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod segment_lookup_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct SegmentLookupServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl SegmentLookupServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> SegmentLookupServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> SegmentLookupServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            SegmentLookupServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Segments returns all segments that match the request.
        pub async fn segments(
            &mut self,
            request: impl tonic::IntoRequest<super::SegmentsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SegmentsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.SegmentLookupService/Segments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.SegmentLookupService",
                        "Segments",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod segment_lookup_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with SegmentLookupServiceServer.
    #[async_trait]
    pub trait SegmentLookupService: std::marker::Send + std::marker::Sync + 'static {
        /// Segments returns all segments that match the request.
        async fn segments(
            &self,
            request: tonic::Request<super::SegmentsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SegmentsResponse>,
            tonic::Status,
        >;
    }
    #[derive(Debug)]
    pub struct SegmentLookupServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> SegmentLookupServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>>
    for SegmentLookupServiceServer<T>
    where
        T: SegmentLookupService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/proto.control_plane.v1.SegmentLookupService/Segments" => {
                    #[allow(non_camel_case_types)]
                    struct SegmentsSvc<T: SegmentLookupService>(pub Arc<T>);
                    impl<
                        T: SegmentLookupService,
                    > tonic::server::UnaryService<super::SegmentsRequest>
                    for SegmentsSvc<T> {
                        type Response = super::SegmentsResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SegmentsRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as SegmentLookupService>::segments(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = SegmentsSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for SegmentLookupServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "proto.control_plane.v1.SegmentLookupService";
    impl<T> tonic::server::NamedService for SegmentLookupServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
/// Generated client implementations.
pub mod segment_registration_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct SegmentRegistrationServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl SegmentRegistrationServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> SegmentRegistrationServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> SegmentRegistrationServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            SegmentRegistrationServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// SegmentsRegistration registers segments at the remote.
        pub async fn segments_registration(
            &mut self,
            request: impl tonic::IntoRequest<super::SegmentsRegistrationRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SegmentsRegistrationResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.SegmentRegistrationService/SegmentsRegistration",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.SegmentRegistrationService",
                        "SegmentsRegistration",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod segment_registration_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with SegmentRegistrationServiceServer.
    #[async_trait]
    pub trait SegmentRegistrationService: std::marker::Send + std::marker::Sync + 'static {
        /// SegmentsRegistration registers segments at the remote.
        async fn segments_registration(
            &self,
            request: tonic::Request<super::SegmentsRegistrationRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SegmentsRegistrationResponse>,
            tonic::Status,
        >;
    }
    #[derive(Debug)]
    pub struct SegmentRegistrationServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> SegmentRegistrationServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>>
    for SegmentRegistrationServiceServer<T>
    where
        T: SegmentRegistrationService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/proto.control_plane.v1.SegmentRegistrationService/SegmentsRegistration" => {
                    #[allow(non_camel_case_types)]
                    struct SegmentsRegistrationSvc<T: SegmentRegistrationService>(
                        pub Arc<T>,
                    );
                    impl<
                        T: SegmentRegistrationService,
                    > tonic::server::UnaryService<super::SegmentsRegistrationRequest>
                    for SegmentsRegistrationSvc<T> {
                        type Response = super::SegmentsRegistrationResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SegmentsRegistrationRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as SegmentRegistrationService>::segments_registration(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = SegmentsRegistrationSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for SegmentRegistrationServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "proto.control_plane.v1.SegmentRegistrationService";
    impl<T> tonic::server::NamedService for SegmentRegistrationServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
/// Generated client implementations.
pub mod segment_creation_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct SegmentCreationServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl SegmentCreationServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> SegmentCreationServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> SegmentCreationServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            SegmentCreationServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Beacon sends a beacon to the remote.
        pub async fn beacon(
            &mut self,
            request: impl tonic::IntoRequest<super::BeaconRequest>,
        ) -> std::result::Result<tonic::Response<super::BeaconResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/proto.control_plane.v1.SegmentCreationService/Beacon",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "proto.control_plane.v1.SegmentCreationService",
                        "Beacon",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod segment_creation_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with SegmentCreationServiceServer.
    #[async_trait]
    pub trait SegmentCreationService: std::marker::Send + std::marker::Sync + 'static {
        /// Beacon sends a beacon to the remote.
        async fn beacon(
            &self,
            request: tonic::Request<super::BeaconRequest>,
        ) -> std::result::Result<tonic::Response<super::BeaconResponse>, tonic::Status>;
    }
    #[derive(Debug)]
    pub struct SegmentCreationServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> SegmentCreationServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>>
    for SegmentCreationServiceServer<T>
    where
        T: SegmentCreationService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/proto.control_plane.v1.SegmentCreationService/Beacon" => {
                    #[allow(non_camel_case_types)]
                    struct BeaconSvc<T: SegmentCreationService>(pub Arc<T>);
                    impl<
                        T: SegmentCreationService,
                    > tonic::server::UnaryService<super::BeaconRequest>
                    for BeaconSvc<T> {
                        type Response = super::BeaconResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::BeaconRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as SegmentCreationService>::beacon(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = BeaconSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for SegmentCreationServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "proto.control_plane.v1.SegmentCreationService";
    impl<T> tonic::server::NamedService for SegmentCreationServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
/// A ServiceResolutionRequest must always fit within a UDP datagram. If the
/// request does not fit, there is no mechanism for clients and servers to
/// establish control-plane reachability.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ServiceResolutionRequest {}
/// A ServiceResolutionResponse must always fit within a UDP datagram. If the
/// response does not fit, there is no mechanism for clients and servers to
/// establish control-plane reachability.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceResolutionResponse {
    /// Supported transports to reach the service,
    ///
    /// List of known transports:
    ///
    /// * QUIC
    ///
    /// Unknown values should be ignored by clients.
    #[prost(map = "string, message", tag = "1")]
    pub transports: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        Transport,
    >,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Transport {
    /// Protocol specific server address descriptor.
    ///
    /// Supported address format for QUIC:
    /// 192.168.0.1:80
    /// \[2001:db8::1\]:80
    ///
    /// Missing ports / zero port / invalid port values should be treated by
    /// clients as errors.
    #[prost(string, tag = "1")]
    pub address: ::prost::alloc::string::String,
}
