ipfs_api_prelude/request/
add.rs1use crate::request::ApiRequest;
10use serde::Serialize;
11
12#[cfg_attr(feature = "with-builder", derive(TypedBuilder))]
13#[derive(Serialize, Default)]
14#[serde(rename_all = "kebab-case")]
15pub struct Add<'a> {
16 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
18 pub trickle: Option<bool>,
19
20 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
22 pub only_hash: Option<bool>,
23
24 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
26 pub wrap_with_directory: Option<bool>,
27
28 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
30 pub chunker: Option<&'a str>,
31
32 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
34 pub pin: Option<bool>,
35
36 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
38 pub raw_leaves: Option<bool>,
39
40 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
43 pub cid_version: Option<u32>,
44
45 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
48 pub hash: Option<&'a str>,
49
50 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
52 pub inline: Option<bool>,
53
54 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
56 pub inline_limit: Option<u32>,
57
58 #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))]
60 pub to_files: Option<&'a str>,
61}
62
63impl<'a> ApiRequest for Add<'a> {
64 const PATH: &'static str = "/add";
65}