// This file is @generated by prost-build.
/// Specification of the GRPC Endpoint.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GrpcEndpoint {
    /// Required. The target URI of the gRPC endpoint. Only UDS path is supported,
    /// and should start with "unix:".
    #[prost(string, tag = "1")]
    pub target_uri: ::prost::alloc::string::String,
}
/// Specification of ValidationCA. Defines the mechanism to obtain the
/// Certificate Authority certificate to validate the peer certificate.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ValidationCa {
    /// The type of certificate provider which provides the CA certificate.
    #[prost(oneof = "validation_ca::Type", tags = "1, 2, 3")]
    pub r#type: ::core::option::Option<validation_ca::Type>,
}
/// Nested message and enum types in `ValidationCA`.
pub mod validation_ca {
    /// The type of certificate provider which provides the CA certificate.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Type {
        /// The path to the file holding the CA certificate to validate the client or
        /// server certificate.
        #[prost(string, tag = "1")]
        CaCertPath(::prost::alloc::string::String),
        /// gRPC specific configuration to access the gRPC server to
        /// obtain the CA certificate.
        #[prost(message, tag = "2")]
        GrpcEndpoint(super::GrpcEndpoint),
        /// The certificate provider instance specification that will be passed to
        /// the data plane, which will be used to load necessary credential
        /// information.
        #[prost(message, tag = "3")]
        CertificateProviderInstance(super::CertificateProviderInstance),
    }
}
/// Specification of a TLS certificate provider instance. Workloads may have one
/// or more CertificateProvider instances (plugins) and one of them is enabled
/// and configured by specifying this message. Workloads use the values from this
/// message to locate and load the CertificateProvider instance configuration.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CertificateProviderInstance {
    /// Required. Plugin instance name, used to locate and load CertificateProvider
    /// instance configuration. Set to "google_cloud_private_spiffe" to use
    /// Certificate Authority Service certificate provider instance.
    #[prost(string, tag = "1")]
    pub plugin_instance: ::prost::alloc::string::String,
}
/// Specification of certificate provider. Defines the mechanism to obtain the
/// certificate and private key for peer to peer authentication.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CertificateProvider {
    /// The type of certificate provider which provides the certificates and
    /// private keys.
    #[prost(oneof = "certificate_provider::Type", tags = "1, 2, 3")]
    pub r#type: ::core::option::Option<certificate_provider::Type>,
}
/// Nested message and enum types in `CertificateProvider`.
pub mod certificate_provider {
    /// Specification of TLS certificate files.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct TlsCertificateFiles {
        /// Required. The path to the file that has the certificate containing public
        /// key.
        #[prost(string, tag = "1")]
        pub certificate_path: ::prost::alloc::string::String,
        /// Required. The path to the file that has the private key.
        #[prost(string, tag = "2")]
        pub private_key_path: ::prost::alloc::string::String,
    }
    /// The type of certificate provider which provides the certificates and
    /// private keys.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Type {
        /// Obtain certificates and private key from a locally mounted
        /// filesystem path.
        #[prost(message, tag = "1")]
        LocalFilepath(TlsCertificateFiles),
        /// gRPC specific configuration to access the gRPC server to
        /// obtain the cert and private key.
        #[prost(message, tag = "2")]
        GrpcEndpoint(super::GrpcEndpoint),
        /// The certificate provider instance specification that will be passed to
        /// the data plane, which will be used to load necessary credential
        /// information.
        #[prost(message, tag = "3")]
        CertificateProviderInstance(super::CertificateProviderInstance),
    }
}
/// ClientTlsPolicy is a resource that specifies how a client should authenticate
/// connections to backends of a service. This resource itself does not affect
/// configuration unless it is attached to a backend service resource.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientTlsPolicy {
    /// Required. Name of the ClientTlsPolicy resource. It matches the pattern
    /// `projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. Free-text description of the resource.
    #[prost(string, tag = "2")]
    pub description: ::prost::alloc::string::String,
    /// Output only. The timestamp when the resource was created.
    #[prost(message, optional, tag = "3")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The timestamp when the resource was updated.
    #[prost(message, optional, tag = "4")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Optional. Set of label tags associated with the resource.
    #[prost(map = "string, string", tag = "5")]
    pub labels: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Optional. Server Name Indication string to present to the server during TLS
    /// handshake. E.g: "secure.example.com".
    #[prost(string, tag = "6")]
    pub sni: ::prost::alloc::string::String,
    /// Optional. Defines a mechanism to provision client identity (public and
    /// private keys) for peer to peer authentication. The presence of this
    /// dictates mTLS.
    #[prost(message, optional, tag = "7")]
    pub client_certificate: ::core::option::Option<CertificateProvider>,
    /// Optional. Defines the mechanism to obtain the Certificate Authority
    /// certificate to validate the server certificate. If empty, client does not
    /// validate the server certificate.
    #[prost(message, repeated, tag = "8")]
    pub server_validation_ca: ::prost::alloc::vec::Vec<ValidationCa>,
}
/// Request used by the ListClientTlsPolicies method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListClientTlsPoliciesRequest {
    /// Required. The project and location from which the ClientTlsPolicies should
    /// be listed, specified in the format `projects/*/locations/{location}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Maximum number of ClientTlsPolicies to return per call.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// The value returned by the last `ListClientTlsPoliciesResponse`
    /// Indicates that this is a continuation of a prior
    /// `ListClientTlsPolicies` call, and that the system
    /// should return the next page of data.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response returned by the ListClientTlsPolicies method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClientTlsPoliciesResponse {
    /// List of ClientTlsPolicy resources.
    #[prost(message, repeated, tag = "1")]
    pub client_tls_policies: ::prost::alloc::vec::Vec<ClientTlsPolicy>,
    /// If there might be more results than those appearing in this response, then
    /// `next_page_token` is included. To get the next set of results, call this
    /// method again using the value of `next_page_token` as `page_token`.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request used by the GetClientTlsPolicy method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetClientTlsPolicyRequest {
    /// Required. A name of the ClientTlsPolicy to get. Must be in the format
    /// `projects/*/locations/{location}/clientTlsPolicies/*`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request used by the CreateClientTlsPolicy method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateClientTlsPolicyRequest {
    /// Required. The parent resource of the ClientTlsPolicy. Must be in
    /// the format `projects/*/locations/{location}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. Short name of the ClientTlsPolicy resource to be created. This
    /// value should be 1-63 characters long, containing only letters, numbers,
    /// hyphens, and underscores, and should not start with a number. E.g.
    /// "client_mtls_policy".
    #[prost(string, tag = "2")]
    pub client_tls_policy_id: ::prost::alloc::string::String,
    /// Required. ClientTlsPolicy resource to be created.
    #[prost(message, optional, tag = "3")]
    pub client_tls_policy: ::core::option::Option<ClientTlsPolicy>,
}
/// Request used by UpdateClientTlsPolicy method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateClientTlsPolicyRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// ClientTlsPolicy resource by the update.  The fields
    /// specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the
    /// mask. If the user does not provide a mask then all fields will be
    /// overwritten.
    #[prost(message, optional, tag = "1")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Required. Updated ClientTlsPolicy resource.
    #[prost(message, optional, tag = "2")]
    pub client_tls_policy: ::core::option::Option<ClientTlsPolicy>,
}
/// Request used by the DeleteClientTlsPolicy method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteClientTlsPolicyRequest {
    /// Required. A name of the ClientTlsPolicy to delete. Must be in
    /// the format `projects/*/locations/{location}/clientTlsPolicies/*`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Represents the metadata of the long-running operation.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    #[prost(message, optional, tag = "1")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The time the operation finished running.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Server-defined resource path for the target of the operation.
    #[prost(string, tag = "3")]
    pub target: ::prost::alloc::string::String,
    /// Output only. Name of the verb executed by the operation.
    #[prost(string, tag = "4")]
    pub verb: ::prost::alloc::string::String,
    /// Output only. Human-readable status of the operation, if any.
    #[prost(string, tag = "5")]
    pub status_message: ::prost::alloc::string::String,
    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have successfully been cancelled
    /// have \[Operation.error\]\[\] value with a
    /// \[google.rpc.Status.code\]\[google.rpc.Status.code\] of 1, corresponding to
    /// `Code.CANCELLED`.
    #[prost(bool, tag = "6")]
    pub requested_cancellation: bool,
    /// Output only. API version used to start the operation.
    #[prost(string, tag = "7")]
    pub api_version: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod network_security_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Network Security API provides resources to configure authentication and
    /// authorization policies. Refer to per API resource documentation for more
    /// information.
    #[derive(Debug, Clone)]
    pub struct NetworkSecurityClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl NetworkSecurityClient<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> NetworkSecurityClient<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,
        ) -> NetworkSecurityClient<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,
        {
            NetworkSecurityClient::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
        }
        /// Lists ClientTlsPolicies in a given project and location.
        pub async fn list_client_tls_policies(
            &mut self,
            request: impl tonic::IntoRequest<super::ListClientTlsPoliciesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListClientTlsPoliciesResponse>,
            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(
                "/google.cloud.networksecurity.v1alpha1.NetworkSecurity/ListClientTlsPolicies",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.networksecurity.v1alpha1.NetworkSecurity",
                        "ListClientTlsPolicies",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets details of a single ClientTlsPolicy.
        pub async fn get_client_tls_policy(
            &mut self,
            request: impl tonic::IntoRequest<super::GetClientTlsPolicyRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ClientTlsPolicy>,
            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(
                "/google.cloud.networksecurity.v1alpha1.NetworkSecurity/GetClientTlsPolicy",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.networksecurity.v1alpha1.NetworkSecurity",
                        "GetClientTlsPolicy",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a new ClientTlsPolicy in a given project and location.
        pub async fn create_client_tls_policy(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateClientTlsPolicyRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            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(
                "/google.cloud.networksecurity.v1alpha1.NetworkSecurity/CreateClientTlsPolicy",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.networksecurity.v1alpha1.NetworkSecurity",
                        "CreateClientTlsPolicy",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates the parameters of a single ClientTlsPolicy.
        pub async fn update_client_tls_policy(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateClientTlsPolicyRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            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(
                "/google.cloud.networksecurity.v1alpha1.NetworkSecurity/UpdateClientTlsPolicy",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.networksecurity.v1alpha1.NetworkSecurity",
                        "UpdateClientTlsPolicy",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a single ClientTlsPolicy.
        pub async fn delete_client_tls_policy(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteClientTlsPolicyRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            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(
                "/google.cloud.networksecurity.v1alpha1.NetworkSecurity/DeleteClientTlsPolicy",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.networksecurity.v1alpha1.NetworkSecurity",
                        "DeleteClientTlsPolicy",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
