hugging_face_client/api/
create_collection.rs1use serde::Serialize;
2
3#[derive(Debug, Serialize)]
5pub struct CreateCollectionReq<'a> {
6 title: &'a str,
7 namespace: &'a str,
8
9 #[serde(skip_serializing_if = "Option::is_none")]
10 description: Option<&'a str>,
11
12 private: bool,
15}
16
17impl<'a> CreateCollectionReq<'a> {
18 pub fn new(title: &'a str, namespace: &'a str, private: bool) -> Self {
19 CreateCollectionReq {
20 title,
21 namespace,
22 description: None,
23 private,
25 }
26 }
27
28 pub fn description(mut self, description: &'a str) -> Self {
29 self.description = Some(description);
30 self
31 }
32
33 }