use crate::for_all_versions;
macro_rules! bundle_next_link_relation {
(stu3) => {
"next"
};
(r4b) => {
"next"
};
(r5) => {
$crate::r5::codes::LinkRelationTypes::Next
};
}
macro_rules! impl_bundle {
($version:ident) => {
mod $version {
use $crate::$version::resources::Bundle;
impl Bundle {
#[must_use]
pub fn next_page_url(&self) -> Option<&String> {
self.link
.iter()
.flatten()
.find(|link| link.relation == bundle_next_link_relation!($version))
.map(|link| &link.url)
}
}
}
};
}
for_all_versions!(impl_bundle);