1use serde::{Deserialize, Serialize};
2use serde_json::{Map, Value};
3use stac::{Collection, Href, Link};
4use stac_derive::{Links, SelfHref};
5
6#[derive(Debug, Serialize, Deserialize, SelfHref, Links)]
8pub struct Collections {
9 pub collections: Vec<Collection>,
11
12 pub links: Vec<Link>,
14
15 #[serde(flatten)]
17 pub additional_fields: Map<String, Value>,
18
19 #[serde(skip)]
20 self_href: Option<Href>,
21}
22
23impl From<Vec<Collection>> for Collections {
24 fn from(collections: Vec<Collection>) -> Collections {
25 Collections {
26 collections,
27 links: Vec::new(),
28 additional_fields: Map::new(),
29 self_href: None,
30 }
31 }
32}