1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
pub mod error;
mod model;
pub use model::*;
mod api;

pub use api::list_versions::ListVersions;

pub type Result<T> = std::result::Result<T, error::LivePlatformError>;

pub fn versions() -> Result<impl Iterator<Item = String>> {
    _list_all_versions(false, false)
}

pub fn all_versions() -> Result<impl Iterator<Item = String>> {
    _list_all_versions(false, true)
}

pub fn all_versions_with_revision() -> Result<impl Iterator<Item = String>> {
    _list_all_versions(true, true)
}

fn _list_all_versions(include_revisions: bool, autopage: bool) -> Result<ListVersions> {
    ListVersions::builder().include_revision(include_revisions).autopage(autopage).list()
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn it_works() {
        let result: Vec<String> = all_versions().unwrap().collect();
        println!("{:?}", result)
    }
}