// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Namespace {
    #[prost(string, repeated, tag = "1")]
    pub levels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableName {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableTarget {
    #[prost(message, optional, tag = "1")]
    pub namespace: ::core::option::Option<Namespace>,
    #[prost(message, optional, tag = "2")]
    pub table_name: ::core::option::Option<TableName>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MaintenanceAction {
    #[prost(message, optional, tag = "1")]
    pub target: ::core::option::Option<TableTarget>,
    #[prost(oneof = "maintenance_action::Action", tags = "2, 3, 4, 5")]
    pub action: ::core::option::Option<maintenance_action::Action>,
}
/// Nested message and enum types in `MaintenanceAction`.
pub mod maintenance_action {
    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum Action {
        #[prost(message, tag = "2")]
        RewriteDataFiles(super::RewriteDataFiles),
        #[prost(message, tag = "3")]
        RewriteManifests(super::RewriteManifests),
        #[prost(message, tag = "4")]
        ExpireSnapshots(super::ExpireSnapshots),
        #[prost(message, tag = "5")]
        RemoveOrphanFiles(super::RemoveOrphanFiles),
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RewriteDataFiles {
    #[prost(uint64, optional, tag = "1")]
    pub target_file_size_bytes: ::core::option::Option<u64>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RewriteManifests {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExpireSnapshots {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RemoveOrphanFiles {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMaintenanceRunResponse {
    #[prost(string, tag = "1")]
    pub run_id: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub actions: ::prost::alloc::vec::Vec<MaintenanceAction>,
    #[prost(enumeration = "MaintenanceRunStatus", tag = "3")]
    pub status: i32,
    #[prost(message, optional, tag = "4")]
    pub started_at: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "5")]
    pub finished_at: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunMaintenanceRequest {
    #[prost(message, repeated, tag = "1")]
    pub actions: ::prost::alloc::vec::Vec<MaintenanceAction>,
    #[prost(string, optional, tag = "2")]
    pub image_override: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunMaintenanceResponse {
    #[prost(string, tag = "1")]
    pub run_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMaintenanceRunRequest {
    #[prost(string, tag = "1")]
    pub run_id: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MaintenanceRunStatus {
    Unspecified = 0,
    Pending = 1,
    Running = 2,
    Succeeded = 3,
    Failed = 4,
}
impl MaintenanceRunStatus {
    /// 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 => "MAINTENANCE_RUN_STATUS_UNSPECIFIED",
            Self::Pending => "MAINTENANCE_RUN_STATUS_PENDING",
            Self::Running => "MAINTENANCE_RUN_STATUS_RUNNING",
            Self::Succeeded => "MAINTENANCE_RUN_STATUS_SUCCEEDED",
            Self::Failed => "MAINTENANCE_RUN_STATUS_FAILED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "MAINTENANCE_RUN_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "MAINTENANCE_RUN_STATUS_PENDING" => Some(Self::Pending),
            "MAINTENANCE_RUN_STATUS_RUNNING" => Some(Self::Running),
            "MAINTENANCE_RUN_STATUS_SUCCEEDED" => Some(Self::Succeeded),
            "MAINTENANCE_RUN_STATUS_FAILED" => Some(Self::Failed),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TableMaintenanceErrors {
    Unspecified = 0,
    TableNotFound = 1,
}
impl TableMaintenanceErrors {
    /// 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 => "TABLE_MAINTENANCE_ERRORS_UNSPECIFIED",
            Self::TableNotFound => "TABLE_MAINTENANCE_ERRORS_TABLE_NOT_FOUND",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TABLE_MAINTENANCE_ERRORS_UNSPECIFIED" => Some(Self::Unspecified),
            "TABLE_MAINTENANCE_ERRORS_TABLE_NOT_FOUND" => Some(Self::TableNotFound),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod iceberg_table_maintenance_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 IcebergTableMaintenanceServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl IcebergTableMaintenanceServiceClient<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> IcebergTableMaintenanceServiceClient<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,
        ) -> IcebergTableMaintenanceServiceClient<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,
        {
            IcebergTableMaintenanceServiceClient::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
        }
        pub async fn run_maintenance(
            &mut self,
            request: impl tonic::IntoRequest<super::RunMaintenanceRequest>,
        ) -> std::result::Result<
            tonic::Response<super::RunMaintenanceResponse>,
            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(
                "/nominal.iceberg.v1.IcebergTableMaintenanceService/RunMaintenance",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.iceberg.v1.IcebergTableMaintenanceService",
                        "RunMaintenance",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn get_maintenance_run(
            &mut self,
            request: impl tonic::IntoRequest<super::GetMaintenanceRunRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetMaintenanceRunResponse>,
            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(
                "/nominal.iceberg.v1.IcebergTableMaintenanceService/GetMaintenanceRun",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.iceberg.v1.IcebergTableMaintenanceService",
                        "GetMaintenanceRun",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IcebergFileWrittenEvent {
    #[prost(message, optional, tag = "1")]
    pub table: ::core::option::Option<TableTarget>,
    #[prost(int32, tag = "2")]
    pub partition_value: i32,
    #[prost(string, tag = "3")]
    pub object_key: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "4")]
    pub ingested_at: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
}
