// mod test_foo;

// mod serde;

// mod serde_impl;

use pyo3;
use pyo3::prelude::*;
// use crate::HeartbeatResponse;
// include!("flyteidl.common.rs");
// include!("flyteidl.workflow.rs");
// include!("flyteidl.workflow.tonic.rs");
// inculde!("flyteidl.logs.dataplane.rs");
// include!("flyteidl.core.rs");
// include!("google.rpc.rs");
// include!("validate.rs");

// use crate::*;
// Re-export all generated protobuf modules
pub mod flyteidl {

    pub mod actions {
        include!("flyteidl2.actions.rs");
    }

    pub mod app {
        include!("flyteidl2.app.rs");
    }

    pub mod auth {
        include!("flyteidl2.auth.rs");
    }

    pub mod project {
        include!("flyteidl2.project.rs");
    }

    pub mod common {
        include!("flyteidl2.common.rs");
    }

    pub mod workflow {
        include!("flyteidl2.workflow.rs");
    }

    pub mod logs {
        pub mod dataplane {
            include!("flyteidl2.logs.dataplane.rs");
        }
    }

    pub mod core {
        include!("flyteidl2.core.rs");
    }

    pub mod notification {
        include!("flyteidl2.notification.rs");
    }

    pub mod task {
        include!("flyteidl2.task.rs");
    }

    pub mod trigger {
        include!("flyteidl2.trigger.rs");
    }

    pub mod secret {
        include!("flyteidl2.secret.rs");
    }
}

// use pyo3_prost::pyclass_for_prost_struct;
pub mod google {
    pub mod rpc {
        include!("google.rpc.rs");
        //         pub mod serde {
        //             include!("google.rpc.serde.rs");
        //         }
    }
    pub mod protobuf {
        include!(concat!(env!("OUT_DIR"), "/google.protobuf.rs"));
        include!(concat!(env!("OUT_DIR"), "/google.protobuf.serde.rs"));
    }
}

pub mod validate {
    include!("validate.rs");
    //     pub mod serde {
    //         include!("validate.serde.rs");
    //     }
}

// Include the generated Box<T> implementations
include!(concat!(env!("OUT_DIR"), "/boxed_impls.rs"));
// pub mod serde {
//     include!(concat!(env!("OUT_DIR"), "/serde_impls.rs"));
// }
pub mod pymodules {
    include!(concat!(env!("OUT_DIR"), "/pymodules.rs"));
}

include!(concat!(env!("OUT_DIR"), "/serde_impls.rs"));
// include!("serde_impl.rs");

//
// // Re-export commonly used types at the root level for convenience
// pub use flyteidl::common::*;
// pub use flyteidl::workflow::*;
// pub use flyteidl::core::*;
// pub use google::rpc::*;
// pub use validate::*;
// pub use crate::*;

// #[pymodule]
// fn pb_rust(_py: Python, m: &PyModule) -> PyResult<()> {
//     m.add_submodule(flyteidl::workflow::make_module(_py)?)?;
//     // ... all submodules ...
//     Ok(())
// }
