meegle/file/
types.rs

1use derive_builder::Builder;
2use serde::Serialize;
3use serde_json::Value;
4
5#[derive(Builder, Debug, Default, Serialize)]
6#[builder(setter(into, strip_option))]
7#[builder(default)]
8pub struct UploadWorkItemFileRequest {
9    pub project_key: String,
10    pub work_item_type_key: String,
11    pub work_item_id: i64,
12    pub file: Vec<u8>,
13    pub filename: String,
14    pub field_key: Option<String>,
15    pub field_alias: Option<String>,
16    pub index: Option<i32>,
17}
18
19#[derive(Builder, Debug, Default, Serialize)]
20#[builder(setter(into, strip_option))]
21#[builder(default)]
22pub struct UploadFileRequest {
23    pub project_key: String,
24    pub file: Vec<u8>,
25    pub filename: String,
26}
27
28#[derive(Builder, Debug, Default, Serialize)]
29#[builder(setter(into, strip_option))]
30#[builder(default)]
31pub struct DownloadWorkItemFileRequest {
32    pub project_key: String,
33    pub work_item_type_key: String,
34    pub work_item_id: i64,
35    pub uuid: String,
36}
37
38#[derive(Builder, Debug, Default, Serialize)]
39#[builder(setter(into, strip_option))]
40#[builder(default)]
41pub struct DeleteFileRequest {
42    pub project_key: String,
43    pub work_item_id: String,
44    pub uuids: Vec<String>,
45    pub field_key: Option<String>,
46    pub field_alias: Option<String>,
47}
48
49pub type UploadWorkItemFileResponse = Value;
50pub type UploadFileResponse = Vec<String>;
51pub type DownloadWorkItemFileResponse = Vec<u8>;
52pub type DeleteFileResponse = Value;