Skip to main content

paperless_api_client/
types.rs

1#![doc = r" This module contains the generated types for the library."]
2#[cfg(feature = "tabled")]
3use tabled::Tabled;
4pub mod base64 {
5    #![doc = " Base64 data that encodes to url safe base64, but can decode from multiple"]
6    #![doc = " base64 implementations to account for various clients and libraries. Compatible"]
7    #![doc = " with serde and JsonSchema."]
8    use serde::{
9        de::{Error, Unexpected, Visitor},
10        Deserialize, Deserializer, Serialize, Serializer,
11    };
12    use std::{convert::TryFrom, fmt};
13    static ALLOWED_DECODING_FORMATS: &[data_encoding::Encoding] = &[
14        data_encoding::BASE64,
15        data_encoding::BASE64URL,
16        data_encoding::BASE64URL_NOPAD,
17        data_encoding::BASE64_MIME,
18        data_encoding::BASE64_NOPAD,
19    ];
20    #[derive(Debug, Clone, PartialEq, Eq)]
21    #[doc = " A container for binary that should be base64 encoded in serialisation. In reverse"]
22    #[doc = " when deserializing, will decode from many different types of base64 possible."]
23    pub struct Base64Data(pub Vec<u8>);
24    impl Base64Data {
25        #[doc = " Return is the data is empty."]
26        pub fn is_empty(&self) -> bool {
27            self.0.is_empty()
28        }
29    }
30
31    impl fmt::Display for Base64Data {
32        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
33            write!(f, "{}", data_encoding::BASE64URL_NOPAD.encode(&self.0))
34        }
35    }
36
37    impl From<Base64Data> for Vec<u8> {
38        fn from(data: Base64Data) -> Vec<u8> {
39            data.0
40        }
41    }
42
43    impl From<Vec<u8>> for Base64Data {
44        fn from(data: Vec<u8>) -> Base64Data {
45            Base64Data(data)
46        }
47    }
48
49    impl AsRef<[u8]> for Base64Data {
50        fn as_ref(&self) -> &[u8] {
51            &self.0
52        }
53    }
54
55    impl TryFrom<&str> for Base64Data {
56        type Error = anyhow::Error;
57        fn try_from(v: &str) -> Result<Self, Self::Error> {
58            for config in ALLOWED_DECODING_FORMATS {
59                if let Ok(data) = config.decode(v.as_bytes()) {
60                    return Ok(Base64Data(data));
61                }
62            }
63            anyhow::bail!("Could not decode base64 data: {v}");
64        }
65    }
66
67    struct Base64DataVisitor;
68    impl Visitor<'_> for Base64DataVisitor {
69        type Value = Base64Data;
70        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
71            write!(formatter, "a base64 encoded string")
72        }
73
74        fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
75        where
76            E: Error,
77        {
78            for config in ALLOWED_DECODING_FORMATS {
79                if let Ok(data) = config.decode(v.as_bytes()) {
80                    return Ok(Base64Data(data));
81                }
82            }
83            Err(serde::de::Error::invalid_value(Unexpected::Str(v), &self))
84        }
85    }
86
87    impl<'de> Deserialize<'de> for Base64Data {
88        fn deserialize<D>(deserializer: D) -> Result<Self, <D as Deserializer<'de>>::Error>
89        where
90            D: Deserializer<'de>,
91        {
92            deserializer.deserialize_str(Base64DataVisitor)
93        }
94    }
95
96    impl Serialize for Base64Data {
97        fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
98        where
99            S: Serializer,
100        {
101            let encoded = data_encoding::BASE64URL_NOPAD.encode(&self.0);
102            serializer.serialize_str(&encoded)
103        }
104    }
105
106    impl schemars::JsonSchema for Base64Data {
107        fn schema_name() -> String {
108            "Base64Data".to_string()
109        }
110
111        fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
112            let mut obj = gen.root_schema_for::<String>().schema;
113            obj.format = Some("byte".to_string());
114            schemars::schema::Schema::Object(obj)
115        }
116
117        fn is_referenceable() -> bool {
118            false
119        }
120    }
121
122    #[cfg(test)]
123    mod tests {
124        use super::Base64Data;
125        use std::convert::TryFrom;
126        #[test]
127        fn test_base64_try_from() {
128            assert!(Base64Data::try_from("aGVsbG8=").is_ok());
129            assert!(Base64Data::try_from("abcdefghij").is_err());
130        }
131    }
132}
133
134#[cfg(feature = "requests")]
135pub mod multipart {
136    #![doc = " Multipart form data types."]
137    use std::path::PathBuf;
138    #[doc = " An attachement to a multipart form."]
139    #[derive(Debug, Clone, PartialEq, Eq, Hash)]
140    pub struct Attachment {
141        #[doc = " The name of the field."]
142        pub name: String,
143        #[doc = " The file path of the attachment."]
144        pub filepath: Option<PathBuf>,
145        #[doc = " The content type of the attachment."]
146        pub content_type: Option<String>,
147        #[doc = " The data of the attachment."]
148        pub data: Vec<u8>,
149    }
150
151    impl std::convert::TryFrom<Attachment> for reqwest::multipart::Part {
152        type Error = reqwest::Error;
153        fn try_from(attachment: Attachment) -> Result<Self, Self::Error> {
154            let mut part = reqwest::multipart::Part::bytes(attachment.data);
155            if let Some(filepath) = attachment.filepath {
156                part = part.file_name(filepath.to_string_lossy().to_string());
157            }
158            if let Some(content_type) = attachment.content_type {
159                part = part.mime_str(&content_type)?;
160            }
161            Ok(part)
162        }
163    }
164
165    impl std::convert::TryFrom<std::path::PathBuf> for Attachment {
166        type Error = std::io::Error;
167        fn try_from(path: std::path::PathBuf) -> Result<Self, Self::Error> {
168            let content_type = mime_guess::from_path(&path).first_raw();
169            let data = std::fs::read(&path)?;
170            Ok(Attachment {
171                name: "file".to_string(),
172                filepath: Some(path),
173                content_type: content_type.map(|s| s.to_string()),
174                data,
175            })
176        }
177    }
178}
179
180#[cfg(feature = "requests")]
181pub mod paginate {
182    #![doc = " Utility functions used for pagination."]
183    use anyhow::Result;
184    #[doc = " A trait for types that allow pagination."]
185    pub trait Pagination {
186        #[doc = " The item that is paginated."]
187        type Item: serde::de::DeserializeOwned;
188        #[doc = " Returns true if the response has more pages."]
189        fn has_more_pages(&self) -> bool;
190        #[doc = " Returns the next page token."]
191        fn next_page_token(&self) -> Option<String>;
192        #[doc = " Modify a request to get the next page."]
193        fn next_page(
194            &self,
195            req: reqwest::Request,
196        ) -> Result<reqwest::Request, crate::types::error::Error>;
197        #[doc = " Get the items from a page."]
198        fn items(&self) -> Vec<Self::Item>;
199    }
200}
201
202pub mod phone_number {
203    #![doc = " A library to implement phone numbers for our database and JSON serialization and deserialization."]
204    use schemars::JsonSchema;
205    use std::str::FromStr;
206    #[doc = " A phone number."]
207    #[derive(Debug, Default, Clone, PartialEq, Hash, Eq)]
208    pub struct PhoneNumber(pub Option<phonenumber::PhoneNumber>);
209    impl From<phonenumber::PhoneNumber> for PhoneNumber {
210        fn from(id: phonenumber::PhoneNumber) -> PhoneNumber {
211            PhoneNumber(Some(id))
212        }
213    }
214
215    impl AsRef<Option<phonenumber::PhoneNumber>> for PhoneNumber {
216        fn as_ref(&self) -> &Option<phonenumber::PhoneNumber> {
217            &self.0
218        }
219    }
220
221    impl std::ops::Deref for PhoneNumber {
222        type Target = Option<phonenumber::PhoneNumber>;
223        fn deref(&self) -> &Self::Target {
224            &self.0
225        }
226    }
227
228    impl serde::ser::Serialize for PhoneNumber {
229        fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
230        where
231            S: serde::ser::Serializer,
232        {
233            serializer.serialize_str(&self.to_string())
234        }
235    }
236
237    impl<'de> serde::de::Deserialize<'de> for PhoneNumber {
238        fn deserialize<D>(deserializer: D) -> Result<PhoneNumber, D::Error>
239        where
240            D: serde::de::Deserializer<'de>,
241        {
242            let s = String::deserialize(deserializer).unwrap_or_default();
243            PhoneNumber::from_str(&s).map_err(serde::de::Error::custom)
244        }
245    }
246
247    impl std::str::FromStr for PhoneNumber {
248        type Err = anyhow::Error;
249        fn from_str(s: &str) -> Result<Self, Self::Err> {
250            if s.trim().is_empty() {
251                return Ok(PhoneNumber(None));
252            }
253            let s = if !s.trim().starts_with('+') {
254                format!("+1{s}")
255            } else {
256                s.to_string()
257            }
258            .replace(['-', '(', ')', ' '], "");
259            Ok(PhoneNumber(Some(phonenumber::parse(None, &s).map_err(
260                |e| anyhow::anyhow!("invalid phone number `{s}`: {e}"),
261            )?)))
262        }
263    }
264
265    impl std::fmt::Display for PhoneNumber {
266        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
267            let s = if let Some(phone) = &self.0 {
268                phone
269                    .format()
270                    .mode(phonenumber::Mode::International)
271                    .to_string()
272            } else {
273                String::new()
274            };
275            write!(f, "{s}")
276        }
277    }
278
279    impl JsonSchema for PhoneNumber {
280        fn schema_name() -> String {
281            "PhoneNumber".to_string()
282        }
283
284        fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
285            let mut obj = gen.root_schema_for::<String>().schema;
286            obj.format = Some("phone".to_string());
287            schemars::schema::Schema::Object(obj)
288        }
289
290        fn is_referenceable() -> bool {
291            false
292        }
293    }
294
295    #[cfg(test)]
296    mod test {
297        use super::PhoneNumber;
298        use pretty_assertions::assert_eq;
299        #[test]
300        fn test_parse_phone_number() {
301            let mut phone = "+1-555-555-5555";
302            let mut phone_parsed: PhoneNumber =
303                serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
304            let mut expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
305            assert_eq!(phone_parsed, expected);
306            let mut expected_str = "+1 555-555-5555";
307            assert_eq!(expected_str, serde_json::json!(phone_parsed));
308            phone = "555-555-5555";
309            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
310            assert_eq!(phone_parsed, expected);
311            assert_eq!(expected_str, serde_json::json!(phone_parsed));
312            phone = "+1 555-555-5555";
313            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
314            assert_eq!(phone_parsed, expected);
315            assert_eq!(expected_str, serde_json::json!(phone_parsed));
316            phone = "5555555555";
317            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
318            assert_eq!(phone_parsed, expected);
319            assert_eq!(expected_str, serde_json::json!(phone_parsed));
320            phone = "(510) 864-1234";
321            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
322            expected = PhoneNumber(Some(phonenumber::parse(None, "+15108641234").unwrap()));
323            assert_eq!(phone_parsed, expected);
324            expected_str = "+1 510-864-1234";
325            assert_eq!(expected_str, serde_json::json!(phone_parsed));
326            phone = "(510)8641234";
327            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
328            assert_eq!(phone_parsed, expected);
329            expected_str = "+1 510-864-1234";
330            assert_eq!(expected_str, serde_json::json!(phone_parsed));
331            phone = "";
332            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
333            assert_eq!(phone_parsed, PhoneNumber(None));
334            assert_eq!("", serde_json::json!(phone_parsed));
335            phone = "+49 30  1234 1234";
336            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
337            expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
338            assert_eq!(phone_parsed, expected);
339            expected_str = "+49 30 12341234";
340            assert_eq!(expected_str, serde_json::json!(phone_parsed));
341        }
342    }
343}
344
345#[cfg(feature = "requests")]
346pub mod error {
347    #![doc = " Error methods."]
348    #[doc = " Error produced by generated client methods."]
349    pub enum Error {
350        #[doc = " The request did not conform to API requirements."]
351        InvalidRequest(String),
352        #[cfg(feature = "retry")]
353        #[doc = " A server error either due to the data, or with the connection."]
354        CommunicationError(reqwest_middleware::Error),
355        #[doc = " A request error, caused when building the request."]
356        RequestError(reqwest::Error),
357        #[doc = " An expected response whose deserialization failed."]
358        SerdeError {
359            #[doc = " The error."]
360            error: format_serde_error::SerdeError,
361            #[doc = " The response status."]
362            status: reqwest::StatusCode,
363        },
364        #[doc = " An expected error response."]
365        InvalidResponsePayload {
366            #[cfg(feature = "retry")]
367            #[doc = " The error."]
368            error: reqwest_middleware::Error,
369            #[cfg(not(feature = "retry"))]
370            #[doc = " The error."]
371            error: reqwest::Error,
372            #[doc = " The full response."]
373            response: reqwest::Response,
374        },
375        #[doc = " An error from the server."]
376        Server {
377            #[doc = " The text from the body."]
378            body: String,
379            #[doc = " The response status."]
380            status: reqwest::StatusCode,
381        },
382        #[doc = " A response not listed in the API description. This may represent a"]
383        #[doc = " success or failure response; check `status().is_success()`."]
384        UnexpectedResponse(reqwest::Response),
385    }
386
387    impl Error {
388        #[doc = " Returns the status code, if the error was generated from a response."]
389        pub fn status(&self) -> Option<reqwest::StatusCode> {
390            match self {
391                Error::InvalidRequest(_) => None,
392                Error::RequestError(e) => e.status(),
393                #[cfg(feature = "retry")]
394                Error::CommunicationError(reqwest_middleware::Error::Reqwest(e)) => e.status(),
395                #[cfg(feature = "retry")]
396                Error::CommunicationError(reqwest_middleware::Error::Middleware(_)) => None,
397                Error::SerdeError { error: _, status } => Some(*status),
398                Error::InvalidResponsePayload { error: _, response } => Some(response.status()),
399                Error::Server { body: _, status } => Some(*status),
400                Error::UnexpectedResponse(r) => Some(r.status()),
401            }
402        }
403
404        #[doc = " Creates a new error from a response status and a serde error."]
405        pub fn from_serde_error(
406            e: format_serde_error::SerdeError,
407            status: reqwest::StatusCode,
408        ) -> Self {
409            Self::SerdeError { error: e, status }
410        }
411    }
412
413    #[cfg(feature = "retry")]
414    impl From<reqwest_middleware::Error> for Error {
415        fn from(e: reqwest_middleware::Error) -> Self {
416            Self::CommunicationError(e)
417        }
418    }
419
420    impl From<reqwest::Error> for Error {
421        fn from(e: reqwest::Error) -> Self {
422            Self::RequestError(e)
423        }
424    }
425
426    impl From<serde_json::Error> for Error {
427        fn from(e: serde_json::Error) -> Self {
428            Self::SerdeError {
429                error: format_serde_error::SerdeError::new(String::new(), e),
430                status: reqwest::StatusCode::INTERNAL_SERVER_ERROR,
431            }
432        }
433    }
434
435    impl std::fmt::Display for Error {
436        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
437            match self {
438                Error::InvalidRequest(s) => {
439                    write!(f, "Invalid Request: {s}")
440                }
441                #[cfg(feature = "retry")]
442                Error::CommunicationError(e) => {
443                    write!(f, "Communication Error: {e}")
444                }
445                Error::RequestError(e) => {
446                    write!(f, "Request Error: {e}")
447                }
448                Error::SerdeError { error, status: _ } => {
449                    write!(f, "Serde Error: {error}")
450                }
451                Error::InvalidResponsePayload { error, response: _ } => {
452                    write!(f, "Invalid Response Payload: {error}")
453                }
454                Error::Server { body, status } => {
455                    write!(f, "Server Error: {status} {body}")
456                }
457                Error::UnexpectedResponse(r) => {
458                    write!(f, "Unexpected Response: {r:?}")
459                }
460            }
461        }
462    }
463
464    impl std::fmt::Debug for Error {
465        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
466            std::fmt::Display::fmt(self, f)
467        }
468    }
469
470    impl std::error::Error for Error {
471        fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
472            match self {
473                #[cfg(feature = "retry")]
474                Error::CommunicationError(e) => Some(e),
475                Error::SerdeError { error, status: _ } => Some(error),
476                Error::InvalidResponsePayload { error, response: _ } => Some(error),
477                _ => None,
478            }
479        }
480    }
481}
482
483#[derive(
484    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
485)]
486#[allow(non_snake_case)]
487pub struct AcknowledgeTasks {
488    pub result: i64,
489}
490
491impl std::fmt::Display for AcknowledgeTasks {
492    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
493        write!(
494            f,
495            "{}",
496            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
497        )
498    }
499}
500
501#[cfg(feature = "tabled")]
502impl tabled::Tabled for AcknowledgeTasks {
503    const LENGTH: usize = 1;
504    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
505        vec![format!("{:?}", self.result).into()]
506    }
507
508    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
509        vec!["result".into()]
510    }
511}
512
513#[derive(
514    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
515)]
516#[allow(non_snake_case)]
517pub struct Actor {
518    pub id: i64,
519    pub username: String,
520}
521
522impl std::fmt::Display for Actor {
523    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
524        write!(
525            f,
526            "{}",
527            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
528        )
529    }
530}
531
532#[cfg(feature = "tabled")]
533impl tabled::Tabled for Actor {
534    const LENGTH: usize = 2;
535    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
536        vec![
537            format!("{:?}", self.id).into(),
538            self.username.clone().into(),
539        ]
540    }
541
542    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
543        vec!["id".into(), "username".into()]
544    }
545}
546
547#[derive(
548    serde :: Serialize,
549    serde :: Deserialize,
550    PartialEq,
551    Hash,
552    Debug,
553    Clone,
554    schemars :: JsonSchema,
555    parse_display :: FromStr,
556    parse_display :: Display,
557)]
558#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
559#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
560pub enum OutputType {
561    #[serde(rename = "pdf")]
562    #[display("pdf")]
563    Pdf,
564    #[serde(rename = "pdfa")]
565    #[display("pdfa")]
566    Pdfa,
567    #[serde(rename = "pdfa-1")]
568    #[display("pdfa-1")]
569    Pdfa1,
570    #[serde(rename = "pdfa-2")]
571    #[display("pdfa-2")]
572    Pdfa2,
573    #[serde(rename = "pdfa-3")]
574    #[display("pdfa-3")]
575    Pdfa3,
576    #[serde(rename = "")]
577    #[display("")]
578    Empty,
579}
580
581#[derive(
582    serde :: Serialize,
583    serde :: Deserialize,
584    PartialEq,
585    Hash,
586    Debug,
587    Clone,
588    schemars :: JsonSchema,
589    parse_display :: FromStr,
590    parse_display :: Display,
591)]
592#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
593#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
594pub enum Mode {
595    #[serde(rename = "skip")]
596    #[display("skip")]
597    Skip,
598    #[serde(rename = "redo")]
599    #[display("redo")]
600    Redo,
601    #[serde(rename = "force")]
602    #[display("force")]
603    Force,
604    #[serde(rename = "skip_noarchive")]
605    #[display("skip_noarchive")]
606    SkipNoarchive,
607    #[serde(rename = "")]
608    #[display("")]
609    Empty,
610}
611
612#[derive(
613    serde :: Serialize,
614    serde :: Deserialize,
615    PartialEq,
616    Hash,
617    Debug,
618    Clone,
619    schemars :: JsonSchema,
620    parse_display :: FromStr,
621    parse_display :: Display,
622)]
623#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
624#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
625pub enum SkipArchiveFile {
626    #[serde(rename = "never")]
627    #[display("never")]
628    Never,
629    #[serde(rename = "with_text")]
630    #[display("with_text")]
631    WithText,
632    #[serde(rename = "always")]
633    #[display("always")]
634    Always,
635    #[serde(rename = "")]
636    #[display("")]
637    Empty,
638}
639
640#[derive(
641    serde :: Serialize,
642    serde :: Deserialize,
643    PartialEq,
644    Hash,
645    Debug,
646    Clone,
647    schemars :: JsonSchema,
648    parse_display :: FromStr,
649    parse_display :: Display,
650)]
651#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
652#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
653pub enum UnpaperClean {
654    #[serde(rename = "clean")]
655    #[display("clean")]
656    Clean,
657    #[serde(rename = "clean-final")]
658    #[display("clean-final")]
659    CleanFinal,
660    #[serde(rename = "none")]
661    #[display("none")]
662    None,
663    #[serde(rename = "")]
664    #[display("")]
665    Empty,
666}
667
668#[derive(
669    serde :: Serialize,
670    serde :: Deserialize,
671    PartialEq,
672    Hash,
673    Debug,
674    Clone,
675    schemars :: JsonSchema,
676    parse_display :: FromStr,
677    parse_display :: Display,
678)]
679#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
680#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
681pub enum ColorConversionStrategy {
682    LeaveColorUnchanged,
683    #[serde(rename = "RGB")]
684    #[display("RGB")]
685    Rgb,
686    UseDeviceIndependentColor,
687    Gray,
688    #[serde(rename = "CMYK")]
689    #[display("CMYK")]
690    Cmyk,
691    #[serde(rename = "")]
692    #[display("")]
693    Empty,
694}
695
696#[derive(
697    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
698)]
699#[allow(non_snake_case)]
700pub struct ApplicationConfiguration {
701    pub id: i64,
702    #[serde(default)]
703    pub user_args: Option<serde_json::Value>,
704    #[serde(default)]
705    pub barcode_tag_mapping: Option<serde_json::Value>,
706    #[serde(default, skip_serializing_if = "Option::is_none")]
707    pub output_type: Option<OutputType>,
708    #[serde(default, skip_serializing_if = "Option::is_none")]
709    pub pages: Option<i64>,
710    #[serde(default, skip_serializing_if = "Option::is_none")]
711    pub language: Option<String>,
712    #[serde(default, skip_serializing_if = "Option::is_none")]
713    pub mode: Option<Mode>,
714    #[serde(default, skip_serializing_if = "Option::is_none")]
715    pub skip_archive_file: Option<SkipArchiveFile>,
716    #[serde(default, skip_serializing_if = "Option::is_none")]
717    pub image_dpi: Option<i64>,
718    #[serde(default, skip_serializing_if = "Option::is_none")]
719    pub unpaper_clean: Option<UnpaperClean>,
720    #[serde(default, skip_serializing_if = "Option::is_none")]
721    pub deskew: Option<bool>,
722    #[serde(default, skip_serializing_if = "Option::is_none")]
723    pub rotate_pages: Option<bool>,
724    #[serde(default, skip_serializing_if = "Option::is_none")]
725    pub rotate_pages_threshold: Option<f64>,
726    #[serde(default, skip_serializing_if = "Option::is_none")]
727    pub max_image_pixels: Option<f64>,
728    #[serde(default, skip_serializing_if = "Option::is_none")]
729    pub color_conversion_strategy: Option<ColorConversionStrategy>,
730    #[serde(default, skip_serializing_if = "Option::is_none")]
731    pub app_title: Option<String>,
732    #[serde(default, skip_serializing_if = "Option::is_none")]
733    pub app_logo: Option<String>,
734    #[serde(default, skip_serializing_if = "Option::is_none")]
735    pub barcodes_enabled: Option<bool>,
736    #[serde(default, skip_serializing_if = "Option::is_none")]
737    pub barcode_enable_tiff_support: Option<bool>,
738    #[serde(default, skip_serializing_if = "Option::is_none")]
739    pub barcode_string: Option<String>,
740    #[serde(default, skip_serializing_if = "Option::is_none")]
741    pub barcode_retain_split_pages: Option<bool>,
742    #[serde(default, skip_serializing_if = "Option::is_none")]
743    pub barcode_enable_asn: Option<bool>,
744    #[serde(default, skip_serializing_if = "Option::is_none")]
745    pub barcode_asn_prefix: Option<String>,
746    #[serde(default, skip_serializing_if = "Option::is_none")]
747    pub barcode_upscale: Option<f64>,
748    #[serde(default, skip_serializing_if = "Option::is_none")]
749    pub barcode_dpi: Option<i64>,
750    #[serde(default, skip_serializing_if = "Option::is_none")]
751    pub barcode_max_pages: Option<i64>,
752    #[serde(default, skip_serializing_if = "Option::is_none")]
753    pub barcode_enable_tag: Option<bool>,
754}
755
756impl std::fmt::Display for ApplicationConfiguration {
757    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
758        write!(
759            f,
760            "{}",
761            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
762        )
763    }
764}
765
766#[cfg(feature = "tabled")]
767impl tabled::Tabled for ApplicationConfiguration {
768    const LENGTH: usize = 27;
769    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
770        vec![
771            format!("{:?}", self.id).into(),
772            format!("{:?}", self.user_args).into(),
773            format!("{:?}", self.barcode_tag_mapping).into(),
774            if let Some(output_type) = &self.output_type {
775                format!("{output_type:?}").into()
776            } else {
777                String::new().into()
778            },
779            if let Some(pages) = &self.pages {
780                format!("{pages:?}").into()
781            } else {
782                String::new().into()
783            },
784            if let Some(language) = &self.language {
785                format!("{language:?}").into()
786            } else {
787                String::new().into()
788            },
789            if let Some(mode) = &self.mode {
790                format!("{mode:?}").into()
791            } else {
792                String::new().into()
793            },
794            if let Some(skip_archive_file) = &self.skip_archive_file {
795                format!("{skip_archive_file:?}").into()
796            } else {
797                String::new().into()
798            },
799            if let Some(image_dpi) = &self.image_dpi {
800                format!("{image_dpi:?}").into()
801            } else {
802                String::new().into()
803            },
804            if let Some(unpaper_clean) = &self.unpaper_clean {
805                format!("{unpaper_clean:?}").into()
806            } else {
807                String::new().into()
808            },
809            if let Some(deskew) = &self.deskew {
810                format!("{deskew:?}").into()
811            } else {
812                String::new().into()
813            },
814            if let Some(rotate_pages) = &self.rotate_pages {
815                format!("{rotate_pages:?}").into()
816            } else {
817                String::new().into()
818            },
819            if let Some(rotate_pages_threshold) = &self.rotate_pages_threshold {
820                format!("{rotate_pages_threshold:?}").into()
821            } else {
822                String::new().into()
823            },
824            if let Some(max_image_pixels) = &self.max_image_pixels {
825                format!("{max_image_pixels:?}").into()
826            } else {
827                String::new().into()
828            },
829            if let Some(color_conversion_strategy) = &self.color_conversion_strategy {
830                format!("{color_conversion_strategy:?}").into()
831            } else {
832                String::new().into()
833            },
834            if let Some(app_title) = &self.app_title {
835                format!("{app_title:?}").into()
836            } else {
837                String::new().into()
838            },
839            if let Some(app_logo) = &self.app_logo {
840                format!("{app_logo:?}").into()
841            } else {
842                String::new().into()
843            },
844            if let Some(barcodes_enabled) = &self.barcodes_enabled {
845                format!("{barcodes_enabled:?}").into()
846            } else {
847                String::new().into()
848            },
849            if let Some(barcode_enable_tiff_support) = &self.barcode_enable_tiff_support {
850                format!("{barcode_enable_tiff_support:?}").into()
851            } else {
852                String::new().into()
853            },
854            if let Some(barcode_string) = &self.barcode_string {
855                format!("{barcode_string:?}").into()
856            } else {
857                String::new().into()
858            },
859            if let Some(barcode_retain_split_pages) = &self.barcode_retain_split_pages {
860                format!("{barcode_retain_split_pages:?}").into()
861            } else {
862                String::new().into()
863            },
864            if let Some(barcode_enable_asn) = &self.barcode_enable_asn {
865                format!("{barcode_enable_asn:?}").into()
866            } else {
867                String::new().into()
868            },
869            if let Some(barcode_asn_prefix) = &self.barcode_asn_prefix {
870                format!("{barcode_asn_prefix:?}").into()
871            } else {
872                String::new().into()
873            },
874            if let Some(barcode_upscale) = &self.barcode_upscale {
875                format!("{barcode_upscale:?}").into()
876            } else {
877                String::new().into()
878            },
879            if let Some(barcode_dpi) = &self.barcode_dpi {
880                format!("{barcode_dpi:?}").into()
881            } else {
882                String::new().into()
883            },
884            if let Some(barcode_max_pages) = &self.barcode_max_pages {
885                format!("{barcode_max_pages:?}").into()
886            } else {
887                String::new().into()
888            },
889            if let Some(barcode_enable_tag) = &self.barcode_enable_tag {
890                format!("{barcode_enable_tag:?}").into()
891            } else {
892                String::new().into()
893            },
894        ]
895    }
896
897    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
898        vec![
899            "id".into(),
900            "user_args".into(),
901            "barcode_tag_mapping".into(),
902            "output_type".into(),
903            "pages".into(),
904            "language".into(),
905            "mode".into(),
906            "skip_archive_file".into(),
907            "image_dpi".into(),
908            "unpaper_clean".into(),
909            "deskew".into(),
910            "rotate_pages".into(),
911            "rotate_pages_threshold".into(),
912            "max_image_pixels".into(),
913            "color_conversion_strategy".into(),
914            "app_title".into(),
915            "app_logo".into(),
916            "barcodes_enabled".into(),
917            "barcode_enable_tiff_support".into(),
918            "barcode_string".into(),
919            "barcode_retain_split_pages".into(),
920            "barcode_enable_asn".into(),
921            "barcode_asn_prefix".into(),
922            "barcode_upscale".into(),
923            "barcode_dpi".into(),
924            "barcode_max_pages".into(),
925            "barcode_enable_tag".into(),
926        ]
927    }
928}
929
930#[derive(
931    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
932)]
933#[allow(non_snake_case)]
934pub struct ApplicationConfigurationRequest {
935    #[serde(default)]
936    pub user_args: Option<serde_json::Value>,
937    #[serde(default)]
938    pub barcode_tag_mapping: Option<serde_json::Value>,
939    #[serde(default, skip_serializing_if = "Option::is_none")]
940    pub output_type: Option<OutputType>,
941    #[serde(default, skip_serializing_if = "Option::is_none")]
942    pub pages: Option<i64>,
943    #[serde(default, skip_serializing_if = "Option::is_none")]
944    pub language: Option<String>,
945    #[serde(default, skip_serializing_if = "Option::is_none")]
946    pub mode: Option<Mode>,
947    #[serde(default, skip_serializing_if = "Option::is_none")]
948    pub skip_archive_file: Option<SkipArchiveFile>,
949    #[serde(default, skip_serializing_if = "Option::is_none")]
950    pub image_dpi: Option<i64>,
951    #[serde(default, skip_serializing_if = "Option::is_none")]
952    pub unpaper_clean: Option<UnpaperClean>,
953    #[serde(default, skip_serializing_if = "Option::is_none")]
954    pub deskew: Option<bool>,
955    #[serde(default, skip_serializing_if = "Option::is_none")]
956    pub rotate_pages: Option<bool>,
957    #[serde(default, skip_serializing_if = "Option::is_none")]
958    pub rotate_pages_threshold: Option<f64>,
959    #[serde(default, skip_serializing_if = "Option::is_none")]
960    pub max_image_pixels: Option<f64>,
961    #[serde(default, skip_serializing_if = "Option::is_none")]
962    pub color_conversion_strategy: Option<ColorConversionStrategy>,
963    #[serde(default, skip_serializing_if = "Option::is_none")]
964    pub app_title: Option<String>,
965    #[serde(default, skip_serializing_if = "Option::is_none")]
966    pub app_logo: Option<bytes::Bytes>,
967    #[serde(default, skip_serializing_if = "Option::is_none")]
968    pub barcodes_enabled: Option<bool>,
969    #[serde(default, skip_serializing_if = "Option::is_none")]
970    pub barcode_enable_tiff_support: Option<bool>,
971    #[serde(default, skip_serializing_if = "Option::is_none")]
972    pub barcode_string: Option<String>,
973    #[serde(default, skip_serializing_if = "Option::is_none")]
974    pub barcode_retain_split_pages: Option<bool>,
975    #[serde(default, skip_serializing_if = "Option::is_none")]
976    pub barcode_enable_asn: Option<bool>,
977    #[serde(default, skip_serializing_if = "Option::is_none")]
978    pub barcode_asn_prefix: Option<String>,
979    #[serde(default, skip_serializing_if = "Option::is_none")]
980    pub barcode_upscale: Option<f64>,
981    #[serde(default, skip_serializing_if = "Option::is_none")]
982    pub barcode_dpi: Option<i64>,
983    #[serde(default, skip_serializing_if = "Option::is_none")]
984    pub barcode_max_pages: Option<i64>,
985    #[serde(default, skip_serializing_if = "Option::is_none")]
986    pub barcode_enable_tag: Option<bool>,
987}
988
989impl std::fmt::Display for ApplicationConfigurationRequest {
990    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
991        write!(
992            f,
993            "{}",
994            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
995        )
996    }
997}
998
999#[cfg(feature = "tabled")]
1000impl tabled::Tabled for ApplicationConfigurationRequest {
1001    const LENGTH: usize = 26;
1002    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1003        vec![
1004            format!("{:?}", self.user_args).into(),
1005            format!("{:?}", self.barcode_tag_mapping).into(),
1006            if let Some(output_type) = &self.output_type {
1007                format!("{output_type:?}").into()
1008            } else {
1009                String::new().into()
1010            },
1011            if let Some(pages) = &self.pages {
1012                format!("{pages:?}").into()
1013            } else {
1014                String::new().into()
1015            },
1016            if let Some(language) = &self.language {
1017                format!("{language:?}").into()
1018            } else {
1019                String::new().into()
1020            },
1021            if let Some(mode) = &self.mode {
1022                format!("{mode:?}").into()
1023            } else {
1024                String::new().into()
1025            },
1026            if let Some(skip_archive_file) = &self.skip_archive_file {
1027                format!("{skip_archive_file:?}").into()
1028            } else {
1029                String::new().into()
1030            },
1031            if let Some(image_dpi) = &self.image_dpi {
1032                format!("{image_dpi:?}").into()
1033            } else {
1034                String::new().into()
1035            },
1036            if let Some(unpaper_clean) = &self.unpaper_clean {
1037                format!("{unpaper_clean:?}").into()
1038            } else {
1039                String::new().into()
1040            },
1041            if let Some(deskew) = &self.deskew {
1042                format!("{deskew:?}").into()
1043            } else {
1044                String::new().into()
1045            },
1046            if let Some(rotate_pages) = &self.rotate_pages {
1047                format!("{rotate_pages:?}").into()
1048            } else {
1049                String::new().into()
1050            },
1051            if let Some(rotate_pages_threshold) = &self.rotate_pages_threshold {
1052                format!("{rotate_pages_threshold:?}").into()
1053            } else {
1054                String::new().into()
1055            },
1056            if let Some(max_image_pixels) = &self.max_image_pixels {
1057                format!("{max_image_pixels:?}").into()
1058            } else {
1059                String::new().into()
1060            },
1061            if let Some(color_conversion_strategy) = &self.color_conversion_strategy {
1062                format!("{color_conversion_strategy:?}").into()
1063            } else {
1064                String::new().into()
1065            },
1066            if let Some(app_title) = &self.app_title {
1067                format!("{app_title:?}").into()
1068            } else {
1069                String::new().into()
1070            },
1071            if let Some(app_logo) = &self.app_logo {
1072                format!("{app_logo:?}").into()
1073            } else {
1074                String::new().into()
1075            },
1076            if let Some(barcodes_enabled) = &self.barcodes_enabled {
1077                format!("{barcodes_enabled:?}").into()
1078            } else {
1079                String::new().into()
1080            },
1081            if let Some(barcode_enable_tiff_support) = &self.barcode_enable_tiff_support {
1082                format!("{barcode_enable_tiff_support:?}").into()
1083            } else {
1084                String::new().into()
1085            },
1086            if let Some(barcode_string) = &self.barcode_string {
1087                format!("{barcode_string:?}").into()
1088            } else {
1089                String::new().into()
1090            },
1091            if let Some(barcode_retain_split_pages) = &self.barcode_retain_split_pages {
1092                format!("{barcode_retain_split_pages:?}").into()
1093            } else {
1094                String::new().into()
1095            },
1096            if let Some(barcode_enable_asn) = &self.barcode_enable_asn {
1097                format!("{barcode_enable_asn:?}").into()
1098            } else {
1099                String::new().into()
1100            },
1101            if let Some(barcode_asn_prefix) = &self.barcode_asn_prefix {
1102                format!("{barcode_asn_prefix:?}").into()
1103            } else {
1104                String::new().into()
1105            },
1106            if let Some(barcode_upscale) = &self.barcode_upscale {
1107                format!("{barcode_upscale:?}").into()
1108            } else {
1109                String::new().into()
1110            },
1111            if let Some(barcode_dpi) = &self.barcode_dpi {
1112                format!("{barcode_dpi:?}").into()
1113            } else {
1114                String::new().into()
1115            },
1116            if let Some(barcode_max_pages) = &self.barcode_max_pages {
1117                format!("{barcode_max_pages:?}").into()
1118            } else {
1119                String::new().into()
1120            },
1121            if let Some(barcode_enable_tag) = &self.barcode_enable_tag {
1122                format!("{barcode_enable_tag:?}").into()
1123            } else {
1124                String::new().into()
1125            },
1126        ]
1127    }
1128
1129    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1130        vec![
1131            "user_args".into(),
1132            "barcode_tag_mapping".into(),
1133            "output_type".into(),
1134            "pages".into(),
1135            "language".into(),
1136            "mode".into(),
1137            "skip_archive_file".into(),
1138            "image_dpi".into(),
1139            "unpaper_clean".into(),
1140            "deskew".into(),
1141            "rotate_pages".into(),
1142            "rotate_pages_threshold".into(),
1143            "max_image_pixels".into(),
1144            "color_conversion_strategy".into(),
1145            "app_title".into(),
1146            "app_logo".into(),
1147            "barcodes_enabled".into(),
1148            "barcode_enable_tiff_support".into(),
1149            "barcode_string".into(),
1150            "barcode_retain_split_pages".into(),
1151            "barcode_enable_asn".into(),
1152            "barcode_asn_prefix".into(),
1153            "barcode_upscale".into(),
1154            "barcode_dpi".into(),
1155            "barcode_max_pages".into(),
1156            "barcode_enable_tag".into(),
1157        ]
1158    }
1159}
1160
1161#[derive(
1162    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1163)]
1164#[allow(non_snake_case)]
1165pub struct BasicUser {
1166    pub id: i64,
1167    #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
1168    pub username: String,
1169    #[serde(default, skip_serializing_if = "Option::is_none")]
1170    pub first_name: Option<String>,
1171    #[serde(default, skip_serializing_if = "Option::is_none")]
1172    pub last_name: Option<String>,
1173}
1174
1175impl std::fmt::Display for BasicUser {
1176    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1177        write!(
1178            f,
1179            "{}",
1180            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1181        )
1182    }
1183}
1184
1185#[cfg(feature = "tabled")]
1186impl tabled::Tabled for BasicUser {
1187    const LENGTH: usize = 4;
1188    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1189        vec![
1190            format!("{:?}", self.id).into(),
1191            self.username.clone().into(),
1192            if let Some(first_name) = &self.first_name {
1193                format!("{first_name:?}").into()
1194            } else {
1195                String::new().into()
1196            },
1197            if let Some(last_name) = &self.last_name {
1198                format!("{last_name:?}").into()
1199            } else {
1200                String::new().into()
1201            },
1202        ]
1203    }
1204
1205    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1206        vec![
1207            "id".into(),
1208            "username".into(),
1209            "first_name".into(),
1210            "last_name".into(),
1211        ]
1212    }
1213}
1214
1215#[derive(
1216    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1217)]
1218#[allow(non_snake_case)]
1219pub struct BasicUserRequest {
1220    #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
1221    pub username: String,
1222    #[serde(default, skip_serializing_if = "Option::is_none")]
1223    pub first_name: Option<String>,
1224    #[serde(default, skip_serializing_if = "Option::is_none")]
1225    pub last_name: Option<String>,
1226}
1227
1228impl std::fmt::Display for BasicUserRequest {
1229    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1230        write!(
1231            f,
1232            "{}",
1233            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1234        )
1235    }
1236}
1237
1238#[cfg(feature = "tabled")]
1239impl tabled::Tabled for BasicUserRequest {
1240    const LENGTH: usize = 3;
1241    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1242        vec![
1243            self.username.clone().into(),
1244            if let Some(first_name) = &self.first_name {
1245                format!("{first_name:?}").into()
1246            } else {
1247                String::new().into()
1248            },
1249            if let Some(last_name) = &self.last_name {
1250                format!("{last_name:?}").into()
1251            } else {
1252                String::new().into()
1253            },
1254        ]
1255    }
1256
1257    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1258        vec!["username".into(), "first_name".into(), "last_name".into()]
1259    }
1260}
1261
1262#[derive(
1263    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1264)]
1265#[allow(non_snake_case)]
1266pub struct BulkDownload {
1267    #[serde(default, skip_serializing_if = "Option::is_none")]
1268    pub content: Option<ContentEnum>,
1269    #[serde(default, skip_serializing_if = "Option::is_none")]
1270    pub compression: Option<CompressionEnum>,
1271    #[serde(default)]
1272    pub follow_formatting: bool,
1273}
1274
1275impl std::fmt::Display for BulkDownload {
1276    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1277        write!(
1278            f,
1279            "{}",
1280            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1281        )
1282    }
1283}
1284
1285#[cfg(feature = "tabled")]
1286impl tabled::Tabled for BulkDownload {
1287    const LENGTH: usize = 3;
1288    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1289        vec![
1290            if let Some(content) = &self.content {
1291                format!("{content:?}").into()
1292            } else {
1293                String::new().into()
1294            },
1295            if let Some(compression) = &self.compression {
1296                format!("{compression:?}").into()
1297            } else {
1298                String::new().into()
1299            },
1300            format!("{:?}", self.follow_formatting).into(),
1301        ]
1302    }
1303
1304    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1305        vec![
1306            "content".into(),
1307            "compression".into(),
1308            "follow_formatting".into(),
1309        ]
1310    }
1311}
1312
1313#[derive(
1314    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1315)]
1316#[allow(non_snake_case)]
1317pub struct BulkDownloadRequest {
1318    pub documents: Vec<i64>,
1319    #[serde(default, skip_serializing_if = "Option::is_none")]
1320    pub content: Option<ContentEnum>,
1321    #[serde(default, skip_serializing_if = "Option::is_none")]
1322    pub compression: Option<CompressionEnum>,
1323    #[serde(default)]
1324    pub follow_formatting: bool,
1325}
1326
1327impl std::fmt::Display for BulkDownloadRequest {
1328    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1329        write!(
1330            f,
1331            "{}",
1332            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1333        )
1334    }
1335}
1336
1337#[cfg(feature = "tabled")]
1338impl tabled::Tabled for BulkDownloadRequest {
1339    const LENGTH: usize = 4;
1340    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1341        vec![
1342            format!("{:?}", self.documents).into(),
1343            if let Some(content) = &self.content {
1344                format!("{content:?}").into()
1345            } else {
1346                String::new().into()
1347            },
1348            if let Some(compression) = &self.compression {
1349                format!("{compression:?}").into()
1350            } else {
1351                String::new().into()
1352            },
1353            format!("{:?}", self.follow_formatting).into(),
1354        ]
1355    }
1356
1357    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1358        vec![
1359            "documents".into(),
1360            "content".into(),
1361            "compression".into(),
1362            "follow_formatting".into(),
1363        ]
1364    }
1365}
1366
1367#[derive(
1368    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1369)]
1370#[allow(non_snake_case)]
1371pub struct BulkEditDocumentsResult {
1372    pub result: String,
1373}
1374
1375impl std::fmt::Display for BulkEditDocumentsResult {
1376    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1377        write!(
1378            f,
1379            "{}",
1380            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1381        )
1382    }
1383}
1384
1385#[cfg(feature = "tabled")]
1386impl tabled::Tabled for BulkEditDocumentsResult {
1387    const LENGTH: usize = 1;
1388    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1389        vec![self.result.clone().into()]
1390    }
1391
1392    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1393        vec!["result".into()]
1394    }
1395}
1396
1397#[derive(
1398    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1399)]
1400#[allow(non_snake_case)]
1401pub struct BulkEditObjectsRequest {
1402    pub objects: Vec<i64>,
1403    pub object_type: ObjectTypeEnum,
1404    pub operation: OperationEnum,
1405    #[serde(default, skip_serializing_if = "Option::is_none")]
1406    pub owner: Option<i64>,
1407    #[serde(default, skip_serializing_if = "Option::is_none")]
1408    pub permissions: Option<std::collections::HashMap<String, serde_json::Value>>,
1409    #[serde(default)]
1410    pub merge: bool,
1411}
1412
1413impl std::fmt::Display for BulkEditObjectsRequest {
1414    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1415        write!(
1416            f,
1417            "{}",
1418            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1419        )
1420    }
1421}
1422
1423#[cfg(feature = "tabled")]
1424impl tabled::Tabled for BulkEditObjectsRequest {
1425    const LENGTH: usize = 6;
1426    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1427        vec![
1428            format!("{:?}", self.objects).into(),
1429            format!("{:?}", self.object_type).into(),
1430            format!("{:?}", self.operation).into(),
1431            if let Some(owner) = &self.owner {
1432                format!("{owner:?}").into()
1433            } else {
1434                String::new().into()
1435            },
1436            if let Some(permissions) = &self.permissions {
1437                format!("{permissions:?}").into()
1438            } else {
1439                String::new().into()
1440            },
1441            format!("{:?}", self.merge).into(),
1442        ]
1443    }
1444
1445    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1446        vec![
1447            "objects".into(),
1448            "object_type".into(),
1449            "operation".into(),
1450            "owner".into(),
1451            "permissions".into(),
1452            "merge".into(),
1453        ]
1454    }
1455}
1456
1457#[derive(
1458    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1459)]
1460#[allow(non_snake_case)]
1461pub struct BulkEditRequest {
1462    pub documents: Vec<i64>,
1463    pub method: MethodEnum,
1464    #[serde(default, skip_serializing_if = "Option::is_none")]
1465    pub parameters: Option<std::collections::HashMap<String, serde_json::Value>>,
1466}
1467
1468impl std::fmt::Display for BulkEditRequest {
1469    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1470        write!(
1471            f,
1472            "{}",
1473            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1474        )
1475    }
1476}
1477
1478#[cfg(feature = "tabled")]
1479impl tabled::Tabled for BulkEditRequest {
1480    const LENGTH: usize = 3;
1481    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1482        vec![
1483            format!("{:?}", self.documents).into(),
1484            format!("{:?}", self.method).into(),
1485            if let Some(parameters) = &self.parameters {
1486                format!("{parameters:?}").into()
1487            } else {
1488                String::new().into()
1489            },
1490        ]
1491    }
1492
1493    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1494        vec!["documents".into(), "method".into(), "parameters".into()]
1495    }
1496}
1497
1498#[derive(
1499    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1500)]
1501#[allow(non_snake_case)]
1502pub struct BulkEditResult {
1503    pub result: String,
1504}
1505
1506impl std::fmt::Display for BulkEditResult {
1507    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1508        write!(
1509            f,
1510            "{}",
1511            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1512        )
1513    }
1514}
1515
1516#[cfg(feature = "tabled")]
1517impl tabled::Tabled for BulkEditResult {
1518    const LENGTH: usize = 1;
1519    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1520        vec![self.result.clone().into()]
1521    }
1522
1523    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1524        vec!["result".into()]
1525    }
1526}
1527
1528#[derive(
1529    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1530)]
1531#[allow(non_snake_case)]
1532pub struct Classifier {
1533    pub status: String,
1534    pub error: String,
1535    pub last_trained: chrono::DateTime<chrono::Utc>,
1536}
1537
1538impl std::fmt::Display for Classifier {
1539    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1540        write!(
1541            f,
1542            "{}",
1543            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1544        )
1545    }
1546}
1547
1548#[cfg(feature = "tabled")]
1549impl tabled::Tabled for Classifier {
1550    const LENGTH: usize = 3;
1551    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1552        vec![
1553            self.status.clone().into(),
1554            self.error.clone().into(),
1555            format!("{:?}", self.last_trained).into(),
1556        ]
1557    }
1558
1559    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1560        vec!["status".into(), "error".into(), "last_trained".into()]
1561    }
1562}
1563
1564#[doc = "* `LeaveColorUnchanged` - LeaveColorUnchanged\n* `RGB` - RGB\n* `UseDeviceIndependentColor` - UseDeviceIndependentColor\n* `Gray` - Gray\n* `CMYK` - CMYK"]
1565#[derive(
1566    serde :: Serialize,
1567    serde :: Deserialize,
1568    PartialEq,
1569    Hash,
1570    Debug,
1571    Clone,
1572    schemars :: JsonSchema,
1573    parse_display :: FromStr,
1574    parse_display :: Display,
1575)]
1576#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1577#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1578pub enum ColorConversionStrategyEnum {
1579    LeaveColorUnchanged,
1580    #[serde(rename = "RGB")]
1581    #[display("RGB")]
1582    Rgb,
1583    UseDeviceIndependentColor,
1584    Gray,
1585    #[serde(rename = "CMYK")]
1586    #[display("CMYK")]
1587    Cmyk,
1588    #[serde(rename = "")]
1589    #[display("")]
1590    Empty,
1591}
1592
1593#[doc = "* `none` - none\n* `deflated` - deflated\n* `bzip2` - bzip2\n* `lzma` - lzma"]
1594#[derive(
1595    serde :: Serialize,
1596    serde :: Deserialize,
1597    PartialEq,
1598    Hash,
1599    Debug,
1600    Clone,
1601    schemars :: JsonSchema,
1602    parse_display :: FromStr,
1603    parse_display :: Display,
1604)]
1605#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1606#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1607pub enum CompressionEnum {
1608    #[serde(rename = "none")]
1609    #[display("none")]
1610    None,
1611    #[serde(rename = "deflated")]
1612    #[display("deflated")]
1613    Deflated,
1614    #[serde(rename = "bzip2")]
1615    #[display("bzip2")]
1616    Bzip2,
1617    #[serde(rename = "lzma")]
1618    #[display("lzma")]
1619    Lzma,
1620}
1621
1622#[doc = "* `archive` - archive\n* `originals` - originals\n* `both` - both"]
1623#[derive(
1624    serde :: Serialize,
1625    serde :: Deserialize,
1626    PartialEq,
1627    Hash,
1628    Debug,
1629    Clone,
1630    schemars :: JsonSchema,
1631    parse_display :: FromStr,
1632    parse_display :: Display,
1633)]
1634#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1635#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1636pub enum ContentEnum {
1637    #[serde(rename = "archive")]
1638    #[display("archive")]
1639    Archive,
1640    #[serde(rename = "originals")]
1641    #[display("originals")]
1642    Originals,
1643    #[serde(rename = "both")]
1644    #[display("both")]
1645    Both,
1646}
1647
1648#[derive(
1649    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1650)]
1651#[allow(non_snake_case)]
1652pub struct View {
1653    #[serde(default, skip_serializing_if = "Option::is_none")]
1654    pub users: Option<Vec<i64>>,
1655    #[serde(default, skip_serializing_if = "Option::is_none")]
1656    pub groups: Option<Vec<i64>>,
1657}
1658
1659impl std::fmt::Display for View {
1660    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1661        write!(
1662            f,
1663            "{}",
1664            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1665        )
1666    }
1667}
1668
1669#[cfg(feature = "tabled")]
1670impl tabled::Tabled for View {
1671    const LENGTH: usize = 2;
1672    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1673        vec![
1674            if let Some(users) = &self.users {
1675                format!("{users:?}").into()
1676            } else {
1677                String::new().into()
1678            },
1679            if let Some(groups) = &self.groups {
1680                format!("{groups:?}").into()
1681            } else {
1682                String::new().into()
1683            },
1684        ]
1685    }
1686
1687    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1688        vec!["users".into(), "groups".into()]
1689    }
1690}
1691
1692#[derive(
1693    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1694)]
1695#[allow(non_snake_case)]
1696pub struct Change {
1697    #[serde(default, skip_serializing_if = "Option::is_none")]
1698    pub users: Option<Vec<i64>>,
1699    #[serde(default, skip_serializing_if = "Option::is_none")]
1700    pub groups: Option<Vec<i64>>,
1701}
1702
1703impl std::fmt::Display for Change {
1704    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1705        write!(
1706            f,
1707            "{}",
1708            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1709        )
1710    }
1711}
1712
1713#[cfg(feature = "tabled")]
1714impl tabled::Tabled for Change {
1715    const LENGTH: usize = 2;
1716    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1717        vec![
1718            if let Some(users) = &self.users {
1719                format!("{users:?}").into()
1720            } else {
1721                String::new().into()
1722            },
1723            if let Some(groups) = &self.groups {
1724                format!("{groups:?}").into()
1725            } else {
1726                String::new().into()
1727            },
1728        ]
1729    }
1730
1731    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1732        vec!["users".into(), "groups".into()]
1733    }
1734}
1735
1736#[derive(
1737    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1738)]
1739#[allow(non_snake_case)]
1740pub struct Permissions {
1741    #[serde(default, skip_serializing_if = "Option::is_none")]
1742    pub view: Option<View>,
1743    #[serde(default, skip_serializing_if = "Option::is_none")]
1744    pub change: Option<Change>,
1745}
1746
1747impl std::fmt::Display for Permissions {
1748    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1749        write!(
1750            f,
1751            "{}",
1752            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1753        )
1754    }
1755}
1756
1757#[cfg(feature = "tabled")]
1758impl tabled::Tabled for Permissions {
1759    const LENGTH: usize = 2;
1760    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1761        vec![
1762            if let Some(view) = &self.view {
1763                format!("{view:?}").into()
1764            } else {
1765                String::new().into()
1766            },
1767            if let Some(change) = &self.change {
1768                format!("{change:?}").into()
1769            } else {
1770                String::new().into()
1771            },
1772        ]
1773    }
1774
1775    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1776        vec!["view".into(), "change".into()]
1777    }
1778}
1779
1780#[derive(
1781    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1782)]
1783#[allow(non_snake_case)]
1784pub struct Correspondent {
1785    pub id: i64,
1786    pub slug: String,
1787    pub name: String,
1788    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
1789    pub match_: Option<String>,
1790    #[serde(default, skip_serializing_if = "Option::is_none")]
1791    pub matching_algorithm: Option<i64>,
1792    #[serde(default, skip_serializing_if = "Option::is_none")]
1793    pub is_insensitive: Option<bool>,
1794    pub document_count: i64,
1795    #[serde(default, skip_serializing_if = "Option::is_none")]
1796    pub last_correspondence: Option<chrono::NaiveDate>,
1797    #[serde(default, skip_serializing_if = "Option::is_none")]
1798    pub owner: Option<i64>,
1799    #[serde(default, skip_serializing_if = "Option::is_none")]
1800    pub permissions: Option<Permissions>,
1801    pub user_can_change: bool,
1802}
1803
1804impl std::fmt::Display for Correspondent {
1805    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1806        write!(
1807            f,
1808            "{}",
1809            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1810        )
1811    }
1812}
1813
1814#[cfg(feature = "tabled")]
1815impl tabled::Tabled for Correspondent {
1816    const LENGTH: usize = 11;
1817    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1818        vec![
1819            format!("{:?}", self.id).into(),
1820            self.slug.clone().into(),
1821            self.name.clone().into(),
1822            if let Some(match_) = &self.match_ {
1823                format!("{match_:?}").into()
1824            } else {
1825                String::new().into()
1826            },
1827            if let Some(matching_algorithm) = &self.matching_algorithm {
1828                format!("{matching_algorithm:?}").into()
1829            } else {
1830                String::new().into()
1831            },
1832            if let Some(is_insensitive) = &self.is_insensitive {
1833                format!("{is_insensitive:?}").into()
1834            } else {
1835                String::new().into()
1836            },
1837            format!("{:?}", self.document_count).into(),
1838            if let Some(last_correspondence) = &self.last_correspondence {
1839                format!("{last_correspondence:?}").into()
1840            } else {
1841                String::new().into()
1842            },
1843            if let Some(owner) = &self.owner {
1844                format!("{owner:?}").into()
1845            } else {
1846                String::new().into()
1847            },
1848            if let Some(permissions) = &self.permissions {
1849                format!("{permissions:?}").into()
1850            } else {
1851                String::new().into()
1852            },
1853            format!("{:?}", self.user_can_change).into(),
1854        ]
1855    }
1856
1857    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1858        vec![
1859            "id".into(),
1860            "slug".into(),
1861            "name".into(),
1862            "match_".into(),
1863            "matching_algorithm".into(),
1864            "is_insensitive".into(),
1865            "document_count".into(),
1866            "last_correspondence".into(),
1867            "owner".into(),
1868            "permissions".into(),
1869            "user_can_change".into(),
1870        ]
1871    }
1872}
1873
1874#[derive(
1875    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1876)]
1877#[allow(non_snake_case)]
1878pub struct CorrespondentCounts {
1879    pub id: i64,
1880    pub document_count: i64,
1881}
1882
1883impl std::fmt::Display for CorrespondentCounts {
1884    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1885        write!(
1886            f,
1887            "{}",
1888            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1889        )
1890    }
1891}
1892
1893#[cfg(feature = "tabled")]
1894impl tabled::Tabled for CorrespondentCounts {
1895    const LENGTH: usize = 2;
1896    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1897        vec![
1898            format!("{:?}", self.id).into(),
1899            format!("{:?}", self.document_count).into(),
1900        ]
1901    }
1902
1903    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1904        vec!["id".into(), "document_count".into()]
1905    }
1906}
1907
1908#[derive(
1909    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1910)]
1911#[allow(non_snake_case)]
1912pub struct SetPermissions {
1913    #[serde(default, skip_serializing_if = "Option::is_none")]
1914    pub view: Option<View>,
1915    #[serde(default, skip_serializing_if = "Option::is_none")]
1916    pub change: Option<Change>,
1917}
1918
1919impl std::fmt::Display for SetPermissions {
1920    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1921        write!(
1922            f,
1923            "{}",
1924            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1925        )
1926    }
1927}
1928
1929#[cfg(feature = "tabled")]
1930impl tabled::Tabled for SetPermissions {
1931    const LENGTH: usize = 2;
1932    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1933        vec![
1934            if let Some(view) = &self.view {
1935                format!("{view:?}").into()
1936            } else {
1937                String::new().into()
1938            },
1939            if let Some(change) = &self.change {
1940                format!("{change:?}").into()
1941            } else {
1942                String::new().into()
1943            },
1944        ]
1945    }
1946
1947    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1948        vec!["view".into(), "change".into()]
1949    }
1950}
1951
1952#[derive(
1953    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1954)]
1955#[allow(non_snake_case)]
1956pub struct CorrespondentRequest {
1957    pub name: String,
1958    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
1959    pub match_: Option<String>,
1960    #[serde(default, skip_serializing_if = "Option::is_none")]
1961    pub matching_algorithm: Option<i64>,
1962    #[serde(default, skip_serializing_if = "Option::is_none")]
1963    pub is_insensitive: Option<bool>,
1964    #[serde(default, skip_serializing_if = "Option::is_none")]
1965    pub owner: Option<i64>,
1966    #[serde(default, skip_serializing_if = "Option::is_none")]
1967    pub set_permissions: Option<SetPermissions>,
1968}
1969
1970impl std::fmt::Display for CorrespondentRequest {
1971    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1972        write!(
1973            f,
1974            "{}",
1975            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1976        )
1977    }
1978}
1979
1980#[cfg(feature = "tabled")]
1981impl tabled::Tabled for CorrespondentRequest {
1982    const LENGTH: usize = 6;
1983    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1984        vec![
1985            self.name.clone().into(),
1986            if let Some(match_) = &self.match_ {
1987                format!("{match_:?}").into()
1988            } else {
1989                String::new().into()
1990            },
1991            if let Some(matching_algorithm) = &self.matching_algorithm {
1992                format!("{matching_algorithm:?}").into()
1993            } else {
1994                String::new().into()
1995            },
1996            if let Some(is_insensitive) = &self.is_insensitive {
1997                format!("{is_insensitive:?}").into()
1998            } else {
1999                String::new().into()
2000            },
2001            if let Some(owner) = &self.owner {
2002                format!("{owner:?}").into()
2003            } else {
2004                String::new().into()
2005            },
2006            if let Some(set_permissions) = &self.set_permissions {
2007                format!("{set_permissions:?}").into()
2008            } else {
2009                String::new().into()
2010            },
2011        ]
2012    }
2013
2014    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2015        vec![
2016            "name".into(),
2017            "match_".into(),
2018            "matching_algorithm".into(),
2019            "is_insensitive".into(),
2020            "owner".into(),
2021            "set_permissions".into(),
2022        ]
2023    }
2024}
2025
2026#[derive(
2027    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2028)]
2029#[allow(non_snake_case)]
2030pub struct CustomField {
2031    pub id: i64,
2032    pub name: String,
2033    #[doc = "* `string` - string\n* `url` - url\n* `date` - date\n* `boolean` - boolean\n* `integer` - integer\n* `float` - float\n* `monetary` - monetary\n* `documentlink` - documentlink\n* `select` - select\n* `longtext` - longtext"]
2034    pub data_type: DataTypeEnum,
2035    #[doc = "Extra data for the custom field, such as select options"]
2036    #[serde(default, skip_serializing_if = "Option::is_none")]
2037    pub extra_data: Option<serde_json::Value>,
2038    pub document_count: i64,
2039}
2040
2041impl std::fmt::Display for CustomField {
2042    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2043        write!(
2044            f,
2045            "{}",
2046            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2047        )
2048    }
2049}
2050
2051#[cfg(feature = "tabled")]
2052impl tabled::Tabled for CustomField {
2053    const LENGTH: usize = 5;
2054    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2055        vec![
2056            format!("{:?}", self.id).into(),
2057            self.name.clone().into(),
2058            format!("{:?}", self.data_type).into(),
2059            if let Some(extra_data) = &self.extra_data {
2060                format!("{extra_data:?}").into()
2061            } else {
2062                String::new().into()
2063            },
2064            format!("{:?}", self.document_count).into(),
2065        ]
2066    }
2067
2068    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2069        vec![
2070            "id".into(),
2071            "name".into(),
2072            "data_type".into(),
2073            "extra_data".into(),
2074            "document_count".into(),
2075        ]
2076    }
2077}
2078
2079#[derive(
2080    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2081)]
2082#[allow(non_snake_case)]
2083pub struct CustomFieldCounts {
2084    pub id: i64,
2085    pub document_count: i64,
2086}
2087
2088impl std::fmt::Display for CustomFieldCounts {
2089    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2090        write!(
2091            f,
2092            "{}",
2093            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2094        )
2095    }
2096}
2097
2098#[cfg(feature = "tabled")]
2099impl tabled::Tabled for CustomFieldCounts {
2100    const LENGTH: usize = 2;
2101    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2102        vec![
2103            format!("{:?}", self.id).into(),
2104            format!("{:?}", self.document_count).into(),
2105        ]
2106    }
2107
2108    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2109        vec!["id".into(), "document_count".into()]
2110    }
2111}
2112
2113#[derive(
2114    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2115)]
2116#[allow(non_snake_case)]
2117pub struct CustomFieldInstance {
2118    #[doc = "Given the *incoming* primitive data, return the value for this field\nthat should be validated and transformed to a native value."]
2119    #[serde(default, skip_serializing_if = "Option::is_none")]
2120    pub value: Option<serde_json::Value>,
2121    pub field: i64,
2122}
2123
2124impl std::fmt::Display for CustomFieldInstance {
2125    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2126        write!(
2127            f,
2128            "{}",
2129            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2130        )
2131    }
2132}
2133
2134#[cfg(feature = "tabled")]
2135impl tabled::Tabled for CustomFieldInstance {
2136    const LENGTH: usize = 2;
2137    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2138        vec![
2139            if let Some(value) = &self.value {
2140                format!("{value:?}").into()
2141            } else {
2142                String::new().into()
2143            },
2144            format!("{:?}", self.field).into(),
2145        ]
2146    }
2147
2148    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2149        vec!["value".into(), "field".into()]
2150    }
2151}
2152
2153#[derive(
2154    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2155)]
2156#[allow(non_snake_case)]
2157pub struct CustomFieldInstanceRequest {
2158    #[doc = "Given the *incoming* primitive data, return the value for this field\nthat should be validated and transformed to a native value."]
2159    #[serde(default)]
2160    pub value: Option<serde_json::Value>,
2161    pub field: i64,
2162}
2163
2164impl std::fmt::Display for CustomFieldInstanceRequest {
2165    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2166        write!(
2167            f,
2168            "{}",
2169            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2170        )
2171    }
2172}
2173
2174#[cfg(feature = "tabled")]
2175impl tabled::Tabled for CustomFieldInstanceRequest {
2176    const LENGTH: usize = 2;
2177    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2178        vec![
2179            format!("{:?}", self.value).into(),
2180            format!("{:?}", self.field).into(),
2181        ]
2182    }
2183
2184    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2185        vec!["value".into(), "field".into()]
2186    }
2187}
2188
2189#[derive(
2190    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2191)]
2192#[allow(non_snake_case)]
2193pub struct CustomFieldRequest {
2194    pub name: String,
2195    #[doc = "* `string` - string\n* `url` - url\n* `date` - date\n* `boolean` - boolean\n* `integer` - integer\n* `float` - float\n* `monetary` - monetary\n* `documentlink` - documentlink\n* `select` - select\n* `longtext` - longtext"]
2196    pub data_type: DataTypeEnum,
2197    #[doc = "Extra data for the custom field, such as select options"]
2198    #[serde(default, skip_serializing_if = "Option::is_none")]
2199    pub extra_data: Option<serde_json::Value>,
2200}
2201
2202impl std::fmt::Display for CustomFieldRequest {
2203    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2204        write!(
2205            f,
2206            "{}",
2207            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2208        )
2209    }
2210}
2211
2212#[cfg(feature = "tabled")]
2213impl tabled::Tabled for CustomFieldRequest {
2214    const LENGTH: usize = 3;
2215    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2216        vec![
2217            self.name.clone().into(),
2218            format!("{:?}", self.data_type).into(),
2219            if let Some(extra_data) = &self.extra_data {
2220                format!("{extra_data:?}").into()
2221            } else {
2222                String::new().into()
2223            },
2224        ]
2225    }
2226
2227    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2228        vec!["name".into(), "data_type".into(), "extra_data".into()]
2229    }
2230}
2231
2232#[doc = "* `string` - string\n* `url` - url\n* `date` - date\n* `boolean` - boolean\n* `integer` - integer\n* `float` - float\n* `monetary` - monetary\n* `documentlink` - documentlink\n* `select` - select\n* `longtext` - longtext"]
2233#[derive(
2234    serde :: Serialize,
2235    serde :: Deserialize,
2236    PartialEq,
2237    Hash,
2238    Debug,
2239    Clone,
2240    schemars :: JsonSchema,
2241    parse_display :: FromStr,
2242    parse_display :: Display,
2243)]
2244#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2245#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2246pub enum DataTypeEnum {
2247    #[serde(rename = "string")]
2248    #[display("string")]
2249    String,
2250    #[serde(rename = "url")]
2251    #[display("url")]
2252    Url,
2253    #[serde(rename = "date")]
2254    #[display("date")]
2255    Date,
2256    #[serde(rename = "boolean")]
2257    #[display("boolean")]
2258    Boolean,
2259    #[serde(rename = "integer")]
2260    #[display("integer")]
2261    Integer,
2262    #[serde(rename = "float")]
2263    #[display("float")]
2264    Float,
2265    #[serde(rename = "monetary")]
2266    #[display("monetary")]
2267    Monetary,
2268    #[serde(rename = "documentlink")]
2269    #[display("documentlink")]
2270    Documentlink,
2271    #[serde(rename = "select")]
2272    #[display("select")]
2273    Select,
2274    #[serde(rename = "longtext")]
2275    #[display("longtext")]
2276    Longtext,
2277}
2278
2279#[derive(
2280    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2281)]
2282#[allow(non_snake_case)]
2283pub struct Database {
2284    #[serde(rename = "type")]
2285    pub type_: String,
2286    pub url: String,
2287    pub status: String,
2288    pub error: String,
2289    pub migration_status: MigrationStatus,
2290}
2291
2292impl std::fmt::Display for Database {
2293    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2294        write!(
2295            f,
2296            "{}",
2297            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2298        )
2299    }
2300}
2301
2302#[cfg(feature = "tabled")]
2303impl tabled::Tabled for Database {
2304    const LENGTH: usize = 5;
2305    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2306        vec![
2307            self.type_.clone().into(),
2308            self.url.clone().into(),
2309            self.status.clone().into(),
2310            self.error.clone().into(),
2311            format!("{:?}", self.migration_status).into(),
2312        ]
2313    }
2314
2315    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2316        vec![
2317            "type_".into(),
2318            "url".into(),
2319            "status".into(),
2320            "error".into(),
2321            "migration_status".into(),
2322        ]
2323    }
2324}
2325
2326#[doc = "* `table` - Table\n* `smallCards` - Small Cards\n* `largeCards` - Large Cards"]
2327#[derive(
2328    serde :: Serialize,
2329    serde :: Deserialize,
2330    PartialEq,
2331    Hash,
2332    Debug,
2333    Clone,
2334    schemars :: JsonSchema,
2335    parse_display :: FromStr,
2336    parse_display :: Display,
2337)]
2338#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2339#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2340pub enum DisplayModeEnum {
2341    #[serde(rename = "table")]
2342    #[display("table")]
2343    Table,
2344    #[serde(rename = "smallCards")]
2345    #[display("smallCards")]
2346    SmallCards,
2347    #[serde(rename = "largeCards")]
2348    #[display("largeCards")]
2349    LargeCards,
2350    #[serde(rename = "")]
2351    #[display("")]
2352    Empty,
2353}
2354
2355#[derive(
2356    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2357)]
2358#[allow(non_snake_case)]
2359pub struct DocumentPermissions {
2360    #[serde(default, skip_serializing_if = "Option::is_none")]
2361    pub view: Option<View>,
2362    #[serde(default, skip_serializing_if = "Option::is_none")]
2363    pub change: Option<Change>,
2364}
2365
2366impl std::fmt::Display for DocumentPermissions {
2367    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2368        write!(
2369            f,
2370            "{}",
2371            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2372        )
2373    }
2374}
2375
2376#[cfg(feature = "tabled")]
2377impl tabled::Tabled for DocumentPermissions {
2378    const LENGTH: usize = 2;
2379    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2380        vec![
2381            if let Some(view) = &self.view {
2382                format!("{view:?}").into()
2383            } else {
2384                String::new().into()
2385            },
2386            if let Some(change) = &self.change {
2387                format!("{change:?}").into()
2388            } else {
2389                String::new().into()
2390            },
2391        ]
2392    }
2393
2394    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2395        vec!["view".into(), "change".into()]
2396    }
2397}
2398
2399#[doc = "Adds update nested feature"]
2400#[derive(
2401    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2402)]
2403#[allow(non_snake_case)]
2404pub struct Document {
2405    pub id: i64,
2406    #[serde(default)]
2407    pub correspondent: Option<i64>,
2408    #[serde(default)]
2409    pub document_type: Option<i64>,
2410    #[serde(default)]
2411    pub storage_path: Option<i64>,
2412    #[serde(default, skip_serializing_if = "Option::is_none")]
2413    pub title: Option<String>,
2414    #[doc = "The raw, text-only data of the document. This field is primarily used for searching."]
2415    #[serde(default, skip_serializing_if = "Option::is_none")]
2416    pub content: Option<String>,
2417    pub tags: Vec<i64>,
2418    #[serde(default, skip_serializing_if = "Option::is_none")]
2419    pub created: Option<chrono::NaiveDate>,
2420    #[serde(default, skip_serializing_if = "Option::is_none")]
2421    #[deprecated]
2422    pub created_date: Option<chrono::NaiveDate>,
2423    pub modified: chrono::DateTime<chrono::Utc>,
2424    pub added: chrono::DateTime<chrono::Utc>,
2425    #[serde(default, skip_serializing_if = "Option::is_none")]
2426    pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
2427    #[doc = "The position of this document in your physical document archive."]
2428    #[serde(default, skip_serializing_if = "Option::is_none")]
2429    pub archive_serial_number: Option<i64>,
2430    #[serde(default)]
2431    pub original_file_name: Option<String>,
2432    #[serde(default)]
2433    pub archived_file_name: Option<String>,
2434    #[serde(default, skip_serializing_if = "Option::is_none")]
2435    pub owner: Option<i64>,
2436    #[serde(default, skip_serializing_if = "Option::is_none")]
2437    pub permissions: Option<DocumentPermissions>,
2438    #[serde(default)]
2439    pub user_can_change: Option<bool>,
2440    #[serde(default)]
2441    pub is_shared_by_requester: Option<bool>,
2442    pub notes: Vec<Notes>,
2443    #[serde(default, skip_serializing_if = "Option::is_none")]
2444    pub custom_fields: Option<Vec<CustomFieldInstance>>,
2445    #[serde(default)]
2446    pub page_count: Option<i64>,
2447    pub mime_type: String,
2448}
2449
2450impl std::fmt::Display for Document {
2451    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2452        write!(
2453            f,
2454            "{}",
2455            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2456        )
2457    }
2458}
2459
2460#[cfg(feature = "tabled")]
2461impl tabled::Tabled for Document {
2462    const LENGTH: usize = 23;
2463    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2464        vec![
2465            format!("{:?}", self.id).into(),
2466            format!("{:?}", self.correspondent).into(),
2467            format!("{:?}", self.document_type).into(),
2468            format!("{:?}", self.storage_path).into(),
2469            if let Some(title) = &self.title {
2470                format!("{title:?}").into()
2471            } else {
2472                String::new().into()
2473            },
2474            if let Some(content) = &self.content {
2475                format!("{content:?}").into()
2476            } else {
2477                String::new().into()
2478            },
2479            format!("{:?}", self.tags).into(),
2480            if let Some(created) = &self.created {
2481                format!("{created:?}").into()
2482            } else {
2483                String::new().into()
2484            },
2485            if let Some(created_date) = &self.created_date {
2486                format!("{created_date:?}").into()
2487            } else {
2488                String::new().into()
2489            },
2490            format!("{:?}", self.modified).into(),
2491            format!("{:?}", self.added).into(),
2492            if let Some(deleted_at) = &self.deleted_at {
2493                format!("{deleted_at:?}").into()
2494            } else {
2495                String::new().into()
2496            },
2497            if let Some(archive_serial_number) = &self.archive_serial_number {
2498                format!("{archive_serial_number:?}").into()
2499            } else {
2500                String::new().into()
2501            },
2502            format!("{:?}", self.original_file_name).into(),
2503            format!("{:?}", self.archived_file_name).into(),
2504            if let Some(owner) = &self.owner {
2505                format!("{owner:?}").into()
2506            } else {
2507                String::new().into()
2508            },
2509            if let Some(permissions) = &self.permissions {
2510                format!("{permissions:?}").into()
2511            } else {
2512                String::new().into()
2513            },
2514            format!("{:?}", self.user_can_change).into(),
2515            format!("{:?}", self.is_shared_by_requester).into(),
2516            format!("{:?}", self.notes).into(),
2517            if let Some(custom_fields) = &self.custom_fields {
2518                format!("{custom_fields:?}").into()
2519            } else {
2520                String::new().into()
2521            },
2522            format!("{:?}", self.page_count).into(),
2523            self.mime_type.clone().into(),
2524        ]
2525    }
2526
2527    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2528        vec![
2529            "id".into(),
2530            "correspondent".into(),
2531            "document_type".into(),
2532            "storage_path".into(),
2533            "title".into(),
2534            "content".into(),
2535            "tags".into(),
2536            "created".into(),
2537            "created_date".into(),
2538            "modified".into(),
2539            "added".into(),
2540            "deleted_at".into(),
2541            "archive_serial_number".into(),
2542            "original_file_name".into(),
2543            "archived_file_name".into(),
2544            "owner".into(),
2545            "permissions".into(),
2546            "user_can_change".into(),
2547            "is_shared_by_requester".into(),
2548            "notes".into(),
2549            "custom_fields".into(),
2550            "page_count".into(),
2551            "mime_type".into(),
2552        ]
2553    }
2554}
2555
2556#[derive(
2557    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2558)]
2559#[allow(non_snake_case)]
2560pub struct DocumentListRequest {
2561    pub documents: Vec<i64>,
2562}
2563
2564impl std::fmt::Display for DocumentListRequest {
2565    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2566        write!(
2567            f,
2568            "{}",
2569            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2570        )
2571    }
2572}
2573
2574#[cfg(feature = "tabled")]
2575impl tabled::Tabled for DocumentListRequest {
2576    const LENGTH: usize = 1;
2577    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2578        vec![format!("{:?}", self.documents).into()]
2579    }
2580
2581    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2582        vec!["documents".into()]
2583    }
2584}
2585
2586#[doc = "Adds update nested feature"]
2587#[derive(
2588    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2589)]
2590#[allow(non_snake_case)]
2591pub struct DocumentRequest {
2592    #[serde(default)]
2593    pub correspondent: Option<i64>,
2594    #[serde(default)]
2595    pub document_type: Option<i64>,
2596    #[serde(default)]
2597    pub storage_path: Option<i64>,
2598    #[serde(default, skip_serializing_if = "Option::is_none")]
2599    pub title: Option<String>,
2600    #[doc = "The raw, text-only data of the document. This field is primarily used for searching."]
2601    #[serde(default, skip_serializing_if = "Option::is_none")]
2602    pub content: Option<String>,
2603    pub tags: Vec<i64>,
2604    #[serde(default, skip_serializing_if = "Option::is_none")]
2605    pub created: Option<chrono::NaiveDate>,
2606    #[serde(default, skip_serializing_if = "Option::is_none")]
2607    #[deprecated]
2608    pub created_date: Option<chrono::NaiveDate>,
2609    #[serde(default, skip_serializing_if = "Option::is_none")]
2610    pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
2611    #[doc = "The position of this document in your physical document archive."]
2612    #[serde(default, skip_serializing_if = "Option::is_none")]
2613    pub archive_serial_number: Option<i64>,
2614    #[serde(default, skip_serializing_if = "Option::is_none")]
2615    pub owner: Option<i64>,
2616    #[serde(default, skip_serializing_if = "Option::is_none")]
2617    pub set_permissions: Option<SetPermissions>,
2618    #[serde(default, skip_serializing_if = "Option::is_none")]
2619    pub custom_fields: Option<Vec<CustomFieldInstanceRequest>>,
2620    #[serde(default, skip_serializing_if = "Option::is_none")]
2621    pub remove_inbox_tags: Option<bool>,
2622}
2623
2624impl std::fmt::Display for DocumentRequest {
2625    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2626        write!(
2627            f,
2628            "{}",
2629            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2630        )
2631    }
2632}
2633
2634#[cfg(feature = "tabled")]
2635impl tabled::Tabled for DocumentRequest {
2636    const LENGTH: usize = 14;
2637    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2638        vec![
2639            format!("{:?}", self.correspondent).into(),
2640            format!("{:?}", self.document_type).into(),
2641            format!("{:?}", self.storage_path).into(),
2642            if let Some(title) = &self.title {
2643                format!("{title:?}").into()
2644            } else {
2645                String::new().into()
2646            },
2647            if let Some(content) = &self.content {
2648                format!("{content:?}").into()
2649            } else {
2650                String::new().into()
2651            },
2652            format!("{:?}", self.tags).into(),
2653            if let Some(created) = &self.created {
2654                format!("{created:?}").into()
2655            } else {
2656                String::new().into()
2657            },
2658            if let Some(created_date) = &self.created_date {
2659                format!("{created_date:?}").into()
2660            } else {
2661                String::new().into()
2662            },
2663            if let Some(deleted_at) = &self.deleted_at {
2664                format!("{deleted_at:?}").into()
2665            } else {
2666                String::new().into()
2667            },
2668            if let Some(archive_serial_number) = &self.archive_serial_number {
2669                format!("{archive_serial_number:?}").into()
2670            } else {
2671                String::new().into()
2672            },
2673            if let Some(owner) = &self.owner {
2674                format!("{owner:?}").into()
2675            } else {
2676                String::new().into()
2677            },
2678            if let Some(set_permissions) = &self.set_permissions {
2679                format!("{set_permissions:?}").into()
2680            } else {
2681                String::new().into()
2682            },
2683            if let Some(custom_fields) = &self.custom_fields {
2684                format!("{custom_fields:?}").into()
2685            } else {
2686                String::new().into()
2687            },
2688            if let Some(remove_inbox_tags) = &self.remove_inbox_tags {
2689                format!("{remove_inbox_tags:?}").into()
2690            } else {
2691                String::new().into()
2692            },
2693        ]
2694    }
2695
2696    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2697        vec![
2698            "correspondent".into(),
2699            "document_type".into(),
2700            "storage_path".into(),
2701            "title".into(),
2702            "content".into(),
2703            "tags".into(),
2704            "created".into(),
2705            "created_date".into(),
2706            "deleted_at".into(),
2707            "archive_serial_number".into(),
2708            "owner".into(),
2709            "set_permissions".into(),
2710            "custom_fields".into(),
2711            "remove_inbox_tags".into(),
2712        ]
2713    }
2714}
2715
2716#[derive(
2717    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2718)]
2719#[allow(non_snake_case)]
2720pub struct DocumentTypePermissions {
2721    #[serde(default, skip_serializing_if = "Option::is_none")]
2722    pub view: Option<View>,
2723    #[serde(default, skip_serializing_if = "Option::is_none")]
2724    pub change: Option<Change>,
2725}
2726
2727impl std::fmt::Display for DocumentTypePermissions {
2728    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2729        write!(
2730            f,
2731            "{}",
2732            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2733        )
2734    }
2735}
2736
2737#[cfg(feature = "tabled")]
2738impl tabled::Tabled for DocumentTypePermissions {
2739    const LENGTH: usize = 2;
2740    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2741        vec![
2742            if let Some(view) = &self.view {
2743                format!("{view:?}").into()
2744            } else {
2745                String::new().into()
2746            },
2747            if let Some(change) = &self.change {
2748                format!("{change:?}").into()
2749            } else {
2750                String::new().into()
2751            },
2752        ]
2753    }
2754
2755    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2756        vec!["view".into(), "change".into()]
2757    }
2758}
2759
2760#[derive(
2761    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2762)]
2763#[allow(non_snake_case)]
2764pub struct DocumentType {
2765    pub id: i64,
2766    pub slug: String,
2767    pub name: String,
2768    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
2769    pub match_: Option<String>,
2770    #[serde(default, skip_serializing_if = "Option::is_none")]
2771    pub matching_algorithm: Option<i64>,
2772    #[serde(default, skip_serializing_if = "Option::is_none")]
2773    pub is_insensitive: Option<bool>,
2774    pub document_count: i64,
2775    #[serde(default, skip_serializing_if = "Option::is_none")]
2776    pub owner: Option<i64>,
2777    pub permissions: DocumentTypePermissions,
2778    pub user_can_change: bool,
2779}
2780
2781impl std::fmt::Display for DocumentType {
2782    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2783        write!(
2784            f,
2785            "{}",
2786            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2787        )
2788    }
2789}
2790
2791#[cfg(feature = "tabled")]
2792impl tabled::Tabled for DocumentType {
2793    const LENGTH: usize = 10;
2794    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2795        vec![
2796            format!("{:?}", self.id).into(),
2797            self.slug.clone().into(),
2798            self.name.clone().into(),
2799            if let Some(match_) = &self.match_ {
2800                format!("{match_:?}").into()
2801            } else {
2802                String::new().into()
2803            },
2804            if let Some(matching_algorithm) = &self.matching_algorithm {
2805                format!("{matching_algorithm:?}").into()
2806            } else {
2807                String::new().into()
2808            },
2809            if let Some(is_insensitive) = &self.is_insensitive {
2810                format!("{is_insensitive:?}").into()
2811            } else {
2812                String::new().into()
2813            },
2814            format!("{:?}", self.document_count).into(),
2815            if let Some(owner) = &self.owner {
2816                format!("{owner:?}").into()
2817            } else {
2818                String::new().into()
2819            },
2820            format!("{:?}", self.permissions).into(),
2821            format!("{:?}", self.user_can_change).into(),
2822        ]
2823    }
2824
2825    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2826        vec![
2827            "id".into(),
2828            "slug".into(),
2829            "name".into(),
2830            "match_".into(),
2831            "matching_algorithm".into(),
2832            "is_insensitive".into(),
2833            "document_count".into(),
2834            "owner".into(),
2835            "permissions".into(),
2836            "user_can_change".into(),
2837        ]
2838    }
2839}
2840
2841#[derive(
2842    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2843)]
2844#[allow(non_snake_case)]
2845pub struct DocumentTypeCounts {
2846    pub id: i64,
2847    pub document_count: i64,
2848}
2849
2850impl std::fmt::Display for DocumentTypeCounts {
2851    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2852        write!(
2853            f,
2854            "{}",
2855            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2856        )
2857    }
2858}
2859
2860#[cfg(feature = "tabled")]
2861impl tabled::Tabled for DocumentTypeCounts {
2862    const LENGTH: usize = 2;
2863    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2864        vec![
2865            format!("{:?}", self.id).into(),
2866            format!("{:?}", self.document_count).into(),
2867        ]
2868    }
2869
2870    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2871        vec!["id".into(), "document_count".into()]
2872    }
2873}
2874
2875#[derive(
2876    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2877)]
2878#[allow(non_snake_case)]
2879pub struct DocumentTypeRequest {
2880    pub name: String,
2881    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
2882    pub match_: Option<String>,
2883    #[serde(default, skip_serializing_if = "Option::is_none")]
2884    pub matching_algorithm: Option<i64>,
2885    #[serde(default, skip_serializing_if = "Option::is_none")]
2886    pub is_insensitive: Option<bool>,
2887    #[serde(default, skip_serializing_if = "Option::is_none")]
2888    pub owner: Option<i64>,
2889    #[serde(default, skip_serializing_if = "Option::is_none")]
2890    pub set_permissions: Option<SetPermissions>,
2891}
2892
2893impl std::fmt::Display for DocumentTypeRequest {
2894    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2895        write!(
2896            f,
2897            "{}",
2898            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2899        )
2900    }
2901}
2902
2903#[cfg(feature = "tabled")]
2904impl tabled::Tabled for DocumentTypeRequest {
2905    const LENGTH: usize = 6;
2906    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2907        vec![
2908            self.name.clone().into(),
2909            if let Some(match_) = &self.match_ {
2910                format!("{match_:?}").into()
2911            } else {
2912                String::new().into()
2913            },
2914            if let Some(matching_algorithm) = &self.matching_algorithm {
2915                format!("{matching_algorithm:?}").into()
2916            } else {
2917                String::new().into()
2918            },
2919            if let Some(is_insensitive) = &self.is_insensitive {
2920                format!("{is_insensitive:?}").into()
2921            } else {
2922                String::new().into()
2923            },
2924            if let Some(owner) = &self.owner {
2925                format!("{owner:?}").into()
2926            } else {
2927                String::new().into()
2928            },
2929            if let Some(set_permissions) = &self.set_permissions {
2930                format!("{set_permissions:?}").into()
2931            } else {
2932                String::new().into()
2933            },
2934        ]
2935    }
2936
2937    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2938        vec![
2939            "name".into(),
2940            "match_".into(),
2941            "matching_algorithm".into(),
2942            "is_insensitive".into(),
2943            "owner".into(),
2944            "set_permissions".into(),
2945        ]
2946    }
2947}
2948
2949#[derive(
2950    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2951)]
2952#[allow(non_snake_case)]
2953pub struct EmailDocumentRequestRequest {
2954    #[doc = "Comma-separated email addresses"]
2955    pub addresses: String,
2956    pub subject: String,
2957    pub message: String,
2958    #[doc = "Use archive version of documents if available"]
2959    #[serde(default)]
2960    pub use_archive_version: bool,
2961}
2962
2963impl std::fmt::Display for EmailDocumentRequestRequest {
2964    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2965        write!(
2966            f,
2967            "{}",
2968            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2969        )
2970    }
2971}
2972
2973#[cfg(feature = "tabled")]
2974impl tabled::Tabled for EmailDocumentRequestRequest {
2975    const LENGTH: usize = 4;
2976    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2977        vec![
2978            self.addresses.clone().into(),
2979            self.subject.clone().into(),
2980            self.message.clone().into(),
2981            format!("{:?}", self.use_archive_version).into(),
2982        ]
2983    }
2984
2985    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2986        vec![
2987            "addresses".into(),
2988            "subject".into(),
2989            "message".into(),
2990            "use_archive_version".into(),
2991        ]
2992    }
2993}
2994
2995#[derive(
2996    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2997)]
2998#[allow(non_snake_case)]
2999pub struct EmailDocumentResponse {
3000    pub message: String,
3001}
3002
3003impl std::fmt::Display for EmailDocumentResponse {
3004    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3005        write!(
3006            f,
3007            "{}",
3008            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3009        )
3010    }
3011}
3012
3013#[cfg(feature = "tabled")]
3014impl tabled::Tabled for EmailDocumentResponse {
3015    const LENGTH: usize = 1;
3016    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3017        vec![self.message.clone().into()]
3018    }
3019
3020    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3021        vec!["message".into()]
3022    }
3023}
3024
3025#[derive(
3026    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3027)]
3028#[allow(non_snake_case)]
3029pub struct EmailDocumentsResponse {
3030    pub message: String,
3031}
3032
3033impl std::fmt::Display for EmailDocumentsResponse {
3034    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3035        write!(
3036            f,
3037            "{}",
3038            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3039        )
3040    }
3041}
3042
3043#[cfg(feature = "tabled")]
3044impl tabled::Tabled for EmailDocumentsResponse {
3045    const LENGTH: usize = 1;
3046    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3047        vec![self.message.clone().into()]
3048    }
3049
3050    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3051        vec!["message".into()]
3052    }
3053}
3054
3055#[derive(
3056    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3057)]
3058#[allow(non_snake_case)]
3059pub struct EmailRequest {
3060    pub documents: Vec<i64>,
3061    #[doc = "Comma-separated email addresses"]
3062    pub addresses: String,
3063    pub subject: String,
3064    pub message: String,
3065    #[doc = "Use archive version of documents if available"]
3066    #[serde(default)]
3067    pub use_archive_version: bool,
3068}
3069
3070impl std::fmt::Display for EmailRequest {
3071    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3072        write!(
3073            f,
3074            "{}",
3075            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3076        )
3077    }
3078}
3079
3080#[cfg(feature = "tabled")]
3081impl tabled::Tabled for EmailRequest {
3082    const LENGTH: usize = 5;
3083    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3084        vec![
3085            format!("{:?}", self.documents).into(),
3086            self.addresses.clone().into(),
3087            self.subject.clone().into(),
3088            self.message.clone().into(),
3089            format!("{:?}", self.use_archive_version).into(),
3090        ]
3091    }
3092
3093    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3094        vec![
3095            "documents".into(),
3096            "addresses".into(),
3097            "subject".into(),
3098            "message".into(),
3099            "use_archive_version".into(),
3100        ]
3101    }
3102}
3103
3104#[doc = "* `archive` - Archive\n* `original` - Original"]
3105#[derive(
3106    serde :: Serialize,
3107    serde :: Deserialize,
3108    PartialEq,
3109    Hash,
3110    Debug,
3111    Clone,
3112    schemars :: JsonSchema,
3113    parse_display :: FromStr,
3114    parse_display :: Display,
3115)]
3116#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
3117#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
3118pub enum FileVersionEnum {
3119    #[serde(rename = "archive")]
3120    #[display("archive")]
3121    Archive,
3122    #[serde(rename = "original")]
3123    #[display("original")]
3124    Original,
3125}
3126
3127#[derive(
3128    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3129)]
3130#[allow(non_snake_case)]
3131pub struct Group {
3132    pub id: i64,
3133    pub name: String,
3134    pub permissions: Vec<String>,
3135}
3136
3137impl std::fmt::Display for Group {
3138    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3139        write!(
3140            f,
3141            "{}",
3142            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3143        )
3144    }
3145}
3146
3147#[cfg(feature = "tabled")]
3148impl tabled::Tabled for Group {
3149    const LENGTH: usize = 3;
3150    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3151        vec![
3152            format!("{:?}", self.id).into(),
3153            self.name.clone().into(),
3154            format!("{:?}", self.permissions).into(),
3155        ]
3156    }
3157
3158    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3159        vec!["id".into(), "name".into(), "permissions".into()]
3160    }
3161}
3162
3163#[derive(
3164    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3165)]
3166#[allow(non_snake_case)]
3167pub struct GroupRequest {
3168    pub name: String,
3169    pub permissions: Vec<String>,
3170}
3171
3172impl std::fmt::Display for GroupRequest {
3173    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3174        write!(
3175            f,
3176            "{}",
3177            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3178        )
3179    }
3180}
3181
3182#[cfg(feature = "tabled")]
3183impl tabled::Tabled for GroupRequest {
3184    const LENGTH: usize = 2;
3185    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3186        vec![
3187            self.name.clone().into(),
3188            format!("{:?}", self.permissions).into(),
3189        ]
3190    }
3191
3192    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3193        vec!["name".into(), "permissions".into()]
3194    }
3195}
3196
3197#[derive(
3198    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3199)]
3200#[allow(non_snake_case)]
3201pub struct Index {
3202    pub status: String,
3203    pub error: String,
3204    pub last_modified: chrono::DateTime<chrono::Utc>,
3205}
3206
3207impl std::fmt::Display for Index {
3208    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3209        write!(
3210            f,
3211            "{}",
3212            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3213        )
3214    }
3215}
3216
3217#[cfg(feature = "tabled")]
3218impl tabled::Tabled for Index {
3219    const LENGTH: usize = 3;
3220    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3221        vec![
3222            self.status.clone().into(),
3223            self.error.clone().into(),
3224            format!("{:?}", self.last_modified).into(),
3225        ]
3226    }
3227
3228    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3229        vec!["status".into(), "error".into(), "last_modified".into()]
3230    }
3231}
3232
3233#[derive(
3234    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3235)]
3236#[allow(non_snake_case)]
3237pub struct LogEntry {
3238    pub id: i64,
3239    pub timestamp: chrono::DateTime<chrono::Utc>,
3240    pub action: String,
3241    pub changes: std::collections::HashMap<String, serde_json::Value>,
3242    pub actor: Actor,
3243}
3244
3245impl std::fmt::Display for LogEntry {
3246    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3247        write!(
3248            f,
3249            "{}",
3250            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3251        )
3252    }
3253}
3254
3255#[cfg(feature = "tabled")]
3256impl tabled::Tabled for LogEntry {
3257    const LENGTH: usize = 5;
3258    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3259        vec![
3260            format!("{:?}", self.id).into(),
3261            format!("{:?}", self.timestamp).into(),
3262            self.action.clone().into(),
3263            format!("{:?}", self.changes).into(),
3264            format!("{:?}", self.actor).into(),
3265        ]
3266    }
3267
3268    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3269        vec![
3270            "id".into(),
3271            "timestamp".into(),
3272            "action".into(),
3273            "changes".into(),
3274            "actor".into(),
3275        ]
3276    }
3277}
3278
3279#[derive(
3280    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3281)]
3282#[allow(non_snake_case)]
3283pub struct MailAccount {
3284    pub id: i64,
3285    pub name: String,
3286    pub imap_server: String,
3287    #[doc = "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."]
3288    #[serde(default, skip_serializing_if = "Option::is_none")]
3289    pub imap_port: Option<i64>,
3290    #[serde(default, skip_serializing_if = "Option::is_none")]
3291    pub imap_security: Option<i64>,
3292    pub username: String,
3293    pub password: String,
3294    #[doc = "The character set to use when communicating with the mail server, such as 'UTF-8' or 'US-ASCII'."]
3295    #[serde(default, skip_serializing_if = "Option::is_none")]
3296    pub character_set: Option<String>,
3297    #[serde(default, skip_serializing_if = "Option::is_none")]
3298    pub is_token: Option<bool>,
3299    #[serde(default, skip_serializing_if = "Option::is_none")]
3300    pub owner: Option<i64>,
3301    pub user_can_change: bool,
3302    #[serde(default, skip_serializing_if = "Option::is_none")]
3303    pub account_type: Option<i64>,
3304    #[doc = "The expiration date of the refresh token. "]
3305    #[serde(default, skip_serializing_if = "Option::is_none")]
3306    pub expiration: Option<chrono::DateTime<chrono::Utc>>,
3307}
3308
3309impl std::fmt::Display for MailAccount {
3310    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3311        write!(
3312            f,
3313            "{}",
3314            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3315        )
3316    }
3317}
3318
3319#[cfg(feature = "tabled")]
3320impl tabled::Tabled for MailAccount {
3321    const LENGTH: usize = 13;
3322    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3323        vec![
3324            format!("{:?}", self.id).into(),
3325            self.name.clone().into(),
3326            self.imap_server.clone().into(),
3327            if let Some(imap_port) = &self.imap_port {
3328                format!("{imap_port:?}").into()
3329            } else {
3330                String::new().into()
3331            },
3332            if let Some(imap_security) = &self.imap_security {
3333                format!("{imap_security:?}").into()
3334            } else {
3335                String::new().into()
3336            },
3337            self.username.clone().into(),
3338            self.password.clone().into(),
3339            if let Some(character_set) = &self.character_set {
3340                format!("{character_set:?}").into()
3341            } else {
3342                String::new().into()
3343            },
3344            if let Some(is_token) = &self.is_token {
3345                format!("{is_token:?}").into()
3346            } else {
3347                String::new().into()
3348            },
3349            if let Some(owner) = &self.owner {
3350                format!("{owner:?}").into()
3351            } else {
3352                String::new().into()
3353            },
3354            format!("{:?}", self.user_can_change).into(),
3355            if let Some(account_type) = &self.account_type {
3356                format!("{account_type:?}").into()
3357            } else {
3358                String::new().into()
3359            },
3360            if let Some(expiration) = &self.expiration {
3361                format!("{expiration:?}").into()
3362            } else {
3363                String::new().into()
3364            },
3365        ]
3366    }
3367
3368    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3369        vec![
3370            "id".into(),
3371            "name".into(),
3372            "imap_server".into(),
3373            "imap_port".into(),
3374            "imap_security".into(),
3375            "username".into(),
3376            "password".into(),
3377            "character_set".into(),
3378            "is_token".into(),
3379            "owner".into(),
3380            "user_can_change".into(),
3381            "account_type".into(),
3382            "expiration".into(),
3383        ]
3384    }
3385}
3386
3387#[derive(
3388    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3389)]
3390#[allow(non_snake_case)]
3391pub struct MailAccountProcessResponse {
3392    #[serde(default, skip_serializing_if = "Option::is_none")]
3393    pub result: Option<String>,
3394}
3395
3396impl std::fmt::Display for MailAccountProcessResponse {
3397    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3398        write!(
3399            f,
3400            "{}",
3401            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3402        )
3403    }
3404}
3405
3406#[cfg(feature = "tabled")]
3407impl tabled::Tabled for MailAccountProcessResponse {
3408    const LENGTH: usize = 1;
3409    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3410        vec![if let Some(result) = &self.result {
3411            format!("{result:?}").into()
3412        } else {
3413            String::new().into()
3414        }]
3415    }
3416
3417    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3418        vec!["result".into()]
3419    }
3420}
3421
3422#[derive(
3423    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3424)]
3425#[allow(non_snake_case)]
3426pub struct MailAccountRequest {
3427    pub name: String,
3428    pub imap_server: String,
3429    #[doc = "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."]
3430    #[serde(default, skip_serializing_if = "Option::is_none")]
3431    pub imap_port: Option<i64>,
3432    #[serde(default, skip_serializing_if = "Option::is_none")]
3433    pub imap_security: Option<i64>,
3434    pub username: String,
3435    pub password: String,
3436    #[doc = "The character set to use when communicating with the mail server, such as 'UTF-8' or 'US-ASCII'."]
3437    #[serde(default, skip_serializing_if = "Option::is_none")]
3438    pub character_set: Option<String>,
3439    #[serde(default, skip_serializing_if = "Option::is_none")]
3440    pub is_token: Option<bool>,
3441    #[serde(default, skip_serializing_if = "Option::is_none")]
3442    pub owner: Option<i64>,
3443    #[serde(default, skip_serializing_if = "Option::is_none")]
3444    pub set_permissions: Option<SetPermissions>,
3445    #[serde(default, skip_serializing_if = "Option::is_none")]
3446    pub account_type: Option<i64>,
3447    #[doc = "The expiration date of the refresh token. "]
3448    #[serde(default, skip_serializing_if = "Option::is_none")]
3449    pub expiration: Option<chrono::DateTime<chrono::Utc>>,
3450}
3451
3452impl std::fmt::Display for MailAccountRequest {
3453    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3454        write!(
3455            f,
3456            "{}",
3457            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3458        )
3459    }
3460}
3461
3462#[cfg(feature = "tabled")]
3463impl tabled::Tabled for MailAccountRequest {
3464    const LENGTH: usize = 12;
3465    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3466        vec![
3467            self.name.clone().into(),
3468            self.imap_server.clone().into(),
3469            if let Some(imap_port) = &self.imap_port {
3470                format!("{imap_port:?}").into()
3471            } else {
3472                String::new().into()
3473            },
3474            if let Some(imap_security) = &self.imap_security {
3475                format!("{imap_security:?}").into()
3476            } else {
3477                String::new().into()
3478            },
3479            self.username.clone().into(),
3480            self.password.clone().into(),
3481            if let Some(character_set) = &self.character_set {
3482                format!("{character_set:?}").into()
3483            } else {
3484                String::new().into()
3485            },
3486            if let Some(is_token) = &self.is_token {
3487                format!("{is_token:?}").into()
3488            } else {
3489                String::new().into()
3490            },
3491            if let Some(owner) = &self.owner {
3492                format!("{owner:?}").into()
3493            } else {
3494                String::new().into()
3495            },
3496            if let Some(set_permissions) = &self.set_permissions {
3497                format!("{set_permissions:?}").into()
3498            } else {
3499                String::new().into()
3500            },
3501            if let Some(account_type) = &self.account_type {
3502                format!("{account_type:?}").into()
3503            } else {
3504                String::new().into()
3505            },
3506            if let Some(expiration) = &self.expiration {
3507                format!("{expiration:?}").into()
3508            } else {
3509                String::new().into()
3510            },
3511        ]
3512    }
3513
3514    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3515        vec![
3516            "name".into(),
3517            "imap_server".into(),
3518            "imap_port".into(),
3519            "imap_security".into(),
3520            "username".into(),
3521            "password".into(),
3522            "character_set".into(),
3523            "is_token".into(),
3524            "owner".into(),
3525            "set_permissions".into(),
3526            "account_type".into(),
3527            "expiration".into(),
3528        ]
3529    }
3530}
3531
3532#[derive(
3533    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3534)]
3535#[allow(non_snake_case)]
3536pub struct MailAccountTestResponse {
3537    pub success: bool,
3538}
3539
3540impl std::fmt::Display for MailAccountTestResponse {
3541    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3542        write!(
3543            f,
3544            "{}",
3545            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3546        )
3547    }
3548}
3549
3550#[cfg(feature = "tabled")]
3551impl tabled::Tabled for MailAccountTestResponse {
3552    const LENGTH: usize = 1;
3553    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3554        vec![format!("{:?}", self.success).into()]
3555    }
3556
3557    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3558        vec!["success".into()]
3559    }
3560}
3561
3562#[derive(
3563    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3564)]
3565#[allow(non_snake_case)]
3566pub struct MailRule {
3567    pub id: i64,
3568    pub name: String,
3569    pub account: i64,
3570    #[serde(default, skip_serializing_if = "Option::is_none")]
3571    pub enabled: Option<bool>,
3572    #[doc = "Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server."]
3573    #[serde(default, skip_serializing_if = "Option::is_none")]
3574    pub folder: Option<String>,
3575    #[serde(default, skip_serializing_if = "Option::is_none")]
3576    pub filter_from: Option<String>,
3577    #[serde(default, skip_serializing_if = "Option::is_none")]
3578    pub filter_to: Option<String>,
3579    #[serde(default, skip_serializing_if = "Option::is_none")]
3580    pub filter_subject: Option<String>,
3581    #[serde(default, skip_serializing_if = "Option::is_none")]
3582    pub filter_body: Option<String>,
3583    #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3584    #[serde(default, skip_serializing_if = "Option::is_none")]
3585    pub filter_attachment_filename_include: Option<String>,
3586    #[doc = "Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3587    #[serde(default, skip_serializing_if = "Option::is_none")]
3588    pub filter_attachment_filename_exclude: Option<String>,
3589    #[doc = "Specified in days."]
3590    #[serde(default, skip_serializing_if = "Option::is_none")]
3591    pub maximum_age: Option<i64>,
3592    #[serde(default, skip_serializing_if = "Option::is_none")]
3593    pub action: Option<i64>,
3594    #[serde(default, skip_serializing_if = "Option::is_none")]
3595    pub action_parameter: Option<String>,
3596    #[serde(default, skip_serializing_if = "Option::is_none")]
3597    pub assign_title_from: Option<i64>,
3598    #[serde(default, skip_serializing_if = "Option::is_none")]
3599    pub assign_tags: Option<Vec<Option<i64>>>,
3600    #[serde(default, skip_serializing_if = "Option::is_none")]
3601    pub assign_correspondent_from: Option<i64>,
3602    #[serde(default, skip_serializing_if = "Option::is_none")]
3603    pub assign_correspondent: Option<i64>,
3604    #[serde(default, skip_serializing_if = "Option::is_none")]
3605    pub assign_document_type: Option<i64>,
3606    #[serde(default, skip_serializing_if = "Option::is_none")]
3607    pub assign_owner_from_rule: Option<bool>,
3608    #[serde(default, skip_serializing_if = "Option::is_none")]
3609    pub order: Option<i64>,
3610    #[doc = "Inline attachments include embedded images, so it's best to combine this option with a filename filter.\n\n* `1` - Only process attachments.\n* `2` - Process all files, including 'inline' attachments."]
3611    #[serde(default, skip_serializing_if = "Option::is_none")]
3612    pub attachment_type: Option<i64>,
3613    #[serde(default, skip_serializing_if = "Option::is_none")]
3614    pub consumption_scope: Option<i64>,
3615    #[serde(default, skip_serializing_if = "Option::is_none")]
3616    pub pdf_layout: Option<i64>,
3617    #[serde(default, skip_serializing_if = "Option::is_none")]
3618    pub owner: Option<i64>,
3619    pub user_can_change: bool,
3620}
3621
3622impl std::fmt::Display for MailRule {
3623    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3624        write!(
3625            f,
3626            "{}",
3627            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3628        )
3629    }
3630}
3631
3632#[cfg(feature = "tabled")]
3633impl tabled::Tabled for MailRule {
3634    const LENGTH: usize = 26;
3635    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3636        vec![
3637            format!("{:?}", self.id).into(),
3638            self.name.clone().into(),
3639            format!("{:?}", self.account).into(),
3640            if let Some(enabled) = &self.enabled {
3641                format!("{enabled:?}").into()
3642            } else {
3643                String::new().into()
3644            },
3645            if let Some(folder) = &self.folder {
3646                format!("{folder:?}").into()
3647            } else {
3648                String::new().into()
3649            },
3650            if let Some(filter_from) = &self.filter_from {
3651                format!("{filter_from:?}").into()
3652            } else {
3653                String::new().into()
3654            },
3655            if let Some(filter_to) = &self.filter_to {
3656                format!("{filter_to:?}").into()
3657            } else {
3658                String::new().into()
3659            },
3660            if let Some(filter_subject) = &self.filter_subject {
3661                format!("{filter_subject:?}").into()
3662            } else {
3663                String::new().into()
3664            },
3665            if let Some(filter_body) = &self.filter_body {
3666                format!("{filter_body:?}").into()
3667            } else {
3668                String::new().into()
3669            },
3670            if let Some(filter_attachment_filename_include) =
3671                &self.filter_attachment_filename_include
3672            {
3673                format!("{filter_attachment_filename_include:?}").into()
3674            } else {
3675                String::new().into()
3676            },
3677            if let Some(filter_attachment_filename_exclude) =
3678                &self.filter_attachment_filename_exclude
3679            {
3680                format!("{filter_attachment_filename_exclude:?}").into()
3681            } else {
3682                String::new().into()
3683            },
3684            if let Some(maximum_age) = &self.maximum_age {
3685                format!("{maximum_age:?}").into()
3686            } else {
3687                String::new().into()
3688            },
3689            if let Some(action) = &self.action {
3690                format!("{action:?}").into()
3691            } else {
3692                String::new().into()
3693            },
3694            if let Some(action_parameter) = &self.action_parameter {
3695                format!("{action_parameter:?}").into()
3696            } else {
3697                String::new().into()
3698            },
3699            if let Some(assign_title_from) = &self.assign_title_from {
3700                format!("{assign_title_from:?}").into()
3701            } else {
3702                String::new().into()
3703            },
3704            if let Some(assign_tags) = &self.assign_tags {
3705                format!("{assign_tags:?}").into()
3706            } else {
3707                String::new().into()
3708            },
3709            if let Some(assign_correspondent_from) = &self.assign_correspondent_from {
3710                format!("{assign_correspondent_from:?}").into()
3711            } else {
3712                String::new().into()
3713            },
3714            if let Some(assign_correspondent) = &self.assign_correspondent {
3715                format!("{assign_correspondent:?}").into()
3716            } else {
3717                String::new().into()
3718            },
3719            if let Some(assign_document_type) = &self.assign_document_type {
3720                format!("{assign_document_type:?}").into()
3721            } else {
3722                String::new().into()
3723            },
3724            if let Some(assign_owner_from_rule) = &self.assign_owner_from_rule {
3725                format!("{assign_owner_from_rule:?}").into()
3726            } else {
3727                String::new().into()
3728            },
3729            if let Some(order) = &self.order {
3730                format!("{order:?}").into()
3731            } else {
3732                String::new().into()
3733            },
3734            if let Some(attachment_type) = &self.attachment_type {
3735                format!("{attachment_type:?}").into()
3736            } else {
3737                String::new().into()
3738            },
3739            if let Some(consumption_scope) = &self.consumption_scope {
3740                format!("{consumption_scope:?}").into()
3741            } else {
3742                String::new().into()
3743            },
3744            if let Some(pdf_layout) = &self.pdf_layout {
3745                format!("{pdf_layout:?}").into()
3746            } else {
3747                String::new().into()
3748            },
3749            if let Some(owner) = &self.owner {
3750                format!("{owner:?}").into()
3751            } else {
3752                String::new().into()
3753            },
3754            format!("{:?}", self.user_can_change).into(),
3755        ]
3756    }
3757
3758    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3759        vec![
3760            "id".into(),
3761            "name".into(),
3762            "account".into(),
3763            "enabled".into(),
3764            "folder".into(),
3765            "filter_from".into(),
3766            "filter_to".into(),
3767            "filter_subject".into(),
3768            "filter_body".into(),
3769            "filter_attachment_filename_include".into(),
3770            "filter_attachment_filename_exclude".into(),
3771            "maximum_age".into(),
3772            "action".into(),
3773            "action_parameter".into(),
3774            "assign_title_from".into(),
3775            "assign_tags".into(),
3776            "assign_correspondent_from".into(),
3777            "assign_correspondent".into(),
3778            "assign_document_type".into(),
3779            "assign_owner_from_rule".into(),
3780            "order".into(),
3781            "attachment_type".into(),
3782            "consumption_scope".into(),
3783            "pdf_layout".into(),
3784            "owner".into(),
3785            "user_can_change".into(),
3786        ]
3787    }
3788}
3789
3790#[derive(
3791    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3792)]
3793#[allow(non_snake_case)]
3794pub struct MailRuleRequest {
3795    pub name: String,
3796    pub account: i64,
3797    #[serde(default, skip_serializing_if = "Option::is_none")]
3798    pub enabled: Option<bool>,
3799    #[doc = "Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server."]
3800    #[serde(default, skip_serializing_if = "Option::is_none")]
3801    pub folder: Option<String>,
3802    #[serde(default, skip_serializing_if = "Option::is_none")]
3803    pub filter_from: Option<String>,
3804    #[serde(default, skip_serializing_if = "Option::is_none")]
3805    pub filter_to: Option<String>,
3806    #[serde(default, skip_serializing_if = "Option::is_none")]
3807    pub filter_subject: Option<String>,
3808    #[serde(default, skip_serializing_if = "Option::is_none")]
3809    pub filter_body: Option<String>,
3810    #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3811    #[serde(default, skip_serializing_if = "Option::is_none")]
3812    pub filter_attachment_filename_include: Option<String>,
3813    #[doc = "Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3814    #[serde(default, skip_serializing_if = "Option::is_none")]
3815    pub filter_attachment_filename_exclude: Option<String>,
3816    #[doc = "Specified in days."]
3817    #[serde(default, skip_serializing_if = "Option::is_none")]
3818    pub maximum_age: Option<i64>,
3819    #[serde(default, skip_serializing_if = "Option::is_none")]
3820    pub action: Option<i64>,
3821    #[serde(default, skip_serializing_if = "Option::is_none")]
3822    pub action_parameter: Option<String>,
3823    #[serde(default, skip_serializing_if = "Option::is_none")]
3824    pub assign_title_from: Option<i64>,
3825    #[serde(default, skip_serializing_if = "Option::is_none")]
3826    pub assign_tags: Option<Vec<Option<i64>>>,
3827    #[serde(default, skip_serializing_if = "Option::is_none")]
3828    pub assign_correspondent_from: Option<i64>,
3829    #[serde(default, skip_serializing_if = "Option::is_none")]
3830    pub assign_correspondent: Option<i64>,
3831    #[serde(default, skip_serializing_if = "Option::is_none")]
3832    pub assign_document_type: Option<i64>,
3833    #[serde(default, skip_serializing_if = "Option::is_none")]
3834    pub assign_owner_from_rule: Option<bool>,
3835    #[serde(default, skip_serializing_if = "Option::is_none")]
3836    pub order: Option<i64>,
3837    #[doc = "Inline attachments include embedded images, so it's best to combine this option with a filename filter.\n\n* `1` - Only process attachments.\n* `2` - Process all files, including 'inline' attachments."]
3838    #[serde(default, skip_serializing_if = "Option::is_none")]
3839    pub attachment_type: Option<i64>,
3840    #[serde(default, skip_serializing_if = "Option::is_none")]
3841    pub consumption_scope: Option<i64>,
3842    #[serde(default, skip_serializing_if = "Option::is_none")]
3843    pub pdf_layout: Option<i64>,
3844    #[serde(default, skip_serializing_if = "Option::is_none")]
3845    pub owner: Option<i64>,
3846    #[serde(default, skip_serializing_if = "Option::is_none")]
3847    pub set_permissions: Option<SetPermissions>,
3848}
3849
3850impl std::fmt::Display for MailRuleRequest {
3851    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3852        write!(
3853            f,
3854            "{}",
3855            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3856        )
3857    }
3858}
3859
3860#[cfg(feature = "tabled")]
3861impl tabled::Tabled for MailRuleRequest {
3862    const LENGTH: usize = 25;
3863    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3864        vec![
3865            self.name.clone().into(),
3866            format!("{:?}", self.account).into(),
3867            if let Some(enabled) = &self.enabled {
3868                format!("{enabled:?}").into()
3869            } else {
3870                String::new().into()
3871            },
3872            if let Some(folder) = &self.folder {
3873                format!("{folder:?}").into()
3874            } else {
3875                String::new().into()
3876            },
3877            if let Some(filter_from) = &self.filter_from {
3878                format!("{filter_from:?}").into()
3879            } else {
3880                String::new().into()
3881            },
3882            if let Some(filter_to) = &self.filter_to {
3883                format!("{filter_to:?}").into()
3884            } else {
3885                String::new().into()
3886            },
3887            if let Some(filter_subject) = &self.filter_subject {
3888                format!("{filter_subject:?}").into()
3889            } else {
3890                String::new().into()
3891            },
3892            if let Some(filter_body) = &self.filter_body {
3893                format!("{filter_body:?}").into()
3894            } else {
3895                String::new().into()
3896            },
3897            if let Some(filter_attachment_filename_include) =
3898                &self.filter_attachment_filename_include
3899            {
3900                format!("{filter_attachment_filename_include:?}").into()
3901            } else {
3902                String::new().into()
3903            },
3904            if let Some(filter_attachment_filename_exclude) =
3905                &self.filter_attachment_filename_exclude
3906            {
3907                format!("{filter_attachment_filename_exclude:?}").into()
3908            } else {
3909                String::new().into()
3910            },
3911            if let Some(maximum_age) = &self.maximum_age {
3912                format!("{maximum_age:?}").into()
3913            } else {
3914                String::new().into()
3915            },
3916            if let Some(action) = &self.action {
3917                format!("{action:?}").into()
3918            } else {
3919                String::new().into()
3920            },
3921            if let Some(action_parameter) = &self.action_parameter {
3922                format!("{action_parameter:?}").into()
3923            } else {
3924                String::new().into()
3925            },
3926            if let Some(assign_title_from) = &self.assign_title_from {
3927                format!("{assign_title_from:?}").into()
3928            } else {
3929                String::new().into()
3930            },
3931            if let Some(assign_tags) = &self.assign_tags {
3932                format!("{assign_tags:?}").into()
3933            } else {
3934                String::new().into()
3935            },
3936            if let Some(assign_correspondent_from) = &self.assign_correspondent_from {
3937                format!("{assign_correspondent_from:?}").into()
3938            } else {
3939                String::new().into()
3940            },
3941            if let Some(assign_correspondent) = &self.assign_correspondent {
3942                format!("{assign_correspondent:?}").into()
3943            } else {
3944                String::new().into()
3945            },
3946            if let Some(assign_document_type) = &self.assign_document_type {
3947                format!("{assign_document_type:?}").into()
3948            } else {
3949                String::new().into()
3950            },
3951            if let Some(assign_owner_from_rule) = &self.assign_owner_from_rule {
3952                format!("{assign_owner_from_rule:?}").into()
3953            } else {
3954                String::new().into()
3955            },
3956            if let Some(order) = &self.order {
3957                format!("{order:?}").into()
3958            } else {
3959                String::new().into()
3960            },
3961            if let Some(attachment_type) = &self.attachment_type {
3962                format!("{attachment_type:?}").into()
3963            } else {
3964                String::new().into()
3965            },
3966            if let Some(consumption_scope) = &self.consumption_scope {
3967                format!("{consumption_scope:?}").into()
3968            } else {
3969                String::new().into()
3970            },
3971            if let Some(pdf_layout) = &self.pdf_layout {
3972                format!("{pdf_layout:?}").into()
3973            } else {
3974                String::new().into()
3975            },
3976            if let Some(owner) = &self.owner {
3977                format!("{owner:?}").into()
3978            } else {
3979                String::new().into()
3980            },
3981            if let Some(set_permissions) = &self.set_permissions {
3982                format!("{set_permissions:?}").into()
3983            } else {
3984                String::new().into()
3985            },
3986        ]
3987    }
3988
3989    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3990        vec![
3991            "name".into(),
3992            "account".into(),
3993            "enabled".into(),
3994            "folder".into(),
3995            "filter_from".into(),
3996            "filter_to".into(),
3997            "filter_subject".into(),
3998            "filter_body".into(),
3999            "filter_attachment_filename_include".into(),
4000            "filter_attachment_filename_exclude".into(),
4001            "maximum_age".into(),
4002            "action".into(),
4003            "action_parameter".into(),
4004            "assign_title_from".into(),
4005            "assign_tags".into(),
4006            "assign_correspondent_from".into(),
4007            "assign_correspondent".into(),
4008            "assign_document_type".into(),
4009            "assign_owner_from_rule".into(),
4010            "order".into(),
4011            "attachment_type".into(),
4012            "consumption_scope".into(),
4013            "pdf_layout".into(),
4014            "owner".into(),
4015            "set_permissions".into(),
4016        ]
4017    }
4018}
4019
4020#[derive(
4021    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4022)]
4023#[allow(non_snake_case)]
4024pub struct Metadata {
4025    pub original_checksum: String,
4026    pub original_size: i64,
4027    pub original_mime_type: String,
4028    pub media_filename: String,
4029    pub has_archive_version: bool,
4030    pub original_metadata: std::collections::HashMap<String, serde_json::Value>,
4031    pub archive_checksum: String,
4032    pub archive_media_filename: String,
4033    pub original_filename: String,
4034    pub archive_size: i64,
4035    pub archive_metadata: std::collections::HashMap<String, serde_json::Value>,
4036    pub lang: String,
4037}
4038
4039impl std::fmt::Display for Metadata {
4040    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4041        write!(
4042            f,
4043            "{}",
4044            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4045        )
4046    }
4047}
4048
4049#[cfg(feature = "tabled")]
4050impl tabled::Tabled for Metadata {
4051    const LENGTH: usize = 12;
4052    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4053        vec![
4054            self.original_checksum.clone().into(),
4055            format!("{:?}", self.original_size).into(),
4056            self.original_mime_type.clone().into(),
4057            self.media_filename.clone().into(),
4058            format!("{:?}", self.has_archive_version).into(),
4059            format!("{:?}", self.original_metadata).into(),
4060            self.archive_checksum.clone().into(),
4061            self.archive_media_filename.clone().into(),
4062            self.original_filename.clone().into(),
4063            format!("{:?}", self.archive_size).into(),
4064            format!("{:?}", self.archive_metadata).into(),
4065            self.lang.clone().into(),
4066        ]
4067    }
4068
4069    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4070        vec![
4071            "original_checksum".into(),
4072            "original_size".into(),
4073            "original_mime_type".into(),
4074            "media_filename".into(),
4075            "has_archive_version".into(),
4076            "original_metadata".into(),
4077            "archive_checksum".into(),
4078            "archive_media_filename".into(),
4079            "original_filename".into(),
4080            "archive_size".into(),
4081            "archive_metadata".into(),
4082            "lang".into(),
4083        ]
4084    }
4085}
4086
4087#[doc = "* `set_correspondent` - set_correspondent\n* `set_document_type` - set_document_type\n* `set_storage_path` - set_storage_path\n* `add_tag` - add_tag\n* `remove_tag` - remove_tag\n* `modify_tags` - modify_tags\n* `modify_custom_fields` - modify_custom_fields\n* `delete` - delete\n* `reprocess` - reprocess\n* `set_permissions` - set_permissions\n* `rotate` - rotate\n* `merge` - merge\n* `split` - split\n* `delete_pages` - delete_pages\n* `edit_pdf` - edit_pdf"]
4088#[derive(
4089    serde :: Serialize,
4090    serde :: Deserialize,
4091    PartialEq,
4092    Hash,
4093    Debug,
4094    Clone,
4095    schemars :: JsonSchema,
4096    parse_display :: FromStr,
4097    parse_display :: Display,
4098)]
4099#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4100#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4101pub enum MethodEnum {
4102    #[serde(rename = "set_correspondent")]
4103    #[display("set_correspondent")]
4104    SetCorrespondent,
4105    #[serde(rename = "set_document_type")]
4106    #[display("set_document_type")]
4107    SetDocumentType,
4108    #[serde(rename = "set_storage_path")]
4109    #[display("set_storage_path")]
4110    SetStoragePath,
4111    #[serde(rename = "add_tag")]
4112    #[display("add_tag")]
4113    AddTag,
4114    #[serde(rename = "remove_tag")]
4115    #[display("remove_tag")]
4116    RemoveTag,
4117    #[serde(rename = "modify_tags")]
4118    #[display("modify_tags")]
4119    ModifyTags,
4120    #[serde(rename = "modify_custom_fields")]
4121    #[display("modify_custom_fields")]
4122    ModifyCustomFields,
4123    #[serde(rename = "delete")]
4124    #[display("delete")]
4125    Delete,
4126    #[serde(rename = "reprocess")]
4127    #[display("reprocess")]
4128    Reprocess,
4129    #[serde(rename = "set_permissions")]
4130    #[display("set_permissions")]
4131    SetPermissions,
4132    #[serde(rename = "rotate")]
4133    #[display("rotate")]
4134    Rotate,
4135    #[serde(rename = "merge")]
4136    #[display("merge")]
4137    Merge,
4138    #[serde(rename = "split")]
4139    #[display("split")]
4140    Split,
4141    #[serde(rename = "delete_pages")]
4142    #[display("delete_pages")]
4143    DeletePages,
4144    #[serde(rename = "edit_pdf")]
4145    #[display("edit_pdf")]
4146    EditPdf,
4147}
4148
4149#[derive(
4150    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4151)]
4152#[allow(non_snake_case)]
4153pub struct MigrationStatus {
4154    pub latest_migration: String,
4155    pub unapplied_migrations: Vec<String>,
4156}
4157
4158impl std::fmt::Display for MigrationStatus {
4159    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4160        write!(
4161            f,
4162            "{}",
4163            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4164        )
4165    }
4166}
4167
4168#[cfg(feature = "tabled")]
4169impl tabled::Tabled for MigrationStatus {
4170    const LENGTH: usize = 2;
4171    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4172        vec![
4173            self.latest_migration.clone().into(),
4174            format!("{:?}", self.unapplied_migrations).into(),
4175        ]
4176    }
4177
4178    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4179        vec!["latest_migration".into(), "unapplied_migrations".into()]
4180    }
4181}
4182
4183#[doc = "* `skip` - skip\n* `redo` - redo\n* `force` - force\n* `skip_noarchive` - skip_noarchive"]
4184#[derive(
4185    serde :: Serialize,
4186    serde :: Deserialize,
4187    PartialEq,
4188    Hash,
4189    Debug,
4190    Clone,
4191    schemars :: JsonSchema,
4192    parse_display :: FromStr,
4193    parse_display :: Display,
4194)]
4195#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4196#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4197pub enum ModeEnum {
4198    #[serde(rename = "skip")]
4199    #[display("skip")]
4200    Skip,
4201    #[serde(rename = "redo")]
4202    #[display("redo")]
4203    Redo,
4204    #[serde(rename = "force")]
4205    #[display("force")]
4206    Force,
4207    #[serde(rename = "skip_noarchive")]
4208    #[display("skip_noarchive")]
4209    SkipNoarchive,
4210    #[serde(rename = "")]
4211    #[display("")]
4212    Empty,
4213}
4214
4215#[derive(
4216    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4217)]
4218#[allow(non_snake_case)]
4219pub struct NoteCreateRequestRequest {
4220    pub note: String,
4221}
4222
4223impl std::fmt::Display for NoteCreateRequestRequest {
4224    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4225        write!(
4226            f,
4227            "{}",
4228            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4229        )
4230    }
4231}
4232
4233#[cfg(feature = "tabled")]
4234impl tabled::Tabled for NoteCreateRequestRequest {
4235    const LENGTH: usize = 1;
4236    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4237        vec![self.note.clone().into()]
4238    }
4239
4240    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4241        vec!["note".into()]
4242    }
4243}
4244
4245#[derive(
4246    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4247)]
4248#[allow(non_snake_case)]
4249pub struct Notes {
4250    pub id: i64,
4251    #[doc = "Note for the document"]
4252    #[serde(default, skip_serializing_if = "Option::is_none")]
4253    pub note: Option<String>,
4254    #[serde(default, skip_serializing_if = "Option::is_none")]
4255    pub created: Option<chrono::DateTime<chrono::Utc>>,
4256    pub user: BasicUser,
4257}
4258
4259impl std::fmt::Display for Notes {
4260    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4261        write!(
4262            f,
4263            "{}",
4264            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4265        )
4266    }
4267}
4268
4269#[cfg(feature = "tabled")]
4270impl tabled::Tabled for Notes {
4271    const LENGTH: usize = 4;
4272    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4273        vec![
4274            format!("{:?}", self.id).into(),
4275            if let Some(note) = &self.note {
4276                format!("{note:?}").into()
4277            } else {
4278                String::new().into()
4279            },
4280            if let Some(created) = &self.created {
4281                format!("{created:?}").into()
4282            } else {
4283                String::new().into()
4284            },
4285            format!("{:?}", self.user).into(),
4286        ]
4287    }
4288
4289    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4290        vec!["id".into(), "note".into(), "created".into(), "user".into()]
4291    }
4292}
4293
4294#[derive(
4295    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4296)]
4297#[allow(non_snake_case)]
4298pub struct NotesRequest {
4299    #[doc = "Note for the document"]
4300    #[serde(default, skip_serializing_if = "Option::is_none")]
4301    pub note: Option<String>,
4302    #[serde(default, skip_serializing_if = "Option::is_none")]
4303    pub created: Option<chrono::DateTime<chrono::Utc>>,
4304}
4305
4306impl std::fmt::Display for NotesRequest {
4307    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4308        write!(
4309            f,
4310            "{}",
4311            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4312        )
4313    }
4314}
4315
4316#[cfg(feature = "tabled")]
4317impl tabled::Tabled for NotesRequest {
4318    const LENGTH: usize = 2;
4319    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4320        vec![
4321            if let Some(note) = &self.note {
4322                format!("{note:?}").into()
4323            } else {
4324                String::new().into()
4325            },
4326            if let Some(created) = &self.created {
4327                format!("{created:?}").into()
4328            } else {
4329                String::new().into()
4330            },
4331        ]
4332    }
4333
4334    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4335        vec!["note".into(), "created".into()]
4336    }
4337}
4338
4339#[doc = "* `tags` - tags\n* `correspondents` - correspondents\n* `document_types` - document_types\n* `storage_paths` - storage_paths"]
4340#[derive(
4341    serde :: Serialize,
4342    serde :: Deserialize,
4343    PartialEq,
4344    Hash,
4345    Debug,
4346    Clone,
4347    schemars :: JsonSchema,
4348    parse_display :: FromStr,
4349    parse_display :: Display,
4350)]
4351#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4352#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4353pub enum ObjectTypeEnum {
4354    #[serde(rename = "tags")]
4355    #[display("tags")]
4356    Tags,
4357    #[serde(rename = "correspondents")]
4358    #[display("correspondents")]
4359    Correspondents,
4360    #[serde(rename = "document_types")]
4361    #[display("document_types")]
4362    DocumentTypes,
4363    #[serde(rename = "storage_paths")]
4364    #[display("storage_paths")]
4365    StoragePaths,
4366}
4367
4368#[doc = "* `set_permissions` - set_permissions\n* `delete` - delete"]
4369#[derive(
4370    serde :: Serialize,
4371    serde :: Deserialize,
4372    PartialEq,
4373    Hash,
4374    Debug,
4375    Clone,
4376    schemars :: JsonSchema,
4377    parse_display :: FromStr,
4378    parse_display :: Display,
4379)]
4380#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4381#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4382pub enum OperationEnum {
4383    #[serde(rename = "set_permissions")]
4384    #[display("set_permissions")]
4385    SetPermissions,
4386    #[serde(rename = "delete")]
4387    #[display("delete")]
4388    Delete,
4389}
4390
4391#[doc = "* `pdf` - pdf\n* `pdfa` - pdfa\n* `pdfa-1` - pdfa-1\n* `pdfa-2` - pdfa-2\n* `pdfa-3` - pdfa-3"]
4392#[derive(
4393    serde :: Serialize,
4394    serde :: Deserialize,
4395    PartialEq,
4396    Hash,
4397    Debug,
4398    Clone,
4399    schemars :: JsonSchema,
4400    parse_display :: FromStr,
4401    parse_display :: Display,
4402)]
4403#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4404#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4405pub enum OutputTypeEnum {
4406    #[serde(rename = "pdf")]
4407    #[display("pdf")]
4408    Pdf,
4409    #[serde(rename = "pdfa")]
4410    #[display("pdfa")]
4411    Pdfa,
4412    #[serde(rename = "pdfa-1")]
4413    #[display("pdfa-1")]
4414    Pdfa1,
4415    #[serde(rename = "pdfa-2")]
4416    #[display("pdfa-2")]
4417    Pdfa2,
4418    #[serde(rename = "pdfa-3")]
4419    #[display("pdfa-3")]
4420    Pdfa3,
4421    #[serde(rename = "")]
4422    #[display("")]
4423    Empty,
4424}
4425
4426#[derive(
4427    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4428)]
4429#[allow(non_snake_case)]
4430pub struct PaginatedCorrespondentList {
4431    pub count: i64,
4432    #[serde(default, skip_serializing_if = "Option::is_none")]
4433    pub next: Option<String>,
4434    #[serde(default, skip_serializing_if = "Option::is_none")]
4435    pub previous: Option<String>,
4436    pub results: Vec<Correspondent>,
4437    #[serde(default, skip_serializing_if = "Option::is_none")]
4438    pub all: Option<Vec<i64>>,
4439}
4440
4441impl std::fmt::Display for PaginatedCorrespondentList {
4442    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4443        write!(
4444            f,
4445            "{}",
4446            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4447        )
4448    }
4449}
4450
4451#[cfg(feature = "requests")]
4452impl crate::types::paginate::Pagination for PaginatedCorrespondentList {
4453    type Item = Correspondent;
4454    fn has_more_pages(&self) -> bool {
4455        self.next.is_some()
4456    }
4457
4458    fn next_page_token(&self) -> Option<String> {
4459        self.next.clone()
4460    }
4461
4462    fn next_page(
4463        &self,
4464        req: reqwest::Request,
4465    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4466        let mut req = req.try_clone().ok_or_else(|| {
4467            crate::types::error::Error::InvalidRequest(format!(
4468                "failed to clone request: {req:?}"
4469            ))
4470        })?;
4471        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4472            crate::types::error::Error::InvalidRequest(format!(
4473                "failed to parse url: {:?}",
4474                self.next
4475            ))
4476        })?;
4477        Ok(req)
4478    }
4479
4480    fn items(&self) -> Vec<Self::Item> {
4481        self.results.clone()
4482    }
4483}
4484
4485#[cfg(feature = "tabled")]
4486impl tabled::Tabled for PaginatedCorrespondentList {
4487    const LENGTH: usize = 5;
4488    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4489        vec![
4490            format!("{:?}", self.count).into(),
4491            if let Some(next) = &self.next {
4492                format!("{next:?}").into()
4493            } else {
4494                String::new().into()
4495            },
4496            if let Some(previous) = &self.previous {
4497                format!("{previous:?}").into()
4498            } else {
4499                String::new().into()
4500            },
4501            format!("{:?}", self.results).into(),
4502            if let Some(all) = &self.all {
4503                format!("{all:?}").into()
4504            } else {
4505                String::new().into()
4506            },
4507        ]
4508    }
4509
4510    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4511        vec![
4512            "count".into(),
4513            "next".into(),
4514            "previous".into(),
4515            "results".into(),
4516            "all".into(),
4517        ]
4518    }
4519}
4520
4521#[derive(
4522    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4523)]
4524#[allow(non_snake_case)]
4525pub struct PaginatedCustomFieldList {
4526    pub count: i64,
4527    #[serde(default, skip_serializing_if = "Option::is_none")]
4528    pub next: Option<String>,
4529    #[serde(default, skip_serializing_if = "Option::is_none")]
4530    pub previous: Option<String>,
4531    pub results: Vec<CustomField>,
4532    #[serde(default, skip_serializing_if = "Option::is_none")]
4533    pub all: Option<Vec<i64>>,
4534}
4535
4536impl std::fmt::Display for PaginatedCustomFieldList {
4537    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4538        write!(
4539            f,
4540            "{}",
4541            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4542        )
4543    }
4544}
4545
4546#[cfg(feature = "requests")]
4547impl crate::types::paginate::Pagination for PaginatedCustomFieldList {
4548    type Item = CustomField;
4549    fn has_more_pages(&self) -> bool {
4550        self.next.is_some()
4551    }
4552
4553    fn next_page_token(&self) -> Option<String> {
4554        self.next.clone()
4555    }
4556
4557    fn next_page(
4558        &self,
4559        req: reqwest::Request,
4560    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4561        let mut req = req.try_clone().ok_or_else(|| {
4562            crate::types::error::Error::InvalidRequest(format!(
4563                "failed to clone request: {req:?}"
4564            ))
4565        })?;
4566        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4567            crate::types::error::Error::InvalidRequest(format!(
4568                "failed to parse url: {:?}",
4569                self.next
4570            ))
4571        })?;
4572        Ok(req)
4573    }
4574
4575    fn items(&self) -> Vec<Self::Item> {
4576        self.results.clone()
4577    }
4578}
4579
4580#[cfg(feature = "tabled")]
4581impl tabled::Tabled for PaginatedCustomFieldList {
4582    const LENGTH: usize = 5;
4583    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4584        vec![
4585            format!("{:?}", self.count).into(),
4586            if let Some(next) = &self.next {
4587                format!("{next:?}").into()
4588            } else {
4589                String::new().into()
4590            },
4591            if let Some(previous) = &self.previous {
4592                format!("{previous:?}").into()
4593            } else {
4594                String::new().into()
4595            },
4596            format!("{:?}", self.results).into(),
4597            if let Some(all) = &self.all {
4598                format!("{all:?}").into()
4599            } else {
4600                String::new().into()
4601            },
4602        ]
4603    }
4604
4605    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4606        vec![
4607            "count".into(),
4608            "next".into(),
4609            "previous".into(),
4610            "results".into(),
4611            "all".into(),
4612        ]
4613    }
4614}
4615
4616#[derive(
4617    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4618)]
4619#[allow(non_snake_case)]
4620pub struct PaginatedDocumentList {
4621    pub count: i64,
4622    #[serde(default, skip_serializing_if = "Option::is_none")]
4623    pub next: Option<String>,
4624    #[serde(default, skip_serializing_if = "Option::is_none")]
4625    pub previous: Option<String>,
4626    pub results: Vec<Document>,
4627    #[serde(default, skip_serializing_if = "Option::is_none")]
4628    pub all: Option<Vec<i64>>,
4629}
4630
4631impl std::fmt::Display for PaginatedDocumentList {
4632    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4633        write!(
4634            f,
4635            "{}",
4636            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4637        )
4638    }
4639}
4640
4641#[cfg(feature = "requests")]
4642impl crate::types::paginate::Pagination for PaginatedDocumentList {
4643    type Item = Document;
4644    fn has_more_pages(&self) -> bool {
4645        self.next.is_some()
4646    }
4647
4648    fn next_page_token(&self) -> Option<String> {
4649        self.next.clone()
4650    }
4651
4652    fn next_page(
4653        &self,
4654        req: reqwest::Request,
4655    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4656        let mut req = req.try_clone().ok_or_else(|| {
4657            crate::types::error::Error::InvalidRequest(format!(
4658                "failed to clone request: {req:?}"
4659            ))
4660        })?;
4661        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4662            crate::types::error::Error::InvalidRequest(format!(
4663                "failed to parse url: {:?}",
4664                self.next
4665            ))
4666        })?;
4667        Ok(req)
4668    }
4669
4670    fn items(&self) -> Vec<Self::Item> {
4671        self.results.clone()
4672    }
4673}
4674
4675#[cfg(feature = "tabled")]
4676impl tabled::Tabled for PaginatedDocumentList {
4677    const LENGTH: usize = 5;
4678    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4679        vec![
4680            format!("{:?}", self.count).into(),
4681            if let Some(next) = &self.next {
4682                format!("{next:?}").into()
4683            } else {
4684                String::new().into()
4685            },
4686            if let Some(previous) = &self.previous {
4687                format!("{previous:?}").into()
4688            } else {
4689                String::new().into()
4690            },
4691            format!("{:?}", self.results).into(),
4692            if let Some(all) = &self.all {
4693                format!("{all:?}").into()
4694            } else {
4695                String::new().into()
4696            },
4697        ]
4698    }
4699
4700    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4701        vec![
4702            "count".into(),
4703            "next".into(),
4704            "previous".into(),
4705            "results".into(),
4706            "all".into(),
4707        ]
4708    }
4709}
4710
4711#[derive(
4712    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4713)]
4714#[allow(non_snake_case)]
4715pub struct PaginatedDocumentTypeList {
4716    pub count: i64,
4717    #[serde(default, skip_serializing_if = "Option::is_none")]
4718    pub next: Option<String>,
4719    #[serde(default, skip_serializing_if = "Option::is_none")]
4720    pub previous: Option<String>,
4721    pub results: Vec<DocumentType>,
4722    #[serde(default, skip_serializing_if = "Option::is_none")]
4723    pub all: Option<Vec<i64>>,
4724}
4725
4726impl std::fmt::Display for PaginatedDocumentTypeList {
4727    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4728        write!(
4729            f,
4730            "{}",
4731            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4732        )
4733    }
4734}
4735
4736#[cfg(feature = "requests")]
4737impl crate::types::paginate::Pagination for PaginatedDocumentTypeList {
4738    type Item = DocumentType;
4739    fn has_more_pages(&self) -> bool {
4740        self.next.is_some()
4741    }
4742
4743    fn next_page_token(&self) -> Option<String> {
4744        self.next.clone()
4745    }
4746
4747    fn next_page(
4748        &self,
4749        req: reqwest::Request,
4750    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4751        let mut req = req.try_clone().ok_or_else(|| {
4752            crate::types::error::Error::InvalidRequest(format!(
4753                "failed to clone request: {req:?}"
4754            ))
4755        })?;
4756        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4757            crate::types::error::Error::InvalidRequest(format!(
4758                "failed to parse url: {:?}",
4759                self.next
4760            ))
4761        })?;
4762        Ok(req)
4763    }
4764
4765    fn items(&self) -> Vec<Self::Item> {
4766        self.results.clone()
4767    }
4768}
4769
4770#[cfg(feature = "tabled")]
4771impl tabled::Tabled for PaginatedDocumentTypeList {
4772    const LENGTH: usize = 5;
4773    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4774        vec![
4775            format!("{:?}", self.count).into(),
4776            if let Some(next) = &self.next {
4777                format!("{next:?}").into()
4778            } else {
4779                String::new().into()
4780            },
4781            if let Some(previous) = &self.previous {
4782                format!("{previous:?}").into()
4783            } else {
4784                String::new().into()
4785            },
4786            format!("{:?}", self.results).into(),
4787            if let Some(all) = &self.all {
4788                format!("{all:?}").into()
4789            } else {
4790                String::new().into()
4791            },
4792        ]
4793    }
4794
4795    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4796        vec![
4797            "count".into(),
4798            "next".into(),
4799            "previous".into(),
4800            "results".into(),
4801            "all".into(),
4802        ]
4803    }
4804}
4805
4806#[derive(
4807    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4808)]
4809#[allow(non_snake_case)]
4810pub struct PaginatedGroupList {
4811    pub count: i64,
4812    #[serde(default, skip_serializing_if = "Option::is_none")]
4813    pub next: Option<String>,
4814    #[serde(default, skip_serializing_if = "Option::is_none")]
4815    pub previous: Option<String>,
4816    pub results: Vec<Group>,
4817    #[serde(default, skip_serializing_if = "Option::is_none")]
4818    pub all: Option<Vec<i64>>,
4819}
4820
4821impl std::fmt::Display for PaginatedGroupList {
4822    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4823        write!(
4824            f,
4825            "{}",
4826            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4827        )
4828    }
4829}
4830
4831#[cfg(feature = "requests")]
4832impl crate::types::paginate::Pagination for PaginatedGroupList {
4833    type Item = Group;
4834    fn has_more_pages(&self) -> bool {
4835        self.next.is_some()
4836    }
4837
4838    fn next_page_token(&self) -> Option<String> {
4839        self.next.clone()
4840    }
4841
4842    fn next_page(
4843        &self,
4844        req: reqwest::Request,
4845    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4846        let mut req = req.try_clone().ok_or_else(|| {
4847            crate::types::error::Error::InvalidRequest(format!(
4848                "failed to clone request: {req:?}"
4849            ))
4850        })?;
4851        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4852            crate::types::error::Error::InvalidRequest(format!(
4853                "failed to parse url: {:?}",
4854                self.next
4855            ))
4856        })?;
4857        Ok(req)
4858    }
4859
4860    fn items(&self) -> Vec<Self::Item> {
4861        self.results.clone()
4862    }
4863}
4864
4865#[cfg(feature = "tabled")]
4866impl tabled::Tabled for PaginatedGroupList {
4867    const LENGTH: usize = 5;
4868    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4869        vec![
4870            format!("{:?}", self.count).into(),
4871            if let Some(next) = &self.next {
4872                format!("{next:?}").into()
4873            } else {
4874                String::new().into()
4875            },
4876            if let Some(previous) = &self.previous {
4877                format!("{previous:?}").into()
4878            } else {
4879                String::new().into()
4880            },
4881            format!("{:?}", self.results).into(),
4882            if let Some(all) = &self.all {
4883                format!("{all:?}").into()
4884            } else {
4885                String::new().into()
4886            },
4887        ]
4888    }
4889
4890    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4891        vec![
4892            "count".into(),
4893            "next".into(),
4894            "previous".into(),
4895            "results".into(),
4896            "all".into(),
4897        ]
4898    }
4899}
4900
4901#[derive(
4902    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4903)]
4904#[allow(non_snake_case)]
4905pub struct PaginatedLogEntryList {
4906    pub count: i64,
4907    #[serde(default, skip_serializing_if = "Option::is_none")]
4908    pub next: Option<String>,
4909    #[serde(default, skip_serializing_if = "Option::is_none")]
4910    pub previous: Option<String>,
4911    pub results: Vec<LogEntry>,
4912    #[serde(default, skip_serializing_if = "Option::is_none")]
4913    pub all: Option<Vec<i64>>,
4914}
4915
4916impl std::fmt::Display for PaginatedLogEntryList {
4917    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4918        write!(
4919            f,
4920            "{}",
4921            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4922        )
4923    }
4924}
4925
4926#[cfg(feature = "requests")]
4927impl crate::types::paginate::Pagination for PaginatedLogEntryList {
4928    type Item = LogEntry;
4929    fn has_more_pages(&self) -> bool {
4930        self.next.is_some()
4931    }
4932
4933    fn next_page_token(&self) -> Option<String> {
4934        self.next.clone()
4935    }
4936
4937    fn next_page(
4938        &self,
4939        req: reqwest::Request,
4940    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4941        let mut req = req.try_clone().ok_or_else(|| {
4942            crate::types::error::Error::InvalidRequest(format!(
4943                "failed to clone request: {req:?}"
4944            ))
4945        })?;
4946        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4947            crate::types::error::Error::InvalidRequest(format!(
4948                "failed to parse url: {:?}",
4949                self.next
4950            ))
4951        })?;
4952        Ok(req)
4953    }
4954
4955    fn items(&self) -> Vec<Self::Item> {
4956        self.results.clone()
4957    }
4958}
4959
4960#[cfg(feature = "tabled")]
4961impl tabled::Tabled for PaginatedLogEntryList {
4962    const LENGTH: usize = 5;
4963    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4964        vec![
4965            format!("{:?}", self.count).into(),
4966            if let Some(next) = &self.next {
4967                format!("{next:?}").into()
4968            } else {
4969                String::new().into()
4970            },
4971            if let Some(previous) = &self.previous {
4972                format!("{previous:?}").into()
4973            } else {
4974                String::new().into()
4975            },
4976            format!("{:?}", self.results).into(),
4977            if let Some(all) = &self.all {
4978                format!("{all:?}").into()
4979            } else {
4980                String::new().into()
4981            },
4982        ]
4983    }
4984
4985    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4986        vec![
4987            "count".into(),
4988            "next".into(),
4989            "previous".into(),
4990            "results".into(),
4991            "all".into(),
4992        ]
4993    }
4994}
4995
4996#[derive(
4997    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4998)]
4999#[allow(non_snake_case)]
5000pub struct PaginatedMailAccountList {
5001    pub count: i64,
5002    #[serde(default, skip_serializing_if = "Option::is_none")]
5003    pub next: Option<String>,
5004    #[serde(default, skip_serializing_if = "Option::is_none")]
5005    pub previous: Option<String>,
5006    pub results: Vec<MailAccount>,
5007    #[serde(default, skip_serializing_if = "Option::is_none")]
5008    pub all: Option<Vec<i64>>,
5009}
5010
5011impl std::fmt::Display for PaginatedMailAccountList {
5012    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5013        write!(
5014            f,
5015            "{}",
5016            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5017        )
5018    }
5019}
5020
5021#[cfg(feature = "requests")]
5022impl crate::types::paginate::Pagination for PaginatedMailAccountList {
5023    type Item = MailAccount;
5024    fn has_more_pages(&self) -> bool {
5025        self.next.is_some()
5026    }
5027
5028    fn next_page_token(&self) -> Option<String> {
5029        self.next.clone()
5030    }
5031
5032    fn next_page(
5033        &self,
5034        req: reqwest::Request,
5035    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5036        let mut req = req.try_clone().ok_or_else(|| {
5037            crate::types::error::Error::InvalidRequest(format!(
5038                "failed to clone request: {req:?}"
5039            ))
5040        })?;
5041        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5042            crate::types::error::Error::InvalidRequest(format!(
5043                "failed to parse url: {:?}",
5044                self.next
5045            ))
5046        })?;
5047        Ok(req)
5048    }
5049
5050    fn items(&self) -> Vec<Self::Item> {
5051        self.results.clone()
5052    }
5053}
5054
5055#[cfg(feature = "tabled")]
5056impl tabled::Tabled for PaginatedMailAccountList {
5057    const LENGTH: usize = 5;
5058    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5059        vec![
5060            format!("{:?}", self.count).into(),
5061            if let Some(next) = &self.next {
5062                format!("{next:?}").into()
5063            } else {
5064                String::new().into()
5065            },
5066            if let Some(previous) = &self.previous {
5067                format!("{previous:?}").into()
5068            } else {
5069                String::new().into()
5070            },
5071            format!("{:?}", self.results).into(),
5072            if let Some(all) = &self.all {
5073                format!("{all:?}").into()
5074            } else {
5075                String::new().into()
5076            },
5077        ]
5078    }
5079
5080    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5081        vec![
5082            "count".into(),
5083            "next".into(),
5084            "previous".into(),
5085            "results".into(),
5086            "all".into(),
5087        ]
5088    }
5089}
5090
5091#[derive(
5092    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5093)]
5094#[allow(non_snake_case)]
5095pub struct PaginatedMailRuleList {
5096    pub count: i64,
5097    #[serde(default, skip_serializing_if = "Option::is_none")]
5098    pub next: Option<String>,
5099    #[serde(default, skip_serializing_if = "Option::is_none")]
5100    pub previous: Option<String>,
5101    pub results: Vec<MailRule>,
5102    #[serde(default, skip_serializing_if = "Option::is_none")]
5103    pub all: Option<Vec<i64>>,
5104}
5105
5106impl std::fmt::Display for PaginatedMailRuleList {
5107    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5108        write!(
5109            f,
5110            "{}",
5111            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5112        )
5113    }
5114}
5115
5116#[cfg(feature = "requests")]
5117impl crate::types::paginate::Pagination for PaginatedMailRuleList {
5118    type Item = MailRule;
5119    fn has_more_pages(&self) -> bool {
5120        self.next.is_some()
5121    }
5122
5123    fn next_page_token(&self) -> Option<String> {
5124        self.next.clone()
5125    }
5126
5127    fn next_page(
5128        &self,
5129        req: reqwest::Request,
5130    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5131        let mut req = req.try_clone().ok_or_else(|| {
5132            crate::types::error::Error::InvalidRequest(format!(
5133                "failed to clone request: {req:?}"
5134            ))
5135        })?;
5136        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5137            crate::types::error::Error::InvalidRequest(format!(
5138                "failed to parse url: {:?}",
5139                self.next
5140            ))
5141        })?;
5142        Ok(req)
5143    }
5144
5145    fn items(&self) -> Vec<Self::Item> {
5146        self.results.clone()
5147    }
5148}
5149
5150#[cfg(feature = "tabled")]
5151impl tabled::Tabled for PaginatedMailRuleList {
5152    const LENGTH: usize = 5;
5153    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5154        vec![
5155            format!("{:?}", self.count).into(),
5156            if let Some(next) = &self.next {
5157                format!("{next:?}").into()
5158            } else {
5159                String::new().into()
5160            },
5161            if let Some(previous) = &self.previous {
5162                format!("{previous:?}").into()
5163            } else {
5164                String::new().into()
5165            },
5166            format!("{:?}", self.results).into(),
5167            if let Some(all) = &self.all {
5168                format!("{all:?}").into()
5169            } else {
5170                String::new().into()
5171            },
5172        ]
5173    }
5174
5175    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5176        vec![
5177            "count".into(),
5178            "next".into(),
5179            "previous".into(),
5180            "results".into(),
5181            "all".into(),
5182        ]
5183    }
5184}
5185
5186#[derive(
5187    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5188)]
5189#[allow(non_snake_case)]
5190pub struct PaginatedProcessedMailList {
5191    pub count: i64,
5192    #[serde(default, skip_serializing_if = "Option::is_none")]
5193    pub next: Option<String>,
5194    #[serde(default, skip_serializing_if = "Option::is_none")]
5195    pub previous: Option<String>,
5196    pub results: Vec<ProcessedMail>,
5197    #[serde(default, skip_serializing_if = "Option::is_none")]
5198    pub all: Option<Vec<i64>>,
5199}
5200
5201impl std::fmt::Display for PaginatedProcessedMailList {
5202    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5203        write!(
5204            f,
5205            "{}",
5206            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5207        )
5208    }
5209}
5210
5211#[cfg(feature = "requests")]
5212impl crate::types::paginate::Pagination for PaginatedProcessedMailList {
5213    type Item = ProcessedMail;
5214    fn has_more_pages(&self) -> bool {
5215        self.next.is_some()
5216    }
5217
5218    fn next_page_token(&self) -> Option<String> {
5219        self.next.clone()
5220    }
5221
5222    fn next_page(
5223        &self,
5224        req: reqwest::Request,
5225    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5226        let mut req = req.try_clone().ok_or_else(|| {
5227            crate::types::error::Error::InvalidRequest(format!(
5228                "failed to clone request: {req:?}"
5229            ))
5230        })?;
5231        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5232            crate::types::error::Error::InvalidRequest(format!(
5233                "failed to parse url: {:?}",
5234                self.next
5235            ))
5236        })?;
5237        Ok(req)
5238    }
5239
5240    fn items(&self) -> Vec<Self::Item> {
5241        self.results.clone()
5242    }
5243}
5244
5245#[cfg(feature = "tabled")]
5246impl tabled::Tabled for PaginatedProcessedMailList {
5247    const LENGTH: usize = 5;
5248    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5249        vec![
5250            format!("{:?}", self.count).into(),
5251            if let Some(next) = &self.next {
5252                format!("{next:?}").into()
5253            } else {
5254                String::new().into()
5255            },
5256            if let Some(previous) = &self.previous {
5257                format!("{previous:?}").into()
5258            } else {
5259                String::new().into()
5260            },
5261            format!("{:?}", self.results).into(),
5262            if let Some(all) = &self.all {
5263                format!("{all:?}").into()
5264            } else {
5265                String::new().into()
5266            },
5267        ]
5268    }
5269
5270    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5271        vec![
5272            "count".into(),
5273            "next".into(),
5274            "previous".into(),
5275            "results".into(),
5276            "all".into(),
5277        ]
5278    }
5279}
5280
5281#[derive(
5282    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5283)]
5284#[allow(non_snake_case)]
5285pub struct PaginatedSavedViewList {
5286    pub count: i64,
5287    #[serde(default, skip_serializing_if = "Option::is_none")]
5288    pub next: Option<String>,
5289    #[serde(default, skip_serializing_if = "Option::is_none")]
5290    pub previous: Option<String>,
5291    pub results: Vec<SavedView>,
5292    #[serde(default, skip_serializing_if = "Option::is_none")]
5293    pub all: Option<Vec<i64>>,
5294}
5295
5296impl std::fmt::Display for PaginatedSavedViewList {
5297    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5298        write!(
5299            f,
5300            "{}",
5301            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5302        )
5303    }
5304}
5305
5306#[cfg(feature = "requests")]
5307impl crate::types::paginate::Pagination for PaginatedSavedViewList {
5308    type Item = SavedView;
5309    fn has_more_pages(&self) -> bool {
5310        self.next.is_some()
5311    }
5312
5313    fn next_page_token(&self) -> Option<String> {
5314        self.next.clone()
5315    }
5316
5317    fn next_page(
5318        &self,
5319        req: reqwest::Request,
5320    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5321        let mut req = req.try_clone().ok_or_else(|| {
5322            crate::types::error::Error::InvalidRequest(format!(
5323                "failed to clone request: {req:?}"
5324            ))
5325        })?;
5326        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5327            crate::types::error::Error::InvalidRequest(format!(
5328                "failed to parse url: {:?}",
5329                self.next
5330            ))
5331        })?;
5332        Ok(req)
5333    }
5334
5335    fn items(&self) -> Vec<Self::Item> {
5336        self.results.clone()
5337    }
5338}
5339
5340#[cfg(feature = "tabled")]
5341impl tabled::Tabled for PaginatedSavedViewList {
5342    const LENGTH: usize = 5;
5343    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5344        vec![
5345            format!("{:?}", self.count).into(),
5346            if let Some(next) = &self.next {
5347                format!("{next:?}").into()
5348            } else {
5349                String::new().into()
5350            },
5351            if let Some(previous) = &self.previous {
5352                format!("{previous:?}").into()
5353            } else {
5354                String::new().into()
5355            },
5356            format!("{:?}", self.results).into(),
5357            if let Some(all) = &self.all {
5358                format!("{all:?}").into()
5359            } else {
5360                String::new().into()
5361            },
5362        ]
5363    }
5364
5365    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5366        vec![
5367            "count".into(),
5368            "next".into(),
5369            "previous".into(),
5370            "results".into(),
5371            "all".into(),
5372        ]
5373    }
5374}
5375
5376#[derive(
5377    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5378)]
5379#[allow(non_snake_case)]
5380pub struct PaginatedShareLinkList {
5381    pub count: i64,
5382    #[serde(default, skip_serializing_if = "Option::is_none")]
5383    pub next: Option<String>,
5384    #[serde(default, skip_serializing_if = "Option::is_none")]
5385    pub previous: Option<String>,
5386    pub results: Vec<ShareLink>,
5387    #[serde(default, skip_serializing_if = "Option::is_none")]
5388    pub all: Option<Vec<i64>>,
5389}
5390
5391impl std::fmt::Display for PaginatedShareLinkList {
5392    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5393        write!(
5394            f,
5395            "{}",
5396            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5397        )
5398    }
5399}
5400
5401#[cfg(feature = "requests")]
5402impl crate::types::paginate::Pagination for PaginatedShareLinkList {
5403    type Item = ShareLink;
5404    fn has_more_pages(&self) -> bool {
5405        self.next.is_some()
5406    }
5407
5408    fn next_page_token(&self) -> Option<String> {
5409        self.next.clone()
5410    }
5411
5412    fn next_page(
5413        &self,
5414        req: reqwest::Request,
5415    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5416        let mut req = req.try_clone().ok_or_else(|| {
5417            crate::types::error::Error::InvalidRequest(format!(
5418                "failed to clone request: {req:?}"
5419            ))
5420        })?;
5421        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5422            crate::types::error::Error::InvalidRequest(format!(
5423                "failed to parse url: {:?}",
5424                self.next
5425            ))
5426        })?;
5427        Ok(req)
5428    }
5429
5430    fn items(&self) -> Vec<Self::Item> {
5431        self.results.clone()
5432    }
5433}
5434
5435#[cfg(feature = "tabled")]
5436impl tabled::Tabled for PaginatedShareLinkList {
5437    const LENGTH: usize = 5;
5438    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5439        vec![
5440            format!("{:?}", self.count).into(),
5441            if let Some(next) = &self.next {
5442                format!("{next:?}").into()
5443            } else {
5444                String::new().into()
5445            },
5446            if let Some(previous) = &self.previous {
5447                format!("{previous:?}").into()
5448            } else {
5449                String::new().into()
5450            },
5451            format!("{:?}", self.results).into(),
5452            if let Some(all) = &self.all {
5453                format!("{all:?}").into()
5454            } else {
5455                String::new().into()
5456            },
5457        ]
5458    }
5459
5460    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5461        vec![
5462            "count".into(),
5463            "next".into(),
5464            "previous".into(),
5465            "results".into(),
5466            "all".into(),
5467        ]
5468    }
5469}
5470
5471#[derive(
5472    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5473)]
5474#[allow(non_snake_case)]
5475pub struct PaginatedStoragePathList {
5476    pub count: i64,
5477    #[serde(default, skip_serializing_if = "Option::is_none")]
5478    pub next: Option<String>,
5479    #[serde(default, skip_serializing_if = "Option::is_none")]
5480    pub previous: Option<String>,
5481    pub results: Vec<StoragePath>,
5482    #[serde(default, skip_serializing_if = "Option::is_none")]
5483    pub all: Option<Vec<i64>>,
5484}
5485
5486impl std::fmt::Display for PaginatedStoragePathList {
5487    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5488        write!(
5489            f,
5490            "{}",
5491            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5492        )
5493    }
5494}
5495
5496#[cfg(feature = "requests")]
5497impl crate::types::paginate::Pagination for PaginatedStoragePathList {
5498    type Item = StoragePath;
5499    fn has_more_pages(&self) -> bool {
5500        self.next.is_some()
5501    }
5502
5503    fn next_page_token(&self) -> Option<String> {
5504        self.next.clone()
5505    }
5506
5507    fn next_page(
5508        &self,
5509        req: reqwest::Request,
5510    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5511        let mut req = req.try_clone().ok_or_else(|| {
5512            crate::types::error::Error::InvalidRequest(format!(
5513                "failed to clone request: {req:?}"
5514            ))
5515        })?;
5516        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5517            crate::types::error::Error::InvalidRequest(format!(
5518                "failed to parse url: {:?}",
5519                self.next
5520            ))
5521        })?;
5522        Ok(req)
5523    }
5524
5525    fn items(&self) -> Vec<Self::Item> {
5526        self.results.clone()
5527    }
5528}
5529
5530#[cfg(feature = "tabled")]
5531impl tabled::Tabled for PaginatedStoragePathList {
5532    const LENGTH: usize = 5;
5533    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5534        vec![
5535            format!("{:?}", self.count).into(),
5536            if let Some(next) = &self.next {
5537                format!("{next:?}").into()
5538            } else {
5539                String::new().into()
5540            },
5541            if let Some(previous) = &self.previous {
5542                format!("{previous:?}").into()
5543            } else {
5544                String::new().into()
5545            },
5546            format!("{:?}", self.results).into(),
5547            if let Some(all) = &self.all {
5548                format!("{all:?}").into()
5549            } else {
5550                String::new().into()
5551            },
5552        ]
5553    }
5554
5555    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5556        vec![
5557            "count".into(),
5558            "next".into(),
5559            "previous".into(),
5560            "results".into(),
5561            "all".into(),
5562        ]
5563    }
5564}
5565
5566#[derive(
5567    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5568)]
5569#[allow(non_snake_case)]
5570pub struct PaginatedTagList {
5571    pub count: i64,
5572    #[serde(default, skip_serializing_if = "Option::is_none")]
5573    pub next: Option<String>,
5574    #[serde(default, skip_serializing_if = "Option::is_none")]
5575    pub previous: Option<String>,
5576    pub results: Vec<Tag>,
5577    #[serde(default, skip_serializing_if = "Option::is_none")]
5578    pub all: Option<Vec<i64>>,
5579}
5580
5581impl std::fmt::Display for PaginatedTagList {
5582    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5583        write!(
5584            f,
5585            "{}",
5586            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5587        )
5588    }
5589}
5590
5591#[cfg(feature = "requests")]
5592impl crate::types::paginate::Pagination for PaginatedTagList {
5593    type Item = Tag;
5594    fn has_more_pages(&self) -> bool {
5595        self.next.is_some()
5596    }
5597
5598    fn next_page_token(&self) -> Option<String> {
5599        self.next.clone()
5600    }
5601
5602    fn next_page(
5603        &self,
5604        req: reqwest::Request,
5605    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5606        let mut req = req.try_clone().ok_or_else(|| {
5607            crate::types::error::Error::InvalidRequest(format!(
5608                "failed to clone request: {req:?}"
5609            ))
5610        })?;
5611        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5612            crate::types::error::Error::InvalidRequest(format!(
5613                "failed to parse url: {:?}",
5614                self.next
5615            ))
5616        })?;
5617        Ok(req)
5618    }
5619
5620    fn items(&self) -> Vec<Self::Item> {
5621        self.results.clone()
5622    }
5623}
5624
5625#[cfg(feature = "tabled")]
5626impl tabled::Tabled for PaginatedTagList {
5627    const LENGTH: usize = 5;
5628    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5629        vec![
5630            format!("{:?}", self.count).into(),
5631            if let Some(next) = &self.next {
5632                format!("{next:?}").into()
5633            } else {
5634                String::new().into()
5635            },
5636            if let Some(previous) = &self.previous {
5637                format!("{previous:?}").into()
5638            } else {
5639                String::new().into()
5640            },
5641            format!("{:?}", self.results).into(),
5642            if let Some(all) = &self.all {
5643                format!("{all:?}").into()
5644            } else {
5645                String::new().into()
5646            },
5647        ]
5648    }
5649
5650    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5651        vec![
5652            "count".into(),
5653            "next".into(),
5654            "previous".into(),
5655            "results".into(),
5656            "all".into(),
5657        ]
5658    }
5659}
5660
5661#[derive(
5662    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5663)]
5664#[allow(non_snake_case)]
5665pub struct PaginatedUserList {
5666    pub count: i64,
5667    #[serde(default, skip_serializing_if = "Option::is_none")]
5668    pub next: Option<String>,
5669    #[serde(default, skip_serializing_if = "Option::is_none")]
5670    pub previous: Option<String>,
5671    pub results: Vec<User>,
5672    #[serde(default, skip_serializing_if = "Option::is_none")]
5673    pub all: Option<Vec<i64>>,
5674}
5675
5676impl std::fmt::Display for PaginatedUserList {
5677    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5678        write!(
5679            f,
5680            "{}",
5681            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5682        )
5683    }
5684}
5685
5686#[cfg(feature = "requests")]
5687impl crate::types::paginate::Pagination for PaginatedUserList {
5688    type Item = User;
5689    fn has_more_pages(&self) -> bool {
5690        self.next.is_some()
5691    }
5692
5693    fn next_page_token(&self) -> Option<String> {
5694        self.next.clone()
5695    }
5696
5697    fn next_page(
5698        &self,
5699        req: reqwest::Request,
5700    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5701        let mut req = req.try_clone().ok_or_else(|| {
5702            crate::types::error::Error::InvalidRequest(format!(
5703                "failed to clone request: {req:?}"
5704            ))
5705        })?;
5706        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5707            crate::types::error::Error::InvalidRequest(format!(
5708                "failed to parse url: {:?}",
5709                self.next
5710            ))
5711        })?;
5712        Ok(req)
5713    }
5714
5715    fn items(&self) -> Vec<Self::Item> {
5716        self.results.clone()
5717    }
5718}
5719
5720#[cfg(feature = "tabled")]
5721impl tabled::Tabled for PaginatedUserList {
5722    const LENGTH: usize = 5;
5723    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5724        vec![
5725            format!("{:?}", self.count).into(),
5726            if let Some(next) = &self.next {
5727                format!("{next:?}").into()
5728            } else {
5729                String::new().into()
5730            },
5731            if let Some(previous) = &self.previous {
5732                format!("{previous:?}").into()
5733            } else {
5734                String::new().into()
5735            },
5736            format!("{:?}", self.results).into(),
5737            if let Some(all) = &self.all {
5738                format!("{all:?}").into()
5739            } else {
5740                String::new().into()
5741            },
5742        ]
5743    }
5744
5745    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5746        vec![
5747            "count".into(),
5748            "next".into(),
5749            "previous".into(),
5750            "results".into(),
5751            "all".into(),
5752        ]
5753    }
5754}
5755
5756#[derive(
5757    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5758)]
5759#[allow(non_snake_case)]
5760pub struct PaginatedWorkflowActionList {
5761    pub count: i64,
5762    #[serde(default, skip_serializing_if = "Option::is_none")]
5763    pub next: Option<String>,
5764    #[serde(default, skip_serializing_if = "Option::is_none")]
5765    pub previous: Option<String>,
5766    pub results: Vec<WorkflowAction>,
5767    #[serde(default, skip_serializing_if = "Option::is_none")]
5768    pub all: Option<Vec<i64>>,
5769}
5770
5771impl std::fmt::Display for PaginatedWorkflowActionList {
5772    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5773        write!(
5774            f,
5775            "{}",
5776            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5777        )
5778    }
5779}
5780
5781#[cfg(feature = "requests")]
5782impl crate::types::paginate::Pagination for PaginatedWorkflowActionList {
5783    type Item = WorkflowAction;
5784    fn has_more_pages(&self) -> bool {
5785        self.next.is_some()
5786    }
5787
5788    fn next_page_token(&self) -> Option<String> {
5789        self.next.clone()
5790    }
5791
5792    fn next_page(
5793        &self,
5794        req: reqwest::Request,
5795    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5796        let mut req = req.try_clone().ok_or_else(|| {
5797            crate::types::error::Error::InvalidRequest(format!(
5798                "failed to clone request: {req:?}"
5799            ))
5800        })?;
5801        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5802            crate::types::error::Error::InvalidRequest(format!(
5803                "failed to parse url: {:?}",
5804                self.next
5805            ))
5806        })?;
5807        Ok(req)
5808    }
5809
5810    fn items(&self) -> Vec<Self::Item> {
5811        self.results.clone()
5812    }
5813}
5814
5815#[cfg(feature = "tabled")]
5816impl tabled::Tabled for PaginatedWorkflowActionList {
5817    const LENGTH: usize = 5;
5818    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5819        vec![
5820            format!("{:?}", self.count).into(),
5821            if let Some(next) = &self.next {
5822                format!("{next:?}").into()
5823            } else {
5824                String::new().into()
5825            },
5826            if let Some(previous) = &self.previous {
5827                format!("{previous:?}").into()
5828            } else {
5829                String::new().into()
5830            },
5831            format!("{:?}", self.results).into(),
5832            if let Some(all) = &self.all {
5833                format!("{all:?}").into()
5834            } else {
5835                String::new().into()
5836            },
5837        ]
5838    }
5839
5840    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5841        vec![
5842            "count".into(),
5843            "next".into(),
5844            "previous".into(),
5845            "results".into(),
5846            "all".into(),
5847        ]
5848    }
5849}
5850
5851#[derive(
5852    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5853)]
5854#[allow(non_snake_case)]
5855pub struct PaginatedWorkflowList {
5856    pub count: i64,
5857    #[serde(default, skip_serializing_if = "Option::is_none")]
5858    pub next: Option<String>,
5859    #[serde(default, skip_serializing_if = "Option::is_none")]
5860    pub previous: Option<String>,
5861    pub results: Vec<Workflow>,
5862    #[serde(default, skip_serializing_if = "Option::is_none")]
5863    pub all: Option<Vec<i64>>,
5864}
5865
5866impl std::fmt::Display for PaginatedWorkflowList {
5867    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5868        write!(
5869            f,
5870            "{}",
5871            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5872        )
5873    }
5874}
5875
5876#[cfg(feature = "requests")]
5877impl crate::types::paginate::Pagination for PaginatedWorkflowList {
5878    type Item = Workflow;
5879    fn has_more_pages(&self) -> bool {
5880        self.next.is_some()
5881    }
5882
5883    fn next_page_token(&self) -> Option<String> {
5884        self.next.clone()
5885    }
5886
5887    fn next_page(
5888        &self,
5889        req: reqwest::Request,
5890    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5891        let mut req = req.try_clone().ok_or_else(|| {
5892            crate::types::error::Error::InvalidRequest(format!(
5893                "failed to clone request: {req:?}"
5894            ))
5895        })?;
5896        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5897            crate::types::error::Error::InvalidRequest(format!(
5898                "failed to parse url: {:?}",
5899                self.next
5900            ))
5901        })?;
5902        Ok(req)
5903    }
5904
5905    fn items(&self) -> Vec<Self::Item> {
5906        self.results.clone()
5907    }
5908}
5909
5910#[cfg(feature = "tabled")]
5911impl tabled::Tabled for PaginatedWorkflowList {
5912    const LENGTH: usize = 5;
5913    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5914        vec![
5915            format!("{:?}", self.count).into(),
5916            if let Some(next) = &self.next {
5917                format!("{next:?}").into()
5918            } else {
5919                String::new().into()
5920            },
5921            if let Some(previous) = &self.previous {
5922                format!("{previous:?}").into()
5923            } else {
5924                String::new().into()
5925            },
5926            format!("{:?}", self.results).into(),
5927            if let Some(all) = &self.all {
5928                format!("{all:?}").into()
5929            } else {
5930                String::new().into()
5931            },
5932        ]
5933    }
5934
5935    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5936        vec![
5937            "count".into(),
5938            "next".into(),
5939            "previous".into(),
5940            "results".into(),
5941            "all".into(),
5942        ]
5943    }
5944}
5945
5946#[derive(
5947    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5948)]
5949#[allow(non_snake_case)]
5950pub struct PaginatedWorkflowTriggerList {
5951    pub count: i64,
5952    #[serde(default, skip_serializing_if = "Option::is_none")]
5953    pub next: Option<String>,
5954    #[serde(default, skip_serializing_if = "Option::is_none")]
5955    pub previous: Option<String>,
5956    pub results: Vec<WorkflowTrigger>,
5957    #[serde(default, skip_serializing_if = "Option::is_none")]
5958    pub all: Option<Vec<i64>>,
5959}
5960
5961impl std::fmt::Display for PaginatedWorkflowTriggerList {
5962    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5963        write!(
5964            f,
5965            "{}",
5966            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5967        )
5968    }
5969}
5970
5971#[cfg(feature = "requests")]
5972impl crate::types::paginate::Pagination for PaginatedWorkflowTriggerList {
5973    type Item = WorkflowTrigger;
5974    fn has_more_pages(&self) -> bool {
5975        self.next.is_some()
5976    }
5977
5978    fn next_page_token(&self) -> Option<String> {
5979        self.next.clone()
5980    }
5981
5982    fn next_page(
5983        &self,
5984        req: reqwest::Request,
5985    ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5986        let mut req = req.try_clone().ok_or_else(|| {
5987            crate::types::error::Error::InvalidRequest(format!(
5988                "failed to clone request: {req:?}"
5989            ))
5990        })?;
5991        *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5992            crate::types::error::Error::InvalidRequest(format!(
5993                "failed to parse url: {:?}",
5994                self.next
5995            ))
5996        })?;
5997        Ok(req)
5998    }
5999
6000    fn items(&self) -> Vec<Self::Item> {
6001        self.results.clone()
6002    }
6003}
6004
6005#[cfg(feature = "tabled")]
6006impl tabled::Tabled for PaginatedWorkflowTriggerList {
6007    const LENGTH: usize = 5;
6008    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6009        vec![
6010            format!("{:?}", self.count).into(),
6011            if let Some(next) = &self.next {
6012                format!("{next:?}").into()
6013            } else {
6014                String::new().into()
6015            },
6016            if let Some(previous) = &self.previous {
6017                format!("{previous:?}").into()
6018            } else {
6019                String::new().into()
6020            },
6021            format!("{:?}", self.results).into(),
6022            if let Some(all) = &self.all {
6023                format!("{all:?}").into()
6024            } else {
6025                String::new().into()
6026            },
6027        ]
6028    }
6029
6030    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6031        vec![
6032            "count".into(),
6033            "next".into(),
6034            "previous".into(),
6035            "results".into(),
6036            "all".into(),
6037        ]
6038    }
6039}
6040
6041#[derive(
6042    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6043)]
6044#[allow(non_snake_case)]
6045pub struct PaperlessAuthToken {
6046    pub token: String,
6047}
6048
6049impl std::fmt::Display for PaperlessAuthToken {
6050    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6051        write!(
6052            f,
6053            "{}",
6054            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6055        )
6056    }
6057}
6058
6059#[cfg(feature = "tabled")]
6060impl tabled::Tabled for PaperlessAuthToken {
6061    const LENGTH: usize = 1;
6062    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6063        vec![self.token.clone().into()]
6064    }
6065
6066    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6067        vec!["token".into()]
6068    }
6069}
6070
6071#[derive(
6072    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6073)]
6074#[allow(non_snake_case)]
6075pub struct PaperlessAuthTokenRequest {
6076    pub username: String,
6077    pub password: String,
6078    #[serde(default, skip_serializing_if = "Option::is_none")]
6079    pub code: Option<String>,
6080}
6081
6082impl std::fmt::Display for PaperlessAuthTokenRequest {
6083    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6084        write!(
6085            f,
6086            "{}",
6087            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6088        )
6089    }
6090}
6091
6092#[cfg(feature = "tabled")]
6093impl tabled::Tabled for PaperlessAuthTokenRequest {
6094    const LENGTH: usize = 3;
6095    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6096        vec![
6097            self.username.clone().into(),
6098            self.password.clone().into(),
6099            if let Some(code) = &self.code {
6100                format!("{code:?}").into()
6101            } else {
6102                String::new().into()
6103            },
6104        ]
6105    }
6106
6107    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6108        vec!["username".into(), "password".into(), "code".into()]
6109    }
6110}
6111
6112#[derive(
6113    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6114)]
6115#[allow(non_snake_case)]
6116pub struct PatchedApplicationConfigurationRequest {
6117    #[serde(default, skip_serializing_if = "Option::is_none")]
6118    pub user_args: Option<serde_json::Value>,
6119    #[serde(default, skip_serializing_if = "Option::is_none")]
6120    pub barcode_tag_mapping: Option<serde_json::Value>,
6121    #[serde(default, skip_serializing_if = "Option::is_none")]
6122    pub output_type: Option<OutputType>,
6123    #[serde(default, skip_serializing_if = "Option::is_none")]
6124    pub pages: Option<i64>,
6125    #[serde(default, skip_serializing_if = "Option::is_none")]
6126    pub language: Option<String>,
6127    #[serde(default, skip_serializing_if = "Option::is_none")]
6128    pub mode: Option<Mode>,
6129    #[serde(default, skip_serializing_if = "Option::is_none")]
6130    pub skip_archive_file: Option<SkipArchiveFile>,
6131    #[serde(default, skip_serializing_if = "Option::is_none")]
6132    pub image_dpi: Option<i64>,
6133    #[serde(default, skip_serializing_if = "Option::is_none")]
6134    pub unpaper_clean: Option<UnpaperClean>,
6135    #[serde(default, skip_serializing_if = "Option::is_none")]
6136    pub deskew: Option<bool>,
6137    #[serde(default, skip_serializing_if = "Option::is_none")]
6138    pub rotate_pages: Option<bool>,
6139    #[serde(default, skip_serializing_if = "Option::is_none")]
6140    pub rotate_pages_threshold: Option<f64>,
6141    #[serde(default, skip_serializing_if = "Option::is_none")]
6142    pub max_image_pixels: Option<f64>,
6143    #[serde(default, skip_serializing_if = "Option::is_none")]
6144    pub color_conversion_strategy: Option<ColorConversionStrategy>,
6145    #[serde(default, skip_serializing_if = "Option::is_none")]
6146    pub app_title: Option<String>,
6147    #[serde(default, skip_serializing_if = "Option::is_none")]
6148    pub app_logo: Option<bytes::Bytes>,
6149    #[serde(default, skip_serializing_if = "Option::is_none")]
6150    pub barcodes_enabled: Option<bool>,
6151    #[serde(default, skip_serializing_if = "Option::is_none")]
6152    pub barcode_enable_tiff_support: Option<bool>,
6153    #[serde(default, skip_serializing_if = "Option::is_none")]
6154    pub barcode_string: Option<String>,
6155    #[serde(default, skip_serializing_if = "Option::is_none")]
6156    pub barcode_retain_split_pages: Option<bool>,
6157    #[serde(default, skip_serializing_if = "Option::is_none")]
6158    pub barcode_enable_asn: Option<bool>,
6159    #[serde(default, skip_serializing_if = "Option::is_none")]
6160    pub barcode_asn_prefix: Option<String>,
6161    #[serde(default, skip_serializing_if = "Option::is_none")]
6162    pub barcode_upscale: Option<f64>,
6163    #[serde(default, skip_serializing_if = "Option::is_none")]
6164    pub barcode_dpi: Option<i64>,
6165    #[serde(default, skip_serializing_if = "Option::is_none")]
6166    pub barcode_max_pages: Option<i64>,
6167    #[serde(default, skip_serializing_if = "Option::is_none")]
6168    pub barcode_enable_tag: Option<bool>,
6169}
6170
6171impl std::fmt::Display for PatchedApplicationConfigurationRequest {
6172    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6173        write!(
6174            f,
6175            "{}",
6176            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6177        )
6178    }
6179}
6180
6181#[cfg(feature = "tabled")]
6182impl tabled::Tabled for PatchedApplicationConfigurationRequest {
6183    const LENGTH: usize = 26;
6184    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6185        vec![
6186            if let Some(user_args) = &self.user_args {
6187                format!("{user_args:?}").into()
6188            } else {
6189                String::new().into()
6190            },
6191            if let Some(barcode_tag_mapping) = &self.barcode_tag_mapping {
6192                format!("{barcode_tag_mapping:?}").into()
6193            } else {
6194                String::new().into()
6195            },
6196            if let Some(output_type) = &self.output_type {
6197                format!("{output_type:?}").into()
6198            } else {
6199                String::new().into()
6200            },
6201            if let Some(pages) = &self.pages {
6202                format!("{pages:?}").into()
6203            } else {
6204                String::new().into()
6205            },
6206            if let Some(language) = &self.language {
6207                format!("{language:?}").into()
6208            } else {
6209                String::new().into()
6210            },
6211            if let Some(mode) = &self.mode {
6212                format!("{mode:?}").into()
6213            } else {
6214                String::new().into()
6215            },
6216            if let Some(skip_archive_file) = &self.skip_archive_file {
6217                format!("{skip_archive_file:?}").into()
6218            } else {
6219                String::new().into()
6220            },
6221            if let Some(image_dpi) = &self.image_dpi {
6222                format!("{image_dpi:?}").into()
6223            } else {
6224                String::new().into()
6225            },
6226            if let Some(unpaper_clean) = &self.unpaper_clean {
6227                format!("{unpaper_clean:?}").into()
6228            } else {
6229                String::new().into()
6230            },
6231            if let Some(deskew) = &self.deskew {
6232                format!("{deskew:?}").into()
6233            } else {
6234                String::new().into()
6235            },
6236            if let Some(rotate_pages) = &self.rotate_pages {
6237                format!("{rotate_pages:?}").into()
6238            } else {
6239                String::new().into()
6240            },
6241            if let Some(rotate_pages_threshold) = &self.rotate_pages_threshold {
6242                format!("{rotate_pages_threshold:?}").into()
6243            } else {
6244                String::new().into()
6245            },
6246            if let Some(max_image_pixels) = &self.max_image_pixels {
6247                format!("{max_image_pixels:?}").into()
6248            } else {
6249                String::new().into()
6250            },
6251            if let Some(color_conversion_strategy) = &self.color_conversion_strategy {
6252                format!("{color_conversion_strategy:?}").into()
6253            } else {
6254                String::new().into()
6255            },
6256            if let Some(app_title) = &self.app_title {
6257                format!("{app_title:?}").into()
6258            } else {
6259                String::new().into()
6260            },
6261            if let Some(app_logo) = &self.app_logo {
6262                format!("{app_logo:?}").into()
6263            } else {
6264                String::new().into()
6265            },
6266            if let Some(barcodes_enabled) = &self.barcodes_enabled {
6267                format!("{barcodes_enabled:?}").into()
6268            } else {
6269                String::new().into()
6270            },
6271            if let Some(barcode_enable_tiff_support) = &self.barcode_enable_tiff_support {
6272                format!("{barcode_enable_tiff_support:?}").into()
6273            } else {
6274                String::new().into()
6275            },
6276            if let Some(barcode_string) = &self.barcode_string {
6277                format!("{barcode_string:?}").into()
6278            } else {
6279                String::new().into()
6280            },
6281            if let Some(barcode_retain_split_pages) = &self.barcode_retain_split_pages {
6282                format!("{barcode_retain_split_pages:?}").into()
6283            } else {
6284                String::new().into()
6285            },
6286            if let Some(barcode_enable_asn) = &self.barcode_enable_asn {
6287                format!("{barcode_enable_asn:?}").into()
6288            } else {
6289                String::new().into()
6290            },
6291            if let Some(barcode_asn_prefix) = &self.barcode_asn_prefix {
6292                format!("{barcode_asn_prefix:?}").into()
6293            } else {
6294                String::new().into()
6295            },
6296            if let Some(barcode_upscale) = &self.barcode_upscale {
6297                format!("{barcode_upscale:?}").into()
6298            } else {
6299                String::new().into()
6300            },
6301            if let Some(barcode_dpi) = &self.barcode_dpi {
6302                format!("{barcode_dpi:?}").into()
6303            } else {
6304                String::new().into()
6305            },
6306            if let Some(barcode_max_pages) = &self.barcode_max_pages {
6307                format!("{barcode_max_pages:?}").into()
6308            } else {
6309                String::new().into()
6310            },
6311            if let Some(barcode_enable_tag) = &self.barcode_enable_tag {
6312                format!("{barcode_enable_tag:?}").into()
6313            } else {
6314                String::new().into()
6315            },
6316        ]
6317    }
6318
6319    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6320        vec![
6321            "user_args".into(),
6322            "barcode_tag_mapping".into(),
6323            "output_type".into(),
6324            "pages".into(),
6325            "language".into(),
6326            "mode".into(),
6327            "skip_archive_file".into(),
6328            "image_dpi".into(),
6329            "unpaper_clean".into(),
6330            "deskew".into(),
6331            "rotate_pages".into(),
6332            "rotate_pages_threshold".into(),
6333            "max_image_pixels".into(),
6334            "color_conversion_strategy".into(),
6335            "app_title".into(),
6336            "app_logo".into(),
6337            "barcodes_enabled".into(),
6338            "barcode_enable_tiff_support".into(),
6339            "barcode_string".into(),
6340            "barcode_retain_split_pages".into(),
6341            "barcode_enable_asn".into(),
6342            "barcode_asn_prefix".into(),
6343            "barcode_upscale".into(),
6344            "barcode_dpi".into(),
6345            "barcode_max_pages".into(),
6346            "barcode_enable_tag".into(),
6347        ]
6348    }
6349}
6350
6351#[derive(
6352    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6353)]
6354#[allow(non_snake_case)]
6355pub struct PatchedCorrespondentRequest {
6356    #[serde(default, skip_serializing_if = "Option::is_none")]
6357    pub name: Option<String>,
6358    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
6359    pub match_: Option<String>,
6360    #[serde(default, skip_serializing_if = "Option::is_none")]
6361    pub matching_algorithm: Option<i64>,
6362    #[serde(default, skip_serializing_if = "Option::is_none")]
6363    pub is_insensitive: Option<bool>,
6364    #[serde(default, skip_serializing_if = "Option::is_none")]
6365    pub owner: Option<i64>,
6366    #[serde(default, skip_serializing_if = "Option::is_none")]
6367    pub set_permissions: Option<SetPermissions>,
6368}
6369
6370impl std::fmt::Display for PatchedCorrespondentRequest {
6371    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6372        write!(
6373            f,
6374            "{}",
6375            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6376        )
6377    }
6378}
6379
6380#[cfg(feature = "tabled")]
6381impl tabled::Tabled for PatchedCorrespondentRequest {
6382    const LENGTH: usize = 6;
6383    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6384        vec![
6385            if let Some(name) = &self.name {
6386                format!("{name:?}").into()
6387            } else {
6388                String::new().into()
6389            },
6390            if let Some(match_) = &self.match_ {
6391                format!("{match_:?}").into()
6392            } else {
6393                String::new().into()
6394            },
6395            if let Some(matching_algorithm) = &self.matching_algorithm {
6396                format!("{matching_algorithm:?}").into()
6397            } else {
6398                String::new().into()
6399            },
6400            if let Some(is_insensitive) = &self.is_insensitive {
6401                format!("{is_insensitive:?}").into()
6402            } else {
6403                String::new().into()
6404            },
6405            if let Some(owner) = &self.owner {
6406                format!("{owner:?}").into()
6407            } else {
6408                String::new().into()
6409            },
6410            if let Some(set_permissions) = &self.set_permissions {
6411                format!("{set_permissions:?}").into()
6412            } else {
6413                String::new().into()
6414            },
6415        ]
6416    }
6417
6418    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6419        vec![
6420            "name".into(),
6421            "match_".into(),
6422            "matching_algorithm".into(),
6423            "is_insensitive".into(),
6424            "owner".into(),
6425            "set_permissions".into(),
6426        ]
6427    }
6428}
6429
6430#[derive(
6431    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6432)]
6433#[allow(non_snake_case)]
6434pub struct PatchedCustomFieldRequest {
6435    #[serde(default, skip_serializing_if = "Option::is_none")]
6436    pub name: Option<String>,
6437    #[doc = "* `string` - string\n* `url` - url\n* `date` - date\n* `boolean` - boolean\n* `integer` - integer\n* `float` - float\n* `monetary` - monetary\n* `documentlink` - documentlink\n* `select` - select\n* `longtext` - longtext"]
6438    #[serde(default, skip_serializing_if = "Option::is_none")]
6439    pub data_type: Option<DataTypeEnum>,
6440    #[doc = "Extra data for the custom field, such as select options"]
6441    #[serde(default, skip_serializing_if = "Option::is_none")]
6442    pub extra_data: Option<serde_json::Value>,
6443}
6444
6445impl std::fmt::Display for PatchedCustomFieldRequest {
6446    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6447        write!(
6448            f,
6449            "{}",
6450            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6451        )
6452    }
6453}
6454
6455#[cfg(feature = "tabled")]
6456impl tabled::Tabled for PatchedCustomFieldRequest {
6457    const LENGTH: usize = 3;
6458    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6459        vec![
6460            if let Some(name) = &self.name {
6461                format!("{name:?}").into()
6462            } else {
6463                String::new().into()
6464            },
6465            if let Some(data_type) = &self.data_type {
6466                format!("{data_type:?}").into()
6467            } else {
6468                String::new().into()
6469            },
6470            if let Some(extra_data) = &self.extra_data {
6471                format!("{extra_data:?}").into()
6472            } else {
6473                String::new().into()
6474            },
6475        ]
6476    }
6477
6478    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6479        vec!["name".into(), "data_type".into(), "extra_data".into()]
6480    }
6481}
6482
6483#[doc = "Adds update nested feature"]
6484#[derive(
6485    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6486)]
6487#[allow(non_snake_case)]
6488pub struct PatchedDocumentRequest {
6489    #[serde(default, skip_serializing_if = "Option::is_none")]
6490    pub correspondent: Option<i64>,
6491    #[serde(default, skip_serializing_if = "Option::is_none")]
6492    pub document_type: Option<i64>,
6493    #[serde(default, skip_serializing_if = "Option::is_none")]
6494    pub storage_path: Option<i64>,
6495    #[serde(default, skip_serializing_if = "Option::is_none")]
6496    pub title: Option<String>,
6497    #[doc = "The raw, text-only data of the document. This field is primarily used for searching."]
6498    #[serde(default, skip_serializing_if = "Option::is_none")]
6499    pub content: Option<String>,
6500    #[serde(default, skip_serializing_if = "Option::is_none")]
6501    pub tags: Option<Vec<i64>>,
6502    #[serde(default, skip_serializing_if = "Option::is_none")]
6503    pub created: Option<chrono::NaiveDate>,
6504    #[serde(default, skip_serializing_if = "Option::is_none")]
6505    #[deprecated]
6506    pub created_date: Option<chrono::NaiveDate>,
6507    #[serde(default, skip_serializing_if = "Option::is_none")]
6508    pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
6509    #[doc = "The position of this document in your physical document archive."]
6510    #[serde(default, skip_serializing_if = "Option::is_none")]
6511    pub archive_serial_number: Option<i64>,
6512    #[serde(default, skip_serializing_if = "Option::is_none")]
6513    pub owner: Option<i64>,
6514    #[serde(default, skip_serializing_if = "Option::is_none")]
6515    pub set_permissions: Option<SetPermissions>,
6516    #[serde(default, skip_serializing_if = "Option::is_none")]
6517    pub custom_fields: Option<Vec<CustomFieldInstanceRequest>>,
6518    #[serde(default, skip_serializing_if = "Option::is_none")]
6519    pub remove_inbox_tags: Option<bool>,
6520}
6521
6522impl std::fmt::Display for PatchedDocumentRequest {
6523    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6524        write!(
6525            f,
6526            "{}",
6527            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6528        )
6529    }
6530}
6531
6532#[cfg(feature = "tabled")]
6533impl tabled::Tabled for PatchedDocumentRequest {
6534    const LENGTH: usize = 14;
6535    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6536        vec![
6537            if let Some(correspondent) = &self.correspondent {
6538                format!("{correspondent:?}").into()
6539            } else {
6540                String::new().into()
6541            },
6542            if let Some(document_type) = &self.document_type {
6543                format!("{document_type:?}").into()
6544            } else {
6545                String::new().into()
6546            },
6547            if let Some(storage_path) = &self.storage_path {
6548                format!("{storage_path:?}").into()
6549            } else {
6550                String::new().into()
6551            },
6552            if let Some(title) = &self.title {
6553                format!("{title:?}").into()
6554            } else {
6555                String::new().into()
6556            },
6557            if let Some(content) = &self.content {
6558                format!("{content:?}").into()
6559            } else {
6560                String::new().into()
6561            },
6562            if let Some(tags) = &self.tags {
6563                format!("{tags:?}").into()
6564            } else {
6565                String::new().into()
6566            },
6567            if let Some(created) = &self.created {
6568                format!("{created:?}").into()
6569            } else {
6570                String::new().into()
6571            },
6572            if let Some(created_date) = &self.created_date {
6573                format!("{created_date:?}").into()
6574            } else {
6575                String::new().into()
6576            },
6577            if let Some(deleted_at) = &self.deleted_at {
6578                format!("{deleted_at:?}").into()
6579            } else {
6580                String::new().into()
6581            },
6582            if let Some(archive_serial_number) = &self.archive_serial_number {
6583                format!("{archive_serial_number:?}").into()
6584            } else {
6585                String::new().into()
6586            },
6587            if let Some(owner) = &self.owner {
6588                format!("{owner:?}").into()
6589            } else {
6590                String::new().into()
6591            },
6592            if let Some(set_permissions) = &self.set_permissions {
6593                format!("{set_permissions:?}").into()
6594            } else {
6595                String::new().into()
6596            },
6597            if let Some(custom_fields) = &self.custom_fields {
6598                format!("{custom_fields:?}").into()
6599            } else {
6600                String::new().into()
6601            },
6602            if let Some(remove_inbox_tags) = &self.remove_inbox_tags {
6603                format!("{remove_inbox_tags:?}").into()
6604            } else {
6605                String::new().into()
6606            },
6607        ]
6608    }
6609
6610    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6611        vec![
6612            "correspondent".into(),
6613            "document_type".into(),
6614            "storage_path".into(),
6615            "title".into(),
6616            "content".into(),
6617            "tags".into(),
6618            "created".into(),
6619            "created_date".into(),
6620            "deleted_at".into(),
6621            "archive_serial_number".into(),
6622            "owner".into(),
6623            "set_permissions".into(),
6624            "custom_fields".into(),
6625            "remove_inbox_tags".into(),
6626        ]
6627    }
6628}
6629
6630#[derive(
6631    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6632)]
6633#[allow(non_snake_case)]
6634pub struct PatchedDocumentTypeRequest {
6635    #[serde(default, skip_serializing_if = "Option::is_none")]
6636    pub name: Option<String>,
6637    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
6638    pub match_: Option<String>,
6639    #[serde(default, skip_serializing_if = "Option::is_none")]
6640    pub matching_algorithm: Option<i64>,
6641    #[serde(default, skip_serializing_if = "Option::is_none")]
6642    pub is_insensitive: Option<bool>,
6643    #[serde(default, skip_serializing_if = "Option::is_none")]
6644    pub owner: Option<i64>,
6645    #[serde(default, skip_serializing_if = "Option::is_none")]
6646    pub set_permissions: Option<SetPermissions>,
6647}
6648
6649impl std::fmt::Display for PatchedDocumentTypeRequest {
6650    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6651        write!(
6652            f,
6653            "{}",
6654            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6655        )
6656    }
6657}
6658
6659#[cfg(feature = "tabled")]
6660impl tabled::Tabled for PatchedDocumentTypeRequest {
6661    const LENGTH: usize = 6;
6662    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6663        vec![
6664            if let Some(name) = &self.name {
6665                format!("{name:?}").into()
6666            } else {
6667                String::new().into()
6668            },
6669            if let Some(match_) = &self.match_ {
6670                format!("{match_:?}").into()
6671            } else {
6672                String::new().into()
6673            },
6674            if let Some(matching_algorithm) = &self.matching_algorithm {
6675                format!("{matching_algorithm:?}").into()
6676            } else {
6677                String::new().into()
6678            },
6679            if let Some(is_insensitive) = &self.is_insensitive {
6680                format!("{is_insensitive:?}").into()
6681            } else {
6682                String::new().into()
6683            },
6684            if let Some(owner) = &self.owner {
6685                format!("{owner:?}").into()
6686            } else {
6687                String::new().into()
6688            },
6689            if let Some(set_permissions) = &self.set_permissions {
6690                format!("{set_permissions:?}").into()
6691            } else {
6692                String::new().into()
6693            },
6694        ]
6695    }
6696
6697    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6698        vec![
6699            "name".into(),
6700            "match_".into(),
6701            "matching_algorithm".into(),
6702            "is_insensitive".into(),
6703            "owner".into(),
6704            "set_permissions".into(),
6705        ]
6706    }
6707}
6708
6709#[derive(
6710    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6711)]
6712#[allow(non_snake_case)]
6713pub struct PatchedGroupRequest {
6714    #[serde(default, skip_serializing_if = "Option::is_none")]
6715    pub name: Option<String>,
6716    #[serde(default, skip_serializing_if = "Option::is_none")]
6717    pub permissions: Option<Vec<String>>,
6718}
6719
6720impl std::fmt::Display for PatchedGroupRequest {
6721    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6722        write!(
6723            f,
6724            "{}",
6725            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6726        )
6727    }
6728}
6729
6730#[cfg(feature = "tabled")]
6731impl tabled::Tabled for PatchedGroupRequest {
6732    const LENGTH: usize = 2;
6733    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6734        vec![
6735            if let Some(name) = &self.name {
6736                format!("{name:?}").into()
6737            } else {
6738                String::new().into()
6739            },
6740            if let Some(permissions) = &self.permissions {
6741                format!("{permissions:?}").into()
6742            } else {
6743                String::new().into()
6744            },
6745        ]
6746    }
6747
6748    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6749        vec!["name".into(), "permissions".into()]
6750    }
6751}
6752
6753#[derive(
6754    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6755)]
6756#[allow(non_snake_case)]
6757pub struct PatchedMailAccountRequest {
6758    #[serde(default, skip_serializing_if = "Option::is_none")]
6759    pub name: Option<String>,
6760    #[serde(default, skip_serializing_if = "Option::is_none")]
6761    pub imap_server: Option<String>,
6762    #[doc = "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."]
6763    #[serde(default, skip_serializing_if = "Option::is_none")]
6764    pub imap_port: Option<i64>,
6765    #[serde(default, skip_serializing_if = "Option::is_none")]
6766    pub imap_security: Option<i64>,
6767    #[serde(default, skip_serializing_if = "Option::is_none")]
6768    pub username: Option<String>,
6769    #[serde(default, skip_serializing_if = "Option::is_none")]
6770    pub password: Option<String>,
6771    #[doc = "The character set to use when communicating with the mail server, such as 'UTF-8' or 'US-ASCII'."]
6772    #[serde(default, skip_serializing_if = "Option::is_none")]
6773    pub character_set: Option<String>,
6774    #[serde(default, skip_serializing_if = "Option::is_none")]
6775    pub is_token: Option<bool>,
6776    #[serde(default, skip_serializing_if = "Option::is_none")]
6777    pub owner: Option<i64>,
6778    #[serde(default, skip_serializing_if = "Option::is_none")]
6779    pub set_permissions: Option<SetPermissions>,
6780    #[serde(default, skip_serializing_if = "Option::is_none")]
6781    pub account_type: Option<i64>,
6782    #[doc = "The expiration date of the refresh token. "]
6783    #[serde(default, skip_serializing_if = "Option::is_none")]
6784    pub expiration: Option<chrono::DateTime<chrono::Utc>>,
6785}
6786
6787impl std::fmt::Display for PatchedMailAccountRequest {
6788    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6789        write!(
6790            f,
6791            "{}",
6792            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6793        )
6794    }
6795}
6796
6797#[cfg(feature = "tabled")]
6798impl tabled::Tabled for PatchedMailAccountRequest {
6799    const LENGTH: usize = 12;
6800    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6801        vec![
6802            if let Some(name) = &self.name {
6803                format!("{name:?}").into()
6804            } else {
6805                String::new().into()
6806            },
6807            if let Some(imap_server) = &self.imap_server {
6808                format!("{imap_server:?}").into()
6809            } else {
6810                String::new().into()
6811            },
6812            if let Some(imap_port) = &self.imap_port {
6813                format!("{imap_port:?}").into()
6814            } else {
6815                String::new().into()
6816            },
6817            if let Some(imap_security) = &self.imap_security {
6818                format!("{imap_security:?}").into()
6819            } else {
6820                String::new().into()
6821            },
6822            if let Some(username) = &self.username {
6823                format!("{username:?}").into()
6824            } else {
6825                String::new().into()
6826            },
6827            if let Some(password) = &self.password {
6828                format!("{password:?}").into()
6829            } else {
6830                String::new().into()
6831            },
6832            if let Some(character_set) = &self.character_set {
6833                format!("{character_set:?}").into()
6834            } else {
6835                String::new().into()
6836            },
6837            if let Some(is_token) = &self.is_token {
6838                format!("{is_token:?}").into()
6839            } else {
6840                String::new().into()
6841            },
6842            if let Some(owner) = &self.owner {
6843                format!("{owner:?}").into()
6844            } else {
6845                String::new().into()
6846            },
6847            if let Some(set_permissions) = &self.set_permissions {
6848                format!("{set_permissions:?}").into()
6849            } else {
6850                String::new().into()
6851            },
6852            if let Some(account_type) = &self.account_type {
6853                format!("{account_type:?}").into()
6854            } else {
6855                String::new().into()
6856            },
6857            if let Some(expiration) = &self.expiration {
6858                format!("{expiration:?}").into()
6859            } else {
6860                String::new().into()
6861            },
6862        ]
6863    }
6864
6865    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6866        vec![
6867            "name".into(),
6868            "imap_server".into(),
6869            "imap_port".into(),
6870            "imap_security".into(),
6871            "username".into(),
6872            "password".into(),
6873            "character_set".into(),
6874            "is_token".into(),
6875            "owner".into(),
6876            "set_permissions".into(),
6877            "account_type".into(),
6878            "expiration".into(),
6879        ]
6880    }
6881}
6882
6883#[derive(
6884    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6885)]
6886#[allow(non_snake_case)]
6887pub struct PatchedMailRuleRequest {
6888    #[serde(default, skip_serializing_if = "Option::is_none")]
6889    pub name: Option<String>,
6890    #[serde(default, skip_serializing_if = "Option::is_none")]
6891    pub account: Option<i64>,
6892    #[serde(default, skip_serializing_if = "Option::is_none")]
6893    pub enabled: Option<bool>,
6894    #[doc = "Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server."]
6895    #[serde(default, skip_serializing_if = "Option::is_none")]
6896    pub folder: Option<String>,
6897    #[serde(default, skip_serializing_if = "Option::is_none")]
6898    pub filter_from: Option<String>,
6899    #[serde(default, skip_serializing_if = "Option::is_none")]
6900    pub filter_to: Option<String>,
6901    #[serde(default, skip_serializing_if = "Option::is_none")]
6902    pub filter_subject: Option<String>,
6903    #[serde(default, skip_serializing_if = "Option::is_none")]
6904    pub filter_body: Option<String>,
6905    #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
6906    #[serde(default, skip_serializing_if = "Option::is_none")]
6907    pub filter_attachment_filename_include: Option<String>,
6908    #[doc = "Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
6909    #[serde(default, skip_serializing_if = "Option::is_none")]
6910    pub filter_attachment_filename_exclude: Option<String>,
6911    #[doc = "Specified in days."]
6912    #[serde(default, skip_serializing_if = "Option::is_none")]
6913    pub maximum_age: Option<i64>,
6914    #[serde(default, skip_serializing_if = "Option::is_none")]
6915    pub action: Option<i64>,
6916    #[serde(default, skip_serializing_if = "Option::is_none")]
6917    pub action_parameter: Option<String>,
6918    #[serde(default, skip_serializing_if = "Option::is_none")]
6919    pub assign_title_from: Option<i64>,
6920    #[serde(default, skip_serializing_if = "Option::is_none")]
6921    pub assign_tags: Option<Vec<Option<i64>>>,
6922    #[serde(default, skip_serializing_if = "Option::is_none")]
6923    pub assign_correspondent_from: Option<i64>,
6924    #[serde(default, skip_serializing_if = "Option::is_none")]
6925    pub assign_correspondent: Option<i64>,
6926    #[serde(default, skip_serializing_if = "Option::is_none")]
6927    pub assign_document_type: Option<i64>,
6928    #[serde(default, skip_serializing_if = "Option::is_none")]
6929    pub assign_owner_from_rule: Option<bool>,
6930    #[serde(default, skip_serializing_if = "Option::is_none")]
6931    pub order: Option<i64>,
6932    #[doc = "Inline attachments include embedded images, so it's best to combine this option with a filename filter.\n\n* `1` - Only process attachments.\n* `2` - Process all files, including 'inline' attachments."]
6933    #[serde(default, skip_serializing_if = "Option::is_none")]
6934    pub attachment_type: Option<i64>,
6935    #[serde(default, skip_serializing_if = "Option::is_none")]
6936    pub consumption_scope: Option<i64>,
6937    #[serde(default, skip_serializing_if = "Option::is_none")]
6938    pub pdf_layout: Option<i64>,
6939    #[serde(default, skip_serializing_if = "Option::is_none")]
6940    pub owner: Option<i64>,
6941    #[serde(default, skip_serializing_if = "Option::is_none")]
6942    pub set_permissions: Option<SetPermissions>,
6943}
6944
6945impl std::fmt::Display for PatchedMailRuleRequest {
6946    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6947        write!(
6948            f,
6949            "{}",
6950            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6951        )
6952    }
6953}
6954
6955#[cfg(feature = "tabled")]
6956impl tabled::Tabled for PatchedMailRuleRequest {
6957    const LENGTH: usize = 25;
6958    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6959        vec![
6960            if let Some(name) = &self.name {
6961                format!("{name:?}").into()
6962            } else {
6963                String::new().into()
6964            },
6965            if let Some(account) = &self.account {
6966                format!("{account:?}").into()
6967            } else {
6968                String::new().into()
6969            },
6970            if let Some(enabled) = &self.enabled {
6971                format!("{enabled:?}").into()
6972            } else {
6973                String::new().into()
6974            },
6975            if let Some(folder) = &self.folder {
6976                format!("{folder:?}").into()
6977            } else {
6978                String::new().into()
6979            },
6980            if let Some(filter_from) = &self.filter_from {
6981                format!("{filter_from:?}").into()
6982            } else {
6983                String::new().into()
6984            },
6985            if let Some(filter_to) = &self.filter_to {
6986                format!("{filter_to:?}").into()
6987            } else {
6988                String::new().into()
6989            },
6990            if let Some(filter_subject) = &self.filter_subject {
6991                format!("{filter_subject:?}").into()
6992            } else {
6993                String::new().into()
6994            },
6995            if let Some(filter_body) = &self.filter_body {
6996                format!("{filter_body:?}").into()
6997            } else {
6998                String::new().into()
6999            },
7000            if let Some(filter_attachment_filename_include) =
7001                &self.filter_attachment_filename_include
7002            {
7003                format!("{filter_attachment_filename_include:?}").into()
7004            } else {
7005                String::new().into()
7006            },
7007            if let Some(filter_attachment_filename_exclude) =
7008                &self.filter_attachment_filename_exclude
7009            {
7010                format!("{filter_attachment_filename_exclude:?}").into()
7011            } else {
7012                String::new().into()
7013            },
7014            if let Some(maximum_age) = &self.maximum_age {
7015                format!("{maximum_age:?}").into()
7016            } else {
7017                String::new().into()
7018            },
7019            if let Some(action) = &self.action {
7020                format!("{action:?}").into()
7021            } else {
7022                String::new().into()
7023            },
7024            if let Some(action_parameter) = &self.action_parameter {
7025                format!("{action_parameter:?}").into()
7026            } else {
7027                String::new().into()
7028            },
7029            if let Some(assign_title_from) = &self.assign_title_from {
7030                format!("{assign_title_from:?}").into()
7031            } else {
7032                String::new().into()
7033            },
7034            if let Some(assign_tags) = &self.assign_tags {
7035                format!("{assign_tags:?}").into()
7036            } else {
7037                String::new().into()
7038            },
7039            if let Some(assign_correspondent_from) = &self.assign_correspondent_from {
7040                format!("{assign_correspondent_from:?}").into()
7041            } else {
7042                String::new().into()
7043            },
7044            if let Some(assign_correspondent) = &self.assign_correspondent {
7045                format!("{assign_correspondent:?}").into()
7046            } else {
7047                String::new().into()
7048            },
7049            if let Some(assign_document_type) = &self.assign_document_type {
7050                format!("{assign_document_type:?}").into()
7051            } else {
7052                String::new().into()
7053            },
7054            if let Some(assign_owner_from_rule) = &self.assign_owner_from_rule {
7055                format!("{assign_owner_from_rule:?}").into()
7056            } else {
7057                String::new().into()
7058            },
7059            if let Some(order) = &self.order {
7060                format!("{order:?}").into()
7061            } else {
7062                String::new().into()
7063            },
7064            if let Some(attachment_type) = &self.attachment_type {
7065                format!("{attachment_type:?}").into()
7066            } else {
7067                String::new().into()
7068            },
7069            if let Some(consumption_scope) = &self.consumption_scope {
7070                format!("{consumption_scope:?}").into()
7071            } else {
7072                String::new().into()
7073            },
7074            if let Some(pdf_layout) = &self.pdf_layout {
7075                format!("{pdf_layout:?}").into()
7076            } else {
7077                String::new().into()
7078            },
7079            if let Some(owner) = &self.owner {
7080                format!("{owner:?}").into()
7081            } else {
7082                String::new().into()
7083            },
7084            if let Some(set_permissions) = &self.set_permissions {
7085                format!("{set_permissions:?}").into()
7086            } else {
7087                String::new().into()
7088            },
7089        ]
7090    }
7091
7092    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7093        vec![
7094            "name".into(),
7095            "account".into(),
7096            "enabled".into(),
7097            "folder".into(),
7098            "filter_from".into(),
7099            "filter_to".into(),
7100            "filter_subject".into(),
7101            "filter_body".into(),
7102            "filter_attachment_filename_include".into(),
7103            "filter_attachment_filename_exclude".into(),
7104            "maximum_age".into(),
7105            "action".into(),
7106            "action_parameter".into(),
7107            "assign_title_from".into(),
7108            "assign_tags".into(),
7109            "assign_correspondent_from".into(),
7110            "assign_correspondent".into(),
7111            "assign_document_type".into(),
7112            "assign_owner_from_rule".into(),
7113            "order".into(),
7114            "attachment_type".into(),
7115            "consumption_scope".into(),
7116            "pdf_layout".into(),
7117            "owner".into(),
7118            "set_permissions".into(),
7119        ]
7120    }
7121}
7122
7123#[derive(
7124    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7125)]
7126#[allow(non_snake_case)]
7127pub struct PatchedProfileRequest {
7128    #[serde(default, skip_serializing_if = "Option::is_none")]
7129    pub email: Option<String>,
7130    #[serde(default, skip_serializing_if = "Option::is_none")]
7131    pub password: Option<String>,
7132    #[serde(default, skip_serializing_if = "Option::is_none")]
7133    pub first_name: Option<String>,
7134    #[serde(default, skip_serializing_if = "Option::is_none")]
7135    pub last_name: Option<String>,
7136}
7137
7138impl std::fmt::Display for PatchedProfileRequest {
7139    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7140        write!(
7141            f,
7142            "{}",
7143            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7144        )
7145    }
7146}
7147
7148#[cfg(feature = "tabled")]
7149impl tabled::Tabled for PatchedProfileRequest {
7150    const LENGTH: usize = 4;
7151    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7152        vec![
7153            if let Some(email) = &self.email {
7154                format!("{email:?}").into()
7155            } else {
7156                String::new().into()
7157            },
7158            if let Some(password) = &self.password {
7159                format!("{password:?}").into()
7160            } else {
7161                String::new().into()
7162            },
7163            if let Some(first_name) = &self.first_name {
7164                format!("{first_name:?}").into()
7165            } else {
7166                String::new().into()
7167            },
7168            if let Some(last_name) = &self.last_name {
7169                format!("{last_name:?}").into()
7170            } else {
7171                String::new().into()
7172            },
7173        ]
7174    }
7175
7176    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7177        vec![
7178            "email".into(),
7179            "password".into(),
7180            "first_name".into(),
7181            "last_name".into(),
7182        ]
7183    }
7184}
7185
7186#[derive(
7187    serde :: Serialize,
7188    serde :: Deserialize,
7189    PartialEq,
7190    Hash,
7191    Debug,
7192    Clone,
7193    schemars :: JsonSchema,
7194    parse_display :: FromStr,
7195    parse_display :: Display,
7196)]
7197#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
7198#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7199pub enum DisplayMode {
7200    #[serde(rename = "table")]
7201    #[display("table")]
7202    Table,
7203    #[serde(rename = "smallCards")]
7204    #[display("smallCards")]
7205    SmallCards,
7206    #[serde(rename = "largeCards")]
7207    #[display("largeCards")]
7208    LargeCards,
7209    #[serde(rename = "")]
7210    #[display("")]
7211    Empty,
7212}
7213
7214#[derive(
7215    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7216)]
7217#[allow(non_snake_case)]
7218pub struct PatchedSavedViewRequest {
7219    #[serde(default, skip_serializing_if = "Option::is_none")]
7220    pub name: Option<String>,
7221    #[serde(default, skip_serializing_if = "Option::is_none")]
7222    pub show_on_dashboard: Option<bool>,
7223    #[serde(default, skip_serializing_if = "Option::is_none")]
7224    pub show_in_sidebar: Option<bool>,
7225    #[serde(default, skip_serializing_if = "Option::is_none")]
7226    pub sort_field: Option<String>,
7227    #[serde(default, skip_serializing_if = "Option::is_none")]
7228    pub sort_reverse: Option<bool>,
7229    #[serde(default, skip_serializing_if = "Option::is_none")]
7230    pub filter_rules: Option<Vec<SavedViewFilterRuleRequest>>,
7231    #[serde(default, skip_serializing_if = "Option::is_none")]
7232    pub page_size: Option<i64>,
7233    #[serde(default, skip_serializing_if = "Option::is_none")]
7234    pub display_mode: Option<DisplayMode>,
7235    #[serde(default, skip_serializing_if = "Option::is_none")]
7236    pub display_fields: Option<serde_json::Value>,
7237    #[serde(default, skip_serializing_if = "Option::is_none")]
7238    pub owner: Option<i64>,
7239}
7240
7241impl std::fmt::Display for PatchedSavedViewRequest {
7242    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7243        write!(
7244            f,
7245            "{}",
7246            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7247        )
7248    }
7249}
7250
7251#[cfg(feature = "tabled")]
7252impl tabled::Tabled for PatchedSavedViewRequest {
7253    const LENGTH: usize = 10;
7254    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7255        vec![
7256            if let Some(name) = &self.name {
7257                format!("{name:?}").into()
7258            } else {
7259                String::new().into()
7260            },
7261            if let Some(show_on_dashboard) = &self.show_on_dashboard {
7262                format!("{show_on_dashboard:?}").into()
7263            } else {
7264                String::new().into()
7265            },
7266            if let Some(show_in_sidebar) = &self.show_in_sidebar {
7267                format!("{show_in_sidebar:?}").into()
7268            } else {
7269                String::new().into()
7270            },
7271            if let Some(sort_field) = &self.sort_field {
7272                format!("{sort_field:?}").into()
7273            } else {
7274                String::new().into()
7275            },
7276            if let Some(sort_reverse) = &self.sort_reverse {
7277                format!("{sort_reverse:?}").into()
7278            } else {
7279                String::new().into()
7280            },
7281            if let Some(filter_rules) = &self.filter_rules {
7282                format!("{filter_rules:?}").into()
7283            } else {
7284                String::new().into()
7285            },
7286            if let Some(page_size) = &self.page_size {
7287                format!("{page_size:?}").into()
7288            } else {
7289                String::new().into()
7290            },
7291            if let Some(display_mode) = &self.display_mode {
7292                format!("{display_mode:?}").into()
7293            } else {
7294                String::new().into()
7295            },
7296            if let Some(display_fields) = &self.display_fields {
7297                format!("{display_fields:?}").into()
7298            } else {
7299                String::new().into()
7300            },
7301            if let Some(owner) = &self.owner {
7302                format!("{owner:?}").into()
7303            } else {
7304                String::new().into()
7305            },
7306        ]
7307    }
7308
7309    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7310        vec![
7311            "name".into(),
7312            "show_on_dashboard".into(),
7313            "show_in_sidebar".into(),
7314            "sort_field".into(),
7315            "sort_reverse".into(),
7316            "filter_rules".into(),
7317            "page_size".into(),
7318            "display_mode".into(),
7319            "display_fields".into(),
7320            "owner".into(),
7321        ]
7322    }
7323}
7324
7325#[derive(
7326    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7327)]
7328#[allow(non_snake_case)]
7329pub struct PatchedStoragePathRequest {
7330    #[serde(default, skip_serializing_if = "Option::is_none")]
7331    pub name: Option<String>,
7332    #[serde(default, skip_serializing_if = "Option::is_none")]
7333    pub path: Option<String>,
7334    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
7335    pub match_: Option<String>,
7336    #[serde(default, skip_serializing_if = "Option::is_none")]
7337    pub matching_algorithm: Option<i64>,
7338    #[serde(default, skip_serializing_if = "Option::is_none")]
7339    pub is_insensitive: Option<bool>,
7340    #[serde(default, skip_serializing_if = "Option::is_none")]
7341    pub owner: Option<i64>,
7342    #[serde(default, skip_serializing_if = "Option::is_none")]
7343    pub set_permissions: Option<SetPermissions>,
7344}
7345
7346impl std::fmt::Display for PatchedStoragePathRequest {
7347    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7348        write!(
7349            f,
7350            "{}",
7351            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7352        )
7353    }
7354}
7355
7356#[cfg(feature = "tabled")]
7357impl tabled::Tabled for PatchedStoragePathRequest {
7358    const LENGTH: usize = 7;
7359    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7360        vec![
7361            if let Some(name) = &self.name {
7362                format!("{name:?}").into()
7363            } else {
7364                String::new().into()
7365            },
7366            if let Some(path) = &self.path {
7367                format!("{path:?}").into()
7368            } else {
7369                String::new().into()
7370            },
7371            if let Some(match_) = &self.match_ {
7372                format!("{match_:?}").into()
7373            } else {
7374                String::new().into()
7375            },
7376            if let Some(matching_algorithm) = &self.matching_algorithm {
7377                format!("{matching_algorithm:?}").into()
7378            } else {
7379                String::new().into()
7380            },
7381            if let Some(is_insensitive) = &self.is_insensitive {
7382                format!("{is_insensitive:?}").into()
7383            } else {
7384                String::new().into()
7385            },
7386            if let Some(owner) = &self.owner {
7387                format!("{owner:?}").into()
7388            } else {
7389                String::new().into()
7390            },
7391            if let Some(set_permissions) = &self.set_permissions {
7392                format!("{set_permissions:?}").into()
7393            } else {
7394                String::new().into()
7395            },
7396        ]
7397    }
7398
7399    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7400        vec![
7401            "name".into(),
7402            "path".into(),
7403            "match_".into(),
7404            "matching_algorithm".into(),
7405            "is_insensitive".into(),
7406            "owner".into(),
7407            "set_permissions".into(),
7408        ]
7409    }
7410}
7411
7412#[derive(
7413    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7414)]
7415#[allow(non_snake_case)]
7416pub struct PatchedTagRequest {
7417    #[serde(default, skip_serializing_if = "Option::is_none")]
7418    pub name: Option<String>,
7419    #[serde(default, skip_serializing_if = "Option::is_none")]
7420    pub color: Option<String>,
7421    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
7422    pub match_: Option<String>,
7423    #[serde(default, skip_serializing_if = "Option::is_none")]
7424    pub matching_algorithm: Option<i64>,
7425    #[serde(default, skip_serializing_if = "Option::is_none")]
7426    pub is_insensitive: Option<bool>,
7427    #[doc = "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."]
7428    #[serde(default, skip_serializing_if = "Option::is_none")]
7429    pub is_inbox_tag: Option<bool>,
7430    #[serde(default, skip_serializing_if = "Option::is_none")]
7431    pub owner: Option<i64>,
7432    #[serde(default, skip_serializing_if = "Option::is_none")]
7433    pub set_permissions: Option<SetPermissions>,
7434    #[serde(default, skip_serializing_if = "Option::is_none")]
7435    pub parent: Option<i64>,
7436}
7437
7438impl std::fmt::Display for PatchedTagRequest {
7439    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7440        write!(
7441            f,
7442            "{}",
7443            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7444        )
7445    }
7446}
7447
7448#[cfg(feature = "tabled")]
7449impl tabled::Tabled for PatchedTagRequest {
7450    const LENGTH: usize = 9;
7451    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7452        vec![
7453            if let Some(name) = &self.name {
7454                format!("{name:?}").into()
7455            } else {
7456                String::new().into()
7457            },
7458            if let Some(color) = &self.color {
7459                format!("{color:?}").into()
7460            } else {
7461                String::new().into()
7462            },
7463            if let Some(match_) = &self.match_ {
7464                format!("{match_:?}").into()
7465            } else {
7466                String::new().into()
7467            },
7468            if let Some(matching_algorithm) = &self.matching_algorithm {
7469                format!("{matching_algorithm:?}").into()
7470            } else {
7471                String::new().into()
7472            },
7473            if let Some(is_insensitive) = &self.is_insensitive {
7474                format!("{is_insensitive:?}").into()
7475            } else {
7476                String::new().into()
7477            },
7478            if let Some(is_inbox_tag) = &self.is_inbox_tag {
7479                format!("{is_inbox_tag:?}").into()
7480            } else {
7481                String::new().into()
7482            },
7483            if let Some(owner) = &self.owner {
7484                format!("{owner:?}").into()
7485            } else {
7486                String::new().into()
7487            },
7488            if let Some(set_permissions) = &self.set_permissions {
7489                format!("{set_permissions:?}").into()
7490            } else {
7491                String::new().into()
7492            },
7493            if let Some(parent) = &self.parent {
7494                format!("{parent:?}").into()
7495            } else {
7496                String::new().into()
7497            },
7498        ]
7499    }
7500
7501    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7502        vec![
7503            "name".into(),
7504            "color".into(),
7505            "match_".into(),
7506            "matching_algorithm".into(),
7507            "is_insensitive".into(),
7508            "is_inbox_tag".into(),
7509            "owner".into(),
7510            "set_permissions".into(),
7511            "parent".into(),
7512        ]
7513    }
7514}
7515
7516#[derive(
7517    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7518)]
7519#[allow(non_snake_case)]
7520pub struct PatchedUserRequest {
7521    #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
7522    #[serde(default, skip_serializing_if = "Option::is_none")]
7523    pub username: Option<String>,
7524    #[serde(default, skip_serializing_if = "Option::is_none")]
7525    pub email: Option<String>,
7526    #[serde(default, skip_serializing_if = "Option::is_none")]
7527    pub password: Option<String>,
7528    #[serde(default, skip_serializing_if = "Option::is_none")]
7529    pub first_name: Option<String>,
7530    #[serde(default, skip_serializing_if = "Option::is_none")]
7531    pub last_name: Option<String>,
7532    #[serde(default, skip_serializing_if = "Option::is_none")]
7533    pub date_joined: Option<chrono::DateTime<chrono::Utc>>,
7534    #[doc = "Designates whether the user can log into this admin site."]
7535    #[serde(default, skip_serializing_if = "Option::is_none")]
7536    pub is_staff: Option<bool>,
7537    #[doc = "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."]
7538    #[serde(default, skip_serializing_if = "Option::is_none")]
7539    pub is_active: Option<bool>,
7540    #[doc = "Designates that this user has all permissions without explicitly assigning them."]
7541    #[serde(default, skip_serializing_if = "Option::is_none")]
7542    pub is_superuser: Option<bool>,
7543    #[doc = "The groups this user belongs to. A user will get all permissions granted to each of their groups."]
7544    #[serde(default, skip_serializing_if = "Option::is_none")]
7545    pub groups: Option<Vec<i64>>,
7546    #[serde(default, skip_serializing_if = "Option::is_none")]
7547    pub user_permissions: Option<Vec<String>>,
7548}
7549
7550impl std::fmt::Display for PatchedUserRequest {
7551    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7552        write!(
7553            f,
7554            "{}",
7555            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7556        )
7557    }
7558}
7559
7560#[cfg(feature = "tabled")]
7561impl tabled::Tabled for PatchedUserRequest {
7562    const LENGTH: usize = 11;
7563    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7564        vec![
7565            if let Some(username) = &self.username {
7566                format!("{username:?}").into()
7567            } else {
7568                String::new().into()
7569            },
7570            if let Some(email) = &self.email {
7571                format!("{email:?}").into()
7572            } else {
7573                String::new().into()
7574            },
7575            if let Some(password) = &self.password {
7576                format!("{password:?}").into()
7577            } else {
7578                String::new().into()
7579            },
7580            if let Some(first_name) = &self.first_name {
7581                format!("{first_name:?}").into()
7582            } else {
7583                String::new().into()
7584            },
7585            if let Some(last_name) = &self.last_name {
7586                format!("{last_name:?}").into()
7587            } else {
7588                String::new().into()
7589            },
7590            if let Some(date_joined) = &self.date_joined {
7591                format!("{date_joined:?}").into()
7592            } else {
7593                String::new().into()
7594            },
7595            if let Some(is_staff) = &self.is_staff {
7596                format!("{is_staff:?}").into()
7597            } else {
7598                String::new().into()
7599            },
7600            if let Some(is_active) = &self.is_active {
7601                format!("{is_active:?}").into()
7602            } else {
7603                String::new().into()
7604            },
7605            if let Some(is_superuser) = &self.is_superuser {
7606                format!("{is_superuser:?}").into()
7607            } else {
7608                String::new().into()
7609            },
7610            if let Some(groups) = &self.groups {
7611                format!("{groups:?}").into()
7612            } else {
7613                String::new().into()
7614            },
7615            if let Some(user_permissions) = &self.user_permissions {
7616                format!("{user_permissions:?}").into()
7617            } else {
7618                String::new().into()
7619            },
7620        ]
7621    }
7622
7623    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7624        vec![
7625            "username".into(),
7626            "email".into(),
7627            "password".into(),
7628            "first_name".into(),
7629            "last_name".into(),
7630            "date_joined".into(),
7631            "is_staff".into(),
7632            "is_active".into(),
7633            "is_superuser".into(),
7634            "groups".into(),
7635            "user_permissions".into(),
7636        ]
7637    }
7638}
7639
7640#[derive(
7641    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7642)]
7643#[allow(non_snake_case)]
7644pub struct PatchedWorkflowActionRequest {
7645    #[serde(default, skip_serializing_if = "Option::is_none")]
7646    pub id: Option<i64>,
7647    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
7648    pub type_: Option<i64>,
7649    #[doc = "Assign a document title, must  be a Jinja2 template, see documentation."]
7650    #[serde(default, skip_serializing_if = "Option::is_none")]
7651    pub assign_title: Option<String>,
7652    #[serde(default, skip_serializing_if = "Option::is_none")]
7653    pub assign_tags: Option<Vec<Option<i64>>>,
7654    #[serde(default, skip_serializing_if = "Option::is_none")]
7655    pub assign_correspondent: Option<i64>,
7656    #[serde(default, skip_serializing_if = "Option::is_none")]
7657    pub assign_document_type: Option<i64>,
7658    #[serde(default, skip_serializing_if = "Option::is_none")]
7659    pub assign_storage_path: Option<i64>,
7660    #[serde(default, skip_serializing_if = "Option::is_none")]
7661    pub assign_owner: Option<i64>,
7662    #[serde(default, skip_serializing_if = "Option::is_none")]
7663    pub assign_view_users: Option<Vec<i64>>,
7664    #[serde(default, skip_serializing_if = "Option::is_none")]
7665    pub assign_view_groups: Option<Vec<i64>>,
7666    #[serde(default, skip_serializing_if = "Option::is_none")]
7667    pub assign_change_users: Option<Vec<i64>>,
7668    #[serde(default, skip_serializing_if = "Option::is_none")]
7669    pub assign_change_groups: Option<Vec<i64>>,
7670    #[serde(default, skip_serializing_if = "Option::is_none")]
7671    pub assign_custom_fields: Option<Vec<i64>>,
7672    #[doc = "Optional values to assign to the custom fields."]
7673    #[serde(default, skip_serializing_if = "Option::is_none")]
7674    pub assign_custom_fields_values: Option<serde_json::Value>,
7675    #[serde(default, skip_serializing_if = "Option::is_none")]
7676    pub remove_all_tags: Option<bool>,
7677    #[serde(default, skip_serializing_if = "Option::is_none")]
7678    pub remove_tags: Option<Vec<i64>>,
7679    #[serde(default, skip_serializing_if = "Option::is_none")]
7680    pub remove_all_correspondents: Option<bool>,
7681    #[serde(default, skip_serializing_if = "Option::is_none")]
7682    pub remove_correspondents: Option<Vec<i64>>,
7683    #[serde(default, skip_serializing_if = "Option::is_none")]
7684    pub remove_all_document_types: Option<bool>,
7685    #[serde(default, skip_serializing_if = "Option::is_none")]
7686    pub remove_document_types: Option<Vec<i64>>,
7687    #[serde(default, skip_serializing_if = "Option::is_none")]
7688    pub remove_all_storage_paths: Option<bool>,
7689    #[serde(default, skip_serializing_if = "Option::is_none")]
7690    pub remove_storage_paths: Option<Vec<i64>>,
7691    #[serde(default, skip_serializing_if = "Option::is_none")]
7692    pub remove_custom_fields: Option<Vec<i64>>,
7693    #[serde(default, skip_serializing_if = "Option::is_none")]
7694    pub remove_all_custom_fields: Option<bool>,
7695    #[serde(default, skip_serializing_if = "Option::is_none")]
7696    pub remove_all_owners: Option<bool>,
7697    #[serde(default, skip_serializing_if = "Option::is_none")]
7698    pub remove_owners: Option<Vec<i64>>,
7699    #[serde(default, skip_serializing_if = "Option::is_none")]
7700    pub remove_all_permissions: Option<bool>,
7701    #[serde(default, skip_serializing_if = "Option::is_none")]
7702    pub remove_view_users: Option<Vec<i64>>,
7703    #[serde(default, skip_serializing_if = "Option::is_none")]
7704    pub remove_view_groups: Option<Vec<i64>>,
7705    #[serde(default, skip_serializing_if = "Option::is_none")]
7706    pub remove_change_users: Option<Vec<i64>>,
7707    #[serde(default, skip_serializing_if = "Option::is_none")]
7708    pub remove_change_groups: Option<Vec<i64>>,
7709    #[serde(default, skip_serializing_if = "Option::is_none")]
7710    pub email: Option<WorkflowActionEmailRequest>,
7711    #[serde(default, skip_serializing_if = "Option::is_none")]
7712    pub webhook: Option<WorkflowActionWebhookRequest>,
7713}
7714
7715impl std::fmt::Display for PatchedWorkflowActionRequest {
7716    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7717        write!(
7718            f,
7719            "{}",
7720            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7721        )
7722    }
7723}
7724
7725#[cfg(feature = "tabled")]
7726impl tabled::Tabled for PatchedWorkflowActionRequest {
7727    const LENGTH: usize = 33;
7728    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7729        vec![
7730            if let Some(id) = &self.id {
7731                format!("{id:?}").into()
7732            } else {
7733                String::new().into()
7734            },
7735            if let Some(type_) = &self.type_ {
7736                format!("{type_:?}").into()
7737            } else {
7738                String::new().into()
7739            },
7740            if let Some(assign_title) = &self.assign_title {
7741                format!("{assign_title:?}").into()
7742            } else {
7743                String::new().into()
7744            },
7745            if let Some(assign_tags) = &self.assign_tags {
7746                format!("{assign_tags:?}").into()
7747            } else {
7748                String::new().into()
7749            },
7750            if let Some(assign_correspondent) = &self.assign_correspondent {
7751                format!("{assign_correspondent:?}").into()
7752            } else {
7753                String::new().into()
7754            },
7755            if let Some(assign_document_type) = &self.assign_document_type {
7756                format!("{assign_document_type:?}").into()
7757            } else {
7758                String::new().into()
7759            },
7760            if let Some(assign_storage_path) = &self.assign_storage_path {
7761                format!("{assign_storage_path:?}").into()
7762            } else {
7763                String::new().into()
7764            },
7765            if let Some(assign_owner) = &self.assign_owner {
7766                format!("{assign_owner:?}").into()
7767            } else {
7768                String::new().into()
7769            },
7770            if let Some(assign_view_users) = &self.assign_view_users {
7771                format!("{assign_view_users:?}").into()
7772            } else {
7773                String::new().into()
7774            },
7775            if let Some(assign_view_groups) = &self.assign_view_groups {
7776                format!("{assign_view_groups:?}").into()
7777            } else {
7778                String::new().into()
7779            },
7780            if let Some(assign_change_users) = &self.assign_change_users {
7781                format!("{assign_change_users:?}").into()
7782            } else {
7783                String::new().into()
7784            },
7785            if let Some(assign_change_groups) = &self.assign_change_groups {
7786                format!("{assign_change_groups:?}").into()
7787            } else {
7788                String::new().into()
7789            },
7790            if let Some(assign_custom_fields) = &self.assign_custom_fields {
7791                format!("{assign_custom_fields:?}").into()
7792            } else {
7793                String::new().into()
7794            },
7795            if let Some(assign_custom_fields_values) = &self.assign_custom_fields_values {
7796                format!("{assign_custom_fields_values:?}").into()
7797            } else {
7798                String::new().into()
7799            },
7800            if let Some(remove_all_tags) = &self.remove_all_tags {
7801                format!("{remove_all_tags:?}").into()
7802            } else {
7803                String::new().into()
7804            },
7805            if let Some(remove_tags) = &self.remove_tags {
7806                format!("{remove_tags:?}").into()
7807            } else {
7808                String::new().into()
7809            },
7810            if let Some(remove_all_correspondents) = &self.remove_all_correspondents {
7811                format!("{remove_all_correspondents:?}").into()
7812            } else {
7813                String::new().into()
7814            },
7815            if let Some(remove_correspondents) = &self.remove_correspondents {
7816                format!("{remove_correspondents:?}").into()
7817            } else {
7818                String::new().into()
7819            },
7820            if let Some(remove_all_document_types) = &self.remove_all_document_types {
7821                format!("{remove_all_document_types:?}").into()
7822            } else {
7823                String::new().into()
7824            },
7825            if let Some(remove_document_types) = &self.remove_document_types {
7826                format!("{remove_document_types:?}").into()
7827            } else {
7828                String::new().into()
7829            },
7830            if let Some(remove_all_storage_paths) = &self.remove_all_storage_paths {
7831                format!("{remove_all_storage_paths:?}").into()
7832            } else {
7833                String::new().into()
7834            },
7835            if let Some(remove_storage_paths) = &self.remove_storage_paths {
7836                format!("{remove_storage_paths:?}").into()
7837            } else {
7838                String::new().into()
7839            },
7840            if let Some(remove_custom_fields) = &self.remove_custom_fields {
7841                format!("{remove_custom_fields:?}").into()
7842            } else {
7843                String::new().into()
7844            },
7845            if let Some(remove_all_custom_fields) = &self.remove_all_custom_fields {
7846                format!("{remove_all_custom_fields:?}").into()
7847            } else {
7848                String::new().into()
7849            },
7850            if let Some(remove_all_owners) = &self.remove_all_owners {
7851                format!("{remove_all_owners:?}").into()
7852            } else {
7853                String::new().into()
7854            },
7855            if let Some(remove_owners) = &self.remove_owners {
7856                format!("{remove_owners:?}").into()
7857            } else {
7858                String::new().into()
7859            },
7860            if let Some(remove_all_permissions) = &self.remove_all_permissions {
7861                format!("{remove_all_permissions:?}").into()
7862            } else {
7863                String::new().into()
7864            },
7865            if let Some(remove_view_users) = &self.remove_view_users {
7866                format!("{remove_view_users:?}").into()
7867            } else {
7868                String::new().into()
7869            },
7870            if let Some(remove_view_groups) = &self.remove_view_groups {
7871                format!("{remove_view_groups:?}").into()
7872            } else {
7873                String::new().into()
7874            },
7875            if let Some(remove_change_users) = &self.remove_change_users {
7876                format!("{remove_change_users:?}").into()
7877            } else {
7878                String::new().into()
7879            },
7880            if let Some(remove_change_groups) = &self.remove_change_groups {
7881                format!("{remove_change_groups:?}").into()
7882            } else {
7883                String::new().into()
7884            },
7885            if let Some(email) = &self.email {
7886                format!("{email:?}").into()
7887            } else {
7888                String::new().into()
7889            },
7890            if let Some(webhook) = &self.webhook {
7891                format!("{webhook:?}").into()
7892            } else {
7893                String::new().into()
7894            },
7895        ]
7896    }
7897
7898    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7899        vec![
7900            "id".into(),
7901            "type_".into(),
7902            "assign_title".into(),
7903            "assign_tags".into(),
7904            "assign_correspondent".into(),
7905            "assign_document_type".into(),
7906            "assign_storage_path".into(),
7907            "assign_owner".into(),
7908            "assign_view_users".into(),
7909            "assign_view_groups".into(),
7910            "assign_change_users".into(),
7911            "assign_change_groups".into(),
7912            "assign_custom_fields".into(),
7913            "assign_custom_fields_values".into(),
7914            "remove_all_tags".into(),
7915            "remove_tags".into(),
7916            "remove_all_correspondents".into(),
7917            "remove_correspondents".into(),
7918            "remove_all_document_types".into(),
7919            "remove_document_types".into(),
7920            "remove_all_storage_paths".into(),
7921            "remove_storage_paths".into(),
7922            "remove_custom_fields".into(),
7923            "remove_all_custom_fields".into(),
7924            "remove_all_owners".into(),
7925            "remove_owners".into(),
7926            "remove_all_permissions".into(),
7927            "remove_view_users".into(),
7928            "remove_view_groups".into(),
7929            "remove_change_users".into(),
7930            "remove_change_groups".into(),
7931            "email".into(),
7932            "webhook".into(),
7933        ]
7934    }
7935}
7936
7937#[derive(
7938    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7939)]
7940#[allow(non_snake_case)]
7941pub struct PatchedWorkflowRequest {
7942    #[serde(default, skip_serializing_if = "Option::is_none")]
7943    pub name: Option<String>,
7944    #[serde(default, skip_serializing_if = "Option::is_none")]
7945    pub order: Option<i64>,
7946    #[serde(default, skip_serializing_if = "Option::is_none")]
7947    pub enabled: Option<bool>,
7948    #[serde(default, skip_serializing_if = "Option::is_none")]
7949    pub triggers: Option<Vec<WorkflowTriggerRequest>>,
7950    #[serde(default, skip_serializing_if = "Option::is_none")]
7951    pub actions: Option<Vec<WorkflowActionRequest>>,
7952}
7953
7954impl std::fmt::Display for PatchedWorkflowRequest {
7955    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7956        write!(
7957            f,
7958            "{}",
7959            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7960        )
7961    }
7962}
7963
7964#[cfg(feature = "tabled")]
7965impl tabled::Tabled for PatchedWorkflowRequest {
7966    const LENGTH: usize = 5;
7967    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7968        vec![
7969            if let Some(name) = &self.name {
7970                format!("{name:?}").into()
7971            } else {
7972                String::new().into()
7973            },
7974            if let Some(order) = &self.order {
7975                format!("{order:?}").into()
7976            } else {
7977                String::new().into()
7978            },
7979            if let Some(enabled) = &self.enabled {
7980                format!("{enabled:?}").into()
7981            } else {
7982                String::new().into()
7983            },
7984            if let Some(triggers) = &self.triggers {
7985                format!("{triggers:?}").into()
7986            } else {
7987                String::new().into()
7988            },
7989            if let Some(actions) = &self.actions {
7990                format!("{actions:?}").into()
7991            } else {
7992                String::new().into()
7993            },
7994        ]
7995    }
7996
7997    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7998        vec![
7999            "name".into(),
8000            "order".into(),
8001            "enabled".into(),
8002            "triggers".into(),
8003            "actions".into(),
8004        ]
8005    }
8006}
8007
8008#[derive(
8009    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8010)]
8011#[allow(non_snake_case)]
8012pub struct PatchedWorkflowTriggerRequest {
8013    #[serde(default, skip_serializing_if = "Option::is_none")]
8014    pub id: Option<i64>,
8015    #[serde(default)]
8016    pub sources: Vec<i64>,
8017    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
8018    pub type_: Option<i64>,
8019    #[doc = "Only consume documents with a path that matches this if specified. Wildcards specified as * are allowed. Case insensitive."]
8020    #[serde(default, skip_serializing_if = "Option::is_none")]
8021    pub filter_path: Option<String>,
8022    #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
8023    #[serde(default, skip_serializing_if = "Option::is_none")]
8024    pub filter_filename: Option<String>,
8025    #[serde(default, skip_serializing_if = "Option::is_none")]
8026    pub filter_mailrule: Option<i64>,
8027    #[serde(default, skip_serializing_if = "Option::is_none")]
8028    pub matching_algorithm: Option<i64>,
8029    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
8030    pub match_: Option<String>,
8031    #[serde(default, skip_serializing_if = "Option::is_none")]
8032    pub is_insensitive: Option<bool>,
8033    #[serde(default, skip_serializing_if = "Option::is_none")]
8034    pub filter_has_tags: Option<Vec<i64>>,
8035    #[serde(default, skip_serializing_if = "Option::is_none")]
8036    pub filter_has_all_tags: Option<Vec<i64>>,
8037    #[serde(default, skip_serializing_if = "Option::is_none")]
8038    pub filter_has_not_tags: Option<Vec<i64>>,
8039    #[doc = "JSON-encoded custom field query expression."]
8040    #[serde(default, skip_serializing_if = "Option::is_none")]
8041    pub filter_custom_field_query: Option<String>,
8042    #[serde(default, skip_serializing_if = "Option::is_none")]
8043    pub filter_has_not_correspondents: Option<Vec<i64>>,
8044    #[serde(default, skip_serializing_if = "Option::is_none")]
8045    pub filter_has_not_document_types: Option<Vec<i64>>,
8046    #[serde(default, skip_serializing_if = "Option::is_none")]
8047    pub filter_has_not_storage_paths: Option<Vec<i64>>,
8048    #[serde(default, skip_serializing_if = "Option::is_none")]
8049    pub filter_has_correspondent: Option<i64>,
8050    #[serde(default, skip_serializing_if = "Option::is_none")]
8051    pub filter_has_document_type: Option<i64>,
8052    #[serde(default, skip_serializing_if = "Option::is_none")]
8053    pub filter_has_storage_path: Option<i64>,
8054    #[doc = "The number of days to offset the schedule trigger by."]
8055    #[serde(default, skip_serializing_if = "Option::is_none")]
8056    pub schedule_offset_days: Option<i64>,
8057    #[doc = "If the schedule should be recurring."]
8058    #[serde(default, skip_serializing_if = "Option::is_none")]
8059    pub schedule_is_recurring: Option<bool>,
8060    #[doc = "The number of days between recurring schedule triggers."]
8061    #[serde(default, skip_serializing_if = "Option::is_none")]
8062    pub schedule_recurring_interval_days: Option<i64>,
8063    #[doc = "The field to check for a schedule trigger.\n\n* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
8064    #[serde(default, skip_serializing_if = "Option::is_none")]
8065    pub schedule_date_field: Option<ScheduleDateFieldEnum>,
8066    #[serde(default, skip_serializing_if = "Option::is_none")]
8067    pub schedule_date_custom_field: Option<i64>,
8068}
8069
8070impl std::fmt::Display for PatchedWorkflowTriggerRequest {
8071    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8072        write!(
8073            f,
8074            "{}",
8075            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8076        )
8077    }
8078}
8079
8080#[cfg(feature = "tabled")]
8081impl tabled::Tabled for PatchedWorkflowTriggerRequest {
8082    const LENGTH: usize = 24;
8083    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8084        vec![
8085            if let Some(id) = &self.id {
8086                format!("{id:?}").into()
8087            } else {
8088                String::new().into()
8089            },
8090            format!("{:?}", self.sources).into(),
8091            if let Some(type_) = &self.type_ {
8092                format!("{type_:?}").into()
8093            } else {
8094                String::new().into()
8095            },
8096            if let Some(filter_path) = &self.filter_path {
8097                format!("{filter_path:?}").into()
8098            } else {
8099                String::new().into()
8100            },
8101            if let Some(filter_filename) = &self.filter_filename {
8102                format!("{filter_filename:?}").into()
8103            } else {
8104                String::new().into()
8105            },
8106            if let Some(filter_mailrule) = &self.filter_mailrule {
8107                format!("{filter_mailrule:?}").into()
8108            } else {
8109                String::new().into()
8110            },
8111            if let Some(matching_algorithm) = &self.matching_algorithm {
8112                format!("{matching_algorithm:?}").into()
8113            } else {
8114                String::new().into()
8115            },
8116            if let Some(match_) = &self.match_ {
8117                format!("{match_:?}").into()
8118            } else {
8119                String::new().into()
8120            },
8121            if let Some(is_insensitive) = &self.is_insensitive {
8122                format!("{is_insensitive:?}").into()
8123            } else {
8124                String::new().into()
8125            },
8126            if let Some(filter_has_tags) = &self.filter_has_tags {
8127                format!("{filter_has_tags:?}").into()
8128            } else {
8129                String::new().into()
8130            },
8131            if let Some(filter_has_all_tags) = &self.filter_has_all_tags {
8132                format!("{filter_has_all_tags:?}").into()
8133            } else {
8134                String::new().into()
8135            },
8136            if let Some(filter_has_not_tags) = &self.filter_has_not_tags {
8137                format!("{filter_has_not_tags:?}").into()
8138            } else {
8139                String::new().into()
8140            },
8141            if let Some(filter_custom_field_query) = &self.filter_custom_field_query {
8142                format!("{filter_custom_field_query:?}").into()
8143            } else {
8144                String::new().into()
8145            },
8146            if let Some(filter_has_not_correspondents) = &self.filter_has_not_correspondents {
8147                format!("{filter_has_not_correspondents:?}").into()
8148            } else {
8149                String::new().into()
8150            },
8151            if let Some(filter_has_not_document_types) = &self.filter_has_not_document_types {
8152                format!("{filter_has_not_document_types:?}").into()
8153            } else {
8154                String::new().into()
8155            },
8156            if let Some(filter_has_not_storage_paths) = &self.filter_has_not_storage_paths {
8157                format!("{filter_has_not_storage_paths:?}").into()
8158            } else {
8159                String::new().into()
8160            },
8161            if let Some(filter_has_correspondent) = &self.filter_has_correspondent {
8162                format!("{filter_has_correspondent:?}").into()
8163            } else {
8164                String::new().into()
8165            },
8166            if let Some(filter_has_document_type) = &self.filter_has_document_type {
8167                format!("{filter_has_document_type:?}").into()
8168            } else {
8169                String::new().into()
8170            },
8171            if let Some(filter_has_storage_path) = &self.filter_has_storage_path {
8172                format!("{filter_has_storage_path:?}").into()
8173            } else {
8174                String::new().into()
8175            },
8176            if let Some(schedule_offset_days) = &self.schedule_offset_days {
8177                format!("{schedule_offset_days:?}").into()
8178            } else {
8179                String::new().into()
8180            },
8181            if let Some(schedule_is_recurring) = &self.schedule_is_recurring {
8182                format!("{schedule_is_recurring:?}").into()
8183            } else {
8184                String::new().into()
8185            },
8186            if let Some(schedule_recurring_interval_days) = &self.schedule_recurring_interval_days {
8187                format!("{schedule_recurring_interval_days:?}").into()
8188            } else {
8189                String::new().into()
8190            },
8191            if let Some(schedule_date_field) = &self.schedule_date_field {
8192                format!("{schedule_date_field:?}").into()
8193            } else {
8194                String::new().into()
8195            },
8196            if let Some(schedule_date_custom_field) = &self.schedule_date_custom_field {
8197                format!("{schedule_date_custom_field:?}").into()
8198            } else {
8199                String::new().into()
8200            },
8201        ]
8202    }
8203
8204    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8205        vec![
8206            "id".into(),
8207            "sources".into(),
8208            "type_".into(),
8209            "filter_path".into(),
8210            "filter_filename".into(),
8211            "filter_mailrule".into(),
8212            "matching_algorithm".into(),
8213            "match_".into(),
8214            "is_insensitive".into(),
8215            "filter_has_tags".into(),
8216            "filter_has_all_tags".into(),
8217            "filter_has_not_tags".into(),
8218            "filter_custom_field_query".into(),
8219            "filter_has_not_correspondents".into(),
8220            "filter_has_not_document_types".into(),
8221            "filter_has_not_storage_paths".into(),
8222            "filter_has_correspondent".into(),
8223            "filter_has_document_type".into(),
8224            "filter_has_storage_path".into(),
8225            "schedule_offset_days".into(),
8226            "schedule_is_recurring".into(),
8227            "schedule_recurring_interval_days".into(),
8228            "schedule_date_field".into(),
8229            "schedule_date_custom_field".into(),
8230        ]
8231    }
8232}
8233
8234#[derive(
8235    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8236)]
8237#[allow(non_snake_case)]
8238pub struct PostDocumentRequest {
8239    #[serde(default, skip_serializing_if = "Option::is_none")]
8240    pub created: Option<chrono::DateTime<chrono::Utc>>,
8241    pub document: bytes::Bytes,
8242    #[serde(default, skip_serializing_if = "Option::is_none")]
8243    pub title: Option<String>,
8244    #[serde(default, skip_serializing_if = "Option::is_none")]
8245    pub correspondent: Option<i64>,
8246    #[serde(default, skip_serializing_if = "Option::is_none")]
8247    pub document_type: Option<i64>,
8248    #[serde(default, skip_serializing_if = "Option::is_none")]
8249    pub storage_path: Option<i64>,
8250    #[serde(default, skip_serializing_if = "Option::is_none")]
8251    pub tags: Option<Vec<i64>>,
8252    #[serde(default, skip_serializing_if = "Option::is_none")]
8253    pub archive_serial_number: Option<i64>,
8254    #[serde(default, skip_serializing_if = "Option::is_none")]
8255    pub custom_fields: Option<serde_json::Value>,
8256    #[serde(default, skip_serializing_if = "Option::is_none")]
8257    pub from_webui: Option<bool>,
8258}
8259
8260impl std::fmt::Display for PostDocumentRequest {
8261    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8262        write!(
8263            f,
8264            "{}",
8265            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8266        )
8267    }
8268}
8269
8270#[cfg(feature = "tabled")]
8271impl tabled::Tabled for PostDocumentRequest {
8272    const LENGTH: usize = 10;
8273    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8274        vec![
8275            if let Some(created) = &self.created {
8276                format!("{created:?}").into()
8277            } else {
8278                String::new().into()
8279            },
8280            format!("{:?}", self.document).into(),
8281            if let Some(title) = &self.title {
8282                format!("{title:?}").into()
8283            } else {
8284                String::new().into()
8285            },
8286            if let Some(correspondent) = &self.correspondent {
8287                format!("{correspondent:?}").into()
8288            } else {
8289                String::new().into()
8290            },
8291            if let Some(document_type) = &self.document_type {
8292                format!("{document_type:?}").into()
8293            } else {
8294                String::new().into()
8295            },
8296            if let Some(storage_path) = &self.storage_path {
8297                format!("{storage_path:?}").into()
8298            } else {
8299                String::new().into()
8300            },
8301            if let Some(tags) = &self.tags {
8302                format!("{tags:?}").into()
8303            } else {
8304                String::new().into()
8305            },
8306            if let Some(archive_serial_number) = &self.archive_serial_number {
8307                format!("{archive_serial_number:?}").into()
8308            } else {
8309                String::new().into()
8310            },
8311            if let Some(custom_fields) = &self.custom_fields {
8312                format!("{custom_fields:?}").into()
8313            } else {
8314                String::new().into()
8315            },
8316            if let Some(from_webui) = &self.from_webui {
8317                format!("{from_webui:?}").into()
8318            } else {
8319                String::new().into()
8320            },
8321        ]
8322    }
8323
8324    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8325        vec![
8326            "created".into(),
8327            "document".into(),
8328            "title".into(),
8329            "correspondent".into(),
8330            "document_type".into(),
8331            "storage_path".into(),
8332            "tags".into(),
8333            "archive_serial_number".into(),
8334            "custom_fields".into(),
8335            "from_webui".into(),
8336        ]
8337    }
8338}
8339
8340#[derive(
8341    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8342)]
8343#[allow(non_snake_case)]
8344pub struct ProcessedMail {
8345    pub id: i64,
8346    #[serde(default, skip_serializing_if = "Option::is_none")]
8347    pub owner: Option<i64>,
8348    pub rule: i64,
8349    pub folder: String,
8350    pub uid: String,
8351    pub subject: String,
8352    pub received: chrono::DateTime<chrono::Utc>,
8353    pub processed: chrono::DateTime<chrono::Utc>,
8354    pub status: String,
8355    #[serde(default)]
8356    pub error: Option<String>,
8357}
8358
8359impl std::fmt::Display for ProcessedMail {
8360    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8361        write!(
8362            f,
8363            "{}",
8364            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8365        )
8366    }
8367}
8368
8369#[cfg(feature = "tabled")]
8370impl tabled::Tabled for ProcessedMail {
8371    const LENGTH: usize = 10;
8372    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8373        vec![
8374            format!("{:?}", self.id).into(),
8375            if let Some(owner) = &self.owner {
8376                format!("{owner:?}").into()
8377            } else {
8378                String::new().into()
8379            },
8380            format!("{:?}", self.rule).into(),
8381            self.folder.clone().into(),
8382            self.uid.clone().into(),
8383            self.subject.clone().into(),
8384            format!("{:?}", self.received).into(),
8385            format!("{:?}", self.processed).into(),
8386            self.status.clone().into(),
8387            format!("{:?}", self.error).into(),
8388        ]
8389    }
8390
8391    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8392        vec![
8393            "id".into(),
8394            "owner".into(),
8395            "rule".into(),
8396            "folder".into(),
8397            "uid".into(),
8398            "subject".into(),
8399            "received".into(),
8400            "processed".into(),
8401            "status".into(),
8402            "error".into(),
8403        ]
8404    }
8405}
8406
8407#[derive(
8408    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8409)]
8410#[allow(non_snake_case)]
8411pub struct ProcessedMailRequest {
8412    #[serde(default, skip_serializing_if = "Option::is_none")]
8413    pub owner: Option<i64>,
8414}
8415
8416impl std::fmt::Display for ProcessedMailRequest {
8417    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8418        write!(
8419            f,
8420            "{}",
8421            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8422        )
8423    }
8424}
8425
8426#[cfg(feature = "tabled")]
8427impl tabled::Tabled for ProcessedMailRequest {
8428    const LENGTH: usize = 1;
8429    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8430        vec![if let Some(owner) = &self.owner {
8431            format!("{owner:?}").into()
8432        } else {
8433            String::new().into()
8434        }]
8435    }
8436
8437    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8438        vec!["owner".into()]
8439    }
8440}
8441
8442#[derive(
8443    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8444)]
8445#[allow(non_snake_case)]
8446pub struct Profile {
8447    #[serde(default, skip_serializing_if = "Option::is_none")]
8448    pub email: Option<String>,
8449    #[serde(default, skip_serializing_if = "Option::is_none")]
8450    pub password: Option<String>,
8451    #[serde(default, skip_serializing_if = "Option::is_none")]
8452    pub first_name: Option<String>,
8453    #[serde(default, skip_serializing_if = "Option::is_none")]
8454    pub last_name: Option<String>,
8455    pub auth_token: String,
8456    pub social_accounts: Vec<SocialAccount>,
8457    pub has_usable_password: bool,
8458    pub is_mfa_enabled: bool,
8459}
8460
8461impl std::fmt::Display for Profile {
8462    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8463        write!(
8464            f,
8465            "{}",
8466            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8467        )
8468    }
8469}
8470
8471#[cfg(feature = "tabled")]
8472impl tabled::Tabled for Profile {
8473    const LENGTH: usize = 8;
8474    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8475        vec![
8476            if let Some(email) = &self.email {
8477                format!("{email:?}").into()
8478            } else {
8479                String::new().into()
8480            },
8481            if let Some(password) = &self.password {
8482                format!("{password:?}").into()
8483            } else {
8484                String::new().into()
8485            },
8486            if let Some(first_name) = &self.first_name {
8487                format!("{first_name:?}").into()
8488            } else {
8489                String::new().into()
8490            },
8491            if let Some(last_name) = &self.last_name {
8492                format!("{last_name:?}").into()
8493            } else {
8494                String::new().into()
8495            },
8496            self.auth_token.clone().into(),
8497            format!("{:?}", self.social_accounts).into(),
8498            format!("{:?}", self.has_usable_password).into(),
8499            format!("{:?}", self.is_mfa_enabled).into(),
8500        ]
8501    }
8502
8503    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8504        vec![
8505            "email".into(),
8506            "password".into(),
8507            "first_name".into(),
8508            "last_name".into(),
8509            "auth_token".into(),
8510            "social_accounts".into(),
8511            "has_usable_password".into(),
8512            "is_mfa_enabled".into(),
8513        ]
8514    }
8515}
8516
8517#[derive(
8518    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8519)]
8520#[allow(non_snake_case)]
8521pub struct SanityCheck {
8522    pub status: String,
8523    pub error: String,
8524    pub last_run: chrono::DateTime<chrono::Utc>,
8525}
8526
8527impl std::fmt::Display for SanityCheck {
8528    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8529        write!(
8530            f,
8531            "{}",
8532            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8533        )
8534    }
8535}
8536
8537#[cfg(feature = "tabled")]
8538impl tabled::Tabled for SanityCheck {
8539    const LENGTH: usize = 3;
8540    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8541        vec![
8542            self.status.clone().into(),
8543            self.error.clone().into(),
8544            format!("{:?}", self.last_run).into(),
8545        ]
8546    }
8547
8548    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8549        vec!["status".into(), "error".into(), "last_run".into()]
8550    }
8551}
8552
8553#[derive(
8554    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8555)]
8556#[allow(non_snake_case)]
8557pub struct SavedView {
8558    pub id: i64,
8559    pub name: String,
8560    pub show_on_dashboard: bool,
8561    pub show_in_sidebar: bool,
8562    #[serde(default, skip_serializing_if = "Option::is_none")]
8563    pub sort_field: Option<String>,
8564    #[serde(default, skip_serializing_if = "Option::is_none")]
8565    pub sort_reverse: Option<bool>,
8566    pub filter_rules: Vec<SavedViewFilterRule>,
8567    #[serde(default, skip_serializing_if = "Option::is_none")]
8568    pub page_size: Option<i64>,
8569    #[serde(default, skip_serializing_if = "Option::is_none")]
8570    pub display_mode: Option<DisplayMode>,
8571    #[serde(default, skip_serializing_if = "Option::is_none")]
8572    pub display_fields: Option<serde_json::Value>,
8573    #[serde(default, skip_serializing_if = "Option::is_none")]
8574    pub owner: Option<i64>,
8575    pub user_can_change: bool,
8576}
8577
8578impl std::fmt::Display for SavedView {
8579    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8580        write!(
8581            f,
8582            "{}",
8583            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8584        )
8585    }
8586}
8587
8588#[cfg(feature = "tabled")]
8589impl tabled::Tabled for SavedView {
8590    const LENGTH: usize = 12;
8591    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8592        vec![
8593            format!("{:?}", self.id).into(),
8594            self.name.clone().into(),
8595            format!("{:?}", self.show_on_dashboard).into(),
8596            format!("{:?}", self.show_in_sidebar).into(),
8597            if let Some(sort_field) = &self.sort_field {
8598                format!("{sort_field:?}").into()
8599            } else {
8600                String::new().into()
8601            },
8602            if let Some(sort_reverse) = &self.sort_reverse {
8603                format!("{sort_reverse:?}").into()
8604            } else {
8605                String::new().into()
8606            },
8607            format!("{:?}", self.filter_rules).into(),
8608            if let Some(page_size) = &self.page_size {
8609                format!("{page_size:?}").into()
8610            } else {
8611                String::new().into()
8612            },
8613            if let Some(display_mode) = &self.display_mode {
8614                format!("{display_mode:?}").into()
8615            } else {
8616                String::new().into()
8617            },
8618            if let Some(display_fields) = &self.display_fields {
8619                format!("{display_fields:?}").into()
8620            } else {
8621                String::new().into()
8622            },
8623            if let Some(owner) = &self.owner {
8624                format!("{owner:?}").into()
8625            } else {
8626                String::new().into()
8627            },
8628            format!("{:?}", self.user_can_change).into(),
8629        ]
8630    }
8631
8632    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8633        vec![
8634            "id".into(),
8635            "name".into(),
8636            "show_on_dashboard".into(),
8637            "show_in_sidebar".into(),
8638            "sort_field".into(),
8639            "sort_reverse".into(),
8640            "filter_rules".into(),
8641            "page_size".into(),
8642            "display_mode".into(),
8643            "display_fields".into(),
8644            "owner".into(),
8645            "user_can_change".into(),
8646        ]
8647    }
8648}
8649
8650#[derive(
8651    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8652)]
8653#[allow(non_snake_case)]
8654pub struct SavedViewFilterRule {
8655    pub rule_type: i64,
8656    #[serde(default, skip_serializing_if = "Option::is_none")]
8657    pub value: Option<String>,
8658}
8659
8660impl std::fmt::Display for SavedViewFilterRule {
8661    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8662        write!(
8663            f,
8664            "{}",
8665            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8666        )
8667    }
8668}
8669
8670#[cfg(feature = "tabled")]
8671impl tabled::Tabled for SavedViewFilterRule {
8672    const LENGTH: usize = 2;
8673    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8674        vec![
8675            format!("{:?}", self.rule_type).into(),
8676            if let Some(value) = &self.value {
8677                format!("{value:?}").into()
8678            } else {
8679                String::new().into()
8680            },
8681        ]
8682    }
8683
8684    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8685        vec!["rule_type".into(), "value".into()]
8686    }
8687}
8688
8689#[derive(
8690    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8691)]
8692#[allow(non_snake_case)]
8693pub struct SavedViewFilterRuleRequest {
8694    pub rule_type: i64,
8695    #[serde(default, skip_serializing_if = "Option::is_none")]
8696    pub value: Option<String>,
8697}
8698
8699impl std::fmt::Display for SavedViewFilterRuleRequest {
8700    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8701        write!(
8702            f,
8703            "{}",
8704            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8705        )
8706    }
8707}
8708
8709#[cfg(feature = "tabled")]
8710impl tabled::Tabled for SavedViewFilterRuleRequest {
8711    const LENGTH: usize = 2;
8712    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8713        vec![
8714            format!("{:?}", self.rule_type).into(),
8715            if let Some(value) = &self.value {
8716                format!("{value:?}").into()
8717            } else {
8718                String::new().into()
8719            },
8720        ]
8721    }
8722
8723    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8724        vec!["rule_type".into(), "value".into()]
8725    }
8726}
8727
8728#[derive(
8729    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8730)]
8731#[allow(non_snake_case)]
8732pub struct SavedViewRequest {
8733    pub name: String,
8734    pub show_on_dashboard: bool,
8735    pub show_in_sidebar: bool,
8736    #[serde(default, skip_serializing_if = "Option::is_none")]
8737    pub sort_field: Option<String>,
8738    #[serde(default, skip_serializing_if = "Option::is_none")]
8739    pub sort_reverse: Option<bool>,
8740    pub filter_rules: Vec<SavedViewFilterRuleRequest>,
8741    #[serde(default, skip_serializing_if = "Option::is_none")]
8742    pub page_size: Option<i64>,
8743    #[serde(default, skip_serializing_if = "Option::is_none")]
8744    pub display_mode: Option<DisplayMode>,
8745    #[serde(default, skip_serializing_if = "Option::is_none")]
8746    pub display_fields: Option<serde_json::Value>,
8747    #[serde(default, skip_serializing_if = "Option::is_none")]
8748    pub owner: Option<i64>,
8749}
8750
8751impl std::fmt::Display for SavedViewRequest {
8752    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8753        write!(
8754            f,
8755            "{}",
8756            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8757        )
8758    }
8759}
8760
8761#[cfg(feature = "tabled")]
8762impl tabled::Tabled for SavedViewRequest {
8763    const LENGTH: usize = 10;
8764    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8765        vec![
8766            self.name.clone().into(),
8767            format!("{:?}", self.show_on_dashboard).into(),
8768            format!("{:?}", self.show_in_sidebar).into(),
8769            if let Some(sort_field) = &self.sort_field {
8770                format!("{sort_field:?}").into()
8771            } else {
8772                String::new().into()
8773            },
8774            if let Some(sort_reverse) = &self.sort_reverse {
8775                format!("{sort_reverse:?}").into()
8776            } else {
8777                String::new().into()
8778            },
8779            format!("{:?}", self.filter_rules).into(),
8780            if let Some(page_size) = &self.page_size {
8781                format!("{page_size:?}").into()
8782            } else {
8783                String::new().into()
8784            },
8785            if let Some(display_mode) = &self.display_mode {
8786                format!("{display_mode:?}").into()
8787            } else {
8788                String::new().into()
8789            },
8790            if let Some(display_fields) = &self.display_fields {
8791                format!("{display_fields:?}").into()
8792            } else {
8793                String::new().into()
8794            },
8795            if let Some(owner) = &self.owner {
8796                format!("{owner:?}").into()
8797            } else {
8798                String::new().into()
8799            },
8800        ]
8801    }
8802
8803    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8804        vec![
8805            "name".into(),
8806            "show_on_dashboard".into(),
8807            "show_in_sidebar".into(),
8808            "sort_field".into(),
8809            "sort_reverse".into(),
8810            "filter_rules".into(),
8811            "page_size".into(),
8812            "display_mode".into(),
8813            "display_fields".into(),
8814            "owner".into(),
8815        ]
8816    }
8817}
8818
8819#[doc = "* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
8820#[derive(
8821    serde :: Serialize,
8822    serde :: Deserialize,
8823    PartialEq,
8824    Hash,
8825    Debug,
8826    Clone,
8827    schemars :: JsonSchema,
8828    parse_display :: FromStr,
8829    parse_display :: Display,
8830)]
8831#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
8832#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8833pub enum ScheduleDateFieldEnum {
8834    #[serde(rename = "added")]
8835    #[display("added")]
8836    Added,
8837    #[serde(rename = "created")]
8838    #[display("created")]
8839    Created,
8840    #[serde(rename = "modified")]
8841    #[display("modified")]
8842    Modified,
8843    #[serde(rename = "custom_field")]
8844    #[display("custom_field")]
8845    CustomField,
8846}
8847
8848#[derive(
8849    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8850)]
8851#[allow(non_snake_case)]
8852pub struct SearchResult {
8853    pub total: i64,
8854    pub documents: Vec<Document>,
8855    pub saved_views: Vec<SavedView>,
8856    pub tags: Vec<Tag>,
8857    pub correspondents: Vec<Correspondent>,
8858    pub document_types: Vec<DocumentType>,
8859    pub storage_paths: Vec<StoragePath>,
8860    pub users: Vec<User>,
8861    pub groups: Vec<Group>,
8862    pub mail_rules: Vec<MailRule>,
8863    pub mail_accounts: Vec<MailAccount>,
8864    pub workflows: Vec<Workflow>,
8865    pub custom_fields: Vec<CustomField>,
8866}
8867
8868impl std::fmt::Display for SearchResult {
8869    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8870        write!(
8871            f,
8872            "{}",
8873            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8874        )
8875    }
8876}
8877
8878#[cfg(feature = "tabled")]
8879impl tabled::Tabled for SearchResult {
8880    const LENGTH: usize = 13;
8881    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8882        vec![
8883            format!("{:?}", self.total).into(),
8884            format!("{:?}", self.documents).into(),
8885            format!("{:?}", self.saved_views).into(),
8886            format!("{:?}", self.tags).into(),
8887            format!("{:?}", self.correspondents).into(),
8888            format!("{:?}", self.document_types).into(),
8889            format!("{:?}", self.storage_paths).into(),
8890            format!("{:?}", self.users).into(),
8891            format!("{:?}", self.groups).into(),
8892            format!("{:?}", self.mail_rules).into(),
8893            format!("{:?}", self.mail_accounts).into(),
8894            format!("{:?}", self.workflows).into(),
8895            format!("{:?}", self.custom_fields).into(),
8896        ]
8897    }
8898
8899    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8900        vec![
8901            "total".into(),
8902            "documents".into(),
8903            "saved_views".into(),
8904            "tags".into(),
8905            "correspondents".into(),
8906            "document_types".into(),
8907            "storage_paths".into(),
8908            "users".into(),
8909            "groups".into(),
8910            "mail_rules".into(),
8911            "mail_accounts".into(),
8912            "workflows".into(),
8913            "custom_fields".into(),
8914        ]
8915    }
8916}
8917
8918#[derive(
8919    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8920)]
8921#[allow(non_snake_case)]
8922pub struct SelectionData {
8923    pub selected_correspondents: Vec<CorrespondentCounts>,
8924    pub selected_tags: Vec<TagCounts>,
8925    pub selected_document_types: Vec<DocumentTypeCounts>,
8926    pub selected_storage_paths: Vec<StoragePathCounts>,
8927    pub selected_custom_fields: Vec<CustomFieldCounts>,
8928}
8929
8930impl std::fmt::Display for SelectionData {
8931    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8932        write!(
8933            f,
8934            "{}",
8935            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8936        )
8937    }
8938}
8939
8940#[cfg(feature = "tabled")]
8941impl tabled::Tabled for SelectionData {
8942    const LENGTH: usize = 5;
8943    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8944        vec![
8945            format!("{:?}", self.selected_correspondents).into(),
8946            format!("{:?}", self.selected_tags).into(),
8947            format!("{:?}", self.selected_document_types).into(),
8948            format!("{:?}", self.selected_storage_paths).into(),
8949            format!("{:?}", self.selected_custom_fields).into(),
8950        ]
8951    }
8952
8953    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8954        vec![
8955            "selected_correspondents".into(),
8956            "selected_tags".into(),
8957            "selected_document_types".into(),
8958            "selected_storage_paths".into(),
8959            "selected_custom_fields".into(),
8960        ]
8961    }
8962}
8963
8964#[derive(
8965    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8966)]
8967#[allow(non_snake_case)]
8968pub struct ShareLink {
8969    pub id: i64,
8970    pub created: chrono::DateTime<chrono::Utc>,
8971    #[serde(default, skip_serializing_if = "Option::is_none")]
8972    pub expiration: Option<chrono::DateTime<chrono::Utc>>,
8973    pub slug: String,
8974    #[serde(default, skip_serializing_if = "Option::is_none")]
8975    pub document: Option<i64>,
8976    #[doc = "* `archive` - Archive\n* `original` - Original"]
8977    #[serde(default, skip_serializing_if = "Option::is_none")]
8978    pub file_version: Option<FileVersionEnum>,
8979}
8980
8981impl std::fmt::Display for ShareLink {
8982    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8983        write!(
8984            f,
8985            "{}",
8986            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8987        )
8988    }
8989}
8990
8991#[cfg(feature = "tabled")]
8992impl tabled::Tabled for ShareLink {
8993    const LENGTH: usize = 6;
8994    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8995        vec![
8996            format!("{:?}", self.id).into(),
8997            format!("{:?}", self.created).into(),
8998            if let Some(expiration) = &self.expiration {
8999                format!("{expiration:?}").into()
9000            } else {
9001                String::new().into()
9002            },
9003            self.slug.clone().into(),
9004            if let Some(document) = &self.document {
9005                format!("{document:?}").into()
9006            } else {
9007                String::new().into()
9008            },
9009            if let Some(file_version) = &self.file_version {
9010                format!("{file_version:?}").into()
9011            } else {
9012                String::new().into()
9013            },
9014        ]
9015    }
9016
9017    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9018        vec![
9019            "id".into(),
9020            "created".into(),
9021            "expiration".into(),
9022            "slug".into(),
9023            "document".into(),
9024            "file_version".into(),
9025        ]
9026    }
9027}
9028
9029#[derive(
9030    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9031)]
9032#[allow(non_snake_case)]
9033pub struct ShareLinkRequest {
9034    #[serde(default, skip_serializing_if = "Option::is_none")]
9035    pub expiration: Option<chrono::DateTime<chrono::Utc>>,
9036    #[serde(default, skip_serializing_if = "Option::is_none")]
9037    pub document: Option<i64>,
9038    #[doc = "* `archive` - Archive\n* `original` - Original"]
9039    #[serde(default, skip_serializing_if = "Option::is_none")]
9040    pub file_version: Option<FileVersionEnum>,
9041}
9042
9043impl std::fmt::Display for ShareLinkRequest {
9044    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9045        write!(
9046            f,
9047            "{}",
9048            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9049        )
9050    }
9051}
9052
9053#[cfg(feature = "tabled")]
9054impl tabled::Tabled for ShareLinkRequest {
9055    const LENGTH: usize = 3;
9056    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9057        vec![
9058            if let Some(expiration) = &self.expiration {
9059                format!("{expiration:?}").into()
9060            } else {
9061                String::new().into()
9062            },
9063            if let Some(document) = &self.document {
9064                format!("{document:?}").into()
9065            } else {
9066                String::new().into()
9067            },
9068            if let Some(file_version) = &self.file_version {
9069                format!("{file_version:?}").into()
9070            } else {
9071                String::new().into()
9072            },
9073        ]
9074    }
9075
9076    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9077        vec![
9078            "expiration".into(),
9079            "document".into(),
9080            "file_version".into(),
9081        ]
9082    }
9083}
9084
9085#[doc = "* `never` - never\n* `with_text` - with_text\n* `always` - always"]
9086#[derive(
9087    serde :: Serialize,
9088    serde :: Deserialize,
9089    PartialEq,
9090    Hash,
9091    Debug,
9092    Clone,
9093    schemars :: JsonSchema,
9094    parse_display :: FromStr,
9095    parse_display :: Display,
9096)]
9097#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9098#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9099pub enum SkipArchiveFileEnum {
9100    #[serde(rename = "never")]
9101    #[display("never")]
9102    Never,
9103    #[serde(rename = "with_text")]
9104    #[display("with_text")]
9105    WithText,
9106    #[serde(rename = "always")]
9107    #[display("always")]
9108    Always,
9109    #[serde(rename = "")]
9110    #[display("")]
9111    Empty,
9112}
9113
9114#[derive(
9115    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9116)]
9117#[allow(non_snake_case)]
9118pub struct SocialAccount {
9119    pub id: i64,
9120    pub provider: String,
9121    pub name: String,
9122}
9123
9124impl std::fmt::Display for SocialAccount {
9125    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9126        write!(
9127            f,
9128            "{}",
9129            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9130        )
9131    }
9132}
9133
9134#[cfg(feature = "tabled")]
9135impl tabled::Tabled for SocialAccount {
9136    const LENGTH: usize = 3;
9137    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9138        vec![
9139            format!("{:?}", self.id).into(),
9140            self.provider.clone().into(),
9141            self.name.clone().into(),
9142        ]
9143    }
9144
9145    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9146        vec!["id".into(), "provider".into(), "name".into()]
9147    }
9148}
9149
9150#[derive(
9151    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9152)]
9153#[allow(non_snake_case)]
9154pub struct SocialAccountRequest {
9155    pub provider: String,
9156}
9157
9158impl std::fmt::Display for SocialAccountRequest {
9159    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9160        write!(
9161            f,
9162            "{}",
9163            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9164        )
9165    }
9166}
9167
9168#[cfg(feature = "tabled")]
9169impl tabled::Tabled for SocialAccountRequest {
9170    const LENGTH: usize = 1;
9171    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9172        vec![self.provider.clone().into()]
9173    }
9174
9175    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9176        vec!["provider".into()]
9177    }
9178}
9179
9180#[doc = "* `FAILURE` - FAILURE\n* `PENDING` - PENDING\n* `RECEIVED` - RECEIVED\n* `RETRY` - RETRY\n* `REVOKED` - REVOKED\n* `STARTED` - STARTED\n* `SUCCESS` - SUCCESS"]
9181#[derive(
9182    serde :: Serialize,
9183    serde :: Deserialize,
9184    PartialEq,
9185    Hash,
9186    Debug,
9187    Clone,
9188    schemars :: JsonSchema,
9189    parse_display :: FromStr,
9190    parse_display :: Display,
9191)]
9192#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9193#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9194pub enum StatusEnum {
9195    #[serde(rename = "FAILURE")]
9196    #[display("FAILURE")]
9197    Failure,
9198    #[serde(rename = "PENDING")]
9199    #[display("PENDING")]
9200    Pending,
9201    #[serde(rename = "RECEIVED")]
9202    #[display("RECEIVED")]
9203    Received,
9204    #[serde(rename = "RETRY")]
9205    #[display("RETRY")]
9206    Retry,
9207    #[serde(rename = "REVOKED")]
9208    #[display("REVOKED")]
9209    Revoked,
9210    #[serde(rename = "STARTED")]
9211    #[display("STARTED")]
9212    Started,
9213    #[serde(rename = "SUCCESS")]
9214    #[display("SUCCESS")]
9215    Success,
9216}
9217
9218#[derive(
9219    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9220)]
9221#[allow(non_snake_case)]
9222pub struct Storage {
9223    pub total: i64,
9224    pub available: i64,
9225}
9226
9227impl std::fmt::Display for Storage {
9228    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9229        write!(
9230            f,
9231            "{}",
9232            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9233        )
9234    }
9235}
9236
9237#[cfg(feature = "tabled")]
9238impl tabled::Tabled for Storage {
9239    const LENGTH: usize = 2;
9240    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9241        vec![
9242            format!("{:?}", self.total).into(),
9243            format!("{:?}", self.available).into(),
9244        ]
9245    }
9246
9247    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9248        vec!["total".into(), "available".into()]
9249    }
9250}
9251
9252#[derive(
9253    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9254)]
9255#[allow(non_snake_case)]
9256pub struct StoragePath {
9257    pub id: i64,
9258    pub slug: String,
9259    pub name: String,
9260    pub path: String,
9261    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9262    pub match_: Option<String>,
9263    #[serde(default, skip_serializing_if = "Option::is_none")]
9264    pub matching_algorithm: Option<i64>,
9265    #[serde(default, skip_serializing_if = "Option::is_none")]
9266    pub is_insensitive: Option<bool>,
9267    pub document_count: i64,
9268    #[serde(default, skip_serializing_if = "Option::is_none")]
9269    pub owner: Option<i64>,
9270    pub user_can_change: bool,
9271}
9272
9273impl std::fmt::Display for StoragePath {
9274    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9275        write!(
9276            f,
9277            "{}",
9278            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9279        )
9280    }
9281}
9282
9283#[cfg(feature = "tabled")]
9284impl tabled::Tabled for StoragePath {
9285    const LENGTH: usize = 10;
9286    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9287        vec![
9288            format!("{:?}", self.id).into(),
9289            self.slug.clone().into(),
9290            self.name.clone().into(),
9291            self.path.clone().into(),
9292            if let Some(match_) = &self.match_ {
9293                format!("{match_:?}").into()
9294            } else {
9295                String::new().into()
9296            },
9297            if let Some(matching_algorithm) = &self.matching_algorithm {
9298                format!("{matching_algorithm:?}").into()
9299            } else {
9300                String::new().into()
9301            },
9302            if let Some(is_insensitive) = &self.is_insensitive {
9303                format!("{is_insensitive:?}").into()
9304            } else {
9305                String::new().into()
9306            },
9307            format!("{:?}", self.document_count).into(),
9308            if let Some(owner) = &self.owner {
9309                format!("{owner:?}").into()
9310            } else {
9311                String::new().into()
9312            },
9313            format!("{:?}", self.user_can_change).into(),
9314        ]
9315    }
9316
9317    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9318        vec![
9319            "id".into(),
9320            "slug".into(),
9321            "name".into(),
9322            "path".into(),
9323            "match_".into(),
9324            "matching_algorithm".into(),
9325            "is_insensitive".into(),
9326            "document_count".into(),
9327            "owner".into(),
9328            "user_can_change".into(),
9329        ]
9330    }
9331}
9332
9333#[derive(
9334    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9335)]
9336#[allow(non_snake_case)]
9337pub struct StoragePathCounts {
9338    pub id: i64,
9339    pub document_count: i64,
9340}
9341
9342impl std::fmt::Display for StoragePathCounts {
9343    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9344        write!(
9345            f,
9346            "{}",
9347            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9348        )
9349    }
9350}
9351
9352#[cfg(feature = "tabled")]
9353impl tabled::Tabled for StoragePathCounts {
9354    const LENGTH: usize = 2;
9355    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9356        vec![
9357            format!("{:?}", self.id).into(),
9358            format!("{:?}", self.document_count).into(),
9359        ]
9360    }
9361
9362    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9363        vec!["id".into(), "document_count".into()]
9364    }
9365}
9366
9367#[derive(
9368    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9369)]
9370#[allow(non_snake_case)]
9371pub struct StoragePathRequest {
9372    pub name: String,
9373    pub path: String,
9374    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9375    pub match_: Option<String>,
9376    #[serde(default, skip_serializing_if = "Option::is_none")]
9377    pub matching_algorithm: Option<i64>,
9378    #[serde(default, skip_serializing_if = "Option::is_none")]
9379    pub is_insensitive: Option<bool>,
9380    #[serde(default, skip_serializing_if = "Option::is_none")]
9381    pub owner: Option<i64>,
9382    #[serde(default, skip_serializing_if = "Option::is_none")]
9383    pub set_permissions: Option<SetPermissions>,
9384}
9385
9386impl std::fmt::Display for StoragePathRequest {
9387    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9388        write!(
9389            f,
9390            "{}",
9391            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9392        )
9393    }
9394}
9395
9396#[cfg(feature = "tabled")]
9397impl tabled::Tabled for StoragePathRequest {
9398    const LENGTH: usize = 7;
9399    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9400        vec![
9401            self.name.clone().into(),
9402            self.path.clone().into(),
9403            if let Some(match_) = &self.match_ {
9404                format!("{match_:?}").into()
9405            } else {
9406                String::new().into()
9407            },
9408            if let Some(matching_algorithm) = &self.matching_algorithm {
9409                format!("{matching_algorithm:?}").into()
9410            } else {
9411                String::new().into()
9412            },
9413            if let Some(is_insensitive) = &self.is_insensitive {
9414                format!("{is_insensitive:?}").into()
9415            } else {
9416                String::new().into()
9417            },
9418            if let Some(owner) = &self.owner {
9419                format!("{owner:?}").into()
9420            } else {
9421                String::new().into()
9422            },
9423            if let Some(set_permissions) = &self.set_permissions {
9424                format!("{set_permissions:?}").into()
9425            } else {
9426                String::new().into()
9427            },
9428        ]
9429    }
9430
9431    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9432        vec![
9433            "name".into(),
9434            "path".into(),
9435            "match_".into(),
9436            "matching_algorithm".into(),
9437            "is_insensitive".into(),
9438            "owner".into(),
9439            "set_permissions".into(),
9440        ]
9441    }
9442}
9443
9444#[derive(
9445    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9446)]
9447#[allow(non_snake_case)]
9448pub struct Suggestions {
9449    pub correspondents: Vec<i64>,
9450    pub tags: Vec<i64>,
9451    pub document_types: Vec<i64>,
9452    pub storage_paths: Vec<i64>,
9453    pub dates: Vec<String>,
9454}
9455
9456impl std::fmt::Display for Suggestions {
9457    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9458        write!(
9459            f,
9460            "{}",
9461            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9462        )
9463    }
9464}
9465
9466#[cfg(feature = "tabled")]
9467impl tabled::Tabled for Suggestions {
9468    const LENGTH: usize = 5;
9469    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9470        vec![
9471            format!("{:?}", self.correspondents).into(),
9472            format!("{:?}", self.tags).into(),
9473            format!("{:?}", self.document_types).into(),
9474            format!("{:?}", self.storage_paths).into(),
9475            format!("{:?}", self.dates).into(),
9476        ]
9477    }
9478
9479    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9480        vec![
9481            "correspondents".into(),
9482            "tags".into(),
9483            "document_types".into(),
9484            "storage_paths".into(),
9485            "dates".into(),
9486        ]
9487    }
9488}
9489
9490#[derive(
9491    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9492)]
9493#[allow(non_snake_case)]
9494pub struct SystemStatus {
9495    pub pngx_version: String,
9496    pub server_os: String,
9497    pub install_type: String,
9498    pub storage: Storage,
9499    pub database: Database,
9500    pub tasks: Tasks,
9501    pub index: Index,
9502    pub classifier: Classifier,
9503    pub sanity_check: SanityCheck,
9504}
9505
9506impl std::fmt::Display for SystemStatus {
9507    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9508        write!(
9509            f,
9510            "{}",
9511            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9512        )
9513    }
9514}
9515
9516#[cfg(feature = "tabled")]
9517impl tabled::Tabled for SystemStatus {
9518    const LENGTH: usize = 9;
9519    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9520        vec![
9521            self.pngx_version.clone().into(),
9522            self.server_os.clone().into(),
9523            self.install_type.clone().into(),
9524            format!("{:?}", self.storage).into(),
9525            format!("{:?}", self.database).into(),
9526            format!("{:?}", self.tasks).into(),
9527            format!("{:?}", self.index).into(),
9528            format!("{:?}", self.classifier).into(),
9529            format!("{:?}", self.sanity_check).into(),
9530        ]
9531    }
9532
9533    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9534        vec![
9535            "pngx_version".into(),
9536            "server_os".into(),
9537            "install_type".into(),
9538            "storage".into(),
9539            "database".into(),
9540            "tasks".into(),
9541            "index".into(),
9542            "classifier".into(),
9543            "sanity_check".into(),
9544        ]
9545    }
9546}
9547
9548#[derive(
9549    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9550)]
9551#[allow(non_snake_case)]
9552pub struct Tag {
9553    pub id: i64,
9554    pub slug: String,
9555    pub name: String,
9556    #[serde(default, skip_serializing_if = "Option::is_none")]
9557    pub color: Option<String>,
9558    pub text_color: String,
9559    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9560    pub match_: Option<String>,
9561    #[serde(default, skip_serializing_if = "Option::is_none")]
9562    pub matching_algorithm: Option<i64>,
9563    #[serde(default, skip_serializing_if = "Option::is_none")]
9564    pub is_insensitive: Option<bool>,
9565    #[doc = "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."]
9566    #[serde(default, skip_serializing_if = "Option::is_none")]
9567    pub is_inbox_tag: Option<bool>,
9568    #[serde(default)]
9569    pub document_count: i64,
9570    #[serde(default, skip_serializing_if = "Option::is_none")]
9571    pub owner: Option<i64>,
9572    pub user_can_change: bool,
9573    #[serde(default, skip_serializing_if = "Option::is_none")]
9574    pub parent: Option<i64>,
9575    pub children: Vec<i64>,
9576}
9577
9578impl std::fmt::Display for Tag {
9579    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9580        write!(
9581            f,
9582            "{}",
9583            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9584        )
9585    }
9586}
9587
9588#[cfg(feature = "tabled")]
9589impl tabled::Tabled for Tag {
9590    const LENGTH: usize = 14;
9591    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9592        vec![
9593            format!("{:?}", self.id).into(),
9594            self.slug.clone().into(),
9595            self.name.clone().into(),
9596            if let Some(color) = &self.color {
9597                format!("{color:?}").into()
9598            } else {
9599                String::new().into()
9600            },
9601            self.text_color.clone().into(),
9602            if let Some(match_) = &self.match_ {
9603                format!("{match_:?}").into()
9604            } else {
9605                String::new().into()
9606            },
9607            if let Some(matching_algorithm) = &self.matching_algorithm {
9608                format!("{matching_algorithm:?}").into()
9609            } else {
9610                String::new().into()
9611            },
9612            if let Some(is_insensitive) = &self.is_insensitive {
9613                format!("{is_insensitive:?}").into()
9614            } else {
9615                String::new().into()
9616            },
9617            if let Some(is_inbox_tag) = &self.is_inbox_tag {
9618                format!("{is_inbox_tag:?}").into()
9619            } else {
9620                String::new().into()
9621            },
9622            format!("{:?}", self.document_count).into(),
9623            if let Some(owner) = &self.owner {
9624                format!("{owner:?}").into()
9625            } else {
9626                String::new().into()
9627            },
9628            format!("{:?}", self.user_can_change).into(),
9629            if let Some(parent) = &self.parent {
9630                format!("{parent:?}").into()
9631            } else {
9632                String::new().into()
9633            },
9634            format!("{:?}", self.children).into(),
9635        ]
9636    }
9637
9638    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9639        vec![
9640            "id".into(),
9641            "slug".into(),
9642            "name".into(),
9643            "color".into(),
9644            "text_color".into(),
9645            "match_".into(),
9646            "matching_algorithm".into(),
9647            "is_insensitive".into(),
9648            "is_inbox_tag".into(),
9649            "document_count".into(),
9650            "owner".into(),
9651            "user_can_change".into(),
9652            "parent".into(),
9653            "children".into(),
9654        ]
9655    }
9656}
9657
9658#[derive(
9659    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9660)]
9661#[allow(non_snake_case)]
9662pub struct TagCounts {
9663    pub id: i64,
9664    pub document_count: i64,
9665}
9666
9667impl std::fmt::Display for TagCounts {
9668    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9669        write!(
9670            f,
9671            "{}",
9672            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9673        )
9674    }
9675}
9676
9677#[cfg(feature = "tabled")]
9678impl tabled::Tabled for TagCounts {
9679    const LENGTH: usize = 2;
9680    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9681        vec![
9682            format!("{:?}", self.id).into(),
9683            format!("{:?}", self.document_count).into(),
9684        ]
9685    }
9686
9687    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9688        vec!["id".into(), "document_count".into()]
9689    }
9690}
9691
9692#[derive(
9693    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9694)]
9695#[allow(non_snake_case)]
9696pub struct TagRequest {
9697    pub name: String,
9698    #[serde(default, skip_serializing_if = "Option::is_none")]
9699    pub color: Option<String>,
9700    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9701    pub match_: Option<String>,
9702    #[serde(default, skip_serializing_if = "Option::is_none")]
9703    pub matching_algorithm: Option<i64>,
9704    #[serde(default, skip_serializing_if = "Option::is_none")]
9705    pub is_insensitive: Option<bool>,
9706    #[doc = "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."]
9707    #[serde(default, skip_serializing_if = "Option::is_none")]
9708    pub is_inbox_tag: Option<bool>,
9709    #[serde(default, skip_serializing_if = "Option::is_none")]
9710    pub owner: Option<i64>,
9711    #[serde(default, skip_serializing_if = "Option::is_none")]
9712    pub set_permissions: Option<SetPermissions>,
9713    #[serde(default, skip_serializing_if = "Option::is_none")]
9714    pub parent: Option<i64>,
9715}
9716
9717impl std::fmt::Display for TagRequest {
9718    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9719        write!(
9720            f,
9721            "{}",
9722            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9723        )
9724    }
9725}
9726
9727#[cfg(feature = "tabled")]
9728impl tabled::Tabled for TagRequest {
9729    const LENGTH: usize = 9;
9730    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9731        vec![
9732            self.name.clone().into(),
9733            if let Some(color) = &self.color {
9734                format!("{color:?}").into()
9735            } else {
9736                String::new().into()
9737            },
9738            if let Some(match_) = &self.match_ {
9739                format!("{match_:?}").into()
9740            } else {
9741                String::new().into()
9742            },
9743            if let Some(matching_algorithm) = &self.matching_algorithm {
9744                format!("{matching_algorithm:?}").into()
9745            } else {
9746                String::new().into()
9747            },
9748            if let Some(is_insensitive) = &self.is_insensitive {
9749                format!("{is_insensitive:?}").into()
9750            } else {
9751                String::new().into()
9752            },
9753            if let Some(is_inbox_tag) = &self.is_inbox_tag {
9754                format!("{is_inbox_tag:?}").into()
9755            } else {
9756                String::new().into()
9757            },
9758            if let Some(owner) = &self.owner {
9759                format!("{owner:?}").into()
9760            } else {
9761                String::new().into()
9762            },
9763            if let Some(set_permissions) = &self.set_permissions {
9764                format!("{set_permissions:?}").into()
9765            } else {
9766                String::new().into()
9767            },
9768            if let Some(parent) = &self.parent {
9769                format!("{parent:?}").into()
9770            } else {
9771                String::new().into()
9772            },
9773        ]
9774    }
9775
9776    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9777        vec![
9778            "name".into(),
9779            "color".into(),
9780            "match_".into(),
9781            "matching_algorithm".into(),
9782            "is_insensitive".into(),
9783            "is_inbox_tag".into(),
9784            "owner".into(),
9785            "set_permissions".into(),
9786            "parent".into(),
9787        ]
9788    }
9789}
9790
9791#[doc = "* `consume_file` - Consume File\n* `train_classifier` - Train Classifier\n* `check_sanity` - Check Sanity\n* `index_optimize` - Index Optimize"]
9792#[derive(
9793    serde :: Serialize,
9794    serde :: Deserialize,
9795    PartialEq,
9796    Hash,
9797    Debug,
9798    Clone,
9799    schemars :: JsonSchema,
9800    parse_display :: FromStr,
9801    parse_display :: Display,
9802)]
9803#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9804#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9805pub enum TaskNameEnum {
9806    #[serde(rename = "consume_file")]
9807    #[display("consume_file")]
9808    ConsumeFile,
9809    #[serde(rename = "train_classifier")]
9810    #[display("train_classifier")]
9811    TrainClassifier,
9812    #[serde(rename = "check_sanity")]
9813    #[display("check_sanity")]
9814    CheckSanity,
9815    #[serde(rename = "index_optimize")]
9816    #[display("index_optimize")]
9817    IndexOptimize,
9818}
9819
9820#[derive(
9821    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9822)]
9823#[allow(non_snake_case)]
9824pub struct Tasks {
9825    pub redis_url: String,
9826    pub redis_status: String,
9827    pub redis_error: String,
9828    pub celery_status: String,
9829}
9830
9831impl std::fmt::Display for Tasks {
9832    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9833        write!(
9834            f,
9835            "{}",
9836            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9837        )
9838    }
9839}
9840
9841#[cfg(feature = "tabled")]
9842impl tabled::Tabled for Tasks {
9843    const LENGTH: usize = 4;
9844    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9845        vec![
9846            self.redis_url.clone().into(),
9847            self.redis_status.clone().into(),
9848            self.redis_error.clone().into(),
9849            self.celery_status.clone().into(),
9850        ]
9851    }
9852
9853    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9854        vec![
9855            "redis_url".into(),
9856            "redis_status".into(),
9857            "redis_error".into(),
9858            "celery_status".into(),
9859        ]
9860    }
9861}
9862
9863#[doc = "Name of the task that was run\n\n* `consume_file` - Consume File\n* `train_classifier` - Train Classifier\n* `check_sanity` - Check Sanity\n* `index_optimize` - Index Optimize"]
9864#[derive(
9865    serde :: Serialize,
9866    serde :: Deserialize,
9867    PartialEq,
9868    Hash,
9869    Debug,
9870    Clone,
9871    schemars :: JsonSchema,
9872    parse_display :: FromStr,
9873    parse_display :: Display,
9874)]
9875#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9876#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9877pub enum TaskName {
9878    #[serde(rename = "consume_file")]
9879    #[display("consume_file")]
9880    ConsumeFile,
9881    #[serde(rename = "train_classifier")]
9882    #[display("train_classifier")]
9883    TrainClassifier,
9884    #[serde(rename = "check_sanity")]
9885    #[display("check_sanity")]
9886    CheckSanity,
9887    #[serde(rename = "index_optimize")]
9888    #[display("index_optimize")]
9889    IndexOptimize,
9890}
9891
9892#[derive(
9893    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9894)]
9895#[allow(non_snake_case)]
9896pub struct TasksView {
9897    pub id: i64,
9898    #[doc = "Celery ID for the Task that was run"]
9899    pub task_id: String,
9900    #[doc = "Name of the task that was run\n\n* `consume_file` - Consume File\n* `train_classifier` - Train Classifier\n* `check_sanity` - Check Sanity\n* `index_optimize` - Index Optimize"]
9901    #[serde(default, skip_serializing_if = "Option::is_none")]
9902    pub task_name: Option<TaskName>,
9903    #[doc = "Name of the file which the Task was run for"]
9904    #[serde(default, skip_serializing_if = "Option::is_none")]
9905    pub task_file_name: Option<String>,
9906    #[doc = "Datetime field when the task result was created in UTC"]
9907    #[serde(default, skip_serializing_if = "Option::is_none")]
9908    pub date_created: Option<chrono::DateTime<chrono::Utc>>,
9909    #[doc = "Datetime field when the task was completed in UTC"]
9910    #[serde(default, skip_serializing_if = "Option::is_none")]
9911    pub date_done: Option<chrono::DateTime<chrono::Utc>>,
9912    #[doc = "The type of task that was run\n\n* `auto_task` - Auto Task\n* `scheduled_task` - Scheduled Task\n* `manual_task` - Manual Task"]
9913    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
9914    pub type_: Option<TasksViewTypeEnum>,
9915    #[doc = "Current state of the task being run\n\n* `FAILURE` - FAILURE\n* `PENDING` - PENDING\n* `RECEIVED` - RECEIVED\n* `RETRY` - RETRY\n* `REVOKED` - REVOKED\n* `STARTED` - STARTED\n* `SUCCESS` - SUCCESS"]
9916    #[serde(default, skip_serializing_if = "Option::is_none")]
9917    pub status: Option<StatusEnum>,
9918    #[doc = "The data returned by the task"]
9919    #[serde(default, skip_serializing_if = "Option::is_none")]
9920    pub result: Option<String>,
9921    #[doc = "If the task is acknowledged via the frontend or API"]
9922    #[serde(default, skip_serializing_if = "Option::is_none")]
9923    pub acknowledged: Option<bool>,
9924    #[serde(default)]
9925    pub related_document: Option<String>,
9926    #[serde(default, skip_serializing_if = "Option::is_none")]
9927    pub owner: Option<i64>,
9928}
9929
9930impl std::fmt::Display for TasksView {
9931    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9932        write!(
9933            f,
9934            "{}",
9935            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9936        )
9937    }
9938}
9939
9940#[cfg(feature = "tabled")]
9941impl tabled::Tabled for TasksView {
9942    const LENGTH: usize = 12;
9943    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9944        vec![
9945            format!("{:?}", self.id).into(),
9946            self.task_id.clone().into(),
9947            if let Some(task_name) = &self.task_name {
9948                format!("{task_name:?}").into()
9949            } else {
9950                String::new().into()
9951            },
9952            if let Some(task_file_name) = &self.task_file_name {
9953                format!("{task_file_name:?}").into()
9954            } else {
9955                String::new().into()
9956            },
9957            if let Some(date_created) = &self.date_created {
9958                format!("{date_created:?}").into()
9959            } else {
9960                String::new().into()
9961            },
9962            if let Some(date_done) = &self.date_done {
9963                format!("{date_done:?}").into()
9964            } else {
9965                String::new().into()
9966            },
9967            if let Some(type_) = &self.type_ {
9968                format!("{type_:?}").into()
9969            } else {
9970                String::new().into()
9971            },
9972            if let Some(status) = &self.status {
9973                format!("{status:?}").into()
9974            } else {
9975                String::new().into()
9976            },
9977            if let Some(result) = &self.result {
9978                format!("{result:?}").into()
9979            } else {
9980                String::new().into()
9981            },
9982            if let Some(acknowledged) = &self.acknowledged {
9983                format!("{acknowledged:?}").into()
9984            } else {
9985                String::new().into()
9986            },
9987            format!("{:?}", self.related_document).into(),
9988            if let Some(owner) = &self.owner {
9989                format!("{owner:?}").into()
9990            } else {
9991                String::new().into()
9992            },
9993        ]
9994    }
9995
9996    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9997        vec![
9998            "id".into(),
9999            "task_id".into(),
10000            "task_name".into(),
10001            "task_file_name".into(),
10002            "date_created".into(),
10003            "date_done".into(),
10004            "type_".into(),
10005            "status".into(),
10006            "result".into(),
10007            "acknowledged".into(),
10008            "related_document".into(),
10009            "owner".into(),
10010        ]
10011    }
10012}
10013
10014#[derive(
10015    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10016)]
10017#[allow(non_snake_case)]
10018pub struct TasksViewRequest {
10019    #[doc = "Celery ID for the Task that was run"]
10020    pub task_id: String,
10021    #[doc = "Name of the task that was run\n\n* `consume_file` - Consume File\n* `train_classifier` - Train Classifier\n* `check_sanity` - Check Sanity\n* `index_optimize` - Index Optimize"]
10022    #[serde(default, skip_serializing_if = "Option::is_none")]
10023    pub task_name: Option<TaskName>,
10024    #[doc = "Name of the file which the Task was run for"]
10025    #[serde(default, skip_serializing_if = "Option::is_none")]
10026    pub task_file_name: Option<String>,
10027    #[doc = "Datetime field when the task result was created in UTC"]
10028    #[serde(default, skip_serializing_if = "Option::is_none")]
10029    pub date_created: Option<chrono::DateTime<chrono::Utc>>,
10030    #[doc = "Datetime field when the task was completed in UTC"]
10031    #[serde(default, skip_serializing_if = "Option::is_none")]
10032    pub date_done: Option<chrono::DateTime<chrono::Utc>>,
10033    #[doc = "The type of task that was run\n\n* `auto_task` - Auto Task\n* `scheduled_task` - Scheduled Task\n* `manual_task` - Manual Task"]
10034    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
10035    pub type_: Option<TasksViewTypeEnum>,
10036    #[doc = "Current state of the task being run\n\n* `FAILURE` - FAILURE\n* `PENDING` - PENDING\n* `RECEIVED` - RECEIVED\n* `RETRY` - RETRY\n* `REVOKED` - REVOKED\n* `STARTED` - STARTED\n* `SUCCESS` - SUCCESS"]
10037    #[serde(default, skip_serializing_if = "Option::is_none")]
10038    pub status: Option<StatusEnum>,
10039    #[doc = "The data returned by the task"]
10040    #[serde(default, skip_serializing_if = "Option::is_none")]
10041    pub result: Option<String>,
10042    #[doc = "If the task is acknowledged via the frontend or API"]
10043    #[serde(default, skip_serializing_if = "Option::is_none")]
10044    pub acknowledged: Option<bool>,
10045    #[serde(default, skip_serializing_if = "Option::is_none")]
10046    pub owner: Option<i64>,
10047}
10048
10049impl std::fmt::Display for TasksViewRequest {
10050    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10051        write!(
10052            f,
10053            "{}",
10054            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10055        )
10056    }
10057}
10058
10059#[cfg(feature = "tabled")]
10060impl tabled::Tabled for TasksViewRequest {
10061    const LENGTH: usize = 10;
10062    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10063        vec![
10064            self.task_id.clone().into(),
10065            if let Some(task_name) = &self.task_name {
10066                format!("{task_name:?}").into()
10067            } else {
10068                String::new().into()
10069            },
10070            if let Some(task_file_name) = &self.task_file_name {
10071                format!("{task_file_name:?}").into()
10072            } else {
10073                String::new().into()
10074            },
10075            if let Some(date_created) = &self.date_created {
10076                format!("{date_created:?}").into()
10077            } else {
10078                String::new().into()
10079            },
10080            if let Some(date_done) = &self.date_done {
10081                format!("{date_done:?}").into()
10082            } else {
10083                String::new().into()
10084            },
10085            if let Some(type_) = &self.type_ {
10086                format!("{type_:?}").into()
10087            } else {
10088                String::new().into()
10089            },
10090            if let Some(status) = &self.status {
10091                format!("{status:?}").into()
10092            } else {
10093                String::new().into()
10094            },
10095            if let Some(result) = &self.result {
10096                format!("{result:?}").into()
10097            } else {
10098                String::new().into()
10099            },
10100            if let Some(acknowledged) = &self.acknowledged {
10101                format!("{acknowledged:?}").into()
10102            } else {
10103                String::new().into()
10104            },
10105            if let Some(owner) = &self.owner {
10106                format!("{owner:?}").into()
10107            } else {
10108                String::new().into()
10109            },
10110        ]
10111    }
10112
10113    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10114        vec![
10115            "task_id".into(),
10116            "task_name".into(),
10117            "task_file_name".into(),
10118            "date_created".into(),
10119            "date_done".into(),
10120            "type_".into(),
10121            "status".into(),
10122            "result".into(),
10123            "acknowledged".into(),
10124            "owner".into(),
10125        ]
10126    }
10127}
10128
10129#[doc = "* `auto_task` - Auto Task\n* `scheduled_task` - Scheduled Task\n* `manual_task` - Manual Task"]
10130#[derive(
10131    serde :: Serialize,
10132    serde :: Deserialize,
10133    PartialEq,
10134    Hash,
10135    Debug,
10136    Clone,
10137    schemars :: JsonSchema,
10138    parse_display :: FromStr,
10139    parse_display :: Display,
10140)]
10141#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10142#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10143pub enum TasksViewTypeEnum {
10144    #[serde(rename = "auto_task")]
10145    #[display("auto_task")]
10146    AutoTask,
10147    #[serde(rename = "scheduled_task")]
10148    #[display("scheduled_task")]
10149    ScheduledTask,
10150    #[serde(rename = "manual_task")]
10151    #[display("manual_task")]
10152    ManualTask,
10153}
10154
10155#[doc = "* `restore` - restore\n* `empty` - empty"]
10156#[derive(
10157    serde :: Serialize,
10158    serde :: Deserialize,
10159    PartialEq,
10160    Hash,
10161    Debug,
10162    Clone,
10163    schemars :: JsonSchema,
10164    parse_display :: FromStr,
10165    parse_display :: Display,
10166)]
10167#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10168#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10169pub enum TrashActionEnum {
10170    #[serde(rename = "restore")]
10171    #[display("restore")]
10172    Restore,
10173    #[serde(rename = "empty")]
10174    #[display("empty")]
10175    Empty,
10176}
10177
10178#[derive(
10179    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10180)]
10181#[allow(non_snake_case)]
10182pub struct TrashRequest {
10183    #[serde(default, skip_serializing_if = "Option::is_none")]
10184    pub documents: Option<Vec<i64>>,
10185    pub action: TrashActionEnum,
10186}
10187
10188impl std::fmt::Display for TrashRequest {
10189    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10190        write!(
10191            f,
10192            "{}",
10193            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10194        )
10195    }
10196}
10197
10198#[cfg(feature = "tabled")]
10199impl tabled::Tabled for TrashRequest {
10200    const LENGTH: usize = 2;
10201    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10202        vec![
10203            if let Some(documents) = &self.documents {
10204                format!("{documents:?}").into()
10205            } else {
10206                String::new().into()
10207            },
10208            format!("{:?}", self.action).into(),
10209        ]
10210    }
10211
10212    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10213        vec!["documents".into(), "action".into()]
10214    }
10215}
10216
10217#[derive(
10218    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10219)]
10220#[allow(non_snake_case)]
10221pub struct UiSettingsView {
10222    pub id: i64,
10223    #[serde(default, skip_serializing_if = "Option::is_none")]
10224    pub settings: Option<std::collections::HashMap<String, serde_json::Value>>,
10225}
10226
10227impl std::fmt::Display for UiSettingsView {
10228    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10229        write!(
10230            f,
10231            "{}",
10232            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10233        )
10234    }
10235}
10236
10237#[cfg(feature = "tabled")]
10238impl tabled::Tabled for UiSettingsView {
10239    const LENGTH: usize = 2;
10240    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10241        vec![
10242            format!("{:?}", self.id).into(),
10243            if let Some(settings) = &self.settings {
10244                format!("{settings:?}").into()
10245            } else {
10246                String::new().into()
10247            },
10248        ]
10249    }
10250
10251    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10252        vec!["id".into(), "settings".into()]
10253    }
10254}
10255
10256#[derive(
10257    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10258)]
10259#[allow(non_snake_case)]
10260pub struct UiSettingsViewRequest {
10261    #[serde(default, skip_serializing_if = "Option::is_none")]
10262    pub settings: Option<std::collections::HashMap<String, serde_json::Value>>,
10263}
10264
10265impl std::fmt::Display for UiSettingsViewRequest {
10266    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10267        write!(
10268            f,
10269            "{}",
10270            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10271        )
10272    }
10273}
10274
10275#[cfg(feature = "tabled")]
10276impl tabled::Tabled for UiSettingsViewRequest {
10277    const LENGTH: usize = 1;
10278    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10279        vec![if let Some(settings) = &self.settings {
10280            format!("{settings:?}").into()
10281        } else {
10282            String::new().into()
10283        }]
10284    }
10285
10286    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10287        vec!["settings".into()]
10288    }
10289}
10290
10291#[doc = "* `clean` - clean\n* `clean-final` - clean-final\n* `none` - none"]
10292#[derive(
10293    serde :: Serialize,
10294    serde :: Deserialize,
10295    PartialEq,
10296    Hash,
10297    Debug,
10298    Clone,
10299    schemars :: JsonSchema,
10300    parse_display :: FromStr,
10301    parse_display :: Display,
10302)]
10303#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10304#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10305pub enum UnpaperCleanEnum {
10306    #[serde(rename = "clean")]
10307    #[display("clean")]
10308    Clean,
10309    #[serde(rename = "clean-final")]
10310    #[display("clean-final")]
10311    CleanFinal,
10312    #[serde(rename = "none")]
10313    #[display("none")]
10314    None,
10315    #[serde(rename = "")]
10316    #[display("")]
10317    Empty,
10318}
10319
10320#[derive(
10321    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10322)]
10323#[allow(non_snake_case)]
10324pub struct User {
10325    pub id: i64,
10326    #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
10327    pub username: String,
10328    #[serde(default, skip_serializing_if = "Option::is_none")]
10329    pub email: Option<String>,
10330    #[serde(default, skip_serializing_if = "Option::is_none")]
10331    pub password: Option<String>,
10332    #[serde(default, skip_serializing_if = "Option::is_none")]
10333    pub first_name: Option<String>,
10334    #[serde(default, skip_serializing_if = "Option::is_none")]
10335    pub last_name: Option<String>,
10336    #[serde(default, skip_serializing_if = "Option::is_none")]
10337    pub date_joined: Option<chrono::DateTime<chrono::Utc>>,
10338    #[doc = "Designates whether the user can log into this admin site."]
10339    #[serde(default, skip_serializing_if = "Option::is_none")]
10340    pub is_staff: Option<bool>,
10341    #[doc = "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."]
10342    #[serde(default, skip_serializing_if = "Option::is_none")]
10343    pub is_active: Option<bool>,
10344    #[doc = "Designates that this user has all permissions without explicitly assigning them."]
10345    #[serde(default, skip_serializing_if = "Option::is_none")]
10346    pub is_superuser: Option<bool>,
10347    #[doc = "The groups this user belongs to. A user will get all permissions granted to each of their groups."]
10348    #[serde(default, skip_serializing_if = "Option::is_none")]
10349    pub groups: Option<Vec<i64>>,
10350    #[serde(default, skip_serializing_if = "Option::is_none")]
10351    pub user_permissions: Option<Vec<String>>,
10352    pub inherited_permissions: Vec<String>,
10353    pub is_mfa_enabled: bool,
10354}
10355
10356impl std::fmt::Display for User {
10357    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10358        write!(
10359            f,
10360            "{}",
10361            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10362        )
10363    }
10364}
10365
10366#[cfg(feature = "tabled")]
10367impl tabled::Tabled for User {
10368    const LENGTH: usize = 14;
10369    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10370        vec![
10371            format!("{:?}", self.id).into(),
10372            self.username.clone().into(),
10373            if let Some(email) = &self.email {
10374                format!("{email:?}").into()
10375            } else {
10376                String::new().into()
10377            },
10378            if let Some(password) = &self.password {
10379                format!("{password:?}").into()
10380            } else {
10381                String::new().into()
10382            },
10383            if let Some(first_name) = &self.first_name {
10384                format!("{first_name:?}").into()
10385            } else {
10386                String::new().into()
10387            },
10388            if let Some(last_name) = &self.last_name {
10389                format!("{last_name:?}").into()
10390            } else {
10391                String::new().into()
10392            },
10393            if let Some(date_joined) = &self.date_joined {
10394                format!("{date_joined:?}").into()
10395            } else {
10396                String::new().into()
10397            },
10398            if let Some(is_staff) = &self.is_staff {
10399                format!("{is_staff:?}").into()
10400            } else {
10401                String::new().into()
10402            },
10403            if let Some(is_active) = &self.is_active {
10404                format!("{is_active:?}").into()
10405            } else {
10406                String::new().into()
10407            },
10408            if let Some(is_superuser) = &self.is_superuser {
10409                format!("{is_superuser:?}").into()
10410            } else {
10411                String::new().into()
10412            },
10413            if let Some(groups) = &self.groups {
10414                format!("{groups:?}").into()
10415            } else {
10416                String::new().into()
10417            },
10418            if let Some(user_permissions) = &self.user_permissions {
10419                format!("{user_permissions:?}").into()
10420            } else {
10421                String::new().into()
10422            },
10423            format!("{:?}", self.inherited_permissions).into(),
10424            format!("{:?}", self.is_mfa_enabled).into(),
10425        ]
10426    }
10427
10428    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10429        vec![
10430            "id".into(),
10431            "username".into(),
10432            "email".into(),
10433            "password".into(),
10434            "first_name".into(),
10435            "last_name".into(),
10436            "date_joined".into(),
10437            "is_staff".into(),
10438            "is_active".into(),
10439            "is_superuser".into(),
10440            "groups".into(),
10441            "user_permissions".into(),
10442            "inherited_permissions".into(),
10443            "is_mfa_enabled".into(),
10444        ]
10445    }
10446}
10447
10448#[derive(
10449    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10450)]
10451#[allow(non_snake_case)]
10452pub struct UserRequest {
10453    #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
10454    pub username: String,
10455    #[serde(default, skip_serializing_if = "Option::is_none")]
10456    pub email: Option<String>,
10457    #[serde(default, skip_serializing_if = "Option::is_none")]
10458    pub password: Option<String>,
10459    #[serde(default, skip_serializing_if = "Option::is_none")]
10460    pub first_name: Option<String>,
10461    #[serde(default, skip_serializing_if = "Option::is_none")]
10462    pub last_name: Option<String>,
10463    #[serde(default, skip_serializing_if = "Option::is_none")]
10464    pub date_joined: Option<chrono::DateTime<chrono::Utc>>,
10465    #[doc = "Designates whether the user can log into this admin site."]
10466    #[serde(default, skip_serializing_if = "Option::is_none")]
10467    pub is_staff: Option<bool>,
10468    #[doc = "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."]
10469    #[serde(default, skip_serializing_if = "Option::is_none")]
10470    pub is_active: Option<bool>,
10471    #[doc = "Designates that this user has all permissions without explicitly assigning them."]
10472    #[serde(default, skip_serializing_if = "Option::is_none")]
10473    pub is_superuser: Option<bool>,
10474    #[doc = "The groups this user belongs to. A user will get all permissions granted to each of their groups."]
10475    #[serde(default, skip_serializing_if = "Option::is_none")]
10476    pub groups: Option<Vec<i64>>,
10477    #[serde(default, skip_serializing_if = "Option::is_none")]
10478    pub user_permissions: Option<Vec<String>>,
10479}
10480
10481impl std::fmt::Display for UserRequest {
10482    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10483        write!(
10484            f,
10485            "{}",
10486            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10487        )
10488    }
10489}
10490
10491#[cfg(feature = "tabled")]
10492impl tabled::Tabled for UserRequest {
10493    const LENGTH: usize = 11;
10494    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10495        vec![
10496            self.username.clone().into(),
10497            if let Some(email) = &self.email {
10498                format!("{email:?}").into()
10499            } else {
10500                String::new().into()
10501            },
10502            if let Some(password) = &self.password {
10503                format!("{password:?}").into()
10504            } else {
10505                String::new().into()
10506            },
10507            if let Some(first_name) = &self.first_name {
10508                format!("{first_name:?}").into()
10509            } else {
10510                String::new().into()
10511            },
10512            if let Some(last_name) = &self.last_name {
10513                format!("{last_name:?}").into()
10514            } else {
10515                String::new().into()
10516            },
10517            if let Some(date_joined) = &self.date_joined {
10518                format!("{date_joined:?}").into()
10519            } else {
10520                String::new().into()
10521            },
10522            if let Some(is_staff) = &self.is_staff {
10523                format!("{is_staff:?}").into()
10524            } else {
10525                String::new().into()
10526            },
10527            if let Some(is_active) = &self.is_active {
10528                format!("{is_active:?}").into()
10529            } else {
10530                String::new().into()
10531            },
10532            if let Some(is_superuser) = &self.is_superuser {
10533                format!("{is_superuser:?}").into()
10534            } else {
10535                String::new().into()
10536            },
10537            if let Some(groups) = &self.groups {
10538                format!("{groups:?}").into()
10539            } else {
10540                String::new().into()
10541            },
10542            if let Some(user_permissions) = &self.user_permissions {
10543                format!("{user_permissions:?}").into()
10544            } else {
10545                String::new().into()
10546            },
10547        ]
10548    }
10549
10550    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10551        vec![
10552            "username".into(),
10553            "email".into(),
10554            "password".into(),
10555            "first_name".into(),
10556            "last_name".into(),
10557            "date_joined".into(),
10558            "is_staff".into(),
10559            "is_active".into(),
10560            "is_superuser".into(),
10561            "groups".into(),
10562            "user_permissions".into(),
10563        ]
10564    }
10565}
10566
10567#[derive(
10568    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10569)]
10570#[allow(non_snake_case)]
10571pub struct Workflow {
10572    pub id: i64,
10573    pub name: String,
10574    #[serde(default, skip_serializing_if = "Option::is_none")]
10575    pub order: Option<i64>,
10576    #[serde(default, skip_serializing_if = "Option::is_none")]
10577    pub enabled: Option<bool>,
10578    pub triggers: Vec<WorkflowTrigger>,
10579    pub actions: Vec<WorkflowAction>,
10580}
10581
10582impl std::fmt::Display for Workflow {
10583    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10584        write!(
10585            f,
10586            "{}",
10587            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10588        )
10589    }
10590}
10591
10592#[cfg(feature = "tabled")]
10593impl tabled::Tabled for Workflow {
10594    const LENGTH: usize = 6;
10595    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10596        vec![
10597            format!("{:?}", self.id).into(),
10598            self.name.clone().into(),
10599            if let Some(order) = &self.order {
10600                format!("{order:?}").into()
10601            } else {
10602                String::new().into()
10603            },
10604            if let Some(enabled) = &self.enabled {
10605                format!("{enabled:?}").into()
10606            } else {
10607                String::new().into()
10608            },
10609            format!("{:?}", self.triggers).into(),
10610            format!("{:?}", self.actions).into(),
10611        ]
10612    }
10613
10614    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10615        vec![
10616            "id".into(),
10617            "name".into(),
10618            "order".into(),
10619            "enabled".into(),
10620            "triggers".into(),
10621            "actions".into(),
10622        ]
10623    }
10624}
10625
10626#[derive(
10627    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10628)]
10629#[allow(non_snake_case)]
10630pub struct WorkflowAction {
10631    #[serde(default, skip_serializing_if = "Option::is_none")]
10632    pub id: Option<i64>,
10633    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
10634    pub type_: Option<i64>,
10635    #[doc = "Assign a document title, must  be a Jinja2 template, see documentation."]
10636    #[serde(default, skip_serializing_if = "Option::is_none")]
10637    pub assign_title: Option<String>,
10638    #[serde(default, skip_serializing_if = "Option::is_none")]
10639    pub assign_tags: Option<Vec<Option<i64>>>,
10640    #[serde(default, skip_serializing_if = "Option::is_none")]
10641    pub assign_correspondent: Option<i64>,
10642    #[serde(default, skip_serializing_if = "Option::is_none")]
10643    pub assign_document_type: Option<i64>,
10644    #[serde(default, skip_serializing_if = "Option::is_none")]
10645    pub assign_storage_path: Option<i64>,
10646    #[serde(default, skip_serializing_if = "Option::is_none")]
10647    pub assign_owner: Option<i64>,
10648    #[serde(default, skip_serializing_if = "Option::is_none")]
10649    pub assign_view_users: Option<Vec<i64>>,
10650    #[serde(default, skip_serializing_if = "Option::is_none")]
10651    pub assign_view_groups: Option<Vec<i64>>,
10652    #[serde(default, skip_serializing_if = "Option::is_none")]
10653    pub assign_change_users: Option<Vec<i64>>,
10654    #[serde(default, skip_serializing_if = "Option::is_none")]
10655    pub assign_change_groups: Option<Vec<i64>>,
10656    #[serde(default, skip_serializing_if = "Option::is_none")]
10657    pub assign_custom_fields: Option<Vec<i64>>,
10658    #[doc = "Optional values to assign to the custom fields."]
10659    #[serde(default, skip_serializing_if = "Option::is_none")]
10660    pub assign_custom_fields_values: Option<serde_json::Value>,
10661    #[serde(default, skip_serializing_if = "Option::is_none")]
10662    pub remove_all_tags: Option<bool>,
10663    #[serde(default, skip_serializing_if = "Option::is_none")]
10664    pub remove_tags: Option<Vec<i64>>,
10665    #[serde(default, skip_serializing_if = "Option::is_none")]
10666    pub remove_all_correspondents: Option<bool>,
10667    #[serde(default, skip_serializing_if = "Option::is_none")]
10668    pub remove_correspondents: Option<Vec<i64>>,
10669    #[serde(default, skip_serializing_if = "Option::is_none")]
10670    pub remove_all_document_types: Option<bool>,
10671    #[serde(default, skip_serializing_if = "Option::is_none")]
10672    pub remove_document_types: Option<Vec<i64>>,
10673    #[serde(default, skip_serializing_if = "Option::is_none")]
10674    pub remove_all_storage_paths: Option<bool>,
10675    #[serde(default, skip_serializing_if = "Option::is_none")]
10676    pub remove_storage_paths: Option<Vec<i64>>,
10677    #[serde(default, skip_serializing_if = "Option::is_none")]
10678    pub remove_custom_fields: Option<Vec<i64>>,
10679    #[serde(default, skip_serializing_if = "Option::is_none")]
10680    pub remove_all_custom_fields: Option<bool>,
10681    #[serde(default, skip_serializing_if = "Option::is_none")]
10682    pub remove_all_owners: Option<bool>,
10683    #[serde(default, skip_serializing_if = "Option::is_none")]
10684    pub remove_owners: Option<Vec<i64>>,
10685    #[serde(default, skip_serializing_if = "Option::is_none")]
10686    pub remove_all_permissions: Option<bool>,
10687    #[serde(default, skip_serializing_if = "Option::is_none")]
10688    pub remove_view_users: Option<Vec<i64>>,
10689    #[serde(default, skip_serializing_if = "Option::is_none")]
10690    pub remove_view_groups: Option<Vec<i64>>,
10691    #[serde(default, skip_serializing_if = "Option::is_none")]
10692    pub remove_change_users: Option<Vec<i64>>,
10693    #[serde(default, skip_serializing_if = "Option::is_none")]
10694    pub remove_change_groups: Option<Vec<i64>>,
10695    #[serde(default, skip_serializing_if = "Option::is_none")]
10696    pub email: Option<WorkflowActionEmail>,
10697    #[serde(default, skip_serializing_if = "Option::is_none")]
10698    pub webhook: Option<WorkflowActionWebhook>,
10699}
10700
10701impl std::fmt::Display for WorkflowAction {
10702    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10703        write!(
10704            f,
10705            "{}",
10706            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10707        )
10708    }
10709}
10710
10711#[cfg(feature = "tabled")]
10712impl tabled::Tabled for WorkflowAction {
10713    const LENGTH: usize = 33;
10714    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10715        vec![
10716            if let Some(id) = &self.id {
10717                format!("{id:?}").into()
10718            } else {
10719                String::new().into()
10720            },
10721            if let Some(type_) = &self.type_ {
10722                format!("{type_:?}").into()
10723            } else {
10724                String::new().into()
10725            },
10726            if let Some(assign_title) = &self.assign_title {
10727                format!("{assign_title:?}").into()
10728            } else {
10729                String::new().into()
10730            },
10731            if let Some(assign_tags) = &self.assign_tags {
10732                format!("{assign_tags:?}").into()
10733            } else {
10734                String::new().into()
10735            },
10736            if let Some(assign_correspondent) = &self.assign_correspondent {
10737                format!("{assign_correspondent:?}").into()
10738            } else {
10739                String::new().into()
10740            },
10741            if let Some(assign_document_type) = &self.assign_document_type {
10742                format!("{assign_document_type:?}").into()
10743            } else {
10744                String::new().into()
10745            },
10746            if let Some(assign_storage_path) = &self.assign_storage_path {
10747                format!("{assign_storage_path:?}").into()
10748            } else {
10749                String::new().into()
10750            },
10751            if let Some(assign_owner) = &self.assign_owner {
10752                format!("{assign_owner:?}").into()
10753            } else {
10754                String::new().into()
10755            },
10756            if let Some(assign_view_users) = &self.assign_view_users {
10757                format!("{assign_view_users:?}").into()
10758            } else {
10759                String::new().into()
10760            },
10761            if let Some(assign_view_groups) = &self.assign_view_groups {
10762                format!("{assign_view_groups:?}").into()
10763            } else {
10764                String::new().into()
10765            },
10766            if let Some(assign_change_users) = &self.assign_change_users {
10767                format!("{assign_change_users:?}").into()
10768            } else {
10769                String::new().into()
10770            },
10771            if let Some(assign_change_groups) = &self.assign_change_groups {
10772                format!("{assign_change_groups:?}").into()
10773            } else {
10774                String::new().into()
10775            },
10776            if let Some(assign_custom_fields) = &self.assign_custom_fields {
10777                format!("{assign_custom_fields:?}").into()
10778            } else {
10779                String::new().into()
10780            },
10781            if let Some(assign_custom_fields_values) = &self.assign_custom_fields_values {
10782                format!("{assign_custom_fields_values:?}").into()
10783            } else {
10784                String::new().into()
10785            },
10786            if let Some(remove_all_tags) = &self.remove_all_tags {
10787                format!("{remove_all_tags:?}").into()
10788            } else {
10789                String::new().into()
10790            },
10791            if let Some(remove_tags) = &self.remove_tags {
10792                format!("{remove_tags:?}").into()
10793            } else {
10794                String::new().into()
10795            },
10796            if let Some(remove_all_correspondents) = &self.remove_all_correspondents {
10797                format!("{remove_all_correspondents:?}").into()
10798            } else {
10799                String::new().into()
10800            },
10801            if let Some(remove_correspondents) = &self.remove_correspondents {
10802                format!("{remove_correspondents:?}").into()
10803            } else {
10804                String::new().into()
10805            },
10806            if let Some(remove_all_document_types) = &self.remove_all_document_types {
10807                format!("{remove_all_document_types:?}").into()
10808            } else {
10809                String::new().into()
10810            },
10811            if let Some(remove_document_types) = &self.remove_document_types {
10812                format!("{remove_document_types:?}").into()
10813            } else {
10814                String::new().into()
10815            },
10816            if let Some(remove_all_storage_paths) = &self.remove_all_storage_paths {
10817                format!("{remove_all_storage_paths:?}").into()
10818            } else {
10819                String::new().into()
10820            },
10821            if let Some(remove_storage_paths) = &self.remove_storage_paths {
10822                format!("{remove_storage_paths:?}").into()
10823            } else {
10824                String::new().into()
10825            },
10826            if let Some(remove_custom_fields) = &self.remove_custom_fields {
10827                format!("{remove_custom_fields:?}").into()
10828            } else {
10829                String::new().into()
10830            },
10831            if let Some(remove_all_custom_fields) = &self.remove_all_custom_fields {
10832                format!("{remove_all_custom_fields:?}").into()
10833            } else {
10834                String::new().into()
10835            },
10836            if let Some(remove_all_owners) = &self.remove_all_owners {
10837                format!("{remove_all_owners:?}").into()
10838            } else {
10839                String::new().into()
10840            },
10841            if let Some(remove_owners) = &self.remove_owners {
10842                format!("{remove_owners:?}").into()
10843            } else {
10844                String::new().into()
10845            },
10846            if let Some(remove_all_permissions) = &self.remove_all_permissions {
10847                format!("{remove_all_permissions:?}").into()
10848            } else {
10849                String::new().into()
10850            },
10851            if let Some(remove_view_users) = &self.remove_view_users {
10852                format!("{remove_view_users:?}").into()
10853            } else {
10854                String::new().into()
10855            },
10856            if let Some(remove_view_groups) = &self.remove_view_groups {
10857                format!("{remove_view_groups:?}").into()
10858            } else {
10859                String::new().into()
10860            },
10861            if let Some(remove_change_users) = &self.remove_change_users {
10862                format!("{remove_change_users:?}").into()
10863            } else {
10864                String::new().into()
10865            },
10866            if let Some(remove_change_groups) = &self.remove_change_groups {
10867                format!("{remove_change_groups:?}").into()
10868            } else {
10869                String::new().into()
10870            },
10871            if let Some(email) = &self.email {
10872                format!("{email:?}").into()
10873            } else {
10874                String::new().into()
10875            },
10876            if let Some(webhook) = &self.webhook {
10877                format!("{webhook:?}").into()
10878            } else {
10879                String::new().into()
10880            },
10881        ]
10882    }
10883
10884    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10885        vec![
10886            "id".into(),
10887            "type_".into(),
10888            "assign_title".into(),
10889            "assign_tags".into(),
10890            "assign_correspondent".into(),
10891            "assign_document_type".into(),
10892            "assign_storage_path".into(),
10893            "assign_owner".into(),
10894            "assign_view_users".into(),
10895            "assign_view_groups".into(),
10896            "assign_change_users".into(),
10897            "assign_change_groups".into(),
10898            "assign_custom_fields".into(),
10899            "assign_custom_fields_values".into(),
10900            "remove_all_tags".into(),
10901            "remove_tags".into(),
10902            "remove_all_correspondents".into(),
10903            "remove_correspondents".into(),
10904            "remove_all_document_types".into(),
10905            "remove_document_types".into(),
10906            "remove_all_storage_paths".into(),
10907            "remove_storage_paths".into(),
10908            "remove_custom_fields".into(),
10909            "remove_all_custom_fields".into(),
10910            "remove_all_owners".into(),
10911            "remove_owners".into(),
10912            "remove_all_permissions".into(),
10913            "remove_view_users".into(),
10914            "remove_view_groups".into(),
10915            "remove_change_users".into(),
10916            "remove_change_groups".into(),
10917            "email".into(),
10918            "webhook".into(),
10919        ]
10920    }
10921}
10922
10923#[derive(
10924    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10925)]
10926#[allow(non_snake_case)]
10927pub struct WorkflowActionEmail {
10928    #[serde(default, skip_serializing_if = "Option::is_none")]
10929    pub id: Option<i64>,
10930    #[doc = "The subject of the email, can include some placeholders, see documentation."]
10931    pub subject: String,
10932    #[doc = "The body (message) of the email, can include some placeholders, see documentation."]
10933    pub body: String,
10934    #[doc = "The destination email addresses, comma separated."]
10935    pub to: String,
10936    #[serde(default, skip_serializing_if = "Option::is_none")]
10937    pub include_document: Option<bool>,
10938}
10939
10940impl std::fmt::Display for WorkflowActionEmail {
10941    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10942        write!(
10943            f,
10944            "{}",
10945            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10946        )
10947    }
10948}
10949
10950#[cfg(feature = "tabled")]
10951impl tabled::Tabled for WorkflowActionEmail {
10952    const LENGTH: usize = 5;
10953    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10954        vec![
10955            if let Some(id) = &self.id {
10956                format!("{id:?}").into()
10957            } else {
10958                String::new().into()
10959            },
10960            self.subject.clone().into(),
10961            self.body.clone().into(),
10962            self.to.clone().into(),
10963            if let Some(include_document) = &self.include_document {
10964                format!("{include_document:?}").into()
10965            } else {
10966                String::new().into()
10967            },
10968        ]
10969    }
10970
10971    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10972        vec![
10973            "id".into(),
10974            "subject".into(),
10975            "body".into(),
10976            "to".into(),
10977            "include_document".into(),
10978        ]
10979    }
10980}
10981
10982#[derive(
10983    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10984)]
10985#[allow(non_snake_case)]
10986pub struct WorkflowActionEmailRequest {
10987    #[serde(default, skip_serializing_if = "Option::is_none")]
10988    pub id: Option<i64>,
10989    #[doc = "The subject of the email, can include some placeholders, see documentation."]
10990    pub subject: String,
10991    #[doc = "The body (message) of the email, can include some placeholders, see documentation."]
10992    pub body: String,
10993    #[doc = "The destination email addresses, comma separated."]
10994    pub to: String,
10995    #[serde(default, skip_serializing_if = "Option::is_none")]
10996    pub include_document: Option<bool>,
10997}
10998
10999impl std::fmt::Display for WorkflowActionEmailRequest {
11000    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11001        write!(
11002            f,
11003            "{}",
11004            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11005        )
11006    }
11007}
11008
11009#[cfg(feature = "tabled")]
11010impl tabled::Tabled for WorkflowActionEmailRequest {
11011    const LENGTH: usize = 5;
11012    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11013        vec![
11014            if let Some(id) = &self.id {
11015                format!("{id:?}").into()
11016            } else {
11017                String::new().into()
11018            },
11019            self.subject.clone().into(),
11020            self.body.clone().into(),
11021            self.to.clone().into(),
11022            if let Some(include_document) = &self.include_document {
11023                format!("{include_document:?}").into()
11024            } else {
11025                String::new().into()
11026            },
11027        ]
11028    }
11029
11030    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11031        vec![
11032            "id".into(),
11033            "subject".into(),
11034            "body".into(),
11035            "to".into(),
11036            "include_document".into(),
11037        ]
11038    }
11039}
11040
11041#[derive(
11042    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11043)]
11044#[allow(non_snake_case)]
11045pub struct WorkflowActionRequest {
11046    #[serde(default, skip_serializing_if = "Option::is_none")]
11047    pub id: Option<i64>,
11048    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
11049    pub type_: Option<i64>,
11050    #[doc = "Assign a document title, must  be a Jinja2 template, see documentation."]
11051    #[serde(default, skip_serializing_if = "Option::is_none")]
11052    pub assign_title: Option<String>,
11053    #[serde(default, skip_serializing_if = "Option::is_none")]
11054    pub assign_tags: Option<Vec<Option<i64>>>,
11055    #[serde(default, skip_serializing_if = "Option::is_none")]
11056    pub assign_correspondent: Option<i64>,
11057    #[serde(default, skip_serializing_if = "Option::is_none")]
11058    pub assign_document_type: Option<i64>,
11059    #[serde(default, skip_serializing_if = "Option::is_none")]
11060    pub assign_storage_path: Option<i64>,
11061    #[serde(default, skip_serializing_if = "Option::is_none")]
11062    pub assign_owner: Option<i64>,
11063    #[serde(default, skip_serializing_if = "Option::is_none")]
11064    pub assign_view_users: Option<Vec<i64>>,
11065    #[serde(default, skip_serializing_if = "Option::is_none")]
11066    pub assign_view_groups: Option<Vec<i64>>,
11067    #[serde(default, skip_serializing_if = "Option::is_none")]
11068    pub assign_change_users: Option<Vec<i64>>,
11069    #[serde(default, skip_serializing_if = "Option::is_none")]
11070    pub assign_change_groups: Option<Vec<i64>>,
11071    #[serde(default, skip_serializing_if = "Option::is_none")]
11072    pub assign_custom_fields: Option<Vec<i64>>,
11073    #[doc = "Optional values to assign to the custom fields."]
11074    #[serde(default, skip_serializing_if = "Option::is_none")]
11075    pub assign_custom_fields_values: Option<serde_json::Value>,
11076    #[serde(default, skip_serializing_if = "Option::is_none")]
11077    pub remove_all_tags: Option<bool>,
11078    #[serde(default, skip_serializing_if = "Option::is_none")]
11079    pub remove_tags: Option<Vec<i64>>,
11080    #[serde(default, skip_serializing_if = "Option::is_none")]
11081    pub remove_all_correspondents: Option<bool>,
11082    #[serde(default, skip_serializing_if = "Option::is_none")]
11083    pub remove_correspondents: Option<Vec<i64>>,
11084    #[serde(default, skip_serializing_if = "Option::is_none")]
11085    pub remove_all_document_types: Option<bool>,
11086    #[serde(default, skip_serializing_if = "Option::is_none")]
11087    pub remove_document_types: Option<Vec<i64>>,
11088    #[serde(default, skip_serializing_if = "Option::is_none")]
11089    pub remove_all_storage_paths: Option<bool>,
11090    #[serde(default, skip_serializing_if = "Option::is_none")]
11091    pub remove_storage_paths: Option<Vec<i64>>,
11092    #[serde(default, skip_serializing_if = "Option::is_none")]
11093    pub remove_custom_fields: Option<Vec<i64>>,
11094    #[serde(default, skip_serializing_if = "Option::is_none")]
11095    pub remove_all_custom_fields: Option<bool>,
11096    #[serde(default, skip_serializing_if = "Option::is_none")]
11097    pub remove_all_owners: Option<bool>,
11098    #[serde(default, skip_serializing_if = "Option::is_none")]
11099    pub remove_owners: Option<Vec<i64>>,
11100    #[serde(default, skip_serializing_if = "Option::is_none")]
11101    pub remove_all_permissions: Option<bool>,
11102    #[serde(default, skip_serializing_if = "Option::is_none")]
11103    pub remove_view_users: Option<Vec<i64>>,
11104    #[serde(default, skip_serializing_if = "Option::is_none")]
11105    pub remove_view_groups: Option<Vec<i64>>,
11106    #[serde(default, skip_serializing_if = "Option::is_none")]
11107    pub remove_change_users: Option<Vec<i64>>,
11108    #[serde(default, skip_serializing_if = "Option::is_none")]
11109    pub remove_change_groups: Option<Vec<i64>>,
11110    #[serde(default, skip_serializing_if = "Option::is_none")]
11111    pub email: Option<WorkflowActionEmailRequest>,
11112    #[serde(default, skip_serializing_if = "Option::is_none")]
11113    pub webhook: Option<WorkflowActionWebhookRequest>,
11114}
11115
11116impl std::fmt::Display for WorkflowActionRequest {
11117    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11118        write!(
11119            f,
11120            "{}",
11121            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11122        )
11123    }
11124}
11125
11126#[cfg(feature = "tabled")]
11127impl tabled::Tabled for WorkflowActionRequest {
11128    const LENGTH: usize = 33;
11129    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11130        vec![
11131            if let Some(id) = &self.id {
11132                format!("{id:?}").into()
11133            } else {
11134                String::new().into()
11135            },
11136            if let Some(type_) = &self.type_ {
11137                format!("{type_:?}").into()
11138            } else {
11139                String::new().into()
11140            },
11141            if let Some(assign_title) = &self.assign_title {
11142                format!("{assign_title:?}").into()
11143            } else {
11144                String::new().into()
11145            },
11146            if let Some(assign_tags) = &self.assign_tags {
11147                format!("{assign_tags:?}").into()
11148            } else {
11149                String::new().into()
11150            },
11151            if let Some(assign_correspondent) = &self.assign_correspondent {
11152                format!("{assign_correspondent:?}").into()
11153            } else {
11154                String::new().into()
11155            },
11156            if let Some(assign_document_type) = &self.assign_document_type {
11157                format!("{assign_document_type:?}").into()
11158            } else {
11159                String::new().into()
11160            },
11161            if let Some(assign_storage_path) = &self.assign_storage_path {
11162                format!("{assign_storage_path:?}").into()
11163            } else {
11164                String::new().into()
11165            },
11166            if let Some(assign_owner) = &self.assign_owner {
11167                format!("{assign_owner:?}").into()
11168            } else {
11169                String::new().into()
11170            },
11171            if let Some(assign_view_users) = &self.assign_view_users {
11172                format!("{assign_view_users:?}").into()
11173            } else {
11174                String::new().into()
11175            },
11176            if let Some(assign_view_groups) = &self.assign_view_groups {
11177                format!("{assign_view_groups:?}").into()
11178            } else {
11179                String::new().into()
11180            },
11181            if let Some(assign_change_users) = &self.assign_change_users {
11182                format!("{assign_change_users:?}").into()
11183            } else {
11184                String::new().into()
11185            },
11186            if let Some(assign_change_groups) = &self.assign_change_groups {
11187                format!("{assign_change_groups:?}").into()
11188            } else {
11189                String::new().into()
11190            },
11191            if let Some(assign_custom_fields) = &self.assign_custom_fields {
11192                format!("{assign_custom_fields:?}").into()
11193            } else {
11194                String::new().into()
11195            },
11196            if let Some(assign_custom_fields_values) = &self.assign_custom_fields_values {
11197                format!("{assign_custom_fields_values:?}").into()
11198            } else {
11199                String::new().into()
11200            },
11201            if let Some(remove_all_tags) = &self.remove_all_tags {
11202                format!("{remove_all_tags:?}").into()
11203            } else {
11204                String::new().into()
11205            },
11206            if let Some(remove_tags) = &self.remove_tags {
11207                format!("{remove_tags:?}").into()
11208            } else {
11209                String::new().into()
11210            },
11211            if let Some(remove_all_correspondents) = &self.remove_all_correspondents {
11212                format!("{remove_all_correspondents:?}").into()
11213            } else {
11214                String::new().into()
11215            },
11216            if let Some(remove_correspondents) = &self.remove_correspondents {
11217                format!("{remove_correspondents:?}").into()
11218            } else {
11219                String::new().into()
11220            },
11221            if let Some(remove_all_document_types) = &self.remove_all_document_types {
11222                format!("{remove_all_document_types:?}").into()
11223            } else {
11224                String::new().into()
11225            },
11226            if let Some(remove_document_types) = &self.remove_document_types {
11227                format!("{remove_document_types:?}").into()
11228            } else {
11229                String::new().into()
11230            },
11231            if let Some(remove_all_storage_paths) = &self.remove_all_storage_paths {
11232                format!("{remove_all_storage_paths:?}").into()
11233            } else {
11234                String::new().into()
11235            },
11236            if let Some(remove_storage_paths) = &self.remove_storage_paths {
11237                format!("{remove_storage_paths:?}").into()
11238            } else {
11239                String::new().into()
11240            },
11241            if let Some(remove_custom_fields) = &self.remove_custom_fields {
11242                format!("{remove_custom_fields:?}").into()
11243            } else {
11244                String::new().into()
11245            },
11246            if let Some(remove_all_custom_fields) = &self.remove_all_custom_fields {
11247                format!("{remove_all_custom_fields:?}").into()
11248            } else {
11249                String::new().into()
11250            },
11251            if let Some(remove_all_owners) = &self.remove_all_owners {
11252                format!("{remove_all_owners:?}").into()
11253            } else {
11254                String::new().into()
11255            },
11256            if let Some(remove_owners) = &self.remove_owners {
11257                format!("{remove_owners:?}").into()
11258            } else {
11259                String::new().into()
11260            },
11261            if let Some(remove_all_permissions) = &self.remove_all_permissions {
11262                format!("{remove_all_permissions:?}").into()
11263            } else {
11264                String::new().into()
11265            },
11266            if let Some(remove_view_users) = &self.remove_view_users {
11267                format!("{remove_view_users:?}").into()
11268            } else {
11269                String::new().into()
11270            },
11271            if let Some(remove_view_groups) = &self.remove_view_groups {
11272                format!("{remove_view_groups:?}").into()
11273            } else {
11274                String::new().into()
11275            },
11276            if let Some(remove_change_users) = &self.remove_change_users {
11277                format!("{remove_change_users:?}").into()
11278            } else {
11279                String::new().into()
11280            },
11281            if let Some(remove_change_groups) = &self.remove_change_groups {
11282                format!("{remove_change_groups:?}").into()
11283            } else {
11284                String::new().into()
11285            },
11286            if let Some(email) = &self.email {
11287                format!("{email:?}").into()
11288            } else {
11289                String::new().into()
11290            },
11291            if let Some(webhook) = &self.webhook {
11292                format!("{webhook:?}").into()
11293            } else {
11294                String::new().into()
11295            },
11296        ]
11297    }
11298
11299    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11300        vec![
11301            "id".into(),
11302            "type_".into(),
11303            "assign_title".into(),
11304            "assign_tags".into(),
11305            "assign_correspondent".into(),
11306            "assign_document_type".into(),
11307            "assign_storage_path".into(),
11308            "assign_owner".into(),
11309            "assign_view_users".into(),
11310            "assign_view_groups".into(),
11311            "assign_change_users".into(),
11312            "assign_change_groups".into(),
11313            "assign_custom_fields".into(),
11314            "assign_custom_fields_values".into(),
11315            "remove_all_tags".into(),
11316            "remove_tags".into(),
11317            "remove_all_correspondents".into(),
11318            "remove_correspondents".into(),
11319            "remove_all_document_types".into(),
11320            "remove_document_types".into(),
11321            "remove_all_storage_paths".into(),
11322            "remove_storage_paths".into(),
11323            "remove_custom_fields".into(),
11324            "remove_all_custom_fields".into(),
11325            "remove_all_owners".into(),
11326            "remove_owners".into(),
11327            "remove_all_permissions".into(),
11328            "remove_view_users".into(),
11329            "remove_view_groups".into(),
11330            "remove_change_users".into(),
11331            "remove_change_groups".into(),
11332            "email".into(),
11333            "webhook".into(),
11334        ]
11335    }
11336}
11337
11338#[derive(
11339    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11340)]
11341#[allow(non_snake_case)]
11342pub struct WorkflowActionWebhook {
11343    #[serde(default, skip_serializing_if = "Option::is_none")]
11344    pub id: Option<i64>,
11345    #[doc = "The destination URL for the notification."]
11346    pub url: String,
11347    #[serde(default, skip_serializing_if = "Option::is_none")]
11348    pub use_params: Option<bool>,
11349    #[serde(default, skip_serializing_if = "Option::is_none")]
11350    pub as_json: Option<bool>,
11351    #[doc = "The parameters to send with the webhook URL if body not used."]
11352    #[serde(default, skip_serializing_if = "Option::is_none")]
11353    pub params: Option<serde_json::Value>,
11354    #[doc = "The body to send with the webhook URL if parameters not used."]
11355    #[serde(default, skip_serializing_if = "Option::is_none")]
11356    pub body: Option<String>,
11357    #[doc = "The headers to send with the webhook URL."]
11358    #[serde(default, skip_serializing_if = "Option::is_none")]
11359    pub headers: Option<serde_json::Value>,
11360    #[serde(default, skip_serializing_if = "Option::is_none")]
11361    pub include_document: Option<bool>,
11362}
11363
11364impl std::fmt::Display for WorkflowActionWebhook {
11365    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11366        write!(
11367            f,
11368            "{}",
11369            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11370        )
11371    }
11372}
11373
11374#[cfg(feature = "tabled")]
11375impl tabled::Tabled for WorkflowActionWebhook {
11376    const LENGTH: usize = 8;
11377    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11378        vec![
11379            if let Some(id) = &self.id {
11380                format!("{id:?}").into()
11381            } else {
11382                String::new().into()
11383            },
11384            self.url.clone().into(),
11385            if let Some(use_params) = &self.use_params {
11386                format!("{use_params:?}").into()
11387            } else {
11388                String::new().into()
11389            },
11390            if let Some(as_json) = &self.as_json {
11391                format!("{as_json:?}").into()
11392            } else {
11393                String::new().into()
11394            },
11395            if let Some(params) = &self.params {
11396                format!("{params:?}").into()
11397            } else {
11398                String::new().into()
11399            },
11400            if let Some(body) = &self.body {
11401                format!("{body:?}").into()
11402            } else {
11403                String::new().into()
11404            },
11405            if let Some(headers) = &self.headers {
11406                format!("{headers:?}").into()
11407            } else {
11408                String::new().into()
11409            },
11410            if let Some(include_document) = &self.include_document {
11411                format!("{include_document:?}").into()
11412            } else {
11413                String::new().into()
11414            },
11415        ]
11416    }
11417
11418    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11419        vec![
11420            "id".into(),
11421            "url".into(),
11422            "use_params".into(),
11423            "as_json".into(),
11424            "params".into(),
11425            "body".into(),
11426            "headers".into(),
11427            "include_document".into(),
11428        ]
11429    }
11430}
11431
11432#[derive(
11433    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11434)]
11435#[allow(non_snake_case)]
11436pub struct WorkflowActionWebhookRequest {
11437    #[serde(default, skip_serializing_if = "Option::is_none")]
11438    pub id: Option<i64>,
11439    #[doc = "The destination URL for the notification."]
11440    pub url: String,
11441    #[serde(default, skip_serializing_if = "Option::is_none")]
11442    pub use_params: Option<bool>,
11443    #[serde(default, skip_serializing_if = "Option::is_none")]
11444    pub as_json: Option<bool>,
11445    #[doc = "The parameters to send with the webhook URL if body not used."]
11446    #[serde(default, skip_serializing_if = "Option::is_none")]
11447    pub params: Option<serde_json::Value>,
11448    #[doc = "The body to send with the webhook URL if parameters not used."]
11449    #[serde(default, skip_serializing_if = "Option::is_none")]
11450    pub body: Option<String>,
11451    #[doc = "The headers to send with the webhook URL."]
11452    #[serde(default, skip_serializing_if = "Option::is_none")]
11453    pub headers: Option<serde_json::Value>,
11454    #[serde(default, skip_serializing_if = "Option::is_none")]
11455    pub include_document: Option<bool>,
11456}
11457
11458impl std::fmt::Display for WorkflowActionWebhookRequest {
11459    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11460        write!(
11461            f,
11462            "{}",
11463            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11464        )
11465    }
11466}
11467
11468#[cfg(feature = "tabled")]
11469impl tabled::Tabled for WorkflowActionWebhookRequest {
11470    const LENGTH: usize = 8;
11471    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11472        vec![
11473            if let Some(id) = &self.id {
11474                format!("{id:?}").into()
11475            } else {
11476                String::new().into()
11477            },
11478            self.url.clone().into(),
11479            if let Some(use_params) = &self.use_params {
11480                format!("{use_params:?}").into()
11481            } else {
11482                String::new().into()
11483            },
11484            if let Some(as_json) = &self.as_json {
11485                format!("{as_json:?}").into()
11486            } else {
11487                String::new().into()
11488            },
11489            if let Some(params) = &self.params {
11490                format!("{params:?}").into()
11491            } else {
11492                String::new().into()
11493            },
11494            if let Some(body) = &self.body {
11495                format!("{body:?}").into()
11496            } else {
11497                String::new().into()
11498            },
11499            if let Some(headers) = &self.headers {
11500                format!("{headers:?}").into()
11501            } else {
11502                String::new().into()
11503            },
11504            if let Some(include_document) = &self.include_document {
11505                format!("{include_document:?}").into()
11506            } else {
11507                String::new().into()
11508            },
11509        ]
11510    }
11511
11512    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11513        vec![
11514            "id".into(),
11515            "url".into(),
11516            "use_params".into(),
11517            "as_json".into(),
11518            "params".into(),
11519            "body".into(),
11520            "headers".into(),
11521            "include_document".into(),
11522        ]
11523    }
11524}
11525
11526#[derive(
11527    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11528)]
11529#[allow(non_snake_case)]
11530pub struct WorkflowRequest {
11531    pub name: String,
11532    #[serde(default, skip_serializing_if = "Option::is_none")]
11533    pub order: Option<i64>,
11534    #[serde(default, skip_serializing_if = "Option::is_none")]
11535    pub enabled: Option<bool>,
11536    pub triggers: Vec<WorkflowTriggerRequest>,
11537    pub actions: Vec<WorkflowActionRequest>,
11538}
11539
11540impl std::fmt::Display for WorkflowRequest {
11541    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11542        write!(
11543            f,
11544            "{}",
11545            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11546        )
11547    }
11548}
11549
11550#[cfg(feature = "tabled")]
11551impl tabled::Tabled for WorkflowRequest {
11552    const LENGTH: usize = 5;
11553    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11554        vec![
11555            self.name.clone().into(),
11556            if let Some(order) = &self.order {
11557                format!("{order:?}").into()
11558            } else {
11559                String::new().into()
11560            },
11561            if let Some(enabled) = &self.enabled {
11562                format!("{enabled:?}").into()
11563            } else {
11564                String::new().into()
11565            },
11566            format!("{:?}", self.triggers).into(),
11567            format!("{:?}", self.actions).into(),
11568        ]
11569    }
11570
11571    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11572        vec![
11573            "name".into(),
11574            "order".into(),
11575            "enabled".into(),
11576            "triggers".into(),
11577            "actions".into(),
11578        ]
11579    }
11580}
11581
11582#[derive(
11583    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11584)]
11585#[allow(non_snake_case)]
11586pub struct WorkflowTrigger {
11587    #[serde(default, skip_serializing_if = "Option::is_none")]
11588    pub id: Option<i64>,
11589    #[serde(default)]
11590    pub sources: Vec<i64>,
11591    #[serde(rename = "type")]
11592    pub type_: i64,
11593    #[doc = "Only consume documents with a path that matches this if specified. Wildcards specified as * are allowed. Case insensitive."]
11594    #[serde(default, skip_serializing_if = "Option::is_none")]
11595    pub filter_path: Option<String>,
11596    #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
11597    #[serde(default, skip_serializing_if = "Option::is_none")]
11598    pub filter_filename: Option<String>,
11599    #[serde(default, skip_serializing_if = "Option::is_none")]
11600    pub filter_mailrule: Option<i64>,
11601    #[serde(default, skip_serializing_if = "Option::is_none")]
11602    pub matching_algorithm: Option<i64>,
11603    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
11604    pub match_: Option<String>,
11605    #[serde(default, skip_serializing_if = "Option::is_none")]
11606    pub is_insensitive: Option<bool>,
11607    #[serde(default, skip_serializing_if = "Option::is_none")]
11608    pub filter_has_tags: Option<Vec<i64>>,
11609    #[serde(default, skip_serializing_if = "Option::is_none")]
11610    pub filter_has_all_tags: Option<Vec<i64>>,
11611    #[serde(default, skip_serializing_if = "Option::is_none")]
11612    pub filter_has_not_tags: Option<Vec<i64>>,
11613    #[doc = "JSON-encoded custom field query expression."]
11614    #[serde(default, skip_serializing_if = "Option::is_none")]
11615    pub filter_custom_field_query: Option<String>,
11616    #[serde(default, skip_serializing_if = "Option::is_none")]
11617    pub filter_has_not_correspondents: Option<Vec<i64>>,
11618    #[serde(default, skip_serializing_if = "Option::is_none")]
11619    pub filter_has_not_document_types: Option<Vec<i64>>,
11620    #[serde(default, skip_serializing_if = "Option::is_none")]
11621    pub filter_has_not_storage_paths: Option<Vec<i64>>,
11622    #[serde(default, skip_serializing_if = "Option::is_none")]
11623    pub filter_has_correspondent: Option<i64>,
11624    #[serde(default, skip_serializing_if = "Option::is_none")]
11625    pub filter_has_document_type: Option<i64>,
11626    #[serde(default, skip_serializing_if = "Option::is_none")]
11627    pub filter_has_storage_path: Option<i64>,
11628    #[doc = "The number of days to offset the schedule trigger by."]
11629    #[serde(default, skip_serializing_if = "Option::is_none")]
11630    pub schedule_offset_days: Option<i64>,
11631    #[doc = "If the schedule should be recurring."]
11632    #[serde(default, skip_serializing_if = "Option::is_none")]
11633    pub schedule_is_recurring: Option<bool>,
11634    #[doc = "The number of days between recurring schedule triggers."]
11635    #[serde(default, skip_serializing_if = "Option::is_none")]
11636    pub schedule_recurring_interval_days: Option<i64>,
11637    #[doc = "The field to check for a schedule trigger.\n\n* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
11638    #[serde(default, skip_serializing_if = "Option::is_none")]
11639    pub schedule_date_field: Option<ScheduleDateFieldEnum>,
11640    #[serde(default, skip_serializing_if = "Option::is_none")]
11641    pub schedule_date_custom_field: Option<i64>,
11642}
11643
11644impl std::fmt::Display for WorkflowTrigger {
11645    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11646        write!(
11647            f,
11648            "{}",
11649            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11650        )
11651    }
11652}
11653
11654#[cfg(feature = "tabled")]
11655impl tabled::Tabled for WorkflowTrigger {
11656    const LENGTH: usize = 24;
11657    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11658        vec![
11659            if let Some(id) = &self.id {
11660                format!("{id:?}").into()
11661            } else {
11662                String::new().into()
11663            },
11664            format!("{:?}", self.sources).into(),
11665            format!("{:?}", self.type_).into(),
11666            if let Some(filter_path) = &self.filter_path {
11667                format!("{filter_path:?}").into()
11668            } else {
11669                String::new().into()
11670            },
11671            if let Some(filter_filename) = &self.filter_filename {
11672                format!("{filter_filename:?}").into()
11673            } else {
11674                String::new().into()
11675            },
11676            if let Some(filter_mailrule) = &self.filter_mailrule {
11677                format!("{filter_mailrule:?}").into()
11678            } else {
11679                String::new().into()
11680            },
11681            if let Some(matching_algorithm) = &self.matching_algorithm {
11682                format!("{matching_algorithm:?}").into()
11683            } else {
11684                String::new().into()
11685            },
11686            if let Some(match_) = &self.match_ {
11687                format!("{match_:?}").into()
11688            } else {
11689                String::new().into()
11690            },
11691            if let Some(is_insensitive) = &self.is_insensitive {
11692                format!("{is_insensitive:?}").into()
11693            } else {
11694                String::new().into()
11695            },
11696            if let Some(filter_has_tags) = &self.filter_has_tags {
11697                format!("{filter_has_tags:?}").into()
11698            } else {
11699                String::new().into()
11700            },
11701            if let Some(filter_has_all_tags) = &self.filter_has_all_tags {
11702                format!("{filter_has_all_tags:?}").into()
11703            } else {
11704                String::new().into()
11705            },
11706            if let Some(filter_has_not_tags) = &self.filter_has_not_tags {
11707                format!("{filter_has_not_tags:?}").into()
11708            } else {
11709                String::new().into()
11710            },
11711            if let Some(filter_custom_field_query) = &self.filter_custom_field_query {
11712                format!("{filter_custom_field_query:?}").into()
11713            } else {
11714                String::new().into()
11715            },
11716            if let Some(filter_has_not_correspondents) = &self.filter_has_not_correspondents {
11717                format!("{filter_has_not_correspondents:?}").into()
11718            } else {
11719                String::new().into()
11720            },
11721            if let Some(filter_has_not_document_types) = &self.filter_has_not_document_types {
11722                format!("{filter_has_not_document_types:?}").into()
11723            } else {
11724                String::new().into()
11725            },
11726            if let Some(filter_has_not_storage_paths) = &self.filter_has_not_storage_paths {
11727                format!("{filter_has_not_storage_paths:?}").into()
11728            } else {
11729                String::new().into()
11730            },
11731            if let Some(filter_has_correspondent) = &self.filter_has_correspondent {
11732                format!("{filter_has_correspondent:?}").into()
11733            } else {
11734                String::new().into()
11735            },
11736            if let Some(filter_has_document_type) = &self.filter_has_document_type {
11737                format!("{filter_has_document_type:?}").into()
11738            } else {
11739                String::new().into()
11740            },
11741            if let Some(filter_has_storage_path) = &self.filter_has_storage_path {
11742                format!("{filter_has_storage_path:?}").into()
11743            } else {
11744                String::new().into()
11745            },
11746            if let Some(schedule_offset_days) = &self.schedule_offset_days {
11747                format!("{schedule_offset_days:?}").into()
11748            } else {
11749                String::new().into()
11750            },
11751            if let Some(schedule_is_recurring) = &self.schedule_is_recurring {
11752                format!("{schedule_is_recurring:?}").into()
11753            } else {
11754                String::new().into()
11755            },
11756            if let Some(schedule_recurring_interval_days) = &self.schedule_recurring_interval_days {
11757                format!("{schedule_recurring_interval_days:?}").into()
11758            } else {
11759                String::new().into()
11760            },
11761            if let Some(schedule_date_field) = &self.schedule_date_field {
11762                format!("{schedule_date_field:?}").into()
11763            } else {
11764                String::new().into()
11765            },
11766            if let Some(schedule_date_custom_field) = &self.schedule_date_custom_field {
11767                format!("{schedule_date_custom_field:?}").into()
11768            } else {
11769                String::new().into()
11770            },
11771        ]
11772    }
11773
11774    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11775        vec![
11776            "id".into(),
11777            "sources".into(),
11778            "type_".into(),
11779            "filter_path".into(),
11780            "filter_filename".into(),
11781            "filter_mailrule".into(),
11782            "matching_algorithm".into(),
11783            "match_".into(),
11784            "is_insensitive".into(),
11785            "filter_has_tags".into(),
11786            "filter_has_all_tags".into(),
11787            "filter_has_not_tags".into(),
11788            "filter_custom_field_query".into(),
11789            "filter_has_not_correspondents".into(),
11790            "filter_has_not_document_types".into(),
11791            "filter_has_not_storage_paths".into(),
11792            "filter_has_correspondent".into(),
11793            "filter_has_document_type".into(),
11794            "filter_has_storage_path".into(),
11795            "schedule_offset_days".into(),
11796            "schedule_is_recurring".into(),
11797            "schedule_recurring_interval_days".into(),
11798            "schedule_date_field".into(),
11799            "schedule_date_custom_field".into(),
11800        ]
11801    }
11802}
11803
11804#[derive(
11805    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11806)]
11807#[allow(non_snake_case)]
11808pub struct WorkflowTriggerRequest {
11809    #[serde(default, skip_serializing_if = "Option::is_none")]
11810    pub id: Option<i64>,
11811    #[serde(default)]
11812    pub sources: Vec<i64>,
11813    #[serde(rename = "type")]
11814    pub type_: i64,
11815    #[doc = "Only consume documents with a path that matches this if specified. Wildcards specified as * are allowed. Case insensitive."]
11816    #[serde(default, skip_serializing_if = "Option::is_none")]
11817    pub filter_path: Option<String>,
11818    #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
11819    #[serde(default, skip_serializing_if = "Option::is_none")]
11820    pub filter_filename: Option<String>,
11821    #[serde(default, skip_serializing_if = "Option::is_none")]
11822    pub filter_mailrule: Option<i64>,
11823    #[serde(default, skip_serializing_if = "Option::is_none")]
11824    pub matching_algorithm: Option<i64>,
11825    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
11826    pub match_: Option<String>,
11827    #[serde(default, skip_serializing_if = "Option::is_none")]
11828    pub is_insensitive: Option<bool>,
11829    #[serde(default, skip_serializing_if = "Option::is_none")]
11830    pub filter_has_tags: Option<Vec<i64>>,
11831    #[serde(default, skip_serializing_if = "Option::is_none")]
11832    pub filter_has_all_tags: Option<Vec<i64>>,
11833    #[serde(default, skip_serializing_if = "Option::is_none")]
11834    pub filter_has_not_tags: Option<Vec<i64>>,
11835    #[doc = "JSON-encoded custom field query expression."]
11836    #[serde(default, skip_serializing_if = "Option::is_none")]
11837    pub filter_custom_field_query: Option<String>,
11838    #[serde(default, skip_serializing_if = "Option::is_none")]
11839    pub filter_has_not_correspondents: Option<Vec<i64>>,
11840    #[serde(default, skip_serializing_if = "Option::is_none")]
11841    pub filter_has_not_document_types: Option<Vec<i64>>,
11842    #[serde(default, skip_serializing_if = "Option::is_none")]
11843    pub filter_has_not_storage_paths: Option<Vec<i64>>,
11844    #[serde(default, skip_serializing_if = "Option::is_none")]
11845    pub filter_has_correspondent: Option<i64>,
11846    #[serde(default, skip_serializing_if = "Option::is_none")]
11847    pub filter_has_document_type: Option<i64>,
11848    #[serde(default, skip_serializing_if = "Option::is_none")]
11849    pub filter_has_storage_path: Option<i64>,
11850    #[doc = "The number of days to offset the schedule trigger by."]
11851    #[serde(default, skip_serializing_if = "Option::is_none")]
11852    pub schedule_offset_days: Option<i64>,
11853    #[doc = "If the schedule should be recurring."]
11854    #[serde(default, skip_serializing_if = "Option::is_none")]
11855    pub schedule_is_recurring: Option<bool>,
11856    #[doc = "The number of days between recurring schedule triggers."]
11857    #[serde(default, skip_serializing_if = "Option::is_none")]
11858    pub schedule_recurring_interval_days: Option<i64>,
11859    #[doc = "The field to check for a schedule trigger.\n\n* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
11860    #[serde(default, skip_serializing_if = "Option::is_none")]
11861    pub schedule_date_field: Option<ScheduleDateFieldEnum>,
11862    #[serde(default, skip_serializing_if = "Option::is_none")]
11863    pub schedule_date_custom_field: Option<i64>,
11864}
11865
11866impl std::fmt::Display for WorkflowTriggerRequest {
11867    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11868        write!(
11869            f,
11870            "{}",
11871            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11872        )
11873    }
11874}
11875
11876#[cfg(feature = "tabled")]
11877impl tabled::Tabled for WorkflowTriggerRequest {
11878    const LENGTH: usize = 24;
11879    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11880        vec![
11881            if let Some(id) = &self.id {
11882                format!("{id:?}").into()
11883            } else {
11884                String::new().into()
11885            },
11886            format!("{:?}", self.sources).into(),
11887            format!("{:?}", self.type_).into(),
11888            if let Some(filter_path) = &self.filter_path {
11889                format!("{filter_path:?}").into()
11890            } else {
11891                String::new().into()
11892            },
11893            if let Some(filter_filename) = &self.filter_filename {
11894                format!("{filter_filename:?}").into()
11895            } else {
11896                String::new().into()
11897            },
11898            if let Some(filter_mailrule) = &self.filter_mailrule {
11899                format!("{filter_mailrule:?}").into()
11900            } else {
11901                String::new().into()
11902            },
11903            if let Some(matching_algorithm) = &self.matching_algorithm {
11904                format!("{matching_algorithm:?}").into()
11905            } else {
11906                String::new().into()
11907            },
11908            if let Some(match_) = &self.match_ {
11909                format!("{match_:?}").into()
11910            } else {
11911                String::new().into()
11912            },
11913            if let Some(is_insensitive) = &self.is_insensitive {
11914                format!("{is_insensitive:?}").into()
11915            } else {
11916                String::new().into()
11917            },
11918            if let Some(filter_has_tags) = &self.filter_has_tags {
11919                format!("{filter_has_tags:?}").into()
11920            } else {
11921                String::new().into()
11922            },
11923            if let Some(filter_has_all_tags) = &self.filter_has_all_tags {
11924                format!("{filter_has_all_tags:?}").into()
11925            } else {
11926                String::new().into()
11927            },
11928            if let Some(filter_has_not_tags) = &self.filter_has_not_tags {
11929                format!("{filter_has_not_tags:?}").into()
11930            } else {
11931                String::new().into()
11932            },
11933            if let Some(filter_custom_field_query) = &self.filter_custom_field_query {
11934                format!("{filter_custom_field_query:?}").into()
11935            } else {
11936                String::new().into()
11937            },
11938            if let Some(filter_has_not_correspondents) = &self.filter_has_not_correspondents {
11939                format!("{filter_has_not_correspondents:?}").into()
11940            } else {
11941                String::new().into()
11942            },
11943            if let Some(filter_has_not_document_types) = &self.filter_has_not_document_types {
11944                format!("{filter_has_not_document_types:?}").into()
11945            } else {
11946                String::new().into()
11947            },
11948            if let Some(filter_has_not_storage_paths) = &self.filter_has_not_storage_paths {
11949                format!("{filter_has_not_storage_paths:?}").into()
11950            } else {
11951                String::new().into()
11952            },
11953            if let Some(filter_has_correspondent) = &self.filter_has_correspondent {
11954                format!("{filter_has_correspondent:?}").into()
11955            } else {
11956                String::new().into()
11957            },
11958            if let Some(filter_has_document_type) = &self.filter_has_document_type {
11959                format!("{filter_has_document_type:?}").into()
11960            } else {
11961                String::new().into()
11962            },
11963            if let Some(filter_has_storage_path) = &self.filter_has_storage_path {
11964                format!("{filter_has_storage_path:?}").into()
11965            } else {
11966                String::new().into()
11967            },
11968            if let Some(schedule_offset_days) = &self.schedule_offset_days {
11969                format!("{schedule_offset_days:?}").into()
11970            } else {
11971                String::new().into()
11972            },
11973            if let Some(schedule_is_recurring) = &self.schedule_is_recurring {
11974                format!("{schedule_is_recurring:?}").into()
11975            } else {
11976                String::new().into()
11977            },
11978            if let Some(schedule_recurring_interval_days) = &self.schedule_recurring_interval_days {
11979                format!("{schedule_recurring_interval_days:?}").into()
11980            } else {
11981                String::new().into()
11982            },
11983            if let Some(schedule_date_field) = &self.schedule_date_field {
11984                format!("{schedule_date_field:?}").into()
11985            } else {
11986                String::new().into()
11987            },
11988            if let Some(schedule_date_custom_field) = &self.schedule_date_custom_field {
11989                format!("{schedule_date_custom_field:?}").into()
11990            } else {
11991                String::new().into()
11992            },
11993        ]
11994    }
11995
11996    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11997        vec![
11998            "id".into(),
11999            "sources".into(),
12000            "type_".into(),
12001            "filter_path".into(),
12002            "filter_filename".into(),
12003            "filter_mailrule".into(),
12004            "matching_algorithm".into(),
12005            "match_".into(),
12006            "is_insensitive".into(),
12007            "filter_has_tags".into(),
12008            "filter_has_all_tags".into(),
12009            "filter_has_not_tags".into(),
12010            "filter_custom_field_query".into(),
12011            "filter_has_not_correspondents".into(),
12012            "filter_has_not_document_types".into(),
12013            "filter_has_not_storage_paths".into(),
12014            "filter_has_correspondent".into(),
12015            "filter_has_document_type".into(),
12016            "filter_has_storage_path".into(),
12017            "schedule_offset_days".into(),
12018            "schedule_is_recurring".into(),
12019            "schedule_recurring_interval_days".into(),
12020            "schedule_date_field".into(),
12021            "schedule_date_custom_field".into(),
12022        ]
12023    }
12024}
12025
12026#[derive(
12027    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12028)]
12029#[allow(non_snake_case)]
12030pub struct DocumentShareLinksResponse {
12031    #[serde(default, skip_serializing_if = "Option::is_none")]
12032    pub id: Option<i64>,
12033    #[serde(default, skip_serializing_if = "Option::is_none")]
12034    pub created: Option<chrono::DateTime<chrono::Utc>>,
12035    #[serde(default, skip_serializing_if = "Option::is_none")]
12036    pub expiration: Option<chrono::DateTime<chrono::Utc>>,
12037    #[serde(default, skip_serializing_if = "Option::is_none")]
12038    pub slug: Option<String>,
12039}
12040
12041impl std::fmt::Display for DocumentShareLinksResponse {
12042    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12043        write!(
12044            f,
12045            "{}",
12046            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12047        )
12048    }
12049}
12050
12051#[cfg(feature = "tabled")]
12052impl tabled::Tabled for DocumentShareLinksResponse {
12053    const LENGTH: usize = 4;
12054    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12055        vec![
12056            if let Some(id) = &self.id {
12057                format!("{id:?}").into()
12058            } else {
12059                String::new().into()
12060            },
12061            if let Some(created) = &self.created {
12062                format!("{created:?}").into()
12063            } else {
12064                String::new().into()
12065            },
12066            if let Some(expiration) = &self.expiration {
12067                format!("{expiration:?}").into()
12068            } else {
12069                String::new().into()
12070            },
12071            if let Some(slug) = &self.slug {
12072                format!("{slug:?}").into()
12073            } else {
12074                String::new().into()
12075            },
12076        ]
12077    }
12078
12079    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12080        vec![
12081            "id".into(),
12082            "created".into(),
12083            "expiration".into(),
12084            "slug".into(),
12085        ]
12086    }
12087}
12088
12089#[derive(
12090    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12091)]
12092#[allow(non_snake_case)]
12093pub struct ProfileDisconnectSocialAccountCreateRequestBody {
12094    pub id: i64,
12095}
12096
12097impl std::fmt::Display for ProfileDisconnectSocialAccountCreateRequestBody {
12098    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12099        write!(
12100            f,
12101            "{}",
12102            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12103        )
12104    }
12105}
12106
12107#[cfg(feature = "tabled")]
12108impl tabled::Tabled for ProfileDisconnectSocialAccountCreateRequestBody {
12109    const LENGTH: usize = 1;
12110    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12111        vec![format!("{:?}", self.id).into()]
12112    }
12113
12114    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12115        vec!["id".into()]
12116    }
12117}
12118
12119#[derive(
12120    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12121)]
12122#[allow(non_snake_case)]
12123pub struct ProfileTotpCreateRequestBody {
12124    pub secret: String,
12125    pub code: String,
12126}
12127
12128impl std::fmt::Display for ProfileTotpCreateRequestBody {
12129    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12130        write!(
12131            f,
12132            "{}",
12133            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12134        )
12135    }
12136}
12137
12138#[cfg(feature = "tabled")]
12139impl tabled::Tabled for ProfileTotpCreateRequestBody {
12140    const LENGTH: usize = 2;
12141    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12142        vec![self.secret.clone().into(), self.code.clone().into()]
12143    }
12144
12145    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12146        vec!["secret".into(), "code".into()]
12147    }
12148}
12149
12150#[derive(
12151    serde :: Serialize,
12152    serde :: Deserialize,
12153    PartialEq,
12154    Hash,
12155    Debug,
12156    Clone,
12157    schemars :: JsonSchema,
12158    parse_display :: FromStr,
12159    parse_display :: Display,
12160)]
12161#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
12162#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
12163pub enum Status {
12164    #[serde(rename = "FAILURE")]
12165    #[display("FAILURE")]
12166    Failure,
12167    #[serde(rename = "PENDING")]
12168    #[display("PENDING")]
12169    Pending,
12170    #[serde(rename = "RECEIVED")]
12171    #[display("RECEIVED")]
12172    Received,
12173    #[serde(rename = "RETRY")]
12174    #[display("RETRY")]
12175    Retry,
12176    #[serde(rename = "REVOKED")]
12177    #[display("REVOKED")]
12178    Revoked,
12179    #[serde(rename = "STARTED")]
12180    #[display("STARTED")]
12181    Started,
12182    #[serde(rename = "SUCCESS")]
12183    #[display("SUCCESS")]
12184    Success,
12185}
12186
12187#[derive(
12188    serde :: Serialize,
12189    serde :: Deserialize,
12190    PartialEq,
12191    Hash,
12192    Debug,
12193    Clone,
12194    schemars :: JsonSchema,
12195    parse_display :: FromStr,
12196    parse_display :: Display,
12197)]
12198#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
12199#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
12200pub enum ListTaskName {
12201    #[serde(rename = "check_sanity")]
12202    #[display("check_sanity")]
12203    CheckSanity,
12204    #[serde(rename = "consume_file")]
12205    #[display("consume_file")]
12206    ConsumeFile,
12207    #[serde(rename = "index_optimize")]
12208    #[display("index_optimize")]
12209    IndexOptimize,
12210    #[serde(rename = "train_classifier")]
12211    #[display("train_classifier")]
12212    TrainClassifier,
12213}
12214
12215#[derive(
12216    serde :: Serialize,
12217    serde :: Deserialize,
12218    PartialEq,
12219    Hash,
12220    Debug,
12221    Clone,
12222    schemars :: JsonSchema,
12223    parse_display :: FromStr,
12224    parse_display :: Display,
12225)]
12226#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
12227#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
12228pub enum Type {
12229    #[serde(rename = "auto_task")]
12230    #[display("auto_task")]
12231    AutoTask,
12232    #[serde(rename = "manual_task")]
12233    #[display("manual_task")]
12234    ManualTask,
12235    #[serde(rename = "scheduled_task")]
12236    #[display("scheduled_task")]
12237    ScheduledTask,
12238}
12239
12240#[derive(
12241    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12242)]
12243#[allow(non_snake_case)]
12244pub struct AcknowledgeTasksRequestBody {
12245    pub tasks: Vec<i64>,
12246}
12247
12248impl std::fmt::Display for AcknowledgeTasksRequestBody {
12249    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12250        write!(
12251            f,
12252            "{}",
12253            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12254        )
12255    }
12256}
12257
12258#[cfg(feature = "tabled")]
12259impl tabled::Tabled for AcknowledgeTasksRequestBody {
12260    const LENGTH: usize = 1;
12261    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12262        vec![format!("{:?}", self.tasks).into()]
12263    }
12264
12265    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12266        vec!["tasks".into()]
12267    }
12268}