#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IbmCosTargetSpec {
    #[prost(string, tag = "1")]
    pub bucket_crn: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub endpoint: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "3")]
    pub service_crn: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "IbmBucketType", optional, tag = "4")]
    pub bucket_type: ::core::option::Option<i32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct S3TargetSpec {
    #[prost(string, tag = "1")]
    pub bucket: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub region: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArchiveSpec {
    #[prost(string, tag = "1")]
    pub archiving_format_id: ::prost::alloc::string::String,
    #[prost(bool, tag = "2")]
    pub is_active: bool,
    #[prost(bool, tag = "3")]
    pub enable_tags: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Target {
    #[prost(message, optional, tag = "3")]
    pub archive_spec: ::core::option::Option<ArchiveSpec>,
    #[prost(oneof = "target::TargetSpec", tags = "1, 2")]
    pub target_spec: ::core::option::Option<target::TargetSpec>,
}
pub mod target {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum TargetSpec {
        #[prost(message, tag = "1")]
        S3(super::S3TargetSpec),
        #[prost(message, tag = "2")]
        IbmCos(super::IbmCosTargetSpec),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IbmBucketType {
    Unspecified = 0,
    External = 1,
    Internal = 2,
}
impl IbmBucketType {
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "IBM_BUCKET_TYPE_UNSPECIFIED",
            Self::External => "IBM_BUCKET_TYPE_EXTERNAL",
            Self::Internal => "IBM_BUCKET_TYPE_INTERNAL",
        }
    }
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "IBM_BUCKET_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "IBM_BUCKET_TYPE_EXTERNAL" => Some(Self::External),
            "IBM_BUCKET_TYPE_INTERNAL" => Some(Self::Internal),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InternalTargetServiceGetTargetsRequest {
    #[prost(message, optional, tag = "1")]
    pub filter: ::core::option::Option<InternalGetTargetsRequestFilter>,
    #[prost(message, optional, tag = "2")]
    pub order: ::core::option::Option<TargetResponseOrder>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InternalTargetServiceGetTargetsResponse {
    #[prost(message, repeated, tag = "1")]
    pub targets: ::prost::alloc::vec::Vec<TargetResponse>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InternalGetTargetsRequestFilter {
    #[prost(uint32, repeated, tag = "1")]
    pub company_ids: ::prost::alloc::vec::Vec<u32>,
    #[prost(enumeration = "ArchivingFormatId", repeated, tag = "2")]
    pub format_id: ::prost::alloc::vec::Vec<i32>,
    #[prost(bool, optional, tag = "3")]
    pub is_active: ::core::option::Option<bool>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TargetResponseOrder {
    #[prost(enumeration = "OrderBy", optional, tag = "1")]
    pub order_by: ::core::option::Option<i32>,
    #[prost(enumeration = "OrderDirection", optional, tag = "2")]
    pub order_direction: ::core::option::Option<i32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TargetResponse {
    #[prost(uint32, tag = "1")]
    pub company_id: u32,
    #[prost(message, optional, tag = "2")]
    pub target: ::core::option::Option<Target>,
    #[prost(message, optional, tag = "3")]
    pub additional_target_properties: ::core::option::Option<
        InternalAdditionalTargetProperties,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InternalAdditionalTargetProperties {
    #[prost(string, optional, tag = "1")]
    pub bucket_v2: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ArchivingFormatId {
    Unspecified = 0,
    WideParquetV1 = 1,
}
impl ArchivingFormatId {
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "ARCHIVING_FORMAT_ID_UNSPECIFIED",
            Self::WideParquetV1 => "ARCHIVING_FORMAT_ID_WIDE_PARQUET_V1",
        }
    }
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ARCHIVING_FORMAT_ID_UNSPECIFIED" => Some(Self::Unspecified),
            "ARCHIVING_FORMAT_ID_WIDE_PARQUET_V1" => Some(Self::WideParquetV1),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderBy {
    Unspecified = 0,
    UpdatedAt = 1,
    CreatedAt = 2,
    CompanyId = 3,
}
impl OrderBy {
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "ORDER_BY_UNSPECIFIED",
            Self::UpdatedAt => "ORDER_BY_UPDATED_AT",
            Self::CreatedAt => "ORDER_BY_CREATED_AT",
            Self::CompanyId => "ORDER_BY_COMPANY_ID",
        }
    }
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_BY_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_BY_UPDATED_AT" => Some(Self::UpdatedAt),
            "ORDER_BY_CREATED_AT" => Some(Self::CreatedAt),
            "ORDER_BY_COMPANY_ID" => Some(Self::CompanyId),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderDirection {
    Unspecified = 0,
    Asc = 1,
    Desc = 2,
}
impl OrderDirection {
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "ORDER_DIRECTION_UNSPECIFIED",
            Self::Asc => "ORDER_DIRECTION_ASC",
            Self::Desc => "ORDER_DIRECTION_DESC",
        }
    }
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_DIRECTION_ASC" => Some(Self::Asc),
            "ORDER_DIRECTION_DESC" => Some(Self::Desc),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetTargetRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTargetResponse {
    #[prost(message, optional, tag = "1")]
    pub target: ::core::option::Option<Target>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetTargetRequest {
    #[prost(bool, tag = "1")]
    pub is_active: bool,
    #[prost(oneof = "set_target_request::TargetSpec", tags = "2, 3")]
    pub target_spec: ::core::option::Option<set_target_request::TargetSpec>,
}
pub mod set_target_request {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum TargetSpec {
        #[prost(message, tag = "2")]
        S3(super::S3TargetSpec),
        #[prost(message, tag = "3")]
        IbmCos(super::IbmCosTargetSpec),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetTargetResponse {
    #[prost(message, optional, tag = "1")]
    pub target: ::core::option::Option<Target>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetExternalTargetRequest {
    #[prost(bool, tag = "1")]
    pub is_active: bool,
    #[prost(uint32, tag = "4")]
    pub company_id: u32,
    #[prost(oneof = "set_external_target_request::TargetSpec", tags = "2, 3")]
    pub target_spec: ::core::option::Option<set_external_target_request::TargetSpec>,
}
pub mod set_external_target_request {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum TargetSpec {
        #[prost(message, tag = "2")]
        S3(super::S3TargetSpec),
        #[prost(message, tag = "3")]
        IbmCos(super::IbmCosTargetSpec),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetExternalTargetResponse {
    #[prost(message, optional, tag = "1")]
    pub target: ::core::option::Option<Target>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CompanyArchiveConfig {
    #[prost(uint32, tag = "1")]
    pub company_id: u32,
    #[prost(bool, tag = "2")]
    pub archive_configured: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidateTargetRequest {
    #[prost(bool, tag = "1")]
    pub is_active: bool,
    #[prost(oneof = "validate_target_request::TargetSpec", tags = "2, 3")]
    pub target_spec: ::core::option::Option<validate_target_request::TargetSpec>,
}
pub mod validate_target_request {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum TargetSpec {
        #[prost(message, tag = "2")]
        S3(super::S3TargetSpec),
        #[prost(message, tag = "3")]
        IbmCos(super::IbmCosTargetSpec),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ValidateTargetResponse {
    #[prost(bool, tag = "1")]
    pub is_valid: bool,
}
pub mod target_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 TargetServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl TargetServiceClient<tonic::transport::Channel> {
        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> TargetServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        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,
        ) -> TargetServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            TargetServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        pub async fn get_target(
            &mut self,
            request: impl tonic::IntoRequest<super::GetTargetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetTargetResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/com.coralogix.archive.v2.TargetService/GetTarget",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "com.coralogix.archive.v2.TargetService",
                        "GetTarget",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn set_target(
            &mut self,
            request: impl tonic::IntoRequest<super::SetTargetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SetTargetResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/com.coralogix.archive.v2.TargetService/SetTarget",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "com.coralogix.archive.v2.TargetService",
                        "SetTarget",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn validate_target(
            &mut self,
            request: impl tonic::IntoRequest<super::ValidateTargetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ValidateTargetResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/com.coralogix.archive.v2.TargetService/ValidateTarget",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "com.coralogix.archive.v2.TargetService",
                        "ValidateTarget",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
pub mod internal_target_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 InternalTargetServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl InternalTargetServiceClient<tonic::transport::Channel> {
        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> InternalTargetServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        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,
        ) -> InternalTargetServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            InternalTargetServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        pub async fn get_targets(
            &mut self,
            request: impl tonic::IntoRequest<
                super::InternalTargetServiceGetTargetsRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::InternalTargetServiceGetTargetsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/com.coralogix.archive.v2.InternalTargetService/GetTargets",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "com.coralogix.archive.v2.InternalTargetService",
                        "GetTargets",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn set_external_target(
            &mut self,
            request: impl tonic::IntoRequest<super::SetExternalTargetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SetExternalTargetResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/com.coralogix.archive.v2.InternalTargetService/SetExternalTarget",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "com.coralogix.archive.v2.InternalTargetService",
                        "SetExternalTarget",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}