use loc_api::loc_client::ApiClient;
use loc_api::param_models::{FacetReq, Facet};
use loc_api::attribute_models::AttributesSelect;
use loc_api::attribute_models::SortField;
use loc_api::format_models::MediaType;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ApiClient::new();
let response = client.get_format(
MediaType::Maps,
Some("usa"),
Some(AttributesSelect {
include: vec!["pagination".to_string(), "results".to_string()],
exclude: vec![],
}),
Some(FacetReq { filters: vec![Facet::Subject { value: "geography".to_string() }] }),
Some(10),
Some(1),
Some(SortField::TitleS),
)?;
println!("url: {}", response.1);
if let Some(results) = response.0.results {
for item in results {
println!("{:#?}", item);
}
}
Ok(())
}