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#[doc = "* `1` - IMAP\n* `2` - Gmail OAuth\n* `3` - Outlook OAuth"]
484#[derive(
485 serde_repr :: Serialize_repr,
486 serde_repr :: Deserialize_repr,
487 PartialEq,
488 Hash,
489 Debug,
490 Clone,
491 Copy,
492 schemars :: JsonSchema,
493)]
494#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
495#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
496#[repr(i64)]
497pub enum AccountTypeEnum {
498 #[doc = "IMAP"]
499 Imap = 1,
500 #[doc = "Gmail OAuth"]
501 GmailOAuth = 2,
502 #[doc = "Outlook OAuth"]
503 OutlookOAuth = 3,
504}
505
506#[derive(
507 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
508)]
509#[allow(non_snake_case)]
510pub struct AcknowledgeTasks {
511 pub result: i64,
512}
513
514impl std::fmt::Display for AcknowledgeTasks {
515 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
516 write!(
517 f,
518 "{}",
519 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
520 )
521 }
522}
523
524#[cfg(feature = "tabled")]
525impl tabled::Tabled for AcknowledgeTasks {
526 const LENGTH: usize = 1;
527 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
528 vec![format!("{:?}", self.result).into()]
529 }
530
531 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
532 vec!["result".into()]
533 }
534}
535
536#[derive(
537 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
538)]
539#[allow(non_snake_case)]
540pub struct Actor {
541 pub id: i64,
542 pub username: String,
543}
544
545impl std::fmt::Display for Actor {
546 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
547 write!(
548 f,
549 "{}",
550 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
551 )
552 }
553}
554
555#[cfg(feature = "tabled")]
556impl tabled::Tabled for Actor {
557 const LENGTH: usize = 2;
558 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
559 vec![
560 format!("{:?}", self.id).into(),
561 self.username.clone().into(),
562 ]
563 }
564
565 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
566 vec!["id".into(), "username".into()]
567 }
568}
569
570#[derive(
571 serde :: Serialize,
572 serde :: Deserialize,
573 PartialEq,
574 Hash,
575 Debug,
576 Clone,
577 schemars :: JsonSchema,
578 parse_display :: FromStr,
579 parse_display :: Display,
580)]
581#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
582#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
583pub enum OutputType {
584 #[serde(rename = "pdf")]
585 #[display("pdf")]
586 Pdf,
587 #[serde(rename = "pdfa")]
588 #[display("pdfa")]
589 Pdfa,
590 #[serde(rename = "pdfa-1")]
591 #[display("pdfa-1")]
592 Pdfa1,
593 #[serde(rename = "pdfa-2")]
594 #[display("pdfa-2")]
595 Pdfa2,
596 #[serde(rename = "pdfa-3")]
597 #[display("pdfa-3")]
598 Pdfa3,
599 #[serde(rename = "")]
600 #[display("")]
601 Empty,
602}
603
604#[derive(
605 serde :: Serialize,
606 serde :: Deserialize,
607 PartialEq,
608 Hash,
609 Debug,
610 Clone,
611 schemars :: JsonSchema,
612 parse_display :: FromStr,
613 parse_display :: Display,
614)]
615#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
616#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
617pub enum Mode {
618 #[serde(rename = "skip")]
619 #[display("skip")]
620 Skip,
621 #[serde(rename = "redo")]
622 #[display("redo")]
623 Redo,
624 #[serde(rename = "force")]
625 #[display("force")]
626 Force,
627 #[serde(rename = "skip_noarchive")]
628 #[display("skip_noarchive")]
629 SkipNoarchive,
630 #[serde(rename = "")]
631 #[display("")]
632 Empty,
633}
634
635#[derive(
636 serde :: Serialize,
637 serde :: Deserialize,
638 PartialEq,
639 Hash,
640 Debug,
641 Clone,
642 schemars :: JsonSchema,
643 parse_display :: FromStr,
644 parse_display :: Display,
645)]
646#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
647#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
648pub enum SkipArchiveFile {
649 #[serde(rename = "never")]
650 #[display("never")]
651 Never,
652 #[serde(rename = "with_text")]
653 #[display("with_text")]
654 WithText,
655 #[serde(rename = "always")]
656 #[display("always")]
657 Always,
658 #[serde(rename = "")]
659 #[display("")]
660 Empty,
661}
662
663#[derive(
664 serde :: Serialize,
665 serde :: Deserialize,
666 PartialEq,
667 Hash,
668 Debug,
669 Clone,
670 schemars :: JsonSchema,
671 parse_display :: FromStr,
672 parse_display :: Display,
673)]
674#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
675#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
676pub enum UnpaperClean {
677 #[serde(rename = "clean")]
678 #[display("clean")]
679 Clean,
680 #[serde(rename = "clean-final")]
681 #[display("clean-final")]
682 CleanFinal,
683 #[serde(rename = "none")]
684 #[display("none")]
685 None,
686 #[serde(rename = "")]
687 #[display("")]
688 Empty,
689}
690
691#[derive(
692 serde :: Serialize,
693 serde :: Deserialize,
694 PartialEq,
695 Hash,
696 Debug,
697 Clone,
698 schemars :: JsonSchema,
699 parse_display :: FromStr,
700 parse_display :: Display,
701)]
702#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
703#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
704pub enum ColorConversionStrategy {
705 LeaveColorUnchanged,
706 #[serde(rename = "RGB")]
707 #[display("RGB")]
708 Rgb,
709 UseDeviceIndependentColor,
710 Gray,
711 #[serde(rename = "CMYK")]
712 #[display("CMYK")]
713 Cmyk,
714 #[serde(rename = "")]
715 #[display("")]
716 Empty,
717}
718
719#[derive(
720 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
721)]
722#[allow(non_snake_case)]
723pub struct ApplicationConfiguration {
724 pub id: i64,
725 #[serde(default)]
726 pub user_args: Option<serde_json::Value>,
727 #[serde(default)]
728 pub barcode_tag_mapping: Option<serde_json::Value>,
729 #[serde(default, skip_serializing_if = "Option::is_none")]
730 pub output_type: Option<OutputType>,
731 #[serde(default, skip_serializing_if = "Option::is_none")]
732 pub pages: Option<i64>,
733 #[serde(default, skip_serializing_if = "Option::is_none")]
734 pub language: Option<String>,
735 #[serde(default, skip_serializing_if = "Option::is_none")]
736 pub mode: Option<Mode>,
737 #[serde(default, skip_serializing_if = "Option::is_none")]
738 pub skip_archive_file: Option<SkipArchiveFile>,
739 #[serde(default, skip_serializing_if = "Option::is_none")]
740 pub image_dpi: Option<i64>,
741 #[serde(default, skip_serializing_if = "Option::is_none")]
742 pub unpaper_clean: Option<UnpaperClean>,
743 #[serde(default, skip_serializing_if = "Option::is_none")]
744 pub deskew: Option<bool>,
745 #[serde(default, skip_serializing_if = "Option::is_none")]
746 pub rotate_pages: Option<bool>,
747 #[serde(default, skip_serializing_if = "Option::is_none")]
748 pub rotate_pages_threshold: Option<f64>,
749 #[serde(default, skip_serializing_if = "Option::is_none")]
750 pub max_image_pixels: Option<f64>,
751 #[serde(default, skip_serializing_if = "Option::is_none")]
752 pub color_conversion_strategy: Option<ColorConversionStrategy>,
753 #[serde(default, skip_serializing_if = "Option::is_none")]
754 pub app_title: Option<String>,
755 #[serde(default, skip_serializing_if = "Option::is_none")]
756 pub app_logo: Option<String>,
757 #[serde(default, skip_serializing_if = "Option::is_none")]
758 pub barcodes_enabled: Option<bool>,
759 #[serde(default, skip_serializing_if = "Option::is_none")]
760 pub barcode_enable_tiff_support: Option<bool>,
761 #[serde(default, skip_serializing_if = "Option::is_none")]
762 pub barcode_string: Option<String>,
763 #[serde(default, skip_serializing_if = "Option::is_none")]
764 pub barcode_retain_split_pages: Option<bool>,
765 #[serde(default, skip_serializing_if = "Option::is_none")]
766 pub barcode_enable_asn: Option<bool>,
767 #[serde(default, skip_serializing_if = "Option::is_none")]
768 pub barcode_asn_prefix: Option<String>,
769 #[serde(default, skip_serializing_if = "Option::is_none")]
770 pub barcode_upscale: Option<f64>,
771 #[serde(default, skip_serializing_if = "Option::is_none")]
772 pub barcode_dpi: Option<i64>,
773 #[serde(default, skip_serializing_if = "Option::is_none")]
774 pub barcode_max_pages: Option<i64>,
775 #[serde(default, skip_serializing_if = "Option::is_none")]
776 pub barcode_enable_tag: Option<bool>,
777}
778
779impl std::fmt::Display for ApplicationConfiguration {
780 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
781 write!(
782 f,
783 "{}",
784 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
785 )
786 }
787}
788
789#[cfg(feature = "tabled")]
790impl tabled::Tabled for ApplicationConfiguration {
791 const LENGTH: usize = 27;
792 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
793 vec![
794 format!("{:?}", self.id).into(),
795 format!("{:?}", self.user_args).into(),
796 format!("{:?}", self.barcode_tag_mapping).into(),
797 if let Some(output_type) = &self.output_type {
798 format!("{output_type:?}").into()
799 } else {
800 String::new().into()
801 },
802 if let Some(pages) = &self.pages {
803 format!("{pages:?}").into()
804 } else {
805 String::new().into()
806 },
807 if let Some(language) = &self.language {
808 format!("{language:?}").into()
809 } else {
810 String::new().into()
811 },
812 if let Some(mode) = &self.mode {
813 format!("{mode:?}").into()
814 } else {
815 String::new().into()
816 },
817 if let Some(skip_archive_file) = &self.skip_archive_file {
818 format!("{skip_archive_file:?}").into()
819 } else {
820 String::new().into()
821 },
822 if let Some(image_dpi) = &self.image_dpi {
823 format!("{image_dpi:?}").into()
824 } else {
825 String::new().into()
826 },
827 if let Some(unpaper_clean) = &self.unpaper_clean {
828 format!("{unpaper_clean:?}").into()
829 } else {
830 String::new().into()
831 },
832 if let Some(deskew) = &self.deskew {
833 format!("{deskew:?}").into()
834 } else {
835 String::new().into()
836 },
837 if let Some(rotate_pages) = &self.rotate_pages {
838 format!("{rotate_pages:?}").into()
839 } else {
840 String::new().into()
841 },
842 if let Some(rotate_pages_threshold) = &self.rotate_pages_threshold {
843 format!("{rotate_pages_threshold:?}").into()
844 } else {
845 String::new().into()
846 },
847 if let Some(max_image_pixels) = &self.max_image_pixels {
848 format!("{max_image_pixels:?}").into()
849 } else {
850 String::new().into()
851 },
852 if let Some(color_conversion_strategy) = &self.color_conversion_strategy {
853 format!("{color_conversion_strategy:?}").into()
854 } else {
855 String::new().into()
856 },
857 if let Some(app_title) = &self.app_title {
858 format!("{app_title:?}").into()
859 } else {
860 String::new().into()
861 },
862 if let Some(app_logo) = &self.app_logo {
863 format!("{app_logo:?}").into()
864 } else {
865 String::new().into()
866 },
867 if let Some(barcodes_enabled) = &self.barcodes_enabled {
868 format!("{barcodes_enabled:?}").into()
869 } else {
870 String::new().into()
871 },
872 if let Some(barcode_enable_tiff_support) = &self.barcode_enable_tiff_support {
873 format!("{barcode_enable_tiff_support:?}").into()
874 } else {
875 String::new().into()
876 },
877 if let Some(barcode_string) = &self.barcode_string {
878 format!("{barcode_string:?}").into()
879 } else {
880 String::new().into()
881 },
882 if let Some(barcode_retain_split_pages) = &self.barcode_retain_split_pages {
883 format!("{barcode_retain_split_pages:?}").into()
884 } else {
885 String::new().into()
886 },
887 if let Some(barcode_enable_asn) = &self.barcode_enable_asn {
888 format!("{barcode_enable_asn:?}").into()
889 } else {
890 String::new().into()
891 },
892 if let Some(barcode_asn_prefix) = &self.barcode_asn_prefix {
893 format!("{barcode_asn_prefix:?}").into()
894 } else {
895 String::new().into()
896 },
897 if let Some(barcode_upscale) = &self.barcode_upscale {
898 format!("{barcode_upscale:?}").into()
899 } else {
900 String::new().into()
901 },
902 if let Some(barcode_dpi) = &self.barcode_dpi {
903 format!("{barcode_dpi:?}").into()
904 } else {
905 String::new().into()
906 },
907 if let Some(barcode_max_pages) = &self.barcode_max_pages {
908 format!("{barcode_max_pages:?}").into()
909 } else {
910 String::new().into()
911 },
912 if let Some(barcode_enable_tag) = &self.barcode_enable_tag {
913 format!("{barcode_enable_tag:?}").into()
914 } else {
915 String::new().into()
916 },
917 ]
918 }
919
920 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
921 vec![
922 "id".into(),
923 "user_args".into(),
924 "barcode_tag_mapping".into(),
925 "output_type".into(),
926 "pages".into(),
927 "language".into(),
928 "mode".into(),
929 "skip_archive_file".into(),
930 "image_dpi".into(),
931 "unpaper_clean".into(),
932 "deskew".into(),
933 "rotate_pages".into(),
934 "rotate_pages_threshold".into(),
935 "max_image_pixels".into(),
936 "color_conversion_strategy".into(),
937 "app_title".into(),
938 "app_logo".into(),
939 "barcodes_enabled".into(),
940 "barcode_enable_tiff_support".into(),
941 "barcode_string".into(),
942 "barcode_retain_split_pages".into(),
943 "barcode_enable_asn".into(),
944 "barcode_asn_prefix".into(),
945 "barcode_upscale".into(),
946 "barcode_dpi".into(),
947 "barcode_max_pages".into(),
948 "barcode_enable_tag".into(),
949 ]
950 }
951}
952
953#[derive(
954 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
955)]
956#[allow(non_snake_case)]
957pub struct ApplicationConfigurationRequest {
958 #[serde(default)]
959 pub user_args: Option<serde_json::Value>,
960 #[serde(default)]
961 pub barcode_tag_mapping: Option<serde_json::Value>,
962 #[serde(default, skip_serializing_if = "Option::is_none")]
963 pub output_type: Option<OutputType>,
964 #[serde(default, skip_serializing_if = "Option::is_none")]
965 pub pages: Option<i64>,
966 #[serde(default, skip_serializing_if = "Option::is_none")]
967 pub language: Option<String>,
968 #[serde(default, skip_serializing_if = "Option::is_none")]
969 pub mode: Option<Mode>,
970 #[serde(default, skip_serializing_if = "Option::is_none")]
971 pub skip_archive_file: Option<SkipArchiveFile>,
972 #[serde(default, skip_serializing_if = "Option::is_none")]
973 pub image_dpi: Option<i64>,
974 #[serde(default, skip_serializing_if = "Option::is_none")]
975 pub unpaper_clean: Option<UnpaperClean>,
976 #[serde(default, skip_serializing_if = "Option::is_none")]
977 pub deskew: Option<bool>,
978 #[serde(default, skip_serializing_if = "Option::is_none")]
979 pub rotate_pages: Option<bool>,
980 #[serde(default, skip_serializing_if = "Option::is_none")]
981 pub rotate_pages_threshold: Option<f64>,
982 #[serde(default, skip_serializing_if = "Option::is_none")]
983 pub max_image_pixels: Option<f64>,
984 #[serde(default, skip_serializing_if = "Option::is_none")]
985 pub color_conversion_strategy: Option<ColorConversionStrategy>,
986 #[serde(default, skip_serializing_if = "Option::is_none")]
987 pub app_title: Option<String>,
988 #[serde(default, skip_serializing_if = "Option::is_none")]
989 pub app_logo: Option<bytes::Bytes>,
990 #[serde(default, skip_serializing_if = "Option::is_none")]
991 pub barcodes_enabled: Option<bool>,
992 #[serde(default, skip_serializing_if = "Option::is_none")]
993 pub barcode_enable_tiff_support: Option<bool>,
994 #[serde(default, skip_serializing_if = "Option::is_none")]
995 pub barcode_string: Option<String>,
996 #[serde(default, skip_serializing_if = "Option::is_none")]
997 pub barcode_retain_split_pages: Option<bool>,
998 #[serde(default, skip_serializing_if = "Option::is_none")]
999 pub barcode_enable_asn: Option<bool>,
1000 #[serde(default, skip_serializing_if = "Option::is_none")]
1001 pub barcode_asn_prefix: Option<String>,
1002 #[serde(default, skip_serializing_if = "Option::is_none")]
1003 pub barcode_upscale: Option<f64>,
1004 #[serde(default, skip_serializing_if = "Option::is_none")]
1005 pub barcode_dpi: Option<i64>,
1006 #[serde(default, skip_serializing_if = "Option::is_none")]
1007 pub barcode_max_pages: Option<i64>,
1008 #[serde(default, skip_serializing_if = "Option::is_none")]
1009 pub barcode_enable_tag: Option<bool>,
1010}
1011
1012impl std::fmt::Display for ApplicationConfigurationRequest {
1013 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1014 write!(
1015 f,
1016 "{}",
1017 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1018 )
1019 }
1020}
1021
1022#[cfg(feature = "tabled")]
1023impl tabled::Tabled for ApplicationConfigurationRequest {
1024 const LENGTH: usize = 26;
1025 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1026 vec![
1027 format!("{:?}", self.user_args).into(),
1028 format!("{:?}", self.barcode_tag_mapping).into(),
1029 if let Some(output_type) = &self.output_type {
1030 format!("{output_type:?}").into()
1031 } else {
1032 String::new().into()
1033 },
1034 if let Some(pages) = &self.pages {
1035 format!("{pages:?}").into()
1036 } else {
1037 String::new().into()
1038 },
1039 if let Some(language) = &self.language {
1040 format!("{language:?}").into()
1041 } else {
1042 String::new().into()
1043 },
1044 if let Some(mode) = &self.mode {
1045 format!("{mode:?}").into()
1046 } else {
1047 String::new().into()
1048 },
1049 if let Some(skip_archive_file) = &self.skip_archive_file {
1050 format!("{skip_archive_file:?}").into()
1051 } else {
1052 String::new().into()
1053 },
1054 if let Some(image_dpi) = &self.image_dpi {
1055 format!("{image_dpi:?}").into()
1056 } else {
1057 String::new().into()
1058 },
1059 if let Some(unpaper_clean) = &self.unpaper_clean {
1060 format!("{unpaper_clean:?}").into()
1061 } else {
1062 String::new().into()
1063 },
1064 if let Some(deskew) = &self.deskew {
1065 format!("{deskew:?}").into()
1066 } else {
1067 String::new().into()
1068 },
1069 if let Some(rotate_pages) = &self.rotate_pages {
1070 format!("{rotate_pages:?}").into()
1071 } else {
1072 String::new().into()
1073 },
1074 if let Some(rotate_pages_threshold) = &self.rotate_pages_threshold {
1075 format!("{rotate_pages_threshold:?}").into()
1076 } else {
1077 String::new().into()
1078 },
1079 if let Some(max_image_pixels) = &self.max_image_pixels {
1080 format!("{max_image_pixels:?}").into()
1081 } else {
1082 String::new().into()
1083 },
1084 if let Some(color_conversion_strategy) = &self.color_conversion_strategy {
1085 format!("{color_conversion_strategy:?}").into()
1086 } else {
1087 String::new().into()
1088 },
1089 if let Some(app_title) = &self.app_title {
1090 format!("{app_title:?}").into()
1091 } else {
1092 String::new().into()
1093 },
1094 if let Some(app_logo) = &self.app_logo {
1095 format!("{app_logo:?}").into()
1096 } else {
1097 String::new().into()
1098 },
1099 if let Some(barcodes_enabled) = &self.barcodes_enabled {
1100 format!("{barcodes_enabled:?}").into()
1101 } else {
1102 String::new().into()
1103 },
1104 if let Some(barcode_enable_tiff_support) = &self.barcode_enable_tiff_support {
1105 format!("{barcode_enable_tiff_support:?}").into()
1106 } else {
1107 String::new().into()
1108 },
1109 if let Some(barcode_string) = &self.barcode_string {
1110 format!("{barcode_string:?}").into()
1111 } else {
1112 String::new().into()
1113 },
1114 if let Some(barcode_retain_split_pages) = &self.barcode_retain_split_pages {
1115 format!("{barcode_retain_split_pages:?}").into()
1116 } else {
1117 String::new().into()
1118 },
1119 if let Some(barcode_enable_asn) = &self.barcode_enable_asn {
1120 format!("{barcode_enable_asn:?}").into()
1121 } else {
1122 String::new().into()
1123 },
1124 if let Some(barcode_asn_prefix) = &self.barcode_asn_prefix {
1125 format!("{barcode_asn_prefix:?}").into()
1126 } else {
1127 String::new().into()
1128 },
1129 if let Some(barcode_upscale) = &self.barcode_upscale {
1130 format!("{barcode_upscale:?}").into()
1131 } else {
1132 String::new().into()
1133 },
1134 if let Some(barcode_dpi) = &self.barcode_dpi {
1135 format!("{barcode_dpi:?}").into()
1136 } else {
1137 String::new().into()
1138 },
1139 if let Some(barcode_max_pages) = &self.barcode_max_pages {
1140 format!("{barcode_max_pages:?}").into()
1141 } else {
1142 String::new().into()
1143 },
1144 if let Some(barcode_enable_tag) = &self.barcode_enable_tag {
1145 format!("{barcode_enable_tag:?}").into()
1146 } else {
1147 String::new().into()
1148 },
1149 ]
1150 }
1151
1152 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1153 vec![
1154 "user_args".into(),
1155 "barcode_tag_mapping".into(),
1156 "output_type".into(),
1157 "pages".into(),
1158 "language".into(),
1159 "mode".into(),
1160 "skip_archive_file".into(),
1161 "image_dpi".into(),
1162 "unpaper_clean".into(),
1163 "deskew".into(),
1164 "rotate_pages".into(),
1165 "rotate_pages_threshold".into(),
1166 "max_image_pixels".into(),
1167 "color_conversion_strategy".into(),
1168 "app_title".into(),
1169 "app_logo".into(),
1170 "barcodes_enabled".into(),
1171 "barcode_enable_tiff_support".into(),
1172 "barcode_string".into(),
1173 "barcode_retain_split_pages".into(),
1174 "barcode_enable_asn".into(),
1175 "barcode_asn_prefix".into(),
1176 "barcode_upscale".into(),
1177 "barcode_dpi".into(),
1178 "barcode_max_pages".into(),
1179 "barcode_enable_tag".into(),
1180 ]
1181 }
1182}
1183
1184#[doc = "* `1` - Do not assign a correspondent\n* `2` - Use mail address\n* `3` - Use name (or mail address if not available)\n* `4` - Use correspondent selected below"]
1185#[derive(
1186 serde_repr :: Serialize_repr,
1187 serde_repr :: Deserialize_repr,
1188 PartialEq,
1189 Hash,
1190 Debug,
1191 Clone,
1192 Copy,
1193 schemars :: JsonSchema,
1194)]
1195#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1196#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1197#[repr(i64)]
1198pub enum AssignCorrespondentFromEnum {
1199 #[doc = "Do not assign a correspondent"]
1200 DoNotAssignACorrespondent = 1,
1201 #[doc = "Use mail address"]
1202 UseMailAddress = 2,
1203 #[doc = "Use name (or mail address if not available)"]
1204 UseNameOrMailAddressIfNotAvailable = 3,
1205 #[doc = "Use correspondent selected below"]
1206 UseCorrespondentSelectedBelow = 4,
1207}
1208
1209#[doc = "* `1` - Use subject as title\n* `2` - Use attachment filename as title\n* `3` - Do not assign title from rule"]
1210#[derive(
1211 serde_repr :: Serialize_repr,
1212 serde_repr :: Deserialize_repr,
1213 PartialEq,
1214 Hash,
1215 Debug,
1216 Clone,
1217 Copy,
1218 schemars :: JsonSchema,
1219)]
1220#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1221#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1222#[repr(i64)]
1223pub enum AssignTitleFromEnum {
1224 #[doc = "Use subject as title"]
1225 UseSubjectAsTitle = 1,
1226 #[doc = "Use attachment filename as title"]
1227 UseAttachmentFilenameAsTitle = 2,
1228 #[doc = "Do not assign title from rule"]
1229 DoNotAssignTitleFromRule = 3,
1230}
1231
1232#[doc = "* `1` - Only process attachments.\n* `2` - Process all files, including 'inline' attachments."]
1233#[derive(
1234 serde_repr :: Serialize_repr,
1235 serde_repr :: Deserialize_repr,
1236 PartialEq,
1237 Hash,
1238 Debug,
1239 Clone,
1240 Copy,
1241 schemars :: JsonSchema,
1242)]
1243#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1244#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1245#[repr(i64)]
1246pub enum AttachmentTypeEnum {
1247 #[doc = "Only process attachments."]
1248 OnlyProcessAttachments = 1,
1249 #[doc = "Process all files, including 'inline' attachments."]
1250 ProcessAllFilesIncludingInlineAttachments = 2,
1251}
1252
1253#[derive(
1254 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1255)]
1256#[allow(non_snake_case)]
1257pub struct BasicUser {
1258 pub id: i64,
1259 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
1260 pub username: String,
1261 #[serde(default, skip_serializing_if = "Option::is_none")]
1262 pub first_name: Option<String>,
1263 #[serde(default, skip_serializing_if = "Option::is_none")]
1264 pub last_name: Option<String>,
1265}
1266
1267impl std::fmt::Display for BasicUser {
1268 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1269 write!(
1270 f,
1271 "{}",
1272 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1273 )
1274 }
1275}
1276
1277#[cfg(feature = "tabled")]
1278impl tabled::Tabled for BasicUser {
1279 const LENGTH: usize = 4;
1280 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1281 vec![
1282 format!("{:?}", self.id).into(),
1283 self.username.clone().into(),
1284 if let Some(first_name) = &self.first_name {
1285 format!("{first_name:?}").into()
1286 } else {
1287 String::new().into()
1288 },
1289 if let Some(last_name) = &self.last_name {
1290 format!("{last_name:?}").into()
1291 } else {
1292 String::new().into()
1293 },
1294 ]
1295 }
1296
1297 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1298 vec![
1299 "id".into(),
1300 "username".into(),
1301 "first_name".into(),
1302 "last_name".into(),
1303 ]
1304 }
1305}
1306
1307#[derive(
1308 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1309)]
1310#[allow(non_snake_case)]
1311pub struct BasicUserRequest {
1312 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
1313 pub username: String,
1314 #[serde(default, skip_serializing_if = "Option::is_none")]
1315 pub first_name: Option<String>,
1316 #[serde(default, skip_serializing_if = "Option::is_none")]
1317 pub last_name: Option<String>,
1318}
1319
1320impl std::fmt::Display for BasicUserRequest {
1321 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1322 write!(
1323 f,
1324 "{}",
1325 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1326 )
1327 }
1328}
1329
1330#[cfg(feature = "tabled")]
1331impl tabled::Tabled for BasicUserRequest {
1332 const LENGTH: usize = 3;
1333 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1334 vec![
1335 self.username.clone().into(),
1336 if let Some(first_name) = &self.first_name {
1337 format!("{first_name:?}").into()
1338 } else {
1339 String::new().into()
1340 },
1341 if let Some(last_name) = &self.last_name {
1342 format!("{last_name:?}").into()
1343 } else {
1344 String::new().into()
1345 },
1346 ]
1347 }
1348
1349 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1350 vec!["username".into(), "first_name".into(), "last_name".into()]
1351 }
1352}
1353
1354#[derive(
1355 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1356)]
1357#[allow(non_snake_case)]
1358pub struct BulkDownload {
1359 #[serde(default, skip_serializing_if = "Option::is_none")]
1360 pub content: Option<ContentEnum>,
1361 #[serde(default, skip_serializing_if = "Option::is_none")]
1362 pub compression: Option<CompressionEnum>,
1363 #[serde(default)]
1364 pub follow_formatting: bool,
1365}
1366
1367impl std::fmt::Display for BulkDownload {
1368 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1369 write!(
1370 f,
1371 "{}",
1372 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1373 )
1374 }
1375}
1376
1377#[cfg(feature = "tabled")]
1378impl tabled::Tabled for BulkDownload {
1379 const LENGTH: usize = 3;
1380 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1381 vec![
1382 if let Some(content) = &self.content {
1383 format!("{content:?}").into()
1384 } else {
1385 String::new().into()
1386 },
1387 if let Some(compression) = &self.compression {
1388 format!("{compression:?}").into()
1389 } else {
1390 String::new().into()
1391 },
1392 format!("{:?}", self.follow_formatting).into(),
1393 ]
1394 }
1395
1396 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1397 vec![
1398 "content".into(),
1399 "compression".into(),
1400 "follow_formatting".into(),
1401 ]
1402 }
1403}
1404
1405#[derive(
1406 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1407)]
1408#[allow(non_snake_case)]
1409pub struct BulkDownloadRequest {
1410 pub documents: Vec<i64>,
1411 #[serde(default, skip_serializing_if = "Option::is_none")]
1412 pub content: Option<ContentEnum>,
1413 #[serde(default, skip_serializing_if = "Option::is_none")]
1414 pub compression: Option<CompressionEnum>,
1415 #[serde(default)]
1416 pub follow_formatting: bool,
1417}
1418
1419impl std::fmt::Display for BulkDownloadRequest {
1420 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1421 write!(
1422 f,
1423 "{}",
1424 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1425 )
1426 }
1427}
1428
1429#[cfg(feature = "tabled")]
1430impl tabled::Tabled for BulkDownloadRequest {
1431 const LENGTH: usize = 4;
1432 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1433 vec![
1434 format!("{:?}", self.documents).into(),
1435 if let Some(content) = &self.content {
1436 format!("{content:?}").into()
1437 } else {
1438 String::new().into()
1439 },
1440 if let Some(compression) = &self.compression {
1441 format!("{compression:?}").into()
1442 } else {
1443 String::new().into()
1444 },
1445 format!("{:?}", self.follow_formatting).into(),
1446 ]
1447 }
1448
1449 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1450 vec![
1451 "documents".into(),
1452 "content".into(),
1453 "compression".into(),
1454 "follow_formatting".into(),
1455 ]
1456 }
1457}
1458
1459#[derive(
1460 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1461)]
1462#[allow(non_snake_case)]
1463pub struct BulkEditDocumentsResult {
1464 pub result: String,
1465}
1466
1467impl std::fmt::Display for BulkEditDocumentsResult {
1468 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1469 write!(
1470 f,
1471 "{}",
1472 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1473 )
1474 }
1475}
1476
1477#[cfg(feature = "tabled")]
1478impl tabled::Tabled for BulkEditDocumentsResult {
1479 const LENGTH: usize = 1;
1480 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1481 vec![self.result.clone().into()]
1482 }
1483
1484 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1485 vec!["result".into()]
1486 }
1487}
1488
1489#[derive(
1490 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1491)]
1492#[allow(non_snake_case)]
1493pub struct BulkEditObjectsRequest {
1494 pub objects: Vec<i64>,
1495 pub object_type: ObjectTypeEnum,
1496 pub operation: OperationEnum,
1497 #[serde(default, skip_serializing_if = "Option::is_none")]
1498 pub owner: Option<i64>,
1499 #[serde(default, skip_serializing_if = "Option::is_none")]
1500 pub permissions: Option<std::collections::HashMap<String, serde_json::Value>>,
1501 #[serde(default)]
1502 pub merge: bool,
1503}
1504
1505impl std::fmt::Display for BulkEditObjectsRequest {
1506 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1507 write!(
1508 f,
1509 "{}",
1510 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1511 )
1512 }
1513}
1514
1515#[cfg(feature = "tabled")]
1516impl tabled::Tabled for BulkEditObjectsRequest {
1517 const LENGTH: usize = 6;
1518 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1519 vec![
1520 format!("{:?}", self.objects).into(),
1521 format!("{:?}", self.object_type).into(),
1522 format!("{:?}", self.operation).into(),
1523 if let Some(owner) = &self.owner {
1524 format!("{owner:?}").into()
1525 } else {
1526 String::new().into()
1527 },
1528 if let Some(permissions) = &self.permissions {
1529 format!("{permissions:?}").into()
1530 } else {
1531 String::new().into()
1532 },
1533 format!("{:?}", self.merge).into(),
1534 ]
1535 }
1536
1537 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1538 vec![
1539 "objects".into(),
1540 "object_type".into(),
1541 "operation".into(),
1542 "owner".into(),
1543 "permissions".into(),
1544 "merge".into(),
1545 ]
1546 }
1547}
1548
1549#[derive(
1550 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1551)]
1552#[allow(non_snake_case)]
1553pub struct BulkEditRequest {
1554 pub documents: Vec<i64>,
1555 pub method: MethodEnum,
1556 #[serde(default, skip_serializing_if = "Option::is_none")]
1557 pub parameters: Option<std::collections::HashMap<String, serde_json::Value>>,
1558}
1559
1560impl std::fmt::Display for BulkEditRequest {
1561 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1562 write!(
1563 f,
1564 "{}",
1565 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1566 )
1567 }
1568}
1569
1570#[cfg(feature = "tabled")]
1571impl tabled::Tabled for BulkEditRequest {
1572 const LENGTH: usize = 3;
1573 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1574 vec![
1575 format!("{:?}", self.documents).into(),
1576 format!("{:?}", self.method).into(),
1577 if let Some(parameters) = &self.parameters {
1578 format!("{parameters:?}").into()
1579 } else {
1580 String::new().into()
1581 },
1582 ]
1583 }
1584
1585 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1586 vec!["documents".into(), "method".into(), "parameters".into()]
1587 }
1588}
1589
1590#[derive(
1591 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1592)]
1593#[allow(non_snake_case)]
1594pub struct BulkEditResult {
1595 pub result: String,
1596}
1597
1598impl std::fmt::Display for BulkEditResult {
1599 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1600 write!(
1601 f,
1602 "{}",
1603 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1604 )
1605 }
1606}
1607
1608#[cfg(feature = "tabled")]
1609impl tabled::Tabled for BulkEditResult {
1610 const LENGTH: usize = 1;
1611 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1612 vec![self.result.clone().into()]
1613 }
1614
1615 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1616 vec!["result".into()]
1617 }
1618}
1619
1620#[derive(
1621 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1622)]
1623#[allow(non_snake_case)]
1624pub struct Classifier {
1625 pub status: String,
1626 pub error: String,
1627 pub last_trained: chrono::DateTime<chrono::Utc>,
1628}
1629
1630impl std::fmt::Display for Classifier {
1631 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1632 write!(
1633 f,
1634 "{}",
1635 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1636 )
1637 }
1638}
1639
1640#[cfg(feature = "tabled")]
1641impl tabled::Tabled for Classifier {
1642 const LENGTH: usize = 3;
1643 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1644 vec![
1645 self.status.clone().into(),
1646 self.error.clone().into(),
1647 format!("{:?}", self.last_trained).into(),
1648 ]
1649 }
1650
1651 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1652 vec!["status".into(), "error".into(), "last_trained".into()]
1653 }
1654}
1655
1656#[doc = "* `LeaveColorUnchanged` - LeaveColorUnchanged\n* `RGB` - RGB\n* `UseDeviceIndependentColor` - UseDeviceIndependentColor\n* `Gray` - Gray\n* `CMYK` - CMYK"]
1657#[derive(
1658 serde :: Serialize,
1659 serde :: Deserialize,
1660 PartialEq,
1661 Hash,
1662 Debug,
1663 Clone,
1664 schemars :: JsonSchema,
1665 parse_display :: FromStr,
1666 parse_display :: Display,
1667)]
1668#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1669#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1670pub enum ColorConversionStrategyEnum {
1671 LeaveColorUnchanged,
1672 #[serde(rename = "RGB")]
1673 #[display("RGB")]
1674 Rgb,
1675 UseDeviceIndependentColor,
1676 Gray,
1677 #[serde(rename = "CMYK")]
1678 #[display("CMYK")]
1679 Cmyk,
1680 #[serde(rename = "")]
1681 #[display("")]
1682 Empty,
1683}
1684
1685#[doc = "* `none` - none\n* `deflated` - deflated\n* `bzip2` - bzip2\n* `lzma` - lzma"]
1686#[derive(
1687 serde :: Serialize,
1688 serde :: Deserialize,
1689 PartialEq,
1690 Hash,
1691 Debug,
1692 Clone,
1693 schemars :: JsonSchema,
1694 parse_display :: FromStr,
1695 parse_display :: Display,
1696)]
1697#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1698#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1699pub enum CompressionEnum {
1700 #[serde(rename = "none")]
1701 #[display("none")]
1702 None,
1703 #[serde(rename = "deflated")]
1704 #[display("deflated")]
1705 Deflated,
1706 #[serde(rename = "bzip2")]
1707 #[display("bzip2")]
1708 Bzip2,
1709 #[serde(rename = "lzma")]
1710 #[display("lzma")]
1711 Lzma,
1712}
1713
1714#[doc = "* `1` - Only process attachments.\n* `2` - Process full Mail (with embedded attachments in file) as .eml\n* `3` - Process full Mail (with embedded attachments in file) as .eml + process attachments as separate documents"]
1715#[derive(
1716 serde_repr :: Serialize_repr,
1717 serde_repr :: Deserialize_repr,
1718 PartialEq,
1719 Hash,
1720 Debug,
1721 Clone,
1722 Copy,
1723 schemars :: JsonSchema,
1724)]
1725#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1726#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1727#[repr(i64)]
1728pub enum ConsumptionScopeEnum {
1729 #[doc = "Only process attachments."]
1730 OnlyProcessAttachments = 1,
1731 #[doc = "Process full Mail (with embedded attachments in file) as .eml"]
1732 ProcessFullMailWithEmbeddedAttachmentsInFileAsEml = 2,
1733 #[doc = "Process full Mail (with embedded attachments in file) as .eml + process attachments as separate documents"]
1734 ProcessFullMailWithEmbeddedAttachmentsInFileAsEmlProcessAttachmentsAsSeparateDocuments = 3,
1735}
1736
1737#[doc = "* `archive` - archive\n* `originals` - originals\n* `both` - both"]
1738#[derive(
1739 serde :: Serialize,
1740 serde :: Deserialize,
1741 PartialEq,
1742 Hash,
1743 Debug,
1744 Clone,
1745 schemars :: JsonSchema,
1746 parse_display :: FromStr,
1747 parse_display :: Display,
1748)]
1749#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1750#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1751pub enum ContentEnum {
1752 #[serde(rename = "archive")]
1753 #[display("archive")]
1754 Archive,
1755 #[serde(rename = "originals")]
1756 #[display("originals")]
1757 Originals,
1758 #[serde(rename = "both")]
1759 #[display("both")]
1760 Both,
1761}
1762
1763#[derive(
1764 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1765)]
1766#[allow(non_snake_case)]
1767pub struct View {
1768 #[serde(default, skip_serializing_if = "Option::is_none")]
1769 pub users: Option<Vec<i64>>,
1770 #[serde(default, skip_serializing_if = "Option::is_none")]
1771 pub groups: Option<Vec<i64>>,
1772}
1773
1774impl std::fmt::Display for View {
1775 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1776 write!(
1777 f,
1778 "{}",
1779 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1780 )
1781 }
1782}
1783
1784#[cfg(feature = "tabled")]
1785impl tabled::Tabled for View {
1786 const LENGTH: usize = 2;
1787 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1788 vec![
1789 if let Some(users) = &self.users {
1790 format!("{users:?}").into()
1791 } else {
1792 String::new().into()
1793 },
1794 if let Some(groups) = &self.groups {
1795 format!("{groups:?}").into()
1796 } else {
1797 String::new().into()
1798 },
1799 ]
1800 }
1801
1802 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1803 vec!["users".into(), "groups".into()]
1804 }
1805}
1806
1807#[derive(
1808 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1809)]
1810#[allow(non_snake_case)]
1811pub struct Change {
1812 #[serde(default, skip_serializing_if = "Option::is_none")]
1813 pub users: Option<Vec<i64>>,
1814 #[serde(default, skip_serializing_if = "Option::is_none")]
1815 pub groups: Option<Vec<i64>>,
1816}
1817
1818impl std::fmt::Display for Change {
1819 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1820 write!(
1821 f,
1822 "{}",
1823 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1824 )
1825 }
1826}
1827
1828#[cfg(feature = "tabled")]
1829impl tabled::Tabled for Change {
1830 const LENGTH: usize = 2;
1831 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1832 vec![
1833 if let Some(users) = &self.users {
1834 format!("{users:?}").into()
1835 } else {
1836 String::new().into()
1837 },
1838 if let Some(groups) = &self.groups {
1839 format!("{groups:?}").into()
1840 } else {
1841 String::new().into()
1842 },
1843 ]
1844 }
1845
1846 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1847 vec!["users".into(), "groups".into()]
1848 }
1849}
1850
1851#[derive(
1852 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1853)]
1854#[allow(non_snake_case)]
1855pub struct Permissions {
1856 #[serde(default, skip_serializing_if = "Option::is_none")]
1857 pub view: Option<View>,
1858 #[serde(default, skip_serializing_if = "Option::is_none")]
1859 pub change: Option<Change>,
1860}
1861
1862impl std::fmt::Display for Permissions {
1863 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1864 write!(
1865 f,
1866 "{}",
1867 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1868 )
1869 }
1870}
1871
1872#[cfg(feature = "tabled")]
1873impl tabled::Tabled for Permissions {
1874 const LENGTH: usize = 2;
1875 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1876 vec![
1877 if let Some(view) = &self.view {
1878 format!("{view:?}").into()
1879 } else {
1880 String::new().into()
1881 },
1882 if let Some(change) = &self.change {
1883 format!("{change:?}").into()
1884 } else {
1885 String::new().into()
1886 },
1887 ]
1888 }
1889
1890 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1891 vec!["view".into(), "change".into()]
1892 }
1893}
1894
1895#[derive(
1896 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1897)]
1898#[allow(non_snake_case)]
1899pub struct Correspondent {
1900 pub id: i64,
1901 pub slug: String,
1902 pub name: String,
1903 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
1904 pub match_: Option<String>,
1905 #[serde(default, skip_serializing_if = "Option::is_none")]
1906 pub matching_algorithm: Option<MatchingAlgorithm>,
1907 #[serde(default, skip_serializing_if = "Option::is_none")]
1908 pub is_insensitive: Option<bool>,
1909 pub document_count: i64,
1910 #[serde(default, skip_serializing_if = "Option::is_none")]
1911 pub last_correspondence: Option<chrono::NaiveDate>,
1912 #[serde(default, skip_serializing_if = "Option::is_none")]
1913 pub owner: Option<i64>,
1914 #[serde(default, skip_serializing_if = "Option::is_none")]
1915 pub permissions: Option<Permissions>,
1916 pub user_can_change: bool,
1917}
1918
1919impl std::fmt::Display for Correspondent {
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 Correspondent {
1931 const LENGTH: usize = 11;
1932 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1933 vec![
1934 format!("{:?}", self.id).into(),
1935 self.slug.clone().into(),
1936 self.name.clone().into(),
1937 if let Some(match_) = &self.match_ {
1938 format!("{match_:?}").into()
1939 } else {
1940 String::new().into()
1941 },
1942 if let Some(matching_algorithm) = &self.matching_algorithm {
1943 format!("{matching_algorithm:?}").into()
1944 } else {
1945 String::new().into()
1946 },
1947 if let Some(is_insensitive) = &self.is_insensitive {
1948 format!("{is_insensitive:?}").into()
1949 } else {
1950 String::new().into()
1951 },
1952 format!("{:?}", self.document_count).into(),
1953 if let Some(last_correspondence) = &self.last_correspondence {
1954 format!("{last_correspondence:?}").into()
1955 } else {
1956 String::new().into()
1957 },
1958 if let Some(owner) = &self.owner {
1959 format!("{owner:?}").into()
1960 } else {
1961 String::new().into()
1962 },
1963 if let Some(permissions) = &self.permissions {
1964 format!("{permissions:?}").into()
1965 } else {
1966 String::new().into()
1967 },
1968 format!("{:?}", self.user_can_change).into(),
1969 ]
1970 }
1971
1972 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1973 vec![
1974 "id".into(),
1975 "slug".into(),
1976 "name".into(),
1977 "match_".into(),
1978 "matching_algorithm".into(),
1979 "is_insensitive".into(),
1980 "document_count".into(),
1981 "last_correspondence".into(),
1982 "owner".into(),
1983 "permissions".into(),
1984 "user_can_change".into(),
1985 ]
1986 }
1987}
1988
1989#[derive(
1990 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1991)]
1992#[allow(non_snake_case)]
1993pub struct CorrespondentCounts {
1994 pub id: i64,
1995 pub document_count: i64,
1996}
1997
1998impl std::fmt::Display for CorrespondentCounts {
1999 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2000 write!(
2001 f,
2002 "{}",
2003 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2004 )
2005 }
2006}
2007
2008#[cfg(feature = "tabled")]
2009impl tabled::Tabled for CorrespondentCounts {
2010 const LENGTH: usize = 2;
2011 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2012 vec![
2013 format!("{:?}", self.id).into(),
2014 format!("{:?}", self.document_count).into(),
2015 ]
2016 }
2017
2018 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2019 vec!["id".into(), "document_count".into()]
2020 }
2021}
2022
2023#[derive(
2024 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2025)]
2026#[allow(non_snake_case)]
2027pub struct SetPermissions {
2028 #[serde(default, skip_serializing_if = "Option::is_none")]
2029 pub view: Option<View>,
2030 #[serde(default, skip_serializing_if = "Option::is_none")]
2031 pub change: Option<Change>,
2032}
2033
2034impl std::fmt::Display for SetPermissions {
2035 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2036 write!(
2037 f,
2038 "{}",
2039 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2040 )
2041 }
2042}
2043
2044#[cfg(feature = "tabled")]
2045impl tabled::Tabled for SetPermissions {
2046 const LENGTH: usize = 2;
2047 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2048 vec![
2049 if let Some(view) = &self.view {
2050 format!("{view:?}").into()
2051 } else {
2052 String::new().into()
2053 },
2054 if let Some(change) = &self.change {
2055 format!("{change:?}").into()
2056 } else {
2057 String::new().into()
2058 },
2059 ]
2060 }
2061
2062 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2063 vec!["view".into(), "change".into()]
2064 }
2065}
2066
2067#[derive(
2068 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2069)]
2070#[allow(non_snake_case)]
2071pub struct CorrespondentRequest {
2072 pub name: String,
2073 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
2074 pub match_: Option<String>,
2075 #[serde(default, skip_serializing_if = "Option::is_none")]
2076 pub matching_algorithm: Option<MatchingAlgorithm>,
2077 #[serde(default, skip_serializing_if = "Option::is_none")]
2078 pub is_insensitive: Option<bool>,
2079 #[serde(default, skip_serializing_if = "Option::is_none")]
2080 pub owner: Option<i64>,
2081 #[serde(default, skip_serializing_if = "Option::is_none")]
2082 pub set_permissions: Option<SetPermissions>,
2083}
2084
2085impl std::fmt::Display for CorrespondentRequest {
2086 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2087 write!(
2088 f,
2089 "{}",
2090 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2091 )
2092 }
2093}
2094
2095#[cfg(feature = "tabled")]
2096impl tabled::Tabled for CorrespondentRequest {
2097 const LENGTH: usize = 6;
2098 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2099 vec![
2100 self.name.clone().into(),
2101 if let Some(match_) = &self.match_ {
2102 format!("{match_:?}").into()
2103 } else {
2104 String::new().into()
2105 },
2106 if let Some(matching_algorithm) = &self.matching_algorithm {
2107 format!("{matching_algorithm:?}").into()
2108 } else {
2109 String::new().into()
2110 },
2111 if let Some(is_insensitive) = &self.is_insensitive {
2112 format!("{is_insensitive:?}").into()
2113 } else {
2114 String::new().into()
2115 },
2116 if let Some(owner) = &self.owner {
2117 format!("{owner:?}").into()
2118 } else {
2119 String::new().into()
2120 },
2121 if let Some(set_permissions) = &self.set_permissions {
2122 format!("{set_permissions:?}").into()
2123 } else {
2124 String::new().into()
2125 },
2126 ]
2127 }
2128
2129 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2130 vec![
2131 "name".into(),
2132 "match_".into(),
2133 "matching_algorithm".into(),
2134 "is_insensitive".into(),
2135 "owner".into(),
2136 "set_permissions".into(),
2137 ]
2138 }
2139}
2140
2141#[derive(
2142 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2143)]
2144#[allow(non_snake_case)]
2145pub struct CustomField {
2146 pub id: i64,
2147 pub name: String,
2148 #[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"]
2149 pub data_type: DataTypeEnum,
2150 #[doc = "Extra data for the custom field, such as select options"]
2151 #[serde(default, skip_serializing_if = "Option::is_none")]
2152 pub extra_data: Option<serde_json::Value>,
2153 pub document_count: i64,
2154}
2155
2156impl std::fmt::Display for CustomField {
2157 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2158 write!(
2159 f,
2160 "{}",
2161 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2162 )
2163 }
2164}
2165
2166#[cfg(feature = "tabled")]
2167impl tabled::Tabled for CustomField {
2168 const LENGTH: usize = 5;
2169 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2170 vec![
2171 format!("{:?}", self.id).into(),
2172 self.name.clone().into(),
2173 format!("{:?}", self.data_type).into(),
2174 if let Some(extra_data) = &self.extra_data {
2175 format!("{extra_data:?}").into()
2176 } else {
2177 String::new().into()
2178 },
2179 format!("{:?}", self.document_count).into(),
2180 ]
2181 }
2182
2183 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2184 vec![
2185 "id".into(),
2186 "name".into(),
2187 "data_type".into(),
2188 "extra_data".into(),
2189 "document_count".into(),
2190 ]
2191 }
2192}
2193
2194#[derive(
2195 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2196)]
2197#[allow(non_snake_case)]
2198pub struct CustomFieldCounts {
2199 pub id: i64,
2200 pub document_count: i64,
2201}
2202
2203impl std::fmt::Display for CustomFieldCounts {
2204 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2205 write!(
2206 f,
2207 "{}",
2208 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2209 )
2210 }
2211}
2212
2213#[cfg(feature = "tabled")]
2214impl tabled::Tabled for CustomFieldCounts {
2215 const LENGTH: usize = 2;
2216 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2217 vec![
2218 format!("{:?}", self.id).into(),
2219 format!("{:?}", self.document_count).into(),
2220 ]
2221 }
2222
2223 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2224 vec!["id".into(), "document_count".into()]
2225 }
2226}
2227
2228#[derive(
2229 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2230)]
2231#[allow(non_snake_case)]
2232pub struct CustomFieldInstance {
2233 #[doc = "Given the *incoming* primitive data, return the value for this field\nthat should be validated and transformed to a native value."]
2234 #[serde(default, skip_serializing_if = "Option::is_none")]
2235 pub value: Option<serde_json::Value>,
2236 pub field: i64,
2237}
2238
2239impl std::fmt::Display for CustomFieldInstance {
2240 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2241 write!(
2242 f,
2243 "{}",
2244 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2245 )
2246 }
2247}
2248
2249#[cfg(feature = "tabled")]
2250impl tabled::Tabled for CustomFieldInstance {
2251 const LENGTH: usize = 2;
2252 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2253 vec![
2254 if let Some(value) = &self.value {
2255 format!("{value:?}").into()
2256 } else {
2257 String::new().into()
2258 },
2259 format!("{:?}", self.field).into(),
2260 ]
2261 }
2262
2263 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2264 vec!["value".into(), "field".into()]
2265 }
2266}
2267
2268#[derive(
2269 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2270)]
2271#[allow(non_snake_case)]
2272pub struct CustomFieldInstanceRequest {
2273 #[doc = "Given the *incoming* primitive data, return the value for this field\nthat should be validated and transformed to a native value."]
2274 #[serde(default)]
2275 pub value: Option<serde_json::Value>,
2276 pub field: i64,
2277}
2278
2279impl std::fmt::Display for CustomFieldInstanceRequest {
2280 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2281 write!(
2282 f,
2283 "{}",
2284 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2285 )
2286 }
2287}
2288
2289#[cfg(feature = "tabled")]
2290impl tabled::Tabled for CustomFieldInstanceRequest {
2291 const LENGTH: usize = 2;
2292 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2293 vec![
2294 format!("{:?}", self.value).into(),
2295 format!("{:?}", self.field).into(),
2296 ]
2297 }
2298
2299 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2300 vec!["value".into(), "field".into()]
2301 }
2302}
2303
2304#[derive(
2305 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2306)]
2307#[allow(non_snake_case)]
2308pub struct CustomFieldRequest {
2309 pub name: String,
2310 #[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"]
2311 pub data_type: DataTypeEnum,
2312 #[doc = "Extra data for the custom field, such as select options"]
2313 #[serde(default, skip_serializing_if = "Option::is_none")]
2314 pub extra_data: Option<serde_json::Value>,
2315}
2316
2317impl std::fmt::Display for CustomFieldRequest {
2318 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2319 write!(
2320 f,
2321 "{}",
2322 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2323 )
2324 }
2325}
2326
2327#[cfg(feature = "tabled")]
2328impl tabled::Tabled for CustomFieldRequest {
2329 const LENGTH: usize = 3;
2330 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2331 vec![
2332 self.name.clone().into(),
2333 format!("{:?}", self.data_type).into(),
2334 if let Some(extra_data) = &self.extra_data {
2335 format!("{extra_data:?}").into()
2336 } else {
2337 String::new().into()
2338 },
2339 ]
2340 }
2341
2342 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2343 vec!["name".into(), "data_type".into(), "extra_data".into()]
2344 }
2345}
2346
2347#[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"]
2348#[derive(
2349 serde :: Serialize,
2350 serde :: Deserialize,
2351 PartialEq,
2352 Hash,
2353 Debug,
2354 Clone,
2355 schemars :: JsonSchema,
2356 parse_display :: FromStr,
2357 parse_display :: Display,
2358)]
2359#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2360#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2361pub enum DataTypeEnum {
2362 #[serde(rename = "string")]
2363 #[display("string")]
2364 String,
2365 #[serde(rename = "url")]
2366 #[display("url")]
2367 Url,
2368 #[serde(rename = "date")]
2369 #[display("date")]
2370 Date,
2371 #[serde(rename = "boolean")]
2372 #[display("boolean")]
2373 Boolean,
2374 #[serde(rename = "integer")]
2375 #[display("integer")]
2376 Integer,
2377 #[serde(rename = "float")]
2378 #[display("float")]
2379 Float,
2380 #[serde(rename = "monetary")]
2381 #[display("monetary")]
2382 Monetary,
2383 #[serde(rename = "documentlink")]
2384 #[display("documentlink")]
2385 Documentlink,
2386 #[serde(rename = "select")]
2387 #[display("select")]
2388 Select,
2389 #[serde(rename = "longtext")]
2390 #[display("longtext")]
2391 Longtext,
2392}
2393
2394#[derive(
2395 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2396)]
2397#[allow(non_snake_case)]
2398pub struct Database {
2399 #[serde(rename = "type")]
2400 pub type_: String,
2401 pub url: String,
2402 pub status: String,
2403 pub error: String,
2404 pub migration_status: MigrationStatus,
2405}
2406
2407impl std::fmt::Display for Database {
2408 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2409 write!(
2410 f,
2411 "{}",
2412 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2413 )
2414 }
2415}
2416
2417#[cfg(feature = "tabled")]
2418impl tabled::Tabled for Database {
2419 const LENGTH: usize = 5;
2420 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2421 vec![
2422 self.type_.clone().into(),
2423 self.url.clone().into(),
2424 self.status.clone().into(),
2425 self.error.clone().into(),
2426 format!("{:?}", self.migration_status).into(),
2427 ]
2428 }
2429
2430 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2431 vec![
2432 "type_".into(),
2433 "url".into(),
2434 "status".into(),
2435 "error".into(),
2436 "migration_status".into(),
2437 ]
2438 }
2439}
2440
2441#[doc = "* `table` - Table\n* `smallCards` - Small Cards\n* `largeCards` - Large Cards"]
2442#[derive(
2443 serde :: Serialize,
2444 serde :: Deserialize,
2445 PartialEq,
2446 Hash,
2447 Debug,
2448 Clone,
2449 schemars :: JsonSchema,
2450 parse_display :: FromStr,
2451 parse_display :: Display,
2452)]
2453#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2454#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2455pub enum DisplayModeEnum {
2456 #[serde(rename = "table")]
2457 #[display("table")]
2458 Table,
2459 #[serde(rename = "smallCards")]
2460 #[display("smallCards")]
2461 SmallCards,
2462 #[serde(rename = "largeCards")]
2463 #[display("largeCards")]
2464 LargeCards,
2465 #[serde(rename = "")]
2466 #[display("")]
2467 Empty,
2468}
2469
2470#[derive(
2471 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2472)]
2473#[allow(non_snake_case)]
2474pub struct DocumentPermissions {
2475 #[serde(default, skip_serializing_if = "Option::is_none")]
2476 pub view: Option<View>,
2477 #[serde(default, skip_serializing_if = "Option::is_none")]
2478 pub change: Option<Change>,
2479}
2480
2481impl std::fmt::Display for DocumentPermissions {
2482 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2483 write!(
2484 f,
2485 "{}",
2486 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2487 )
2488 }
2489}
2490
2491#[cfg(feature = "tabled")]
2492impl tabled::Tabled for DocumentPermissions {
2493 const LENGTH: usize = 2;
2494 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2495 vec![
2496 if let Some(view) = &self.view {
2497 format!("{view:?}").into()
2498 } else {
2499 String::new().into()
2500 },
2501 if let Some(change) = &self.change {
2502 format!("{change:?}").into()
2503 } else {
2504 String::new().into()
2505 },
2506 ]
2507 }
2508
2509 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2510 vec!["view".into(), "change".into()]
2511 }
2512}
2513
2514#[doc = "Adds update nested feature"]
2515#[derive(
2516 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2517)]
2518#[allow(non_snake_case)]
2519pub struct Document {
2520 pub id: i64,
2521 #[serde(default)]
2522 pub correspondent: Option<i64>,
2523 #[serde(default)]
2524 pub document_type: Option<i64>,
2525 #[serde(default)]
2526 pub storage_path: Option<i64>,
2527 #[serde(default, skip_serializing_if = "Option::is_none")]
2528 pub title: Option<String>,
2529 #[doc = "The raw, text-only data of the document. This field is primarily used for searching."]
2530 #[serde(default, skip_serializing_if = "Option::is_none")]
2531 pub content: Option<String>,
2532 pub tags: Vec<i64>,
2533 #[serde(default, skip_serializing_if = "Option::is_none")]
2534 pub created: Option<chrono::NaiveDate>,
2535 #[serde(default, skip_serializing_if = "Option::is_none")]
2536 #[deprecated]
2537 pub created_date: Option<chrono::NaiveDate>,
2538 pub modified: chrono::DateTime<chrono::Utc>,
2539 pub added: chrono::DateTime<chrono::Utc>,
2540 #[serde(default, skip_serializing_if = "Option::is_none")]
2541 pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
2542 #[doc = "The position of this document in your physical document archive."]
2543 #[serde(default, skip_serializing_if = "Option::is_none")]
2544 pub archive_serial_number: Option<i64>,
2545 #[serde(default)]
2546 pub original_file_name: Option<String>,
2547 #[serde(default)]
2548 pub archived_file_name: Option<String>,
2549 #[serde(default, skip_serializing_if = "Option::is_none")]
2550 pub owner: Option<i64>,
2551 #[serde(default, skip_serializing_if = "Option::is_none")]
2552 pub permissions: Option<DocumentPermissions>,
2553 #[serde(default)]
2554 pub user_can_change: Option<bool>,
2555 #[serde(default)]
2556 pub is_shared_by_requester: Option<bool>,
2557 pub notes: Vec<Notes>,
2558 #[serde(default, skip_serializing_if = "Option::is_none")]
2559 pub custom_fields: Option<Vec<CustomFieldInstance>>,
2560 #[serde(default)]
2561 pub page_count: Option<i64>,
2562 pub mime_type: String,
2563}
2564
2565impl std::fmt::Display for Document {
2566 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2567 write!(
2568 f,
2569 "{}",
2570 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2571 )
2572 }
2573}
2574
2575#[cfg(feature = "tabled")]
2576impl tabled::Tabled for Document {
2577 const LENGTH: usize = 23;
2578 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2579 vec![
2580 format!("{:?}", self.id).into(),
2581 format!("{:?}", self.correspondent).into(),
2582 format!("{:?}", self.document_type).into(),
2583 format!("{:?}", self.storage_path).into(),
2584 if let Some(title) = &self.title {
2585 format!("{title:?}").into()
2586 } else {
2587 String::new().into()
2588 },
2589 if let Some(content) = &self.content {
2590 format!("{content:?}").into()
2591 } else {
2592 String::new().into()
2593 },
2594 format!("{:?}", self.tags).into(),
2595 if let Some(created) = &self.created {
2596 format!("{created:?}").into()
2597 } else {
2598 String::new().into()
2599 },
2600 if let Some(created_date) = &self.created_date {
2601 format!("{created_date:?}").into()
2602 } else {
2603 String::new().into()
2604 },
2605 format!("{:?}", self.modified).into(),
2606 format!("{:?}", self.added).into(),
2607 if let Some(deleted_at) = &self.deleted_at {
2608 format!("{deleted_at:?}").into()
2609 } else {
2610 String::new().into()
2611 },
2612 if let Some(archive_serial_number) = &self.archive_serial_number {
2613 format!("{archive_serial_number:?}").into()
2614 } else {
2615 String::new().into()
2616 },
2617 format!("{:?}", self.original_file_name).into(),
2618 format!("{:?}", self.archived_file_name).into(),
2619 if let Some(owner) = &self.owner {
2620 format!("{owner:?}").into()
2621 } else {
2622 String::new().into()
2623 },
2624 if let Some(permissions) = &self.permissions {
2625 format!("{permissions:?}").into()
2626 } else {
2627 String::new().into()
2628 },
2629 format!("{:?}", self.user_can_change).into(),
2630 format!("{:?}", self.is_shared_by_requester).into(),
2631 format!("{:?}", self.notes).into(),
2632 if let Some(custom_fields) = &self.custom_fields {
2633 format!("{custom_fields:?}").into()
2634 } else {
2635 String::new().into()
2636 },
2637 format!("{:?}", self.page_count).into(),
2638 self.mime_type.clone().into(),
2639 ]
2640 }
2641
2642 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2643 vec![
2644 "id".into(),
2645 "correspondent".into(),
2646 "document_type".into(),
2647 "storage_path".into(),
2648 "title".into(),
2649 "content".into(),
2650 "tags".into(),
2651 "created".into(),
2652 "created_date".into(),
2653 "modified".into(),
2654 "added".into(),
2655 "deleted_at".into(),
2656 "archive_serial_number".into(),
2657 "original_file_name".into(),
2658 "archived_file_name".into(),
2659 "owner".into(),
2660 "permissions".into(),
2661 "user_can_change".into(),
2662 "is_shared_by_requester".into(),
2663 "notes".into(),
2664 "custom_fields".into(),
2665 "page_count".into(),
2666 "mime_type".into(),
2667 ]
2668 }
2669}
2670
2671#[derive(
2672 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2673)]
2674#[allow(non_snake_case)]
2675pub struct DocumentListRequest {
2676 pub documents: Vec<i64>,
2677}
2678
2679impl std::fmt::Display for DocumentListRequest {
2680 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2681 write!(
2682 f,
2683 "{}",
2684 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2685 )
2686 }
2687}
2688
2689#[cfg(feature = "tabled")]
2690impl tabled::Tabled for DocumentListRequest {
2691 const LENGTH: usize = 1;
2692 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2693 vec![format!("{:?}", self.documents).into()]
2694 }
2695
2696 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2697 vec!["documents".into()]
2698 }
2699}
2700
2701#[doc = "Adds update nested feature"]
2702#[derive(
2703 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2704)]
2705#[allow(non_snake_case)]
2706pub struct DocumentRequest {
2707 #[serde(default)]
2708 pub correspondent: Option<i64>,
2709 #[serde(default)]
2710 pub document_type: Option<i64>,
2711 #[serde(default)]
2712 pub storage_path: Option<i64>,
2713 #[serde(default, skip_serializing_if = "Option::is_none")]
2714 pub title: Option<String>,
2715 #[doc = "The raw, text-only data of the document. This field is primarily used for searching."]
2716 #[serde(default, skip_serializing_if = "Option::is_none")]
2717 pub content: Option<String>,
2718 pub tags: Vec<i64>,
2719 #[serde(default, skip_serializing_if = "Option::is_none")]
2720 pub created: Option<chrono::NaiveDate>,
2721 #[serde(default, skip_serializing_if = "Option::is_none")]
2722 #[deprecated]
2723 pub created_date: Option<chrono::NaiveDate>,
2724 #[serde(default, skip_serializing_if = "Option::is_none")]
2725 pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
2726 #[doc = "The position of this document in your physical document archive."]
2727 #[serde(default, skip_serializing_if = "Option::is_none")]
2728 pub archive_serial_number: Option<i64>,
2729 #[serde(default, skip_serializing_if = "Option::is_none")]
2730 pub owner: Option<i64>,
2731 #[serde(default, skip_serializing_if = "Option::is_none")]
2732 pub set_permissions: Option<SetPermissions>,
2733 #[serde(default, skip_serializing_if = "Option::is_none")]
2734 pub custom_fields: Option<Vec<CustomFieldInstanceRequest>>,
2735 #[serde(default, skip_serializing_if = "Option::is_none")]
2736 pub remove_inbox_tags: Option<bool>,
2737}
2738
2739impl std::fmt::Display for DocumentRequest {
2740 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2741 write!(
2742 f,
2743 "{}",
2744 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2745 )
2746 }
2747}
2748
2749#[cfg(feature = "tabled")]
2750impl tabled::Tabled for DocumentRequest {
2751 const LENGTH: usize = 14;
2752 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2753 vec![
2754 format!("{:?}", self.correspondent).into(),
2755 format!("{:?}", self.document_type).into(),
2756 format!("{:?}", self.storage_path).into(),
2757 if let Some(title) = &self.title {
2758 format!("{title:?}").into()
2759 } else {
2760 String::new().into()
2761 },
2762 if let Some(content) = &self.content {
2763 format!("{content:?}").into()
2764 } else {
2765 String::new().into()
2766 },
2767 format!("{:?}", self.tags).into(),
2768 if let Some(created) = &self.created {
2769 format!("{created:?}").into()
2770 } else {
2771 String::new().into()
2772 },
2773 if let Some(created_date) = &self.created_date {
2774 format!("{created_date:?}").into()
2775 } else {
2776 String::new().into()
2777 },
2778 if let Some(deleted_at) = &self.deleted_at {
2779 format!("{deleted_at:?}").into()
2780 } else {
2781 String::new().into()
2782 },
2783 if let Some(archive_serial_number) = &self.archive_serial_number {
2784 format!("{archive_serial_number:?}").into()
2785 } else {
2786 String::new().into()
2787 },
2788 if let Some(owner) = &self.owner {
2789 format!("{owner:?}").into()
2790 } else {
2791 String::new().into()
2792 },
2793 if let Some(set_permissions) = &self.set_permissions {
2794 format!("{set_permissions:?}").into()
2795 } else {
2796 String::new().into()
2797 },
2798 if let Some(custom_fields) = &self.custom_fields {
2799 format!("{custom_fields:?}").into()
2800 } else {
2801 String::new().into()
2802 },
2803 if let Some(remove_inbox_tags) = &self.remove_inbox_tags {
2804 format!("{remove_inbox_tags:?}").into()
2805 } else {
2806 String::new().into()
2807 },
2808 ]
2809 }
2810
2811 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2812 vec![
2813 "correspondent".into(),
2814 "document_type".into(),
2815 "storage_path".into(),
2816 "title".into(),
2817 "content".into(),
2818 "tags".into(),
2819 "created".into(),
2820 "created_date".into(),
2821 "deleted_at".into(),
2822 "archive_serial_number".into(),
2823 "owner".into(),
2824 "set_permissions".into(),
2825 "custom_fields".into(),
2826 "remove_inbox_tags".into(),
2827 ]
2828 }
2829}
2830
2831#[derive(
2832 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2833)]
2834#[allow(non_snake_case)]
2835pub struct DocumentTypePermissions {
2836 #[serde(default, skip_serializing_if = "Option::is_none")]
2837 pub view: Option<View>,
2838 #[serde(default, skip_serializing_if = "Option::is_none")]
2839 pub change: Option<Change>,
2840}
2841
2842impl std::fmt::Display for DocumentTypePermissions {
2843 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2844 write!(
2845 f,
2846 "{}",
2847 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2848 )
2849 }
2850}
2851
2852#[cfg(feature = "tabled")]
2853impl tabled::Tabled for DocumentTypePermissions {
2854 const LENGTH: usize = 2;
2855 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2856 vec![
2857 if let Some(view) = &self.view {
2858 format!("{view:?}").into()
2859 } else {
2860 String::new().into()
2861 },
2862 if let Some(change) = &self.change {
2863 format!("{change:?}").into()
2864 } else {
2865 String::new().into()
2866 },
2867 ]
2868 }
2869
2870 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2871 vec!["view".into(), "change".into()]
2872 }
2873}
2874
2875#[derive(
2876 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2877)]
2878#[allow(non_snake_case)]
2879pub struct DocumentType {
2880 pub id: i64,
2881 pub slug: String,
2882 pub name: String,
2883 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
2884 pub match_: Option<String>,
2885 #[serde(default, skip_serializing_if = "Option::is_none")]
2886 pub matching_algorithm: Option<MatchingAlgorithm>,
2887 #[serde(default, skip_serializing_if = "Option::is_none")]
2888 pub is_insensitive: Option<bool>,
2889 pub document_count: i64,
2890 #[serde(default, skip_serializing_if = "Option::is_none")]
2891 pub owner: Option<i64>,
2892 pub permissions: DocumentTypePermissions,
2893 pub user_can_change: bool,
2894}
2895
2896impl std::fmt::Display for DocumentType {
2897 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2898 write!(
2899 f,
2900 "{}",
2901 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2902 )
2903 }
2904}
2905
2906#[cfg(feature = "tabled")]
2907impl tabled::Tabled for DocumentType {
2908 const LENGTH: usize = 10;
2909 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2910 vec![
2911 format!("{:?}", self.id).into(),
2912 self.slug.clone().into(),
2913 self.name.clone().into(),
2914 if let Some(match_) = &self.match_ {
2915 format!("{match_:?}").into()
2916 } else {
2917 String::new().into()
2918 },
2919 if let Some(matching_algorithm) = &self.matching_algorithm {
2920 format!("{matching_algorithm:?}").into()
2921 } else {
2922 String::new().into()
2923 },
2924 if let Some(is_insensitive) = &self.is_insensitive {
2925 format!("{is_insensitive:?}").into()
2926 } else {
2927 String::new().into()
2928 },
2929 format!("{:?}", self.document_count).into(),
2930 if let Some(owner) = &self.owner {
2931 format!("{owner:?}").into()
2932 } else {
2933 String::new().into()
2934 },
2935 format!("{:?}", self.permissions).into(),
2936 format!("{:?}", self.user_can_change).into(),
2937 ]
2938 }
2939
2940 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2941 vec![
2942 "id".into(),
2943 "slug".into(),
2944 "name".into(),
2945 "match_".into(),
2946 "matching_algorithm".into(),
2947 "is_insensitive".into(),
2948 "document_count".into(),
2949 "owner".into(),
2950 "permissions".into(),
2951 "user_can_change".into(),
2952 ]
2953 }
2954}
2955
2956#[derive(
2957 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2958)]
2959#[allow(non_snake_case)]
2960pub struct DocumentTypeCounts {
2961 pub id: i64,
2962 pub document_count: i64,
2963}
2964
2965impl std::fmt::Display for DocumentTypeCounts {
2966 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2967 write!(
2968 f,
2969 "{}",
2970 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2971 )
2972 }
2973}
2974
2975#[cfg(feature = "tabled")]
2976impl tabled::Tabled for DocumentTypeCounts {
2977 const LENGTH: usize = 2;
2978 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2979 vec![
2980 format!("{:?}", self.id).into(),
2981 format!("{:?}", self.document_count).into(),
2982 ]
2983 }
2984
2985 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2986 vec!["id".into(), "document_count".into()]
2987 }
2988}
2989
2990#[derive(
2991 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2992)]
2993#[allow(non_snake_case)]
2994pub struct DocumentTypeRequest {
2995 pub name: String,
2996 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
2997 pub match_: Option<String>,
2998 #[serde(default, skip_serializing_if = "Option::is_none")]
2999 pub matching_algorithm: Option<MatchingAlgorithm>,
3000 #[serde(default, skip_serializing_if = "Option::is_none")]
3001 pub is_insensitive: Option<bool>,
3002 #[serde(default, skip_serializing_if = "Option::is_none")]
3003 pub owner: Option<i64>,
3004 #[serde(default, skip_serializing_if = "Option::is_none")]
3005 pub set_permissions: Option<SetPermissions>,
3006}
3007
3008impl std::fmt::Display for DocumentTypeRequest {
3009 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3010 write!(
3011 f,
3012 "{}",
3013 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3014 )
3015 }
3016}
3017
3018#[cfg(feature = "tabled")]
3019impl tabled::Tabled for DocumentTypeRequest {
3020 const LENGTH: usize = 6;
3021 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3022 vec![
3023 self.name.clone().into(),
3024 if let Some(match_) = &self.match_ {
3025 format!("{match_:?}").into()
3026 } else {
3027 String::new().into()
3028 },
3029 if let Some(matching_algorithm) = &self.matching_algorithm {
3030 format!("{matching_algorithm:?}").into()
3031 } else {
3032 String::new().into()
3033 },
3034 if let Some(is_insensitive) = &self.is_insensitive {
3035 format!("{is_insensitive:?}").into()
3036 } else {
3037 String::new().into()
3038 },
3039 if let Some(owner) = &self.owner {
3040 format!("{owner:?}").into()
3041 } else {
3042 String::new().into()
3043 },
3044 if let Some(set_permissions) = &self.set_permissions {
3045 format!("{set_permissions:?}").into()
3046 } else {
3047 String::new().into()
3048 },
3049 ]
3050 }
3051
3052 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3053 vec![
3054 "name".into(),
3055 "match_".into(),
3056 "matching_algorithm".into(),
3057 "is_insensitive".into(),
3058 "owner".into(),
3059 "set_permissions".into(),
3060 ]
3061 }
3062}
3063
3064#[derive(
3065 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3066)]
3067#[allow(non_snake_case)]
3068pub struct EmailDocumentRequestRequest {
3069 #[doc = "Comma-separated email addresses"]
3070 pub addresses: String,
3071 pub subject: String,
3072 pub message: String,
3073 #[doc = "Use archive version of documents if available"]
3074 #[serde(default)]
3075 pub use_archive_version: bool,
3076}
3077
3078impl std::fmt::Display for EmailDocumentRequestRequest {
3079 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3080 write!(
3081 f,
3082 "{}",
3083 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3084 )
3085 }
3086}
3087
3088#[cfg(feature = "tabled")]
3089impl tabled::Tabled for EmailDocumentRequestRequest {
3090 const LENGTH: usize = 4;
3091 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3092 vec![
3093 self.addresses.clone().into(),
3094 self.subject.clone().into(),
3095 self.message.clone().into(),
3096 format!("{:?}", self.use_archive_version).into(),
3097 ]
3098 }
3099
3100 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3101 vec![
3102 "addresses".into(),
3103 "subject".into(),
3104 "message".into(),
3105 "use_archive_version".into(),
3106 ]
3107 }
3108}
3109
3110#[derive(
3111 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3112)]
3113#[allow(non_snake_case)]
3114pub struct EmailDocumentResponse {
3115 pub message: String,
3116}
3117
3118impl std::fmt::Display for EmailDocumentResponse {
3119 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3120 write!(
3121 f,
3122 "{}",
3123 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3124 )
3125 }
3126}
3127
3128#[cfg(feature = "tabled")]
3129impl tabled::Tabled for EmailDocumentResponse {
3130 const LENGTH: usize = 1;
3131 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3132 vec![self.message.clone().into()]
3133 }
3134
3135 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3136 vec!["message".into()]
3137 }
3138}
3139
3140#[derive(
3141 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3142)]
3143#[allow(non_snake_case)]
3144pub struct EmailDocumentsResponse {
3145 pub message: String,
3146}
3147
3148impl std::fmt::Display for EmailDocumentsResponse {
3149 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3150 write!(
3151 f,
3152 "{}",
3153 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3154 )
3155 }
3156}
3157
3158#[cfg(feature = "tabled")]
3159impl tabled::Tabled for EmailDocumentsResponse {
3160 const LENGTH: usize = 1;
3161 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3162 vec![self.message.clone().into()]
3163 }
3164
3165 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3166 vec!["message".into()]
3167 }
3168}
3169
3170#[derive(
3171 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3172)]
3173#[allow(non_snake_case)]
3174pub struct EmailRequest {
3175 pub documents: Vec<i64>,
3176 #[doc = "Comma-separated email addresses"]
3177 pub addresses: String,
3178 pub subject: String,
3179 pub message: String,
3180 #[doc = "Use archive version of documents if available"]
3181 #[serde(default)]
3182 pub use_archive_version: bool,
3183}
3184
3185impl std::fmt::Display for EmailRequest {
3186 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3187 write!(
3188 f,
3189 "{}",
3190 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3191 )
3192 }
3193}
3194
3195#[cfg(feature = "tabled")]
3196impl tabled::Tabled for EmailRequest {
3197 const LENGTH: usize = 5;
3198 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3199 vec![
3200 format!("{:?}", self.documents).into(),
3201 self.addresses.clone().into(),
3202 self.subject.clone().into(),
3203 self.message.clone().into(),
3204 format!("{:?}", self.use_archive_version).into(),
3205 ]
3206 }
3207
3208 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3209 vec![
3210 "documents".into(),
3211 "addresses".into(),
3212 "subject".into(),
3213 "message".into(),
3214 "use_archive_version".into(),
3215 ]
3216 }
3217}
3218
3219#[doc = "* `archive` - Archive\n* `original` - Original"]
3220#[derive(
3221 serde :: Serialize,
3222 serde :: Deserialize,
3223 PartialEq,
3224 Hash,
3225 Debug,
3226 Clone,
3227 schemars :: JsonSchema,
3228 parse_display :: FromStr,
3229 parse_display :: Display,
3230)]
3231#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
3232#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
3233pub enum FileVersionEnum {
3234 #[serde(rename = "archive")]
3235 #[display("archive")]
3236 Archive,
3237 #[serde(rename = "original")]
3238 #[display("original")]
3239 Original,
3240}
3241
3242#[derive(
3243 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3244)]
3245#[allow(non_snake_case)]
3246pub struct Group {
3247 pub id: i64,
3248 pub name: String,
3249 pub permissions: Vec<String>,
3250}
3251
3252impl std::fmt::Display for Group {
3253 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3254 write!(
3255 f,
3256 "{}",
3257 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3258 )
3259 }
3260}
3261
3262#[cfg(feature = "tabled")]
3263impl tabled::Tabled for Group {
3264 const LENGTH: usize = 3;
3265 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3266 vec![
3267 format!("{:?}", self.id).into(),
3268 self.name.clone().into(),
3269 format!("{:?}", self.permissions).into(),
3270 ]
3271 }
3272
3273 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3274 vec!["id".into(), "name".into(), "permissions".into()]
3275 }
3276}
3277
3278#[derive(
3279 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3280)]
3281#[allow(non_snake_case)]
3282pub struct GroupRequest {
3283 pub name: String,
3284 pub permissions: Vec<String>,
3285}
3286
3287impl std::fmt::Display for GroupRequest {
3288 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3289 write!(
3290 f,
3291 "{}",
3292 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3293 )
3294 }
3295}
3296
3297#[cfg(feature = "tabled")]
3298impl tabled::Tabled for GroupRequest {
3299 const LENGTH: usize = 2;
3300 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3301 vec![
3302 self.name.clone().into(),
3303 format!("{:?}", self.permissions).into(),
3304 ]
3305 }
3306
3307 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3308 vec!["name".into(), "permissions".into()]
3309 }
3310}
3311
3312#[doc = "* `1` - No encryption\n* `2` - Use SSL\n* `3` - Use STARTTLS"]
3313#[derive(
3314 serde_repr :: Serialize_repr,
3315 serde_repr :: Deserialize_repr,
3316 PartialEq,
3317 Hash,
3318 Debug,
3319 Clone,
3320 Copy,
3321 schemars :: JsonSchema,
3322)]
3323#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
3324#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
3325#[repr(i64)]
3326pub enum ImapSecurityEnum {
3327 #[doc = "No encryption"]
3328 NoEncryption = 1,
3329 #[doc = "Use SSL"]
3330 UseSSL = 2,
3331 #[doc = "Use STARTTLS"]
3332 UseSTARTTLS = 3,
3333}
3334
3335#[derive(
3336 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3337)]
3338#[allow(non_snake_case)]
3339pub struct Index {
3340 pub status: String,
3341 pub error: String,
3342 pub last_modified: chrono::DateTime<chrono::Utc>,
3343}
3344
3345impl std::fmt::Display for Index {
3346 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3347 write!(
3348 f,
3349 "{}",
3350 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3351 )
3352 }
3353}
3354
3355#[cfg(feature = "tabled")]
3356impl tabled::Tabled for Index {
3357 const LENGTH: usize = 3;
3358 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3359 vec![
3360 self.status.clone().into(),
3361 self.error.clone().into(),
3362 format!("{:?}", self.last_modified).into(),
3363 ]
3364 }
3365
3366 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3367 vec!["status".into(), "error".into(), "last_modified".into()]
3368 }
3369}
3370
3371#[derive(
3372 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3373)]
3374#[allow(non_snake_case)]
3375pub struct LogEntry {
3376 pub id: i64,
3377 pub timestamp: chrono::DateTime<chrono::Utc>,
3378 pub action: String,
3379 pub changes: std::collections::HashMap<String, serde_json::Value>,
3380 pub actor: Actor,
3381}
3382
3383impl std::fmt::Display for LogEntry {
3384 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3385 write!(
3386 f,
3387 "{}",
3388 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3389 )
3390 }
3391}
3392
3393#[cfg(feature = "tabled")]
3394impl tabled::Tabled for LogEntry {
3395 const LENGTH: usize = 5;
3396 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3397 vec![
3398 format!("{:?}", self.id).into(),
3399 format!("{:?}", self.timestamp).into(),
3400 self.action.clone().into(),
3401 format!("{:?}", self.changes).into(),
3402 format!("{:?}", self.actor).into(),
3403 ]
3404 }
3405
3406 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3407 vec![
3408 "id".into(),
3409 "timestamp".into(),
3410 "action".into(),
3411 "changes".into(),
3412 "actor".into(),
3413 ]
3414 }
3415}
3416
3417#[derive(
3418 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3419)]
3420#[allow(non_snake_case)]
3421pub struct MailAccount {
3422 pub id: i64,
3423 pub name: String,
3424 pub imap_server: String,
3425 #[doc = "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."]
3426 #[serde(default, skip_serializing_if = "Option::is_none")]
3427 pub imap_port: Option<i64>,
3428 #[serde(default, skip_serializing_if = "Option::is_none")]
3429 pub imap_security: Option<ImapSecurityEnum>,
3430 pub username: String,
3431 pub password: String,
3432 #[doc = "The character set to use when communicating with the mail server, such as 'UTF-8' or 'US-ASCII'."]
3433 #[serde(default, skip_serializing_if = "Option::is_none")]
3434 pub character_set: Option<String>,
3435 #[serde(default, skip_serializing_if = "Option::is_none")]
3436 pub is_token: Option<bool>,
3437 #[serde(default, skip_serializing_if = "Option::is_none")]
3438 pub owner: Option<i64>,
3439 pub user_can_change: bool,
3440 #[serde(default, skip_serializing_if = "Option::is_none")]
3441 pub account_type: Option<AccountTypeEnum>,
3442 #[doc = "The expiration date of the refresh token. "]
3443 #[serde(default, skip_serializing_if = "Option::is_none")]
3444 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
3445}
3446
3447impl std::fmt::Display for MailAccount {
3448 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3449 write!(
3450 f,
3451 "{}",
3452 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3453 )
3454 }
3455}
3456
3457#[cfg(feature = "tabled")]
3458impl tabled::Tabled for MailAccount {
3459 const LENGTH: usize = 13;
3460 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3461 vec![
3462 format!("{:?}", self.id).into(),
3463 self.name.clone().into(),
3464 self.imap_server.clone().into(),
3465 if let Some(imap_port) = &self.imap_port {
3466 format!("{imap_port:?}").into()
3467 } else {
3468 String::new().into()
3469 },
3470 if let Some(imap_security) = &self.imap_security {
3471 format!("{imap_security:?}").into()
3472 } else {
3473 String::new().into()
3474 },
3475 self.username.clone().into(),
3476 self.password.clone().into(),
3477 if let Some(character_set) = &self.character_set {
3478 format!("{character_set:?}").into()
3479 } else {
3480 String::new().into()
3481 },
3482 if let Some(is_token) = &self.is_token {
3483 format!("{is_token:?}").into()
3484 } else {
3485 String::new().into()
3486 },
3487 if let Some(owner) = &self.owner {
3488 format!("{owner:?}").into()
3489 } else {
3490 String::new().into()
3491 },
3492 format!("{:?}", self.user_can_change).into(),
3493 if let Some(account_type) = &self.account_type {
3494 format!("{account_type:?}").into()
3495 } else {
3496 String::new().into()
3497 },
3498 if let Some(expiration) = &self.expiration {
3499 format!("{expiration:?}").into()
3500 } else {
3501 String::new().into()
3502 },
3503 ]
3504 }
3505
3506 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3507 vec![
3508 "id".into(),
3509 "name".into(),
3510 "imap_server".into(),
3511 "imap_port".into(),
3512 "imap_security".into(),
3513 "username".into(),
3514 "password".into(),
3515 "character_set".into(),
3516 "is_token".into(),
3517 "owner".into(),
3518 "user_can_change".into(),
3519 "account_type".into(),
3520 "expiration".into(),
3521 ]
3522 }
3523}
3524
3525#[derive(
3526 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3527)]
3528#[allow(non_snake_case)]
3529pub struct MailAccountProcessResponse {
3530 #[serde(default, skip_serializing_if = "Option::is_none")]
3531 pub result: Option<String>,
3532}
3533
3534impl std::fmt::Display for MailAccountProcessResponse {
3535 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3536 write!(
3537 f,
3538 "{}",
3539 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3540 )
3541 }
3542}
3543
3544#[cfg(feature = "tabled")]
3545impl tabled::Tabled for MailAccountProcessResponse {
3546 const LENGTH: usize = 1;
3547 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3548 vec![if let Some(result) = &self.result {
3549 format!("{result:?}").into()
3550 } else {
3551 String::new().into()
3552 }]
3553 }
3554
3555 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3556 vec!["result".into()]
3557 }
3558}
3559
3560#[derive(
3561 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3562)]
3563#[allow(non_snake_case)]
3564pub struct MailAccountRequest {
3565 pub name: String,
3566 pub imap_server: String,
3567 #[doc = "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."]
3568 #[serde(default, skip_serializing_if = "Option::is_none")]
3569 pub imap_port: Option<i64>,
3570 #[serde(default, skip_serializing_if = "Option::is_none")]
3571 pub imap_security: Option<ImapSecurityEnum>,
3572 pub username: String,
3573 pub password: String,
3574 #[doc = "The character set to use when communicating with the mail server, such as 'UTF-8' or 'US-ASCII'."]
3575 #[serde(default, skip_serializing_if = "Option::is_none")]
3576 pub character_set: Option<String>,
3577 #[serde(default, skip_serializing_if = "Option::is_none")]
3578 pub is_token: Option<bool>,
3579 #[serde(default, skip_serializing_if = "Option::is_none")]
3580 pub owner: Option<i64>,
3581 #[serde(default, skip_serializing_if = "Option::is_none")]
3582 pub set_permissions: Option<SetPermissions>,
3583 #[serde(default, skip_serializing_if = "Option::is_none")]
3584 pub account_type: Option<AccountTypeEnum>,
3585 #[doc = "The expiration date of the refresh token. "]
3586 #[serde(default, skip_serializing_if = "Option::is_none")]
3587 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
3588}
3589
3590impl std::fmt::Display for MailAccountRequest {
3591 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3592 write!(
3593 f,
3594 "{}",
3595 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3596 )
3597 }
3598}
3599
3600#[cfg(feature = "tabled")]
3601impl tabled::Tabled for MailAccountRequest {
3602 const LENGTH: usize = 12;
3603 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3604 vec![
3605 self.name.clone().into(),
3606 self.imap_server.clone().into(),
3607 if let Some(imap_port) = &self.imap_port {
3608 format!("{imap_port:?}").into()
3609 } else {
3610 String::new().into()
3611 },
3612 if let Some(imap_security) = &self.imap_security {
3613 format!("{imap_security:?}").into()
3614 } else {
3615 String::new().into()
3616 },
3617 self.username.clone().into(),
3618 self.password.clone().into(),
3619 if let Some(character_set) = &self.character_set {
3620 format!("{character_set:?}").into()
3621 } else {
3622 String::new().into()
3623 },
3624 if let Some(is_token) = &self.is_token {
3625 format!("{is_token:?}").into()
3626 } else {
3627 String::new().into()
3628 },
3629 if let Some(owner) = &self.owner {
3630 format!("{owner:?}").into()
3631 } else {
3632 String::new().into()
3633 },
3634 if let Some(set_permissions) = &self.set_permissions {
3635 format!("{set_permissions:?}").into()
3636 } else {
3637 String::new().into()
3638 },
3639 if let Some(account_type) = &self.account_type {
3640 format!("{account_type:?}").into()
3641 } else {
3642 String::new().into()
3643 },
3644 if let Some(expiration) = &self.expiration {
3645 format!("{expiration:?}").into()
3646 } else {
3647 String::new().into()
3648 },
3649 ]
3650 }
3651
3652 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3653 vec![
3654 "name".into(),
3655 "imap_server".into(),
3656 "imap_port".into(),
3657 "imap_security".into(),
3658 "username".into(),
3659 "password".into(),
3660 "character_set".into(),
3661 "is_token".into(),
3662 "owner".into(),
3663 "set_permissions".into(),
3664 "account_type".into(),
3665 "expiration".into(),
3666 ]
3667 }
3668}
3669
3670#[derive(
3671 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3672)]
3673#[allow(non_snake_case)]
3674pub struct MailAccountTestResponse {
3675 pub success: bool,
3676}
3677
3678impl std::fmt::Display for MailAccountTestResponse {
3679 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3680 write!(
3681 f,
3682 "{}",
3683 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3684 )
3685 }
3686}
3687
3688#[cfg(feature = "tabled")]
3689impl tabled::Tabled for MailAccountTestResponse {
3690 const LENGTH: usize = 1;
3691 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3692 vec![format!("{:?}", self.success).into()]
3693 }
3694
3695 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3696 vec!["success".into()]
3697 }
3698}
3699
3700#[derive(
3701 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3702)]
3703#[allow(non_snake_case)]
3704pub struct MailRule {
3705 pub id: i64,
3706 pub name: String,
3707 pub account: i64,
3708 #[serde(default, skip_serializing_if = "Option::is_none")]
3709 pub enabled: Option<bool>,
3710 #[doc = "Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server."]
3711 #[serde(default, skip_serializing_if = "Option::is_none")]
3712 pub folder: Option<String>,
3713 #[serde(default, skip_serializing_if = "Option::is_none")]
3714 pub filter_from: Option<String>,
3715 #[serde(default, skip_serializing_if = "Option::is_none")]
3716 pub filter_to: Option<String>,
3717 #[serde(default, skip_serializing_if = "Option::is_none")]
3718 pub filter_subject: Option<String>,
3719 #[serde(default, skip_serializing_if = "Option::is_none")]
3720 pub filter_body: Option<String>,
3721 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3722 #[serde(default, skip_serializing_if = "Option::is_none")]
3723 pub filter_attachment_filename_include: Option<String>,
3724 #[doc = "Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3725 #[serde(default, skip_serializing_if = "Option::is_none")]
3726 pub filter_attachment_filename_exclude: Option<String>,
3727 #[doc = "Specified in days."]
3728 #[serde(default, skip_serializing_if = "Option::is_none")]
3729 pub maximum_age: Option<i64>,
3730 #[serde(default, skip_serializing_if = "Option::is_none")]
3731 pub action: Option<MailRuleActionEnum>,
3732 #[serde(default, skip_serializing_if = "Option::is_none")]
3733 pub action_parameter: Option<String>,
3734 #[serde(default, skip_serializing_if = "Option::is_none")]
3735 pub assign_title_from: Option<AssignTitleFromEnum>,
3736 #[serde(default, skip_serializing_if = "Option::is_none")]
3737 pub assign_tags: Option<Vec<Option<i64>>>,
3738 #[serde(default, skip_serializing_if = "Option::is_none")]
3739 pub assign_correspondent_from: Option<AssignCorrespondentFromEnum>,
3740 #[serde(default, skip_serializing_if = "Option::is_none")]
3741 pub assign_correspondent: Option<i64>,
3742 #[serde(default, skip_serializing_if = "Option::is_none")]
3743 pub assign_document_type: Option<i64>,
3744 #[serde(default, skip_serializing_if = "Option::is_none")]
3745 pub assign_owner_from_rule: Option<bool>,
3746 #[serde(default, skip_serializing_if = "Option::is_none")]
3747 pub order: Option<i64>,
3748 #[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."]
3749 #[serde(default, skip_serializing_if = "Option::is_none")]
3750 pub attachment_type: Option<AttachmentTypeEnum>,
3751 #[serde(default, skip_serializing_if = "Option::is_none")]
3752 pub consumption_scope: Option<ConsumptionScopeEnum>,
3753 #[serde(default, skip_serializing_if = "Option::is_none")]
3754 pub pdf_layout: Option<PdfLayoutEnum>,
3755 #[serde(default, skip_serializing_if = "Option::is_none")]
3756 pub owner: Option<i64>,
3757 pub user_can_change: bool,
3758}
3759
3760impl std::fmt::Display for MailRule {
3761 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3762 write!(
3763 f,
3764 "{}",
3765 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3766 )
3767 }
3768}
3769
3770#[cfg(feature = "tabled")]
3771impl tabled::Tabled for MailRule {
3772 const LENGTH: usize = 26;
3773 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3774 vec![
3775 format!("{:?}", self.id).into(),
3776 self.name.clone().into(),
3777 format!("{:?}", self.account).into(),
3778 if let Some(enabled) = &self.enabled {
3779 format!("{enabled:?}").into()
3780 } else {
3781 String::new().into()
3782 },
3783 if let Some(folder) = &self.folder {
3784 format!("{folder:?}").into()
3785 } else {
3786 String::new().into()
3787 },
3788 if let Some(filter_from) = &self.filter_from {
3789 format!("{filter_from:?}").into()
3790 } else {
3791 String::new().into()
3792 },
3793 if let Some(filter_to) = &self.filter_to {
3794 format!("{filter_to:?}").into()
3795 } else {
3796 String::new().into()
3797 },
3798 if let Some(filter_subject) = &self.filter_subject {
3799 format!("{filter_subject:?}").into()
3800 } else {
3801 String::new().into()
3802 },
3803 if let Some(filter_body) = &self.filter_body {
3804 format!("{filter_body:?}").into()
3805 } else {
3806 String::new().into()
3807 },
3808 if let Some(filter_attachment_filename_include) =
3809 &self.filter_attachment_filename_include
3810 {
3811 format!("{filter_attachment_filename_include:?}").into()
3812 } else {
3813 String::new().into()
3814 },
3815 if let Some(filter_attachment_filename_exclude) =
3816 &self.filter_attachment_filename_exclude
3817 {
3818 format!("{filter_attachment_filename_exclude:?}").into()
3819 } else {
3820 String::new().into()
3821 },
3822 if let Some(maximum_age) = &self.maximum_age {
3823 format!("{maximum_age:?}").into()
3824 } else {
3825 String::new().into()
3826 },
3827 if let Some(action) = &self.action {
3828 format!("{action:?}").into()
3829 } else {
3830 String::new().into()
3831 },
3832 if let Some(action_parameter) = &self.action_parameter {
3833 format!("{action_parameter:?}").into()
3834 } else {
3835 String::new().into()
3836 },
3837 if let Some(assign_title_from) = &self.assign_title_from {
3838 format!("{assign_title_from:?}").into()
3839 } else {
3840 String::new().into()
3841 },
3842 if let Some(assign_tags) = &self.assign_tags {
3843 format!("{assign_tags:?}").into()
3844 } else {
3845 String::new().into()
3846 },
3847 if let Some(assign_correspondent_from) = &self.assign_correspondent_from {
3848 format!("{assign_correspondent_from:?}").into()
3849 } else {
3850 String::new().into()
3851 },
3852 if let Some(assign_correspondent) = &self.assign_correspondent {
3853 format!("{assign_correspondent:?}").into()
3854 } else {
3855 String::new().into()
3856 },
3857 if let Some(assign_document_type) = &self.assign_document_type {
3858 format!("{assign_document_type:?}").into()
3859 } else {
3860 String::new().into()
3861 },
3862 if let Some(assign_owner_from_rule) = &self.assign_owner_from_rule {
3863 format!("{assign_owner_from_rule:?}").into()
3864 } else {
3865 String::new().into()
3866 },
3867 if let Some(order) = &self.order {
3868 format!("{order:?}").into()
3869 } else {
3870 String::new().into()
3871 },
3872 if let Some(attachment_type) = &self.attachment_type {
3873 format!("{attachment_type:?}").into()
3874 } else {
3875 String::new().into()
3876 },
3877 if let Some(consumption_scope) = &self.consumption_scope {
3878 format!("{consumption_scope:?}").into()
3879 } else {
3880 String::new().into()
3881 },
3882 if let Some(pdf_layout) = &self.pdf_layout {
3883 format!("{pdf_layout:?}").into()
3884 } else {
3885 String::new().into()
3886 },
3887 if let Some(owner) = &self.owner {
3888 format!("{owner:?}").into()
3889 } else {
3890 String::new().into()
3891 },
3892 format!("{:?}", self.user_can_change).into(),
3893 ]
3894 }
3895
3896 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3897 vec![
3898 "id".into(),
3899 "name".into(),
3900 "account".into(),
3901 "enabled".into(),
3902 "folder".into(),
3903 "filter_from".into(),
3904 "filter_to".into(),
3905 "filter_subject".into(),
3906 "filter_body".into(),
3907 "filter_attachment_filename_include".into(),
3908 "filter_attachment_filename_exclude".into(),
3909 "maximum_age".into(),
3910 "action".into(),
3911 "action_parameter".into(),
3912 "assign_title_from".into(),
3913 "assign_tags".into(),
3914 "assign_correspondent_from".into(),
3915 "assign_correspondent".into(),
3916 "assign_document_type".into(),
3917 "assign_owner_from_rule".into(),
3918 "order".into(),
3919 "attachment_type".into(),
3920 "consumption_scope".into(),
3921 "pdf_layout".into(),
3922 "owner".into(),
3923 "user_can_change".into(),
3924 ]
3925 }
3926}
3927
3928#[doc = "* `1` - Delete\n* `2` - Move to specified folder\n* `3` - Mark as read, don't process read mails\n* `4` - Flag the mail, don't process flagged mails\n* `5` - Tag the mail with specified tag, don't process tagged mails"]
3929#[derive(
3930 serde_repr :: Serialize_repr,
3931 serde_repr :: Deserialize_repr,
3932 PartialEq,
3933 Hash,
3934 Debug,
3935 Clone,
3936 Copy,
3937 schemars :: JsonSchema,
3938)]
3939#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
3940#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
3941#[repr(i64)]
3942pub enum MailRuleActionEnum {
3943 #[doc = "Delete"]
3944 Delete = 1,
3945 #[doc = "Move to specified folder"]
3946 MoveToSpecifiedFolder = 2,
3947 #[doc = "Mark as read, don't process read mails"]
3948 MarkAsReadDonTProcessReadMails = 3,
3949 #[doc = "Flag the mail, don't process flagged mails"]
3950 FlagTheMailDonTProcessFlaggedMails = 4,
3951 #[doc = "Tag the mail with specified tag, don't process tagged mails"]
3952 TagTheMailWithSpecifiedTagDonTProcessTaggedMails = 5,
3953}
3954
3955#[derive(
3956 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3957)]
3958#[allow(non_snake_case)]
3959pub struct MailRuleRequest {
3960 pub name: String,
3961 pub account: i64,
3962 #[serde(default, skip_serializing_if = "Option::is_none")]
3963 pub enabled: Option<bool>,
3964 #[doc = "Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server."]
3965 #[serde(default, skip_serializing_if = "Option::is_none")]
3966 pub folder: Option<String>,
3967 #[serde(default, skip_serializing_if = "Option::is_none")]
3968 pub filter_from: Option<String>,
3969 #[serde(default, skip_serializing_if = "Option::is_none")]
3970 pub filter_to: Option<String>,
3971 #[serde(default, skip_serializing_if = "Option::is_none")]
3972 pub filter_subject: Option<String>,
3973 #[serde(default, skip_serializing_if = "Option::is_none")]
3974 pub filter_body: Option<String>,
3975 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3976 #[serde(default, skip_serializing_if = "Option::is_none")]
3977 pub filter_attachment_filename_include: Option<String>,
3978 #[doc = "Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3979 #[serde(default, skip_serializing_if = "Option::is_none")]
3980 pub filter_attachment_filename_exclude: Option<String>,
3981 #[doc = "Specified in days."]
3982 #[serde(default, skip_serializing_if = "Option::is_none")]
3983 pub maximum_age: Option<i64>,
3984 #[serde(default, skip_serializing_if = "Option::is_none")]
3985 pub action: Option<MailRuleActionEnum>,
3986 #[serde(default, skip_serializing_if = "Option::is_none")]
3987 pub action_parameter: Option<String>,
3988 #[serde(default, skip_serializing_if = "Option::is_none")]
3989 pub assign_title_from: Option<AssignTitleFromEnum>,
3990 #[serde(default, skip_serializing_if = "Option::is_none")]
3991 pub assign_tags: Option<Vec<Option<i64>>>,
3992 #[serde(default, skip_serializing_if = "Option::is_none")]
3993 pub assign_correspondent_from: Option<AssignCorrespondentFromEnum>,
3994 #[serde(default, skip_serializing_if = "Option::is_none")]
3995 pub assign_correspondent: Option<i64>,
3996 #[serde(default, skip_serializing_if = "Option::is_none")]
3997 pub assign_document_type: Option<i64>,
3998 #[serde(default, skip_serializing_if = "Option::is_none")]
3999 pub assign_owner_from_rule: Option<bool>,
4000 #[serde(default, skip_serializing_if = "Option::is_none")]
4001 pub order: Option<i64>,
4002 #[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."]
4003 #[serde(default, skip_serializing_if = "Option::is_none")]
4004 pub attachment_type: Option<AttachmentTypeEnum>,
4005 #[serde(default, skip_serializing_if = "Option::is_none")]
4006 pub consumption_scope: Option<ConsumptionScopeEnum>,
4007 #[serde(default, skip_serializing_if = "Option::is_none")]
4008 pub pdf_layout: Option<PdfLayoutEnum>,
4009 #[serde(default, skip_serializing_if = "Option::is_none")]
4010 pub owner: Option<i64>,
4011 #[serde(default, skip_serializing_if = "Option::is_none")]
4012 pub set_permissions: Option<SetPermissions>,
4013}
4014
4015impl std::fmt::Display for MailRuleRequest {
4016 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4017 write!(
4018 f,
4019 "{}",
4020 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4021 )
4022 }
4023}
4024
4025#[cfg(feature = "tabled")]
4026impl tabled::Tabled for MailRuleRequest {
4027 const LENGTH: usize = 25;
4028 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4029 vec![
4030 self.name.clone().into(),
4031 format!("{:?}", self.account).into(),
4032 if let Some(enabled) = &self.enabled {
4033 format!("{enabled:?}").into()
4034 } else {
4035 String::new().into()
4036 },
4037 if let Some(folder) = &self.folder {
4038 format!("{folder:?}").into()
4039 } else {
4040 String::new().into()
4041 },
4042 if let Some(filter_from) = &self.filter_from {
4043 format!("{filter_from:?}").into()
4044 } else {
4045 String::new().into()
4046 },
4047 if let Some(filter_to) = &self.filter_to {
4048 format!("{filter_to:?}").into()
4049 } else {
4050 String::new().into()
4051 },
4052 if let Some(filter_subject) = &self.filter_subject {
4053 format!("{filter_subject:?}").into()
4054 } else {
4055 String::new().into()
4056 },
4057 if let Some(filter_body) = &self.filter_body {
4058 format!("{filter_body:?}").into()
4059 } else {
4060 String::new().into()
4061 },
4062 if let Some(filter_attachment_filename_include) =
4063 &self.filter_attachment_filename_include
4064 {
4065 format!("{filter_attachment_filename_include:?}").into()
4066 } else {
4067 String::new().into()
4068 },
4069 if let Some(filter_attachment_filename_exclude) =
4070 &self.filter_attachment_filename_exclude
4071 {
4072 format!("{filter_attachment_filename_exclude:?}").into()
4073 } else {
4074 String::new().into()
4075 },
4076 if let Some(maximum_age) = &self.maximum_age {
4077 format!("{maximum_age:?}").into()
4078 } else {
4079 String::new().into()
4080 },
4081 if let Some(action) = &self.action {
4082 format!("{action:?}").into()
4083 } else {
4084 String::new().into()
4085 },
4086 if let Some(action_parameter) = &self.action_parameter {
4087 format!("{action_parameter:?}").into()
4088 } else {
4089 String::new().into()
4090 },
4091 if let Some(assign_title_from) = &self.assign_title_from {
4092 format!("{assign_title_from:?}").into()
4093 } else {
4094 String::new().into()
4095 },
4096 if let Some(assign_tags) = &self.assign_tags {
4097 format!("{assign_tags:?}").into()
4098 } else {
4099 String::new().into()
4100 },
4101 if let Some(assign_correspondent_from) = &self.assign_correspondent_from {
4102 format!("{assign_correspondent_from:?}").into()
4103 } else {
4104 String::new().into()
4105 },
4106 if let Some(assign_correspondent) = &self.assign_correspondent {
4107 format!("{assign_correspondent:?}").into()
4108 } else {
4109 String::new().into()
4110 },
4111 if let Some(assign_document_type) = &self.assign_document_type {
4112 format!("{assign_document_type:?}").into()
4113 } else {
4114 String::new().into()
4115 },
4116 if let Some(assign_owner_from_rule) = &self.assign_owner_from_rule {
4117 format!("{assign_owner_from_rule:?}").into()
4118 } else {
4119 String::new().into()
4120 },
4121 if let Some(order) = &self.order {
4122 format!("{order:?}").into()
4123 } else {
4124 String::new().into()
4125 },
4126 if let Some(attachment_type) = &self.attachment_type {
4127 format!("{attachment_type:?}").into()
4128 } else {
4129 String::new().into()
4130 },
4131 if let Some(consumption_scope) = &self.consumption_scope {
4132 format!("{consumption_scope:?}").into()
4133 } else {
4134 String::new().into()
4135 },
4136 if let Some(pdf_layout) = &self.pdf_layout {
4137 format!("{pdf_layout:?}").into()
4138 } else {
4139 String::new().into()
4140 },
4141 if let Some(owner) = &self.owner {
4142 format!("{owner:?}").into()
4143 } else {
4144 String::new().into()
4145 },
4146 if let Some(set_permissions) = &self.set_permissions {
4147 format!("{set_permissions:?}").into()
4148 } else {
4149 String::new().into()
4150 },
4151 ]
4152 }
4153
4154 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4155 vec![
4156 "name".into(),
4157 "account".into(),
4158 "enabled".into(),
4159 "folder".into(),
4160 "filter_from".into(),
4161 "filter_to".into(),
4162 "filter_subject".into(),
4163 "filter_body".into(),
4164 "filter_attachment_filename_include".into(),
4165 "filter_attachment_filename_exclude".into(),
4166 "maximum_age".into(),
4167 "action".into(),
4168 "action_parameter".into(),
4169 "assign_title_from".into(),
4170 "assign_tags".into(),
4171 "assign_correspondent_from".into(),
4172 "assign_correspondent".into(),
4173 "assign_document_type".into(),
4174 "assign_owner_from_rule".into(),
4175 "order".into(),
4176 "attachment_type".into(),
4177 "consumption_scope".into(),
4178 "pdf_layout".into(),
4179 "owner".into(),
4180 "set_permissions".into(),
4181 ]
4182 }
4183}
4184
4185#[doc = "* `0` - None\n* `1` - Any word\n* `2` - All words\n* `3` - Exact match\n* `4` - Regular expression\n* `5` - Fuzzy word\n* `6` - Automatic"]
4186#[derive(
4187 serde_repr :: Serialize_repr,
4188 serde_repr :: Deserialize_repr,
4189 PartialEq,
4190 Hash,
4191 Debug,
4192 Clone,
4193 Copy,
4194 schemars :: JsonSchema,
4195)]
4196#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4197#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4198#[repr(i64)]
4199pub enum MatchingAlgorithm {
4200 #[doc = "None"]
4201 None = 0,
4202 #[doc = "Any word"]
4203 AnyWord = 1,
4204 #[doc = "All words"]
4205 AllWords = 2,
4206 #[doc = "Exact match"]
4207 ExactMatch = 3,
4208 #[doc = "Regular expression"]
4209 RegularExpression = 4,
4210 #[doc = "Fuzzy word"]
4211 FuzzyWord = 5,
4212 #[doc = "Automatic"]
4213 Automatic = 6,
4214}
4215
4216#[derive(
4217 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4218)]
4219#[allow(non_snake_case)]
4220pub struct Metadata {
4221 pub original_checksum: String,
4222 pub original_size: i64,
4223 pub original_mime_type: String,
4224 pub media_filename: String,
4225 pub has_archive_version: bool,
4226 pub original_metadata: std::collections::HashMap<String, serde_json::Value>,
4227 pub archive_checksum: String,
4228 pub archive_media_filename: String,
4229 pub original_filename: String,
4230 pub archive_size: i64,
4231 pub archive_metadata: std::collections::HashMap<String, serde_json::Value>,
4232 pub lang: String,
4233}
4234
4235impl std::fmt::Display for Metadata {
4236 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4237 write!(
4238 f,
4239 "{}",
4240 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4241 )
4242 }
4243}
4244
4245#[cfg(feature = "tabled")]
4246impl tabled::Tabled for Metadata {
4247 const LENGTH: usize = 12;
4248 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4249 vec![
4250 self.original_checksum.clone().into(),
4251 format!("{:?}", self.original_size).into(),
4252 self.original_mime_type.clone().into(),
4253 self.media_filename.clone().into(),
4254 format!("{:?}", self.has_archive_version).into(),
4255 format!("{:?}", self.original_metadata).into(),
4256 self.archive_checksum.clone().into(),
4257 self.archive_media_filename.clone().into(),
4258 self.original_filename.clone().into(),
4259 format!("{:?}", self.archive_size).into(),
4260 format!("{:?}", self.archive_metadata).into(),
4261 self.lang.clone().into(),
4262 ]
4263 }
4264
4265 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4266 vec![
4267 "original_checksum".into(),
4268 "original_size".into(),
4269 "original_mime_type".into(),
4270 "media_filename".into(),
4271 "has_archive_version".into(),
4272 "original_metadata".into(),
4273 "archive_checksum".into(),
4274 "archive_media_filename".into(),
4275 "original_filename".into(),
4276 "archive_size".into(),
4277 "archive_metadata".into(),
4278 "lang".into(),
4279 ]
4280 }
4281}
4282
4283#[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"]
4284#[derive(
4285 serde :: Serialize,
4286 serde :: Deserialize,
4287 PartialEq,
4288 Hash,
4289 Debug,
4290 Clone,
4291 schemars :: JsonSchema,
4292 parse_display :: FromStr,
4293 parse_display :: Display,
4294)]
4295#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4296#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4297pub enum MethodEnum {
4298 #[serde(rename = "set_correspondent")]
4299 #[display("set_correspondent")]
4300 SetCorrespondent,
4301 #[serde(rename = "set_document_type")]
4302 #[display("set_document_type")]
4303 SetDocumentType,
4304 #[serde(rename = "set_storage_path")]
4305 #[display("set_storage_path")]
4306 SetStoragePath,
4307 #[serde(rename = "add_tag")]
4308 #[display("add_tag")]
4309 AddTag,
4310 #[serde(rename = "remove_tag")]
4311 #[display("remove_tag")]
4312 RemoveTag,
4313 #[serde(rename = "modify_tags")]
4314 #[display("modify_tags")]
4315 ModifyTags,
4316 #[serde(rename = "modify_custom_fields")]
4317 #[display("modify_custom_fields")]
4318 ModifyCustomFields,
4319 #[serde(rename = "delete")]
4320 #[display("delete")]
4321 Delete,
4322 #[serde(rename = "reprocess")]
4323 #[display("reprocess")]
4324 Reprocess,
4325 #[serde(rename = "set_permissions")]
4326 #[display("set_permissions")]
4327 SetPermissions,
4328 #[serde(rename = "rotate")]
4329 #[display("rotate")]
4330 Rotate,
4331 #[serde(rename = "merge")]
4332 #[display("merge")]
4333 Merge,
4334 #[serde(rename = "split")]
4335 #[display("split")]
4336 Split,
4337 #[serde(rename = "delete_pages")]
4338 #[display("delete_pages")]
4339 DeletePages,
4340 #[serde(rename = "edit_pdf")]
4341 #[display("edit_pdf")]
4342 EditPdf,
4343}
4344
4345#[derive(
4346 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4347)]
4348#[allow(non_snake_case)]
4349pub struct MigrationStatus {
4350 pub latest_migration: String,
4351 pub unapplied_migrations: Vec<String>,
4352}
4353
4354impl std::fmt::Display for MigrationStatus {
4355 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4356 write!(
4357 f,
4358 "{}",
4359 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4360 )
4361 }
4362}
4363
4364#[cfg(feature = "tabled")]
4365impl tabled::Tabled for MigrationStatus {
4366 const LENGTH: usize = 2;
4367 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4368 vec![
4369 self.latest_migration.clone().into(),
4370 format!("{:?}", self.unapplied_migrations).into(),
4371 ]
4372 }
4373
4374 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4375 vec!["latest_migration".into(), "unapplied_migrations".into()]
4376 }
4377}
4378
4379#[doc = "* `skip` - skip\n* `redo` - redo\n* `force` - force\n* `skip_noarchive` - skip_noarchive"]
4380#[derive(
4381 serde :: Serialize,
4382 serde :: Deserialize,
4383 PartialEq,
4384 Hash,
4385 Debug,
4386 Clone,
4387 schemars :: JsonSchema,
4388 parse_display :: FromStr,
4389 parse_display :: Display,
4390)]
4391#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4392#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4393pub enum ModeEnum {
4394 #[serde(rename = "skip")]
4395 #[display("skip")]
4396 Skip,
4397 #[serde(rename = "redo")]
4398 #[display("redo")]
4399 Redo,
4400 #[serde(rename = "force")]
4401 #[display("force")]
4402 Force,
4403 #[serde(rename = "skip_noarchive")]
4404 #[display("skip_noarchive")]
4405 SkipNoarchive,
4406 #[serde(rename = "")]
4407 #[display("")]
4408 Empty,
4409}
4410
4411#[derive(
4412 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4413)]
4414#[allow(non_snake_case)]
4415pub struct NoteCreateRequestRequest {
4416 pub note: String,
4417}
4418
4419impl std::fmt::Display for NoteCreateRequestRequest {
4420 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4421 write!(
4422 f,
4423 "{}",
4424 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4425 )
4426 }
4427}
4428
4429#[cfg(feature = "tabled")]
4430impl tabled::Tabled for NoteCreateRequestRequest {
4431 const LENGTH: usize = 1;
4432 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4433 vec![self.note.clone().into()]
4434 }
4435
4436 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4437 vec!["note".into()]
4438 }
4439}
4440
4441#[derive(
4442 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4443)]
4444#[allow(non_snake_case)]
4445pub struct Notes {
4446 pub id: i64,
4447 #[doc = "Note for the document"]
4448 #[serde(default, skip_serializing_if = "Option::is_none")]
4449 pub note: Option<String>,
4450 #[serde(default, skip_serializing_if = "Option::is_none")]
4451 pub created: Option<chrono::DateTime<chrono::Utc>>,
4452 pub user: BasicUser,
4453}
4454
4455impl std::fmt::Display for Notes {
4456 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4457 write!(
4458 f,
4459 "{}",
4460 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4461 )
4462 }
4463}
4464
4465#[cfg(feature = "tabled")]
4466impl tabled::Tabled for Notes {
4467 const LENGTH: usize = 4;
4468 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4469 vec![
4470 format!("{:?}", self.id).into(),
4471 if let Some(note) = &self.note {
4472 format!("{note:?}").into()
4473 } else {
4474 String::new().into()
4475 },
4476 if let Some(created) = &self.created {
4477 format!("{created:?}").into()
4478 } else {
4479 String::new().into()
4480 },
4481 format!("{:?}", self.user).into(),
4482 ]
4483 }
4484
4485 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4486 vec!["id".into(), "note".into(), "created".into(), "user".into()]
4487 }
4488}
4489
4490#[derive(
4491 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4492)]
4493#[allow(non_snake_case)]
4494pub struct NotesRequest {
4495 #[doc = "Note for the document"]
4496 #[serde(default, skip_serializing_if = "Option::is_none")]
4497 pub note: Option<String>,
4498 #[serde(default, skip_serializing_if = "Option::is_none")]
4499 pub created: Option<chrono::DateTime<chrono::Utc>>,
4500}
4501
4502impl std::fmt::Display for NotesRequest {
4503 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4504 write!(
4505 f,
4506 "{}",
4507 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4508 )
4509 }
4510}
4511
4512#[cfg(feature = "tabled")]
4513impl tabled::Tabled for NotesRequest {
4514 const LENGTH: usize = 2;
4515 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4516 vec![
4517 if let Some(note) = &self.note {
4518 format!("{note:?}").into()
4519 } else {
4520 String::new().into()
4521 },
4522 if let Some(created) = &self.created {
4523 format!("{created:?}").into()
4524 } else {
4525 String::new().into()
4526 },
4527 ]
4528 }
4529
4530 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4531 vec!["note".into(), "created".into()]
4532 }
4533}
4534
4535#[doc = "* `tags` - tags\n* `correspondents` - correspondents\n* `document_types` - document_types\n* `storage_paths` - storage_paths"]
4536#[derive(
4537 serde :: Serialize,
4538 serde :: Deserialize,
4539 PartialEq,
4540 Hash,
4541 Debug,
4542 Clone,
4543 schemars :: JsonSchema,
4544 parse_display :: FromStr,
4545 parse_display :: Display,
4546)]
4547#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4548#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4549pub enum ObjectTypeEnum {
4550 #[serde(rename = "tags")]
4551 #[display("tags")]
4552 Tags,
4553 #[serde(rename = "correspondents")]
4554 #[display("correspondents")]
4555 Correspondents,
4556 #[serde(rename = "document_types")]
4557 #[display("document_types")]
4558 DocumentTypes,
4559 #[serde(rename = "storage_paths")]
4560 #[display("storage_paths")]
4561 StoragePaths,
4562}
4563
4564#[doc = "* `set_permissions` - set_permissions\n* `delete` - delete"]
4565#[derive(
4566 serde :: Serialize,
4567 serde :: Deserialize,
4568 PartialEq,
4569 Hash,
4570 Debug,
4571 Clone,
4572 schemars :: JsonSchema,
4573 parse_display :: FromStr,
4574 parse_display :: Display,
4575)]
4576#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4577#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4578pub enum OperationEnum {
4579 #[serde(rename = "set_permissions")]
4580 #[display("set_permissions")]
4581 SetPermissions,
4582 #[serde(rename = "delete")]
4583 #[display("delete")]
4584 Delete,
4585}
4586
4587#[doc = "* `pdf` - pdf\n* `pdfa` - pdfa\n* `pdfa-1` - pdfa-1\n* `pdfa-2` - pdfa-2\n* `pdfa-3` - pdfa-3"]
4588#[derive(
4589 serde :: Serialize,
4590 serde :: Deserialize,
4591 PartialEq,
4592 Hash,
4593 Debug,
4594 Clone,
4595 schemars :: JsonSchema,
4596 parse_display :: FromStr,
4597 parse_display :: Display,
4598)]
4599#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4600#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4601pub enum OutputTypeEnum {
4602 #[serde(rename = "pdf")]
4603 #[display("pdf")]
4604 Pdf,
4605 #[serde(rename = "pdfa")]
4606 #[display("pdfa")]
4607 Pdfa,
4608 #[serde(rename = "pdfa-1")]
4609 #[display("pdfa-1")]
4610 Pdfa1,
4611 #[serde(rename = "pdfa-2")]
4612 #[display("pdfa-2")]
4613 Pdfa2,
4614 #[serde(rename = "pdfa-3")]
4615 #[display("pdfa-3")]
4616 Pdfa3,
4617 #[serde(rename = "")]
4618 #[display("")]
4619 Empty,
4620}
4621
4622#[derive(
4623 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4624)]
4625#[allow(non_snake_case)]
4626pub struct PaginatedCorrespondentList {
4627 pub count: i64,
4628 #[serde(default, skip_serializing_if = "Option::is_none")]
4629 pub next: Option<String>,
4630 #[serde(default, skip_serializing_if = "Option::is_none")]
4631 pub previous: Option<String>,
4632 pub results: Vec<Correspondent>,
4633 #[serde(default, skip_serializing_if = "Option::is_none")]
4634 pub all: Option<Vec<i64>>,
4635}
4636
4637impl std::fmt::Display for PaginatedCorrespondentList {
4638 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4639 write!(
4640 f,
4641 "{}",
4642 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4643 )
4644 }
4645}
4646
4647#[cfg(feature = "requests")]
4648impl crate::types::paginate::Pagination for PaginatedCorrespondentList {
4649 type Item = Correspondent;
4650 fn has_more_pages(&self) -> bool {
4651 self.next.is_some()
4652 }
4653
4654 fn next_page_token(&self) -> Option<String> {
4655 self.next.clone()
4656 }
4657
4658 fn next_page(
4659 &self,
4660 req: reqwest::Request,
4661 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4662 let mut req = req.try_clone().ok_or_else(|| {
4663 crate::types::error::Error::InvalidRequest(format!(
4664 "failed to clone request: {req:?}"
4665 ))
4666 })?;
4667 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4668 crate::types::error::Error::InvalidRequest(format!(
4669 "failed to parse url: {:?}",
4670 self.next
4671 ))
4672 })?;
4673 Ok(req)
4674 }
4675
4676 fn items(&self) -> Vec<Self::Item> {
4677 self.results.clone()
4678 }
4679}
4680
4681#[cfg(feature = "tabled")]
4682impl tabled::Tabled for PaginatedCorrespondentList {
4683 const LENGTH: usize = 5;
4684 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4685 vec![
4686 format!("{:?}", self.count).into(),
4687 if let Some(next) = &self.next {
4688 format!("{next:?}").into()
4689 } else {
4690 String::new().into()
4691 },
4692 if let Some(previous) = &self.previous {
4693 format!("{previous:?}").into()
4694 } else {
4695 String::new().into()
4696 },
4697 format!("{:?}", self.results).into(),
4698 if let Some(all) = &self.all {
4699 format!("{all:?}").into()
4700 } else {
4701 String::new().into()
4702 },
4703 ]
4704 }
4705
4706 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4707 vec![
4708 "count".into(),
4709 "next".into(),
4710 "previous".into(),
4711 "results".into(),
4712 "all".into(),
4713 ]
4714 }
4715}
4716
4717#[derive(
4718 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4719)]
4720#[allow(non_snake_case)]
4721pub struct PaginatedCustomFieldList {
4722 pub count: i64,
4723 #[serde(default, skip_serializing_if = "Option::is_none")]
4724 pub next: Option<String>,
4725 #[serde(default, skip_serializing_if = "Option::is_none")]
4726 pub previous: Option<String>,
4727 pub results: Vec<CustomField>,
4728 #[serde(default, skip_serializing_if = "Option::is_none")]
4729 pub all: Option<Vec<i64>>,
4730}
4731
4732impl std::fmt::Display for PaginatedCustomFieldList {
4733 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4734 write!(
4735 f,
4736 "{}",
4737 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4738 )
4739 }
4740}
4741
4742#[cfg(feature = "requests")]
4743impl crate::types::paginate::Pagination for PaginatedCustomFieldList {
4744 type Item = CustomField;
4745 fn has_more_pages(&self) -> bool {
4746 self.next.is_some()
4747 }
4748
4749 fn next_page_token(&self) -> Option<String> {
4750 self.next.clone()
4751 }
4752
4753 fn next_page(
4754 &self,
4755 req: reqwest::Request,
4756 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4757 let mut req = req.try_clone().ok_or_else(|| {
4758 crate::types::error::Error::InvalidRequest(format!(
4759 "failed to clone request: {req:?}"
4760 ))
4761 })?;
4762 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4763 crate::types::error::Error::InvalidRequest(format!(
4764 "failed to parse url: {:?}",
4765 self.next
4766 ))
4767 })?;
4768 Ok(req)
4769 }
4770
4771 fn items(&self) -> Vec<Self::Item> {
4772 self.results.clone()
4773 }
4774}
4775
4776#[cfg(feature = "tabled")]
4777impl tabled::Tabled for PaginatedCustomFieldList {
4778 const LENGTH: usize = 5;
4779 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4780 vec![
4781 format!("{:?}", self.count).into(),
4782 if let Some(next) = &self.next {
4783 format!("{next:?}").into()
4784 } else {
4785 String::new().into()
4786 },
4787 if let Some(previous) = &self.previous {
4788 format!("{previous:?}").into()
4789 } else {
4790 String::new().into()
4791 },
4792 format!("{:?}", self.results).into(),
4793 if let Some(all) = &self.all {
4794 format!("{all:?}").into()
4795 } else {
4796 String::new().into()
4797 },
4798 ]
4799 }
4800
4801 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4802 vec![
4803 "count".into(),
4804 "next".into(),
4805 "previous".into(),
4806 "results".into(),
4807 "all".into(),
4808 ]
4809 }
4810}
4811
4812#[derive(
4813 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4814)]
4815#[allow(non_snake_case)]
4816pub struct PaginatedDocumentList {
4817 pub count: i64,
4818 #[serde(default, skip_serializing_if = "Option::is_none")]
4819 pub next: Option<String>,
4820 #[serde(default, skip_serializing_if = "Option::is_none")]
4821 pub previous: Option<String>,
4822 pub results: Vec<Document>,
4823 #[serde(default, skip_serializing_if = "Option::is_none")]
4824 pub all: Option<Vec<i64>>,
4825}
4826
4827impl std::fmt::Display for PaginatedDocumentList {
4828 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4829 write!(
4830 f,
4831 "{}",
4832 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4833 )
4834 }
4835}
4836
4837#[cfg(feature = "requests")]
4838impl crate::types::paginate::Pagination for PaginatedDocumentList {
4839 type Item = Document;
4840 fn has_more_pages(&self) -> bool {
4841 self.next.is_some()
4842 }
4843
4844 fn next_page_token(&self) -> Option<String> {
4845 self.next.clone()
4846 }
4847
4848 fn next_page(
4849 &self,
4850 req: reqwest::Request,
4851 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4852 let mut req = req.try_clone().ok_or_else(|| {
4853 crate::types::error::Error::InvalidRequest(format!(
4854 "failed to clone request: {req:?}"
4855 ))
4856 })?;
4857 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4858 crate::types::error::Error::InvalidRequest(format!(
4859 "failed to parse url: {:?}",
4860 self.next
4861 ))
4862 })?;
4863 Ok(req)
4864 }
4865
4866 fn items(&self) -> Vec<Self::Item> {
4867 self.results.clone()
4868 }
4869}
4870
4871#[cfg(feature = "tabled")]
4872impl tabled::Tabled for PaginatedDocumentList {
4873 const LENGTH: usize = 5;
4874 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4875 vec![
4876 format!("{:?}", self.count).into(),
4877 if let Some(next) = &self.next {
4878 format!("{next:?}").into()
4879 } else {
4880 String::new().into()
4881 },
4882 if let Some(previous) = &self.previous {
4883 format!("{previous:?}").into()
4884 } else {
4885 String::new().into()
4886 },
4887 format!("{:?}", self.results).into(),
4888 if let Some(all) = &self.all {
4889 format!("{all:?}").into()
4890 } else {
4891 String::new().into()
4892 },
4893 ]
4894 }
4895
4896 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4897 vec![
4898 "count".into(),
4899 "next".into(),
4900 "previous".into(),
4901 "results".into(),
4902 "all".into(),
4903 ]
4904 }
4905}
4906
4907#[derive(
4908 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4909)]
4910#[allow(non_snake_case)]
4911pub struct PaginatedDocumentTypeList {
4912 pub count: i64,
4913 #[serde(default, skip_serializing_if = "Option::is_none")]
4914 pub next: Option<String>,
4915 #[serde(default, skip_serializing_if = "Option::is_none")]
4916 pub previous: Option<String>,
4917 pub results: Vec<DocumentType>,
4918 #[serde(default, skip_serializing_if = "Option::is_none")]
4919 pub all: Option<Vec<i64>>,
4920}
4921
4922impl std::fmt::Display for PaginatedDocumentTypeList {
4923 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4924 write!(
4925 f,
4926 "{}",
4927 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4928 )
4929 }
4930}
4931
4932#[cfg(feature = "requests")]
4933impl crate::types::paginate::Pagination for PaginatedDocumentTypeList {
4934 type Item = DocumentType;
4935 fn has_more_pages(&self) -> bool {
4936 self.next.is_some()
4937 }
4938
4939 fn next_page_token(&self) -> Option<String> {
4940 self.next.clone()
4941 }
4942
4943 fn next_page(
4944 &self,
4945 req: reqwest::Request,
4946 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4947 let mut req = req.try_clone().ok_or_else(|| {
4948 crate::types::error::Error::InvalidRequest(format!(
4949 "failed to clone request: {req:?}"
4950 ))
4951 })?;
4952 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4953 crate::types::error::Error::InvalidRequest(format!(
4954 "failed to parse url: {:?}",
4955 self.next
4956 ))
4957 })?;
4958 Ok(req)
4959 }
4960
4961 fn items(&self) -> Vec<Self::Item> {
4962 self.results.clone()
4963 }
4964}
4965
4966#[cfg(feature = "tabled")]
4967impl tabled::Tabled for PaginatedDocumentTypeList {
4968 const LENGTH: usize = 5;
4969 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4970 vec![
4971 format!("{:?}", self.count).into(),
4972 if let Some(next) = &self.next {
4973 format!("{next:?}").into()
4974 } else {
4975 String::new().into()
4976 },
4977 if let Some(previous) = &self.previous {
4978 format!("{previous:?}").into()
4979 } else {
4980 String::new().into()
4981 },
4982 format!("{:?}", self.results).into(),
4983 if let Some(all) = &self.all {
4984 format!("{all:?}").into()
4985 } else {
4986 String::new().into()
4987 },
4988 ]
4989 }
4990
4991 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4992 vec![
4993 "count".into(),
4994 "next".into(),
4995 "previous".into(),
4996 "results".into(),
4997 "all".into(),
4998 ]
4999 }
5000}
5001
5002#[derive(
5003 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5004)]
5005#[allow(non_snake_case)]
5006pub struct PaginatedGroupList {
5007 pub count: i64,
5008 #[serde(default, skip_serializing_if = "Option::is_none")]
5009 pub next: Option<String>,
5010 #[serde(default, skip_serializing_if = "Option::is_none")]
5011 pub previous: Option<String>,
5012 pub results: Vec<Group>,
5013 #[serde(default, skip_serializing_if = "Option::is_none")]
5014 pub all: Option<Vec<i64>>,
5015}
5016
5017impl std::fmt::Display for PaginatedGroupList {
5018 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5019 write!(
5020 f,
5021 "{}",
5022 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5023 )
5024 }
5025}
5026
5027#[cfg(feature = "requests")]
5028impl crate::types::paginate::Pagination for PaginatedGroupList {
5029 type Item = Group;
5030 fn has_more_pages(&self) -> bool {
5031 self.next.is_some()
5032 }
5033
5034 fn next_page_token(&self) -> Option<String> {
5035 self.next.clone()
5036 }
5037
5038 fn next_page(
5039 &self,
5040 req: reqwest::Request,
5041 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5042 let mut req = req.try_clone().ok_or_else(|| {
5043 crate::types::error::Error::InvalidRequest(format!(
5044 "failed to clone request: {req:?}"
5045 ))
5046 })?;
5047 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5048 crate::types::error::Error::InvalidRequest(format!(
5049 "failed to parse url: {:?}",
5050 self.next
5051 ))
5052 })?;
5053 Ok(req)
5054 }
5055
5056 fn items(&self) -> Vec<Self::Item> {
5057 self.results.clone()
5058 }
5059}
5060
5061#[cfg(feature = "tabled")]
5062impl tabled::Tabled for PaginatedGroupList {
5063 const LENGTH: usize = 5;
5064 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5065 vec![
5066 format!("{:?}", self.count).into(),
5067 if let Some(next) = &self.next {
5068 format!("{next:?}").into()
5069 } else {
5070 String::new().into()
5071 },
5072 if let Some(previous) = &self.previous {
5073 format!("{previous:?}").into()
5074 } else {
5075 String::new().into()
5076 },
5077 format!("{:?}", self.results).into(),
5078 if let Some(all) = &self.all {
5079 format!("{all:?}").into()
5080 } else {
5081 String::new().into()
5082 },
5083 ]
5084 }
5085
5086 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5087 vec![
5088 "count".into(),
5089 "next".into(),
5090 "previous".into(),
5091 "results".into(),
5092 "all".into(),
5093 ]
5094 }
5095}
5096
5097#[derive(
5098 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5099)]
5100#[allow(non_snake_case)]
5101pub struct PaginatedLogEntryList {
5102 pub count: i64,
5103 #[serde(default, skip_serializing_if = "Option::is_none")]
5104 pub next: Option<String>,
5105 #[serde(default, skip_serializing_if = "Option::is_none")]
5106 pub previous: Option<String>,
5107 pub results: Vec<LogEntry>,
5108 #[serde(default, skip_serializing_if = "Option::is_none")]
5109 pub all: Option<Vec<i64>>,
5110}
5111
5112impl std::fmt::Display for PaginatedLogEntryList {
5113 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5114 write!(
5115 f,
5116 "{}",
5117 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5118 )
5119 }
5120}
5121
5122#[cfg(feature = "requests")]
5123impl crate::types::paginate::Pagination for PaginatedLogEntryList {
5124 type Item = LogEntry;
5125 fn has_more_pages(&self) -> bool {
5126 self.next.is_some()
5127 }
5128
5129 fn next_page_token(&self) -> Option<String> {
5130 self.next.clone()
5131 }
5132
5133 fn next_page(
5134 &self,
5135 req: reqwest::Request,
5136 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5137 let mut req = req.try_clone().ok_or_else(|| {
5138 crate::types::error::Error::InvalidRequest(format!(
5139 "failed to clone request: {req:?}"
5140 ))
5141 })?;
5142 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5143 crate::types::error::Error::InvalidRequest(format!(
5144 "failed to parse url: {:?}",
5145 self.next
5146 ))
5147 })?;
5148 Ok(req)
5149 }
5150
5151 fn items(&self) -> Vec<Self::Item> {
5152 self.results.clone()
5153 }
5154}
5155
5156#[cfg(feature = "tabled")]
5157impl tabled::Tabled for PaginatedLogEntryList {
5158 const LENGTH: usize = 5;
5159 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5160 vec![
5161 format!("{:?}", self.count).into(),
5162 if let Some(next) = &self.next {
5163 format!("{next:?}").into()
5164 } else {
5165 String::new().into()
5166 },
5167 if let Some(previous) = &self.previous {
5168 format!("{previous:?}").into()
5169 } else {
5170 String::new().into()
5171 },
5172 format!("{:?}", self.results).into(),
5173 if let Some(all) = &self.all {
5174 format!("{all:?}").into()
5175 } else {
5176 String::new().into()
5177 },
5178 ]
5179 }
5180
5181 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5182 vec![
5183 "count".into(),
5184 "next".into(),
5185 "previous".into(),
5186 "results".into(),
5187 "all".into(),
5188 ]
5189 }
5190}
5191
5192#[derive(
5193 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5194)]
5195#[allow(non_snake_case)]
5196pub struct PaginatedMailAccountList {
5197 pub count: i64,
5198 #[serde(default, skip_serializing_if = "Option::is_none")]
5199 pub next: Option<String>,
5200 #[serde(default, skip_serializing_if = "Option::is_none")]
5201 pub previous: Option<String>,
5202 pub results: Vec<MailAccount>,
5203 #[serde(default, skip_serializing_if = "Option::is_none")]
5204 pub all: Option<Vec<i64>>,
5205}
5206
5207impl std::fmt::Display for PaginatedMailAccountList {
5208 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5209 write!(
5210 f,
5211 "{}",
5212 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5213 )
5214 }
5215}
5216
5217#[cfg(feature = "requests")]
5218impl crate::types::paginate::Pagination for PaginatedMailAccountList {
5219 type Item = MailAccount;
5220 fn has_more_pages(&self) -> bool {
5221 self.next.is_some()
5222 }
5223
5224 fn next_page_token(&self) -> Option<String> {
5225 self.next.clone()
5226 }
5227
5228 fn next_page(
5229 &self,
5230 req: reqwest::Request,
5231 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5232 let mut req = req.try_clone().ok_or_else(|| {
5233 crate::types::error::Error::InvalidRequest(format!(
5234 "failed to clone request: {req:?}"
5235 ))
5236 })?;
5237 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5238 crate::types::error::Error::InvalidRequest(format!(
5239 "failed to parse url: {:?}",
5240 self.next
5241 ))
5242 })?;
5243 Ok(req)
5244 }
5245
5246 fn items(&self) -> Vec<Self::Item> {
5247 self.results.clone()
5248 }
5249}
5250
5251#[cfg(feature = "tabled")]
5252impl tabled::Tabled for PaginatedMailAccountList {
5253 const LENGTH: usize = 5;
5254 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5255 vec![
5256 format!("{:?}", self.count).into(),
5257 if let Some(next) = &self.next {
5258 format!("{next:?}").into()
5259 } else {
5260 String::new().into()
5261 },
5262 if let Some(previous) = &self.previous {
5263 format!("{previous:?}").into()
5264 } else {
5265 String::new().into()
5266 },
5267 format!("{:?}", self.results).into(),
5268 if let Some(all) = &self.all {
5269 format!("{all:?}").into()
5270 } else {
5271 String::new().into()
5272 },
5273 ]
5274 }
5275
5276 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5277 vec![
5278 "count".into(),
5279 "next".into(),
5280 "previous".into(),
5281 "results".into(),
5282 "all".into(),
5283 ]
5284 }
5285}
5286
5287#[derive(
5288 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5289)]
5290#[allow(non_snake_case)]
5291pub struct PaginatedMailRuleList {
5292 pub count: i64,
5293 #[serde(default, skip_serializing_if = "Option::is_none")]
5294 pub next: Option<String>,
5295 #[serde(default, skip_serializing_if = "Option::is_none")]
5296 pub previous: Option<String>,
5297 pub results: Vec<MailRule>,
5298 #[serde(default, skip_serializing_if = "Option::is_none")]
5299 pub all: Option<Vec<i64>>,
5300}
5301
5302impl std::fmt::Display for PaginatedMailRuleList {
5303 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5304 write!(
5305 f,
5306 "{}",
5307 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5308 )
5309 }
5310}
5311
5312#[cfg(feature = "requests")]
5313impl crate::types::paginate::Pagination for PaginatedMailRuleList {
5314 type Item = MailRule;
5315 fn has_more_pages(&self) -> bool {
5316 self.next.is_some()
5317 }
5318
5319 fn next_page_token(&self) -> Option<String> {
5320 self.next.clone()
5321 }
5322
5323 fn next_page(
5324 &self,
5325 req: reqwest::Request,
5326 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5327 let mut req = req.try_clone().ok_or_else(|| {
5328 crate::types::error::Error::InvalidRequest(format!(
5329 "failed to clone request: {req:?}"
5330 ))
5331 })?;
5332 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5333 crate::types::error::Error::InvalidRequest(format!(
5334 "failed to parse url: {:?}",
5335 self.next
5336 ))
5337 })?;
5338 Ok(req)
5339 }
5340
5341 fn items(&self) -> Vec<Self::Item> {
5342 self.results.clone()
5343 }
5344}
5345
5346#[cfg(feature = "tabled")]
5347impl tabled::Tabled for PaginatedMailRuleList {
5348 const LENGTH: usize = 5;
5349 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5350 vec![
5351 format!("{:?}", self.count).into(),
5352 if let Some(next) = &self.next {
5353 format!("{next:?}").into()
5354 } else {
5355 String::new().into()
5356 },
5357 if let Some(previous) = &self.previous {
5358 format!("{previous:?}").into()
5359 } else {
5360 String::new().into()
5361 },
5362 format!("{:?}", self.results).into(),
5363 if let Some(all) = &self.all {
5364 format!("{all:?}").into()
5365 } else {
5366 String::new().into()
5367 },
5368 ]
5369 }
5370
5371 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5372 vec![
5373 "count".into(),
5374 "next".into(),
5375 "previous".into(),
5376 "results".into(),
5377 "all".into(),
5378 ]
5379 }
5380}
5381
5382#[derive(
5383 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5384)]
5385#[allow(non_snake_case)]
5386pub struct PaginatedProcessedMailList {
5387 pub count: i64,
5388 #[serde(default, skip_serializing_if = "Option::is_none")]
5389 pub next: Option<String>,
5390 #[serde(default, skip_serializing_if = "Option::is_none")]
5391 pub previous: Option<String>,
5392 pub results: Vec<ProcessedMail>,
5393 #[serde(default, skip_serializing_if = "Option::is_none")]
5394 pub all: Option<Vec<i64>>,
5395}
5396
5397impl std::fmt::Display for PaginatedProcessedMailList {
5398 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5399 write!(
5400 f,
5401 "{}",
5402 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5403 )
5404 }
5405}
5406
5407#[cfg(feature = "requests")]
5408impl crate::types::paginate::Pagination for PaginatedProcessedMailList {
5409 type Item = ProcessedMail;
5410 fn has_more_pages(&self) -> bool {
5411 self.next.is_some()
5412 }
5413
5414 fn next_page_token(&self) -> Option<String> {
5415 self.next.clone()
5416 }
5417
5418 fn next_page(
5419 &self,
5420 req: reqwest::Request,
5421 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5422 let mut req = req.try_clone().ok_or_else(|| {
5423 crate::types::error::Error::InvalidRequest(format!(
5424 "failed to clone request: {req:?}"
5425 ))
5426 })?;
5427 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5428 crate::types::error::Error::InvalidRequest(format!(
5429 "failed to parse url: {:?}",
5430 self.next
5431 ))
5432 })?;
5433 Ok(req)
5434 }
5435
5436 fn items(&self) -> Vec<Self::Item> {
5437 self.results.clone()
5438 }
5439}
5440
5441#[cfg(feature = "tabled")]
5442impl tabled::Tabled for PaginatedProcessedMailList {
5443 const LENGTH: usize = 5;
5444 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5445 vec![
5446 format!("{:?}", self.count).into(),
5447 if let Some(next) = &self.next {
5448 format!("{next:?}").into()
5449 } else {
5450 String::new().into()
5451 },
5452 if let Some(previous) = &self.previous {
5453 format!("{previous:?}").into()
5454 } else {
5455 String::new().into()
5456 },
5457 format!("{:?}", self.results).into(),
5458 if let Some(all) = &self.all {
5459 format!("{all:?}").into()
5460 } else {
5461 String::new().into()
5462 },
5463 ]
5464 }
5465
5466 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5467 vec![
5468 "count".into(),
5469 "next".into(),
5470 "previous".into(),
5471 "results".into(),
5472 "all".into(),
5473 ]
5474 }
5475}
5476
5477#[derive(
5478 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5479)]
5480#[allow(non_snake_case)]
5481pub struct PaginatedSavedViewList {
5482 pub count: i64,
5483 #[serde(default, skip_serializing_if = "Option::is_none")]
5484 pub next: Option<String>,
5485 #[serde(default, skip_serializing_if = "Option::is_none")]
5486 pub previous: Option<String>,
5487 pub results: Vec<SavedView>,
5488 #[serde(default, skip_serializing_if = "Option::is_none")]
5489 pub all: Option<Vec<i64>>,
5490}
5491
5492impl std::fmt::Display for PaginatedSavedViewList {
5493 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5494 write!(
5495 f,
5496 "{}",
5497 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5498 )
5499 }
5500}
5501
5502#[cfg(feature = "requests")]
5503impl crate::types::paginate::Pagination for PaginatedSavedViewList {
5504 type Item = SavedView;
5505 fn has_more_pages(&self) -> bool {
5506 self.next.is_some()
5507 }
5508
5509 fn next_page_token(&self) -> Option<String> {
5510 self.next.clone()
5511 }
5512
5513 fn next_page(
5514 &self,
5515 req: reqwest::Request,
5516 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5517 let mut req = req.try_clone().ok_or_else(|| {
5518 crate::types::error::Error::InvalidRequest(format!(
5519 "failed to clone request: {req:?}"
5520 ))
5521 })?;
5522 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5523 crate::types::error::Error::InvalidRequest(format!(
5524 "failed to parse url: {:?}",
5525 self.next
5526 ))
5527 })?;
5528 Ok(req)
5529 }
5530
5531 fn items(&self) -> Vec<Self::Item> {
5532 self.results.clone()
5533 }
5534}
5535
5536#[cfg(feature = "tabled")]
5537impl tabled::Tabled for PaginatedSavedViewList {
5538 const LENGTH: usize = 5;
5539 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5540 vec![
5541 format!("{:?}", self.count).into(),
5542 if let Some(next) = &self.next {
5543 format!("{next:?}").into()
5544 } else {
5545 String::new().into()
5546 },
5547 if let Some(previous) = &self.previous {
5548 format!("{previous:?}").into()
5549 } else {
5550 String::new().into()
5551 },
5552 format!("{:?}", self.results).into(),
5553 if let Some(all) = &self.all {
5554 format!("{all:?}").into()
5555 } else {
5556 String::new().into()
5557 },
5558 ]
5559 }
5560
5561 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5562 vec![
5563 "count".into(),
5564 "next".into(),
5565 "previous".into(),
5566 "results".into(),
5567 "all".into(),
5568 ]
5569 }
5570}
5571
5572#[derive(
5573 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5574)]
5575#[allow(non_snake_case)]
5576pub struct PaginatedShareLinkList {
5577 pub count: i64,
5578 #[serde(default, skip_serializing_if = "Option::is_none")]
5579 pub next: Option<String>,
5580 #[serde(default, skip_serializing_if = "Option::is_none")]
5581 pub previous: Option<String>,
5582 pub results: Vec<ShareLink>,
5583 #[serde(default, skip_serializing_if = "Option::is_none")]
5584 pub all: Option<Vec<i64>>,
5585}
5586
5587impl std::fmt::Display for PaginatedShareLinkList {
5588 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5589 write!(
5590 f,
5591 "{}",
5592 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5593 )
5594 }
5595}
5596
5597#[cfg(feature = "requests")]
5598impl crate::types::paginate::Pagination for PaginatedShareLinkList {
5599 type Item = ShareLink;
5600 fn has_more_pages(&self) -> bool {
5601 self.next.is_some()
5602 }
5603
5604 fn next_page_token(&self) -> Option<String> {
5605 self.next.clone()
5606 }
5607
5608 fn next_page(
5609 &self,
5610 req: reqwest::Request,
5611 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5612 let mut req = req.try_clone().ok_or_else(|| {
5613 crate::types::error::Error::InvalidRequest(format!(
5614 "failed to clone request: {req:?}"
5615 ))
5616 })?;
5617 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5618 crate::types::error::Error::InvalidRequest(format!(
5619 "failed to parse url: {:?}",
5620 self.next
5621 ))
5622 })?;
5623 Ok(req)
5624 }
5625
5626 fn items(&self) -> Vec<Self::Item> {
5627 self.results.clone()
5628 }
5629}
5630
5631#[cfg(feature = "tabled")]
5632impl tabled::Tabled for PaginatedShareLinkList {
5633 const LENGTH: usize = 5;
5634 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5635 vec![
5636 format!("{:?}", self.count).into(),
5637 if let Some(next) = &self.next {
5638 format!("{next:?}").into()
5639 } else {
5640 String::new().into()
5641 },
5642 if let Some(previous) = &self.previous {
5643 format!("{previous:?}").into()
5644 } else {
5645 String::new().into()
5646 },
5647 format!("{:?}", self.results).into(),
5648 if let Some(all) = &self.all {
5649 format!("{all:?}").into()
5650 } else {
5651 String::new().into()
5652 },
5653 ]
5654 }
5655
5656 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5657 vec![
5658 "count".into(),
5659 "next".into(),
5660 "previous".into(),
5661 "results".into(),
5662 "all".into(),
5663 ]
5664 }
5665}
5666
5667#[derive(
5668 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5669)]
5670#[allow(non_snake_case)]
5671pub struct PaginatedStoragePathList {
5672 pub count: i64,
5673 #[serde(default, skip_serializing_if = "Option::is_none")]
5674 pub next: Option<String>,
5675 #[serde(default, skip_serializing_if = "Option::is_none")]
5676 pub previous: Option<String>,
5677 pub results: Vec<StoragePath>,
5678 #[serde(default, skip_serializing_if = "Option::is_none")]
5679 pub all: Option<Vec<i64>>,
5680}
5681
5682impl std::fmt::Display for PaginatedStoragePathList {
5683 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5684 write!(
5685 f,
5686 "{}",
5687 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5688 )
5689 }
5690}
5691
5692#[cfg(feature = "requests")]
5693impl crate::types::paginate::Pagination for PaginatedStoragePathList {
5694 type Item = StoragePath;
5695 fn has_more_pages(&self) -> bool {
5696 self.next.is_some()
5697 }
5698
5699 fn next_page_token(&self) -> Option<String> {
5700 self.next.clone()
5701 }
5702
5703 fn next_page(
5704 &self,
5705 req: reqwest::Request,
5706 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5707 let mut req = req.try_clone().ok_or_else(|| {
5708 crate::types::error::Error::InvalidRequest(format!(
5709 "failed to clone request: {req:?}"
5710 ))
5711 })?;
5712 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5713 crate::types::error::Error::InvalidRequest(format!(
5714 "failed to parse url: {:?}",
5715 self.next
5716 ))
5717 })?;
5718 Ok(req)
5719 }
5720
5721 fn items(&self) -> Vec<Self::Item> {
5722 self.results.clone()
5723 }
5724}
5725
5726#[cfg(feature = "tabled")]
5727impl tabled::Tabled for PaginatedStoragePathList {
5728 const LENGTH: usize = 5;
5729 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5730 vec![
5731 format!("{:?}", self.count).into(),
5732 if let Some(next) = &self.next {
5733 format!("{next:?}").into()
5734 } else {
5735 String::new().into()
5736 },
5737 if let Some(previous) = &self.previous {
5738 format!("{previous:?}").into()
5739 } else {
5740 String::new().into()
5741 },
5742 format!("{:?}", self.results).into(),
5743 if let Some(all) = &self.all {
5744 format!("{all:?}").into()
5745 } else {
5746 String::new().into()
5747 },
5748 ]
5749 }
5750
5751 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5752 vec![
5753 "count".into(),
5754 "next".into(),
5755 "previous".into(),
5756 "results".into(),
5757 "all".into(),
5758 ]
5759 }
5760}
5761
5762#[derive(
5763 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5764)]
5765#[allow(non_snake_case)]
5766pub struct PaginatedTagList {
5767 pub count: i64,
5768 #[serde(default, skip_serializing_if = "Option::is_none")]
5769 pub next: Option<String>,
5770 #[serde(default, skip_serializing_if = "Option::is_none")]
5771 pub previous: Option<String>,
5772 pub results: Vec<Tag>,
5773 #[serde(default, skip_serializing_if = "Option::is_none")]
5774 pub all: Option<Vec<i64>>,
5775}
5776
5777impl std::fmt::Display for PaginatedTagList {
5778 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5779 write!(
5780 f,
5781 "{}",
5782 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5783 )
5784 }
5785}
5786
5787#[cfg(feature = "requests")]
5788impl crate::types::paginate::Pagination for PaginatedTagList {
5789 type Item = Tag;
5790 fn has_more_pages(&self) -> bool {
5791 self.next.is_some()
5792 }
5793
5794 fn next_page_token(&self) -> Option<String> {
5795 self.next.clone()
5796 }
5797
5798 fn next_page(
5799 &self,
5800 req: reqwest::Request,
5801 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5802 let mut req = req.try_clone().ok_or_else(|| {
5803 crate::types::error::Error::InvalidRequest(format!(
5804 "failed to clone request: {req:?}"
5805 ))
5806 })?;
5807 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5808 crate::types::error::Error::InvalidRequest(format!(
5809 "failed to parse url: {:?}",
5810 self.next
5811 ))
5812 })?;
5813 Ok(req)
5814 }
5815
5816 fn items(&self) -> Vec<Self::Item> {
5817 self.results.clone()
5818 }
5819}
5820
5821#[cfg(feature = "tabled")]
5822impl tabled::Tabled for PaginatedTagList {
5823 const LENGTH: usize = 5;
5824 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5825 vec![
5826 format!("{:?}", self.count).into(),
5827 if let Some(next) = &self.next {
5828 format!("{next:?}").into()
5829 } else {
5830 String::new().into()
5831 },
5832 if let Some(previous) = &self.previous {
5833 format!("{previous:?}").into()
5834 } else {
5835 String::new().into()
5836 },
5837 format!("{:?}", self.results).into(),
5838 if let Some(all) = &self.all {
5839 format!("{all:?}").into()
5840 } else {
5841 String::new().into()
5842 },
5843 ]
5844 }
5845
5846 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5847 vec![
5848 "count".into(),
5849 "next".into(),
5850 "previous".into(),
5851 "results".into(),
5852 "all".into(),
5853 ]
5854 }
5855}
5856
5857#[derive(
5858 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5859)]
5860#[allow(non_snake_case)]
5861pub struct PaginatedUserList {
5862 pub count: i64,
5863 #[serde(default, skip_serializing_if = "Option::is_none")]
5864 pub next: Option<String>,
5865 #[serde(default, skip_serializing_if = "Option::is_none")]
5866 pub previous: Option<String>,
5867 pub results: Vec<User>,
5868 #[serde(default, skip_serializing_if = "Option::is_none")]
5869 pub all: Option<Vec<i64>>,
5870}
5871
5872impl std::fmt::Display for PaginatedUserList {
5873 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5874 write!(
5875 f,
5876 "{}",
5877 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5878 )
5879 }
5880}
5881
5882#[cfg(feature = "requests")]
5883impl crate::types::paginate::Pagination for PaginatedUserList {
5884 type Item = User;
5885 fn has_more_pages(&self) -> bool {
5886 self.next.is_some()
5887 }
5888
5889 fn next_page_token(&self) -> Option<String> {
5890 self.next.clone()
5891 }
5892
5893 fn next_page(
5894 &self,
5895 req: reqwest::Request,
5896 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5897 let mut req = req.try_clone().ok_or_else(|| {
5898 crate::types::error::Error::InvalidRequest(format!(
5899 "failed to clone request: {req:?}"
5900 ))
5901 })?;
5902 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5903 crate::types::error::Error::InvalidRequest(format!(
5904 "failed to parse url: {:?}",
5905 self.next
5906 ))
5907 })?;
5908 Ok(req)
5909 }
5910
5911 fn items(&self) -> Vec<Self::Item> {
5912 self.results.clone()
5913 }
5914}
5915
5916#[cfg(feature = "tabled")]
5917impl tabled::Tabled for PaginatedUserList {
5918 const LENGTH: usize = 5;
5919 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5920 vec![
5921 format!("{:?}", self.count).into(),
5922 if let Some(next) = &self.next {
5923 format!("{next:?}").into()
5924 } else {
5925 String::new().into()
5926 },
5927 if let Some(previous) = &self.previous {
5928 format!("{previous:?}").into()
5929 } else {
5930 String::new().into()
5931 },
5932 format!("{:?}", self.results).into(),
5933 if let Some(all) = &self.all {
5934 format!("{all:?}").into()
5935 } else {
5936 String::new().into()
5937 },
5938 ]
5939 }
5940
5941 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5942 vec![
5943 "count".into(),
5944 "next".into(),
5945 "previous".into(),
5946 "results".into(),
5947 "all".into(),
5948 ]
5949 }
5950}
5951
5952#[derive(
5953 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5954)]
5955#[allow(non_snake_case)]
5956pub struct PaginatedWorkflowActionList {
5957 pub count: i64,
5958 #[serde(default, skip_serializing_if = "Option::is_none")]
5959 pub next: Option<String>,
5960 #[serde(default, skip_serializing_if = "Option::is_none")]
5961 pub previous: Option<String>,
5962 pub results: Vec<WorkflowAction>,
5963 #[serde(default, skip_serializing_if = "Option::is_none")]
5964 pub all: Option<Vec<i64>>,
5965}
5966
5967impl std::fmt::Display for PaginatedWorkflowActionList {
5968 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5969 write!(
5970 f,
5971 "{}",
5972 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5973 )
5974 }
5975}
5976
5977#[cfg(feature = "requests")]
5978impl crate::types::paginate::Pagination for PaginatedWorkflowActionList {
5979 type Item = WorkflowAction;
5980 fn has_more_pages(&self) -> bool {
5981 self.next.is_some()
5982 }
5983
5984 fn next_page_token(&self) -> Option<String> {
5985 self.next.clone()
5986 }
5987
5988 fn next_page(
5989 &self,
5990 req: reqwest::Request,
5991 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5992 let mut req = req.try_clone().ok_or_else(|| {
5993 crate::types::error::Error::InvalidRequest(format!(
5994 "failed to clone request: {req:?}"
5995 ))
5996 })?;
5997 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5998 crate::types::error::Error::InvalidRequest(format!(
5999 "failed to parse url: {:?}",
6000 self.next
6001 ))
6002 })?;
6003 Ok(req)
6004 }
6005
6006 fn items(&self) -> Vec<Self::Item> {
6007 self.results.clone()
6008 }
6009}
6010
6011#[cfg(feature = "tabled")]
6012impl tabled::Tabled for PaginatedWorkflowActionList {
6013 const LENGTH: usize = 5;
6014 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6015 vec![
6016 format!("{:?}", self.count).into(),
6017 if let Some(next) = &self.next {
6018 format!("{next:?}").into()
6019 } else {
6020 String::new().into()
6021 },
6022 if let Some(previous) = &self.previous {
6023 format!("{previous:?}").into()
6024 } else {
6025 String::new().into()
6026 },
6027 format!("{:?}", self.results).into(),
6028 if let Some(all) = &self.all {
6029 format!("{all:?}").into()
6030 } else {
6031 String::new().into()
6032 },
6033 ]
6034 }
6035
6036 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6037 vec![
6038 "count".into(),
6039 "next".into(),
6040 "previous".into(),
6041 "results".into(),
6042 "all".into(),
6043 ]
6044 }
6045}
6046
6047#[derive(
6048 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6049)]
6050#[allow(non_snake_case)]
6051pub struct PaginatedWorkflowList {
6052 pub count: i64,
6053 #[serde(default, skip_serializing_if = "Option::is_none")]
6054 pub next: Option<String>,
6055 #[serde(default, skip_serializing_if = "Option::is_none")]
6056 pub previous: Option<String>,
6057 pub results: Vec<Workflow>,
6058 #[serde(default, skip_serializing_if = "Option::is_none")]
6059 pub all: Option<Vec<i64>>,
6060}
6061
6062impl std::fmt::Display for PaginatedWorkflowList {
6063 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6064 write!(
6065 f,
6066 "{}",
6067 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6068 )
6069 }
6070}
6071
6072#[cfg(feature = "requests")]
6073impl crate::types::paginate::Pagination for PaginatedWorkflowList {
6074 type Item = Workflow;
6075 fn has_more_pages(&self) -> bool {
6076 self.next.is_some()
6077 }
6078
6079 fn next_page_token(&self) -> Option<String> {
6080 self.next.clone()
6081 }
6082
6083 fn next_page(
6084 &self,
6085 req: reqwest::Request,
6086 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
6087 let mut req = req.try_clone().ok_or_else(|| {
6088 crate::types::error::Error::InvalidRequest(format!(
6089 "failed to clone request: {req:?}"
6090 ))
6091 })?;
6092 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
6093 crate::types::error::Error::InvalidRequest(format!(
6094 "failed to parse url: {:?}",
6095 self.next
6096 ))
6097 })?;
6098 Ok(req)
6099 }
6100
6101 fn items(&self) -> Vec<Self::Item> {
6102 self.results.clone()
6103 }
6104}
6105
6106#[cfg(feature = "tabled")]
6107impl tabled::Tabled for PaginatedWorkflowList {
6108 const LENGTH: usize = 5;
6109 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6110 vec![
6111 format!("{:?}", self.count).into(),
6112 if let Some(next) = &self.next {
6113 format!("{next:?}").into()
6114 } else {
6115 String::new().into()
6116 },
6117 if let Some(previous) = &self.previous {
6118 format!("{previous:?}").into()
6119 } else {
6120 String::new().into()
6121 },
6122 format!("{:?}", self.results).into(),
6123 if let Some(all) = &self.all {
6124 format!("{all:?}").into()
6125 } else {
6126 String::new().into()
6127 },
6128 ]
6129 }
6130
6131 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6132 vec![
6133 "count".into(),
6134 "next".into(),
6135 "previous".into(),
6136 "results".into(),
6137 "all".into(),
6138 ]
6139 }
6140}
6141
6142#[derive(
6143 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6144)]
6145#[allow(non_snake_case)]
6146pub struct PaginatedWorkflowTriggerList {
6147 pub count: i64,
6148 #[serde(default, skip_serializing_if = "Option::is_none")]
6149 pub next: Option<String>,
6150 #[serde(default, skip_serializing_if = "Option::is_none")]
6151 pub previous: Option<String>,
6152 pub results: Vec<WorkflowTrigger>,
6153 #[serde(default, skip_serializing_if = "Option::is_none")]
6154 pub all: Option<Vec<i64>>,
6155}
6156
6157impl std::fmt::Display for PaginatedWorkflowTriggerList {
6158 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6159 write!(
6160 f,
6161 "{}",
6162 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6163 )
6164 }
6165}
6166
6167#[cfg(feature = "requests")]
6168impl crate::types::paginate::Pagination for PaginatedWorkflowTriggerList {
6169 type Item = WorkflowTrigger;
6170 fn has_more_pages(&self) -> bool {
6171 self.next.is_some()
6172 }
6173
6174 fn next_page_token(&self) -> Option<String> {
6175 self.next.clone()
6176 }
6177
6178 fn next_page(
6179 &self,
6180 req: reqwest::Request,
6181 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
6182 let mut req = req.try_clone().ok_or_else(|| {
6183 crate::types::error::Error::InvalidRequest(format!(
6184 "failed to clone request: {req:?}"
6185 ))
6186 })?;
6187 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
6188 crate::types::error::Error::InvalidRequest(format!(
6189 "failed to parse url: {:?}",
6190 self.next
6191 ))
6192 })?;
6193 Ok(req)
6194 }
6195
6196 fn items(&self) -> Vec<Self::Item> {
6197 self.results.clone()
6198 }
6199}
6200
6201#[cfg(feature = "tabled")]
6202impl tabled::Tabled for PaginatedWorkflowTriggerList {
6203 const LENGTH: usize = 5;
6204 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6205 vec![
6206 format!("{:?}", self.count).into(),
6207 if let Some(next) = &self.next {
6208 format!("{next:?}").into()
6209 } else {
6210 String::new().into()
6211 },
6212 if let Some(previous) = &self.previous {
6213 format!("{previous:?}").into()
6214 } else {
6215 String::new().into()
6216 },
6217 format!("{:?}", self.results).into(),
6218 if let Some(all) = &self.all {
6219 format!("{all:?}").into()
6220 } else {
6221 String::new().into()
6222 },
6223 ]
6224 }
6225
6226 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6227 vec![
6228 "count".into(),
6229 "next".into(),
6230 "previous".into(),
6231 "results".into(),
6232 "all".into(),
6233 ]
6234 }
6235}
6236
6237#[derive(
6238 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6239)]
6240#[allow(non_snake_case)]
6241pub struct PaperlessAuthToken {
6242 pub token: String,
6243}
6244
6245impl std::fmt::Display for PaperlessAuthToken {
6246 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6247 write!(
6248 f,
6249 "{}",
6250 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6251 )
6252 }
6253}
6254
6255#[cfg(feature = "tabled")]
6256impl tabled::Tabled for PaperlessAuthToken {
6257 const LENGTH: usize = 1;
6258 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6259 vec![self.token.clone().into()]
6260 }
6261
6262 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6263 vec!["token".into()]
6264 }
6265}
6266
6267#[derive(
6268 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6269)]
6270#[allow(non_snake_case)]
6271pub struct PaperlessAuthTokenRequest {
6272 pub username: String,
6273 pub password: String,
6274 #[serde(default, skip_serializing_if = "Option::is_none")]
6275 pub code: Option<String>,
6276}
6277
6278impl std::fmt::Display for PaperlessAuthTokenRequest {
6279 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6280 write!(
6281 f,
6282 "{}",
6283 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6284 )
6285 }
6286}
6287
6288#[cfg(feature = "tabled")]
6289impl tabled::Tabled for PaperlessAuthTokenRequest {
6290 const LENGTH: usize = 3;
6291 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6292 vec![
6293 self.username.clone().into(),
6294 self.password.clone().into(),
6295 if let Some(code) = &self.code {
6296 format!("{code:?}").into()
6297 } else {
6298 String::new().into()
6299 },
6300 ]
6301 }
6302
6303 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6304 vec!["username".into(), "password".into(), "code".into()]
6305 }
6306}
6307
6308#[derive(
6309 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6310)]
6311#[allow(non_snake_case)]
6312pub struct PatchedApplicationConfigurationRequest {
6313 #[serde(default, skip_serializing_if = "Option::is_none")]
6314 pub user_args: Option<serde_json::Value>,
6315 #[serde(default, skip_serializing_if = "Option::is_none")]
6316 pub barcode_tag_mapping: Option<serde_json::Value>,
6317 #[serde(default, skip_serializing_if = "Option::is_none")]
6318 pub output_type: Option<OutputType>,
6319 #[serde(default, skip_serializing_if = "Option::is_none")]
6320 pub pages: Option<i64>,
6321 #[serde(default, skip_serializing_if = "Option::is_none")]
6322 pub language: Option<String>,
6323 #[serde(default, skip_serializing_if = "Option::is_none")]
6324 pub mode: Option<Mode>,
6325 #[serde(default, skip_serializing_if = "Option::is_none")]
6326 pub skip_archive_file: Option<SkipArchiveFile>,
6327 #[serde(default, skip_serializing_if = "Option::is_none")]
6328 pub image_dpi: Option<i64>,
6329 #[serde(default, skip_serializing_if = "Option::is_none")]
6330 pub unpaper_clean: Option<UnpaperClean>,
6331 #[serde(default, skip_serializing_if = "Option::is_none")]
6332 pub deskew: Option<bool>,
6333 #[serde(default, skip_serializing_if = "Option::is_none")]
6334 pub rotate_pages: Option<bool>,
6335 #[serde(default, skip_serializing_if = "Option::is_none")]
6336 pub rotate_pages_threshold: Option<f64>,
6337 #[serde(default, skip_serializing_if = "Option::is_none")]
6338 pub max_image_pixels: Option<f64>,
6339 #[serde(default, skip_serializing_if = "Option::is_none")]
6340 pub color_conversion_strategy: Option<ColorConversionStrategy>,
6341 #[serde(default, skip_serializing_if = "Option::is_none")]
6342 pub app_title: Option<String>,
6343 #[serde(default, skip_serializing_if = "Option::is_none")]
6344 pub app_logo: Option<bytes::Bytes>,
6345 #[serde(default, skip_serializing_if = "Option::is_none")]
6346 pub barcodes_enabled: Option<bool>,
6347 #[serde(default, skip_serializing_if = "Option::is_none")]
6348 pub barcode_enable_tiff_support: Option<bool>,
6349 #[serde(default, skip_serializing_if = "Option::is_none")]
6350 pub barcode_string: Option<String>,
6351 #[serde(default, skip_serializing_if = "Option::is_none")]
6352 pub barcode_retain_split_pages: Option<bool>,
6353 #[serde(default, skip_serializing_if = "Option::is_none")]
6354 pub barcode_enable_asn: Option<bool>,
6355 #[serde(default, skip_serializing_if = "Option::is_none")]
6356 pub barcode_asn_prefix: Option<String>,
6357 #[serde(default, skip_serializing_if = "Option::is_none")]
6358 pub barcode_upscale: Option<f64>,
6359 #[serde(default, skip_serializing_if = "Option::is_none")]
6360 pub barcode_dpi: Option<i64>,
6361 #[serde(default, skip_serializing_if = "Option::is_none")]
6362 pub barcode_max_pages: Option<i64>,
6363 #[serde(default, skip_serializing_if = "Option::is_none")]
6364 pub barcode_enable_tag: Option<bool>,
6365}
6366
6367impl std::fmt::Display for PatchedApplicationConfigurationRequest {
6368 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6369 write!(
6370 f,
6371 "{}",
6372 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6373 )
6374 }
6375}
6376
6377#[cfg(feature = "tabled")]
6378impl tabled::Tabled for PatchedApplicationConfigurationRequest {
6379 const LENGTH: usize = 26;
6380 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6381 vec![
6382 if let Some(user_args) = &self.user_args {
6383 format!("{user_args:?}").into()
6384 } else {
6385 String::new().into()
6386 },
6387 if let Some(barcode_tag_mapping) = &self.barcode_tag_mapping {
6388 format!("{barcode_tag_mapping:?}").into()
6389 } else {
6390 String::new().into()
6391 },
6392 if let Some(output_type) = &self.output_type {
6393 format!("{output_type:?}").into()
6394 } else {
6395 String::new().into()
6396 },
6397 if let Some(pages) = &self.pages {
6398 format!("{pages:?}").into()
6399 } else {
6400 String::new().into()
6401 },
6402 if let Some(language) = &self.language {
6403 format!("{language:?}").into()
6404 } else {
6405 String::new().into()
6406 },
6407 if let Some(mode) = &self.mode {
6408 format!("{mode:?}").into()
6409 } else {
6410 String::new().into()
6411 },
6412 if let Some(skip_archive_file) = &self.skip_archive_file {
6413 format!("{skip_archive_file:?}").into()
6414 } else {
6415 String::new().into()
6416 },
6417 if let Some(image_dpi) = &self.image_dpi {
6418 format!("{image_dpi:?}").into()
6419 } else {
6420 String::new().into()
6421 },
6422 if let Some(unpaper_clean) = &self.unpaper_clean {
6423 format!("{unpaper_clean:?}").into()
6424 } else {
6425 String::new().into()
6426 },
6427 if let Some(deskew) = &self.deskew {
6428 format!("{deskew:?}").into()
6429 } else {
6430 String::new().into()
6431 },
6432 if let Some(rotate_pages) = &self.rotate_pages {
6433 format!("{rotate_pages:?}").into()
6434 } else {
6435 String::new().into()
6436 },
6437 if let Some(rotate_pages_threshold) = &self.rotate_pages_threshold {
6438 format!("{rotate_pages_threshold:?}").into()
6439 } else {
6440 String::new().into()
6441 },
6442 if let Some(max_image_pixels) = &self.max_image_pixels {
6443 format!("{max_image_pixels:?}").into()
6444 } else {
6445 String::new().into()
6446 },
6447 if let Some(color_conversion_strategy) = &self.color_conversion_strategy {
6448 format!("{color_conversion_strategy:?}").into()
6449 } else {
6450 String::new().into()
6451 },
6452 if let Some(app_title) = &self.app_title {
6453 format!("{app_title:?}").into()
6454 } else {
6455 String::new().into()
6456 },
6457 if let Some(app_logo) = &self.app_logo {
6458 format!("{app_logo:?}").into()
6459 } else {
6460 String::new().into()
6461 },
6462 if let Some(barcodes_enabled) = &self.barcodes_enabled {
6463 format!("{barcodes_enabled:?}").into()
6464 } else {
6465 String::new().into()
6466 },
6467 if let Some(barcode_enable_tiff_support) = &self.barcode_enable_tiff_support {
6468 format!("{barcode_enable_tiff_support:?}").into()
6469 } else {
6470 String::new().into()
6471 },
6472 if let Some(barcode_string) = &self.barcode_string {
6473 format!("{barcode_string:?}").into()
6474 } else {
6475 String::new().into()
6476 },
6477 if let Some(barcode_retain_split_pages) = &self.barcode_retain_split_pages {
6478 format!("{barcode_retain_split_pages:?}").into()
6479 } else {
6480 String::new().into()
6481 },
6482 if let Some(barcode_enable_asn) = &self.barcode_enable_asn {
6483 format!("{barcode_enable_asn:?}").into()
6484 } else {
6485 String::new().into()
6486 },
6487 if let Some(barcode_asn_prefix) = &self.barcode_asn_prefix {
6488 format!("{barcode_asn_prefix:?}").into()
6489 } else {
6490 String::new().into()
6491 },
6492 if let Some(barcode_upscale) = &self.barcode_upscale {
6493 format!("{barcode_upscale:?}").into()
6494 } else {
6495 String::new().into()
6496 },
6497 if let Some(barcode_dpi) = &self.barcode_dpi {
6498 format!("{barcode_dpi:?}").into()
6499 } else {
6500 String::new().into()
6501 },
6502 if let Some(barcode_max_pages) = &self.barcode_max_pages {
6503 format!("{barcode_max_pages:?}").into()
6504 } else {
6505 String::new().into()
6506 },
6507 if let Some(barcode_enable_tag) = &self.barcode_enable_tag {
6508 format!("{barcode_enable_tag:?}").into()
6509 } else {
6510 String::new().into()
6511 },
6512 ]
6513 }
6514
6515 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6516 vec![
6517 "user_args".into(),
6518 "barcode_tag_mapping".into(),
6519 "output_type".into(),
6520 "pages".into(),
6521 "language".into(),
6522 "mode".into(),
6523 "skip_archive_file".into(),
6524 "image_dpi".into(),
6525 "unpaper_clean".into(),
6526 "deskew".into(),
6527 "rotate_pages".into(),
6528 "rotate_pages_threshold".into(),
6529 "max_image_pixels".into(),
6530 "color_conversion_strategy".into(),
6531 "app_title".into(),
6532 "app_logo".into(),
6533 "barcodes_enabled".into(),
6534 "barcode_enable_tiff_support".into(),
6535 "barcode_string".into(),
6536 "barcode_retain_split_pages".into(),
6537 "barcode_enable_asn".into(),
6538 "barcode_asn_prefix".into(),
6539 "barcode_upscale".into(),
6540 "barcode_dpi".into(),
6541 "barcode_max_pages".into(),
6542 "barcode_enable_tag".into(),
6543 ]
6544 }
6545}
6546
6547#[derive(
6548 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6549)]
6550#[allow(non_snake_case)]
6551pub struct PatchedCorrespondentRequest {
6552 #[serde(default, skip_serializing_if = "Option::is_none")]
6553 pub name: Option<String>,
6554 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
6555 pub match_: Option<String>,
6556 #[serde(default, skip_serializing_if = "Option::is_none")]
6557 pub matching_algorithm: Option<MatchingAlgorithm>,
6558 #[serde(default, skip_serializing_if = "Option::is_none")]
6559 pub is_insensitive: Option<bool>,
6560 #[serde(default, skip_serializing_if = "Option::is_none")]
6561 pub owner: Option<i64>,
6562 #[serde(default, skip_serializing_if = "Option::is_none")]
6563 pub set_permissions: Option<SetPermissions>,
6564}
6565
6566impl std::fmt::Display for PatchedCorrespondentRequest {
6567 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6568 write!(
6569 f,
6570 "{}",
6571 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6572 )
6573 }
6574}
6575
6576#[cfg(feature = "tabled")]
6577impl tabled::Tabled for PatchedCorrespondentRequest {
6578 const LENGTH: usize = 6;
6579 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6580 vec![
6581 if let Some(name) = &self.name {
6582 format!("{name:?}").into()
6583 } else {
6584 String::new().into()
6585 },
6586 if let Some(match_) = &self.match_ {
6587 format!("{match_:?}").into()
6588 } else {
6589 String::new().into()
6590 },
6591 if let Some(matching_algorithm) = &self.matching_algorithm {
6592 format!("{matching_algorithm:?}").into()
6593 } else {
6594 String::new().into()
6595 },
6596 if let Some(is_insensitive) = &self.is_insensitive {
6597 format!("{is_insensitive:?}").into()
6598 } else {
6599 String::new().into()
6600 },
6601 if let Some(owner) = &self.owner {
6602 format!("{owner:?}").into()
6603 } else {
6604 String::new().into()
6605 },
6606 if let Some(set_permissions) = &self.set_permissions {
6607 format!("{set_permissions:?}").into()
6608 } else {
6609 String::new().into()
6610 },
6611 ]
6612 }
6613
6614 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6615 vec![
6616 "name".into(),
6617 "match_".into(),
6618 "matching_algorithm".into(),
6619 "is_insensitive".into(),
6620 "owner".into(),
6621 "set_permissions".into(),
6622 ]
6623 }
6624}
6625
6626#[derive(
6627 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6628)]
6629#[allow(non_snake_case)]
6630pub struct PatchedCustomFieldRequest {
6631 #[serde(default, skip_serializing_if = "Option::is_none")]
6632 pub name: Option<String>,
6633 #[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"]
6634 #[serde(default, skip_serializing_if = "Option::is_none")]
6635 pub data_type: Option<DataTypeEnum>,
6636 #[doc = "Extra data for the custom field, such as select options"]
6637 #[serde(default, skip_serializing_if = "Option::is_none")]
6638 pub extra_data: Option<serde_json::Value>,
6639}
6640
6641impl std::fmt::Display for PatchedCustomFieldRequest {
6642 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6643 write!(
6644 f,
6645 "{}",
6646 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6647 )
6648 }
6649}
6650
6651#[cfg(feature = "tabled")]
6652impl tabled::Tabled for PatchedCustomFieldRequest {
6653 const LENGTH: usize = 3;
6654 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6655 vec![
6656 if let Some(name) = &self.name {
6657 format!("{name:?}").into()
6658 } else {
6659 String::new().into()
6660 },
6661 if let Some(data_type) = &self.data_type {
6662 format!("{data_type:?}").into()
6663 } else {
6664 String::new().into()
6665 },
6666 if let Some(extra_data) = &self.extra_data {
6667 format!("{extra_data:?}").into()
6668 } else {
6669 String::new().into()
6670 },
6671 ]
6672 }
6673
6674 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6675 vec!["name".into(), "data_type".into(), "extra_data".into()]
6676 }
6677}
6678
6679#[doc = "Adds update nested feature"]
6680#[derive(
6681 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6682)]
6683#[allow(non_snake_case)]
6684pub struct PatchedDocumentRequest {
6685 #[serde(default, skip_serializing_if = "Option::is_none")]
6686 pub correspondent: Option<i64>,
6687 #[serde(default, skip_serializing_if = "Option::is_none")]
6688 pub document_type: Option<i64>,
6689 #[serde(default, skip_serializing_if = "Option::is_none")]
6690 pub storage_path: Option<i64>,
6691 #[serde(default, skip_serializing_if = "Option::is_none")]
6692 pub title: Option<String>,
6693 #[doc = "The raw, text-only data of the document. This field is primarily used for searching."]
6694 #[serde(default, skip_serializing_if = "Option::is_none")]
6695 pub content: Option<String>,
6696 #[serde(default, skip_serializing_if = "Option::is_none")]
6697 pub tags: Option<Vec<i64>>,
6698 #[serde(default, skip_serializing_if = "Option::is_none")]
6699 pub created: Option<chrono::NaiveDate>,
6700 #[serde(default, skip_serializing_if = "Option::is_none")]
6701 #[deprecated]
6702 pub created_date: Option<chrono::NaiveDate>,
6703 #[serde(default, skip_serializing_if = "Option::is_none")]
6704 pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
6705 #[doc = "The position of this document in your physical document archive."]
6706 #[serde(default, skip_serializing_if = "Option::is_none")]
6707 pub archive_serial_number: Option<i64>,
6708 #[serde(default, skip_serializing_if = "Option::is_none")]
6709 pub owner: Option<i64>,
6710 #[serde(default, skip_serializing_if = "Option::is_none")]
6711 pub set_permissions: Option<SetPermissions>,
6712 #[serde(default, skip_serializing_if = "Option::is_none")]
6713 pub custom_fields: Option<Vec<CustomFieldInstanceRequest>>,
6714 #[serde(default, skip_serializing_if = "Option::is_none")]
6715 pub remove_inbox_tags: Option<bool>,
6716}
6717
6718impl std::fmt::Display for PatchedDocumentRequest {
6719 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6720 write!(
6721 f,
6722 "{}",
6723 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6724 )
6725 }
6726}
6727
6728#[cfg(feature = "tabled")]
6729impl tabled::Tabled for PatchedDocumentRequest {
6730 const LENGTH: usize = 14;
6731 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6732 vec![
6733 if let Some(correspondent) = &self.correspondent {
6734 format!("{correspondent:?}").into()
6735 } else {
6736 String::new().into()
6737 },
6738 if let Some(document_type) = &self.document_type {
6739 format!("{document_type:?}").into()
6740 } else {
6741 String::new().into()
6742 },
6743 if let Some(storage_path) = &self.storage_path {
6744 format!("{storage_path:?}").into()
6745 } else {
6746 String::new().into()
6747 },
6748 if let Some(title) = &self.title {
6749 format!("{title:?}").into()
6750 } else {
6751 String::new().into()
6752 },
6753 if let Some(content) = &self.content {
6754 format!("{content:?}").into()
6755 } else {
6756 String::new().into()
6757 },
6758 if let Some(tags) = &self.tags {
6759 format!("{tags:?}").into()
6760 } else {
6761 String::new().into()
6762 },
6763 if let Some(created) = &self.created {
6764 format!("{created:?}").into()
6765 } else {
6766 String::new().into()
6767 },
6768 if let Some(created_date) = &self.created_date {
6769 format!("{created_date:?}").into()
6770 } else {
6771 String::new().into()
6772 },
6773 if let Some(deleted_at) = &self.deleted_at {
6774 format!("{deleted_at:?}").into()
6775 } else {
6776 String::new().into()
6777 },
6778 if let Some(archive_serial_number) = &self.archive_serial_number {
6779 format!("{archive_serial_number:?}").into()
6780 } else {
6781 String::new().into()
6782 },
6783 if let Some(owner) = &self.owner {
6784 format!("{owner:?}").into()
6785 } else {
6786 String::new().into()
6787 },
6788 if let Some(set_permissions) = &self.set_permissions {
6789 format!("{set_permissions:?}").into()
6790 } else {
6791 String::new().into()
6792 },
6793 if let Some(custom_fields) = &self.custom_fields {
6794 format!("{custom_fields:?}").into()
6795 } else {
6796 String::new().into()
6797 },
6798 if let Some(remove_inbox_tags) = &self.remove_inbox_tags {
6799 format!("{remove_inbox_tags:?}").into()
6800 } else {
6801 String::new().into()
6802 },
6803 ]
6804 }
6805
6806 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6807 vec![
6808 "correspondent".into(),
6809 "document_type".into(),
6810 "storage_path".into(),
6811 "title".into(),
6812 "content".into(),
6813 "tags".into(),
6814 "created".into(),
6815 "created_date".into(),
6816 "deleted_at".into(),
6817 "archive_serial_number".into(),
6818 "owner".into(),
6819 "set_permissions".into(),
6820 "custom_fields".into(),
6821 "remove_inbox_tags".into(),
6822 ]
6823 }
6824}
6825
6826#[derive(
6827 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6828)]
6829#[allow(non_snake_case)]
6830pub struct PatchedDocumentTypeRequest {
6831 #[serde(default, skip_serializing_if = "Option::is_none")]
6832 pub name: Option<String>,
6833 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
6834 pub match_: Option<String>,
6835 #[serde(default, skip_serializing_if = "Option::is_none")]
6836 pub matching_algorithm: Option<MatchingAlgorithm>,
6837 #[serde(default, skip_serializing_if = "Option::is_none")]
6838 pub is_insensitive: Option<bool>,
6839 #[serde(default, skip_serializing_if = "Option::is_none")]
6840 pub owner: Option<i64>,
6841 #[serde(default, skip_serializing_if = "Option::is_none")]
6842 pub set_permissions: Option<SetPermissions>,
6843}
6844
6845impl std::fmt::Display for PatchedDocumentTypeRequest {
6846 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6847 write!(
6848 f,
6849 "{}",
6850 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6851 )
6852 }
6853}
6854
6855#[cfg(feature = "tabled")]
6856impl tabled::Tabled for PatchedDocumentTypeRequest {
6857 const LENGTH: usize = 6;
6858 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6859 vec![
6860 if let Some(name) = &self.name {
6861 format!("{name:?}").into()
6862 } else {
6863 String::new().into()
6864 },
6865 if let Some(match_) = &self.match_ {
6866 format!("{match_:?}").into()
6867 } else {
6868 String::new().into()
6869 },
6870 if let Some(matching_algorithm) = &self.matching_algorithm {
6871 format!("{matching_algorithm:?}").into()
6872 } else {
6873 String::new().into()
6874 },
6875 if let Some(is_insensitive) = &self.is_insensitive {
6876 format!("{is_insensitive:?}").into()
6877 } else {
6878 String::new().into()
6879 },
6880 if let Some(owner) = &self.owner {
6881 format!("{owner:?}").into()
6882 } else {
6883 String::new().into()
6884 },
6885 if let Some(set_permissions) = &self.set_permissions {
6886 format!("{set_permissions:?}").into()
6887 } else {
6888 String::new().into()
6889 },
6890 ]
6891 }
6892
6893 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6894 vec![
6895 "name".into(),
6896 "match_".into(),
6897 "matching_algorithm".into(),
6898 "is_insensitive".into(),
6899 "owner".into(),
6900 "set_permissions".into(),
6901 ]
6902 }
6903}
6904
6905#[derive(
6906 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6907)]
6908#[allow(non_snake_case)]
6909pub struct PatchedGroupRequest {
6910 #[serde(default, skip_serializing_if = "Option::is_none")]
6911 pub name: Option<String>,
6912 #[serde(default, skip_serializing_if = "Option::is_none")]
6913 pub permissions: Option<Vec<String>>,
6914}
6915
6916impl std::fmt::Display for PatchedGroupRequest {
6917 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6918 write!(
6919 f,
6920 "{}",
6921 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6922 )
6923 }
6924}
6925
6926#[cfg(feature = "tabled")]
6927impl tabled::Tabled for PatchedGroupRequest {
6928 const LENGTH: usize = 2;
6929 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6930 vec![
6931 if let Some(name) = &self.name {
6932 format!("{name:?}").into()
6933 } else {
6934 String::new().into()
6935 },
6936 if let Some(permissions) = &self.permissions {
6937 format!("{permissions:?}").into()
6938 } else {
6939 String::new().into()
6940 },
6941 ]
6942 }
6943
6944 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6945 vec!["name".into(), "permissions".into()]
6946 }
6947}
6948
6949#[derive(
6950 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6951)]
6952#[allow(non_snake_case)]
6953pub struct PatchedMailAccountRequest {
6954 #[serde(default, skip_serializing_if = "Option::is_none")]
6955 pub name: Option<String>,
6956 #[serde(default, skip_serializing_if = "Option::is_none")]
6957 pub imap_server: Option<String>,
6958 #[doc = "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."]
6959 #[serde(default, skip_serializing_if = "Option::is_none")]
6960 pub imap_port: Option<i64>,
6961 #[serde(default, skip_serializing_if = "Option::is_none")]
6962 pub imap_security: Option<ImapSecurityEnum>,
6963 #[serde(default, skip_serializing_if = "Option::is_none")]
6964 pub username: Option<String>,
6965 #[serde(default, skip_serializing_if = "Option::is_none")]
6966 pub password: Option<String>,
6967 #[doc = "The character set to use when communicating with the mail server, such as 'UTF-8' or 'US-ASCII'."]
6968 #[serde(default, skip_serializing_if = "Option::is_none")]
6969 pub character_set: Option<String>,
6970 #[serde(default, skip_serializing_if = "Option::is_none")]
6971 pub is_token: Option<bool>,
6972 #[serde(default, skip_serializing_if = "Option::is_none")]
6973 pub owner: Option<i64>,
6974 #[serde(default, skip_serializing_if = "Option::is_none")]
6975 pub set_permissions: Option<SetPermissions>,
6976 #[serde(default, skip_serializing_if = "Option::is_none")]
6977 pub account_type: Option<AccountTypeEnum>,
6978 #[doc = "The expiration date of the refresh token. "]
6979 #[serde(default, skip_serializing_if = "Option::is_none")]
6980 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
6981}
6982
6983impl std::fmt::Display for PatchedMailAccountRequest {
6984 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6985 write!(
6986 f,
6987 "{}",
6988 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6989 )
6990 }
6991}
6992
6993#[cfg(feature = "tabled")]
6994impl tabled::Tabled for PatchedMailAccountRequest {
6995 const LENGTH: usize = 12;
6996 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6997 vec![
6998 if let Some(name) = &self.name {
6999 format!("{name:?}").into()
7000 } else {
7001 String::new().into()
7002 },
7003 if let Some(imap_server) = &self.imap_server {
7004 format!("{imap_server:?}").into()
7005 } else {
7006 String::new().into()
7007 },
7008 if let Some(imap_port) = &self.imap_port {
7009 format!("{imap_port:?}").into()
7010 } else {
7011 String::new().into()
7012 },
7013 if let Some(imap_security) = &self.imap_security {
7014 format!("{imap_security:?}").into()
7015 } else {
7016 String::new().into()
7017 },
7018 if let Some(username) = &self.username {
7019 format!("{username:?}").into()
7020 } else {
7021 String::new().into()
7022 },
7023 if let Some(password) = &self.password {
7024 format!("{password:?}").into()
7025 } else {
7026 String::new().into()
7027 },
7028 if let Some(character_set) = &self.character_set {
7029 format!("{character_set:?}").into()
7030 } else {
7031 String::new().into()
7032 },
7033 if let Some(is_token) = &self.is_token {
7034 format!("{is_token:?}").into()
7035 } else {
7036 String::new().into()
7037 },
7038 if let Some(owner) = &self.owner {
7039 format!("{owner:?}").into()
7040 } else {
7041 String::new().into()
7042 },
7043 if let Some(set_permissions) = &self.set_permissions {
7044 format!("{set_permissions:?}").into()
7045 } else {
7046 String::new().into()
7047 },
7048 if let Some(account_type) = &self.account_type {
7049 format!("{account_type:?}").into()
7050 } else {
7051 String::new().into()
7052 },
7053 if let Some(expiration) = &self.expiration {
7054 format!("{expiration:?}").into()
7055 } else {
7056 String::new().into()
7057 },
7058 ]
7059 }
7060
7061 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7062 vec![
7063 "name".into(),
7064 "imap_server".into(),
7065 "imap_port".into(),
7066 "imap_security".into(),
7067 "username".into(),
7068 "password".into(),
7069 "character_set".into(),
7070 "is_token".into(),
7071 "owner".into(),
7072 "set_permissions".into(),
7073 "account_type".into(),
7074 "expiration".into(),
7075 ]
7076 }
7077}
7078
7079#[derive(
7080 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7081)]
7082#[allow(non_snake_case)]
7083pub struct PatchedMailRuleRequest {
7084 #[serde(default, skip_serializing_if = "Option::is_none")]
7085 pub name: Option<String>,
7086 #[serde(default, skip_serializing_if = "Option::is_none")]
7087 pub account: Option<i64>,
7088 #[serde(default, skip_serializing_if = "Option::is_none")]
7089 pub enabled: Option<bool>,
7090 #[doc = "Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server."]
7091 #[serde(default, skip_serializing_if = "Option::is_none")]
7092 pub folder: Option<String>,
7093 #[serde(default, skip_serializing_if = "Option::is_none")]
7094 pub filter_from: Option<String>,
7095 #[serde(default, skip_serializing_if = "Option::is_none")]
7096 pub filter_to: Option<String>,
7097 #[serde(default, skip_serializing_if = "Option::is_none")]
7098 pub filter_subject: Option<String>,
7099 #[serde(default, skip_serializing_if = "Option::is_none")]
7100 pub filter_body: Option<String>,
7101 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
7102 #[serde(default, skip_serializing_if = "Option::is_none")]
7103 pub filter_attachment_filename_include: Option<String>,
7104 #[doc = "Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
7105 #[serde(default, skip_serializing_if = "Option::is_none")]
7106 pub filter_attachment_filename_exclude: Option<String>,
7107 #[doc = "Specified in days."]
7108 #[serde(default, skip_serializing_if = "Option::is_none")]
7109 pub maximum_age: Option<i64>,
7110 #[serde(default, skip_serializing_if = "Option::is_none")]
7111 pub action: Option<MailRuleActionEnum>,
7112 #[serde(default, skip_serializing_if = "Option::is_none")]
7113 pub action_parameter: Option<String>,
7114 #[serde(default, skip_serializing_if = "Option::is_none")]
7115 pub assign_title_from: Option<AssignTitleFromEnum>,
7116 #[serde(default, skip_serializing_if = "Option::is_none")]
7117 pub assign_tags: Option<Vec<Option<i64>>>,
7118 #[serde(default, skip_serializing_if = "Option::is_none")]
7119 pub assign_correspondent_from: Option<AssignCorrespondentFromEnum>,
7120 #[serde(default, skip_serializing_if = "Option::is_none")]
7121 pub assign_correspondent: Option<i64>,
7122 #[serde(default, skip_serializing_if = "Option::is_none")]
7123 pub assign_document_type: Option<i64>,
7124 #[serde(default, skip_serializing_if = "Option::is_none")]
7125 pub assign_owner_from_rule: Option<bool>,
7126 #[serde(default, skip_serializing_if = "Option::is_none")]
7127 pub order: Option<i64>,
7128 #[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."]
7129 #[serde(default, skip_serializing_if = "Option::is_none")]
7130 pub attachment_type: Option<AttachmentTypeEnum>,
7131 #[serde(default, skip_serializing_if = "Option::is_none")]
7132 pub consumption_scope: Option<ConsumptionScopeEnum>,
7133 #[serde(default, skip_serializing_if = "Option::is_none")]
7134 pub pdf_layout: Option<PdfLayoutEnum>,
7135 #[serde(default, skip_serializing_if = "Option::is_none")]
7136 pub owner: Option<i64>,
7137 #[serde(default, skip_serializing_if = "Option::is_none")]
7138 pub set_permissions: Option<SetPermissions>,
7139}
7140
7141impl std::fmt::Display for PatchedMailRuleRequest {
7142 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7143 write!(
7144 f,
7145 "{}",
7146 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7147 )
7148 }
7149}
7150
7151#[cfg(feature = "tabled")]
7152impl tabled::Tabled for PatchedMailRuleRequest {
7153 const LENGTH: usize = 25;
7154 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7155 vec![
7156 if let Some(name) = &self.name {
7157 format!("{name:?}").into()
7158 } else {
7159 String::new().into()
7160 },
7161 if let Some(account) = &self.account {
7162 format!("{account:?}").into()
7163 } else {
7164 String::new().into()
7165 },
7166 if let Some(enabled) = &self.enabled {
7167 format!("{enabled:?}").into()
7168 } else {
7169 String::new().into()
7170 },
7171 if let Some(folder) = &self.folder {
7172 format!("{folder:?}").into()
7173 } else {
7174 String::new().into()
7175 },
7176 if let Some(filter_from) = &self.filter_from {
7177 format!("{filter_from:?}").into()
7178 } else {
7179 String::new().into()
7180 },
7181 if let Some(filter_to) = &self.filter_to {
7182 format!("{filter_to:?}").into()
7183 } else {
7184 String::new().into()
7185 },
7186 if let Some(filter_subject) = &self.filter_subject {
7187 format!("{filter_subject:?}").into()
7188 } else {
7189 String::new().into()
7190 },
7191 if let Some(filter_body) = &self.filter_body {
7192 format!("{filter_body:?}").into()
7193 } else {
7194 String::new().into()
7195 },
7196 if let Some(filter_attachment_filename_include) =
7197 &self.filter_attachment_filename_include
7198 {
7199 format!("{filter_attachment_filename_include:?}").into()
7200 } else {
7201 String::new().into()
7202 },
7203 if let Some(filter_attachment_filename_exclude) =
7204 &self.filter_attachment_filename_exclude
7205 {
7206 format!("{filter_attachment_filename_exclude:?}").into()
7207 } else {
7208 String::new().into()
7209 },
7210 if let Some(maximum_age) = &self.maximum_age {
7211 format!("{maximum_age:?}").into()
7212 } else {
7213 String::new().into()
7214 },
7215 if let Some(action) = &self.action {
7216 format!("{action:?}").into()
7217 } else {
7218 String::new().into()
7219 },
7220 if let Some(action_parameter) = &self.action_parameter {
7221 format!("{action_parameter:?}").into()
7222 } else {
7223 String::new().into()
7224 },
7225 if let Some(assign_title_from) = &self.assign_title_from {
7226 format!("{assign_title_from:?}").into()
7227 } else {
7228 String::new().into()
7229 },
7230 if let Some(assign_tags) = &self.assign_tags {
7231 format!("{assign_tags:?}").into()
7232 } else {
7233 String::new().into()
7234 },
7235 if let Some(assign_correspondent_from) = &self.assign_correspondent_from {
7236 format!("{assign_correspondent_from:?}").into()
7237 } else {
7238 String::new().into()
7239 },
7240 if let Some(assign_correspondent) = &self.assign_correspondent {
7241 format!("{assign_correspondent:?}").into()
7242 } else {
7243 String::new().into()
7244 },
7245 if let Some(assign_document_type) = &self.assign_document_type {
7246 format!("{assign_document_type:?}").into()
7247 } else {
7248 String::new().into()
7249 },
7250 if let Some(assign_owner_from_rule) = &self.assign_owner_from_rule {
7251 format!("{assign_owner_from_rule:?}").into()
7252 } else {
7253 String::new().into()
7254 },
7255 if let Some(order) = &self.order {
7256 format!("{order:?}").into()
7257 } else {
7258 String::new().into()
7259 },
7260 if let Some(attachment_type) = &self.attachment_type {
7261 format!("{attachment_type:?}").into()
7262 } else {
7263 String::new().into()
7264 },
7265 if let Some(consumption_scope) = &self.consumption_scope {
7266 format!("{consumption_scope:?}").into()
7267 } else {
7268 String::new().into()
7269 },
7270 if let Some(pdf_layout) = &self.pdf_layout {
7271 format!("{pdf_layout:?}").into()
7272 } else {
7273 String::new().into()
7274 },
7275 if let Some(owner) = &self.owner {
7276 format!("{owner:?}").into()
7277 } else {
7278 String::new().into()
7279 },
7280 if let Some(set_permissions) = &self.set_permissions {
7281 format!("{set_permissions:?}").into()
7282 } else {
7283 String::new().into()
7284 },
7285 ]
7286 }
7287
7288 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7289 vec![
7290 "name".into(),
7291 "account".into(),
7292 "enabled".into(),
7293 "folder".into(),
7294 "filter_from".into(),
7295 "filter_to".into(),
7296 "filter_subject".into(),
7297 "filter_body".into(),
7298 "filter_attachment_filename_include".into(),
7299 "filter_attachment_filename_exclude".into(),
7300 "maximum_age".into(),
7301 "action".into(),
7302 "action_parameter".into(),
7303 "assign_title_from".into(),
7304 "assign_tags".into(),
7305 "assign_correspondent_from".into(),
7306 "assign_correspondent".into(),
7307 "assign_document_type".into(),
7308 "assign_owner_from_rule".into(),
7309 "order".into(),
7310 "attachment_type".into(),
7311 "consumption_scope".into(),
7312 "pdf_layout".into(),
7313 "owner".into(),
7314 "set_permissions".into(),
7315 ]
7316 }
7317}
7318
7319#[derive(
7320 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7321)]
7322#[allow(non_snake_case)]
7323pub struct PatchedProfileRequest {
7324 #[serde(default, skip_serializing_if = "Option::is_none")]
7325 pub email: Option<String>,
7326 #[serde(default, skip_serializing_if = "Option::is_none")]
7327 pub password: Option<String>,
7328 #[serde(default, skip_serializing_if = "Option::is_none")]
7329 pub first_name: Option<String>,
7330 #[serde(default, skip_serializing_if = "Option::is_none")]
7331 pub last_name: Option<String>,
7332}
7333
7334impl std::fmt::Display for PatchedProfileRequest {
7335 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7336 write!(
7337 f,
7338 "{}",
7339 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7340 )
7341 }
7342}
7343
7344#[cfg(feature = "tabled")]
7345impl tabled::Tabled for PatchedProfileRequest {
7346 const LENGTH: usize = 4;
7347 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7348 vec![
7349 if let Some(email) = &self.email {
7350 format!("{email:?}").into()
7351 } else {
7352 String::new().into()
7353 },
7354 if let Some(password) = &self.password {
7355 format!("{password:?}").into()
7356 } else {
7357 String::new().into()
7358 },
7359 if let Some(first_name) = &self.first_name {
7360 format!("{first_name:?}").into()
7361 } else {
7362 String::new().into()
7363 },
7364 if let Some(last_name) = &self.last_name {
7365 format!("{last_name:?}").into()
7366 } else {
7367 String::new().into()
7368 },
7369 ]
7370 }
7371
7372 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7373 vec![
7374 "email".into(),
7375 "password".into(),
7376 "first_name".into(),
7377 "last_name".into(),
7378 ]
7379 }
7380}
7381
7382#[derive(
7383 serde :: Serialize,
7384 serde :: Deserialize,
7385 PartialEq,
7386 Hash,
7387 Debug,
7388 Clone,
7389 schemars :: JsonSchema,
7390 parse_display :: FromStr,
7391 parse_display :: Display,
7392)]
7393#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
7394#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7395pub enum DisplayMode {
7396 #[serde(rename = "table")]
7397 #[display("table")]
7398 Table,
7399 #[serde(rename = "smallCards")]
7400 #[display("smallCards")]
7401 SmallCards,
7402 #[serde(rename = "largeCards")]
7403 #[display("largeCards")]
7404 LargeCards,
7405 #[serde(rename = "")]
7406 #[display("")]
7407 Empty,
7408}
7409
7410#[derive(
7411 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7412)]
7413#[allow(non_snake_case)]
7414pub struct PatchedSavedViewRequest {
7415 #[serde(default, skip_serializing_if = "Option::is_none")]
7416 pub name: Option<String>,
7417 #[serde(default, skip_serializing_if = "Option::is_none")]
7418 pub show_on_dashboard: Option<bool>,
7419 #[serde(default, skip_serializing_if = "Option::is_none")]
7420 pub show_in_sidebar: Option<bool>,
7421 #[serde(default, skip_serializing_if = "Option::is_none")]
7422 pub sort_field: Option<String>,
7423 #[serde(default, skip_serializing_if = "Option::is_none")]
7424 pub sort_reverse: Option<bool>,
7425 #[serde(default, skip_serializing_if = "Option::is_none")]
7426 pub filter_rules: Option<Vec<SavedViewFilterRuleRequest>>,
7427 #[serde(default, skip_serializing_if = "Option::is_none")]
7428 pub page_size: Option<i64>,
7429 #[serde(default, skip_serializing_if = "Option::is_none")]
7430 pub display_mode: Option<DisplayMode>,
7431 #[serde(default, skip_serializing_if = "Option::is_none")]
7432 pub display_fields: Option<serde_json::Value>,
7433 #[serde(default, skip_serializing_if = "Option::is_none")]
7434 pub owner: Option<i64>,
7435}
7436
7437impl std::fmt::Display for PatchedSavedViewRequest {
7438 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7439 write!(
7440 f,
7441 "{}",
7442 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7443 )
7444 }
7445}
7446
7447#[cfg(feature = "tabled")]
7448impl tabled::Tabled for PatchedSavedViewRequest {
7449 const LENGTH: usize = 10;
7450 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7451 vec![
7452 if let Some(name) = &self.name {
7453 format!("{name:?}").into()
7454 } else {
7455 String::new().into()
7456 },
7457 if let Some(show_on_dashboard) = &self.show_on_dashboard {
7458 format!("{show_on_dashboard:?}").into()
7459 } else {
7460 String::new().into()
7461 },
7462 if let Some(show_in_sidebar) = &self.show_in_sidebar {
7463 format!("{show_in_sidebar:?}").into()
7464 } else {
7465 String::new().into()
7466 },
7467 if let Some(sort_field) = &self.sort_field {
7468 format!("{sort_field:?}").into()
7469 } else {
7470 String::new().into()
7471 },
7472 if let Some(sort_reverse) = &self.sort_reverse {
7473 format!("{sort_reverse:?}").into()
7474 } else {
7475 String::new().into()
7476 },
7477 if let Some(filter_rules) = &self.filter_rules {
7478 format!("{filter_rules:?}").into()
7479 } else {
7480 String::new().into()
7481 },
7482 if let Some(page_size) = &self.page_size {
7483 format!("{page_size:?}").into()
7484 } else {
7485 String::new().into()
7486 },
7487 if let Some(display_mode) = &self.display_mode {
7488 format!("{display_mode:?}").into()
7489 } else {
7490 String::new().into()
7491 },
7492 if let Some(display_fields) = &self.display_fields {
7493 format!("{display_fields:?}").into()
7494 } else {
7495 String::new().into()
7496 },
7497 if let Some(owner) = &self.owner {
7498 format!("{owner:?}").into()
7499 } else {
7500 String::new().into()
7501 },
7502 ]
7503 }
7504
7505 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7506 vec![
7507 "name".into(),
7508 "show_on_dashboard".into(),
7509 "show_in_sidebar".into(),
7510 "sort_field".into(),
7511 "sort_reverse".into(),
7512 "filter_rules".into(),
7513 "page_size".into(),
7514 "display_mode".into(),
7515 "display_fields".into(),
7516 "owner".into(),
7517 ]
7518 }
7519}
7520
7521#[derive(
7522 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7523)]
7524#[allow(non_snake_case)]
7525pub struct PatchedStoragePathRequest {
7526 #[serde(default, skip_serializing_if = "Option::is_none")]
7527 pub name: Option<String>,
7528 #[serde(default, skip_serializing_if = "Option::is_none")]
7529 pub path: Option<String>,
7530 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
7531 pub match_: Option<String>,
7532 #[serde(default, skip_serializing_if = "Option::is_none")]
7533 pub matching_algorithm: Option<MatchingAlgorithm>,
7534 #[serde(default, skip_serializing_if = "Option::is_none")]
7535 pub is_insensitive: Option<bool>,
7536 #[serde(default, skip_serializing_if = "Option::is_none")]
7537 pub owner: Option<i64>,
7538 #[serde(default, skip_serializing_if = "Option::is_none")]
7539 pub set_permissions: Option<SetPermissions>,
7540}
7541
7542impl std::fmt::Display for PatchedStoragePathRequest {
7543 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7544 write!(
7545 f,
7546 "{}",
7547 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7548 )
7549 }
7550}
7551
7552#[cfg(feature = "tabled")]
7553impl tabled::Tabled for PatchedStoragePathRequest {
7554 const LENGTH: usize = 7;
7555 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7556 vec![
7557 if let Some(name) = &self.name {
7558 format!("{name:?}").into()
7559 } else {
7560 String::new().into()
7561 },
7562 if let Some(path) = &self.path {
7563 format!("{path:?}").into()
7564 } else {
7565 String::new().into()
7566 },
7567 if let Some(match_) = &self.match_ {
7568 format!("{match_:?}").into()
7569 } else {
7570 String::new().into()
7571 },
7572 if let Some(matching_algorithm) = &self.matching_algorithm {
7573 format!("{matching_algorithm:?}").into()
7574 } else {
7575 String::new().into()
7576 },
7577 if let Some(is_insensitive) = &self.is_insensitive {
7578 format!("{is_insensitive:?}").into()
7579 } else {
7580 String::new().into()
7581 },
7582 if let Some(owner) = &self.owner {
7583 format!("{owner:?}").into()
7584 } else {
7585 String::new().into()
7586 },
7587 if let Some(set_permissions) = &self.set_permissions {
7588 format!("{set_permissions:?}").into()
7589 } else {
7590 String::new().into()
7591 },
7592 ]
7593 }
7594
7595 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7596 vec![
7597 "name".into(),
7598 "path".into(),
7599 "match_".into(),
7600 "matching_algorithm".into(),
7601 "is_insensitive".into(),
7602 "owner".into(),
7603 "set_permissions".into(),
7604 ]
7605 }
7606}
7607
7608#[derive(
7609 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7610)]
7611#[allow(non_snake_case)]
7612pub struct PatchedTagRequest {
7613 #[serde(default, skip_serializing_if = "Option::is_none")]
7614 pub name: Option<String>,
7615 #[serde(default, skip_serializing_if = "Option::is_none")]
7616 pub color: Option<String>,
7617 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
7618 pub match_: Option<String>,
7619 #[serde(default, skip_serializing_if = "Option::is_none")]
7620 pub matching_algorithm: Option<MatchingAlgorithm>,
7621 #[serde(default, skip_serializing_if = "Option::is_none")]
7622 pub is_insensitive: Option<bool>,
7623 #[doc = "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."]
7624 #[serde(default, skip_serializing_if = "Option::is_none")]
7625 pub is_inbox_tag: Option<bool>,
7626 #[serde(default, skip_serializing_if = "Option::is_none")]
7627 pub owner: Option<i64>,
7628 #[serde(default, skip_serializing_if = "Option::is_none")]
7629 pub set_permissions: Option<SetPermissions>,
7630 #[serde(default, skip_serializing_if = "Option::is_none")]
7631 pub parent: Option<i64>,
7632}
7633
7634impl std::fmt::Display for PatchedTagRequest {
7635 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7636 write!(
7637 f,
7638 "{}",
7639 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7640 )
7641 }
7642}
7643
7644#[cfg(feature = "tabled")]
7645impl tabled::Tabled for PatchedTagRequest {
7646 const LENGTH: usize = 9;
7647 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7648 vec![
7649 if let Some(name) = &self.name {
7650 format!("{name:?}").into()
7651 } else {
7652 String::new().into()
7653 },
7654 if let Some(color) = &self.color {
7655 format!("{color:?}").into()
7656 } else {
7657 String::new().into()
7658 },
7659 if let Some(match_) = &self.match_ {
7660 format!("{match_:?}").into()
7661 } else {
7662 String::new().into()
7663 },
7664 if let Some(matching_algorithm) = &self.matching_algorithm {
7665 format!("{matching_algorithm:?}").into()
7666 } else {
7667 String::new().into()
7668 },
7669 if let Some(is_insensitive) = &self.is_insensitive {
7670 format!("{is_insensitive:?}").into()
7671 } else {
7672 String::new().into()
7673 },
7674 if let Some(is_inbox_tag) = &self.is_inbox_tag {
7675 format!("{is_inbox_tag:?}").into()
7676 } else {
7677 String::new().into()
7678 },
7679 if let Some(owner) = &self.owner {
7680 format!("{owner:?}").into()
7681 } else {
7682 String::new().into()
7683 },
7684 if let Some(set_permissions) = &self.set_permissions {
7685 format!("{set_permissions:?}").into()
7686 } else {
7687 String::new().into()
7688 },
7689 if let Some(parent) = &self.parent {
7690 format!("{parent:?}").into()
7691 } else {
7692 String::new().into()
7693 },
7694 ]
7695 }
7696
7697 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7698 vec![
7699 "name".into(),
7700 "color".into(),
7701 "match_".into(),
7702 "matching_algorithm".into(),
7703 "is_insensitive".into(),
7704 "is_inbox_tag".into(),
7705 "owner".into(),
7706 "set_permissions".into(),
7707 "parent".into(),
7708 ]
7709 }
7710}
7711
7712#[derive(
7713 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7714)]
7715#[allow(non_snake_case)]
7716pub struct PatchedUserRequest {
7717 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
7718 #[serde(default, skip_serializing_if = "Option::is_none")]
7719 pub username: Option<String>,
7720 #[serde(default, skip_serializing_if = "Option::is_none")]
7721 pub email: Option<String>,
7722 #[serde(default, skip_serializing_if = "Option::is_none")]
7723 pub password: Option<String>,
7724 #[serde(default, skip_serializing_if = "Option::is_none")]
7725 pub first_name: Option<String>,
7726 #[serde(default, skip_serializing_if = "Option::is_none")]
7727 pub last_name: Option<String>,
7728 #[serde(default, skip_serializing_if = "Option::is_none")]
7729 pub date_joined: Option<chrono::DateTime<chrono::Utc>>,
7730 #[doc = "Designates whether the user can log into this admin site."]
7731 #[serde(default, skip_serializing_if = "Option::is_none")]
7732 pub is_staff: Option<bool>,
7733 #[doc = "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."]
7734 #[serde(default, skip_serializing_if = "Option::is_none")]
7735 pub is_active: Option<bool>,
7736 #[doc = "Designates that this user has all permissions without explicitly assigning them."]
7737 #[serde(default, skip_serializing_if = "Option::is_none")]
7738 pub is_superuser: Option<bool>,
7739 #[doc = "The groups this user belongs to. A user will get all permissions granted to each of their groups."]
7740 #[serde(default, skip_serializing_if = "Option::is_none")]
7741 pub groups: Option<Vec<i64>>,
7742 #[serde(default, skip_serializing_if = "Option::is_none")]
7743 pub user_permissions: Option<Vec<String>>,
7744}
7745
7746impl std::fmt::Display for PatchedUserRequest {
7747 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7748 write!(
7749 f,
7750 "{}",
7751 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7752 )
7753 }
7754}
7755
7756#[cfg(feature = "tabled")]
7757impl tabled::Tabled for PatchedUserRequest {
7758 const LENGTH: usize = 11;
7759 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7760 vec![
7761 if let Some(username) = &self.username {
7762 format!("{username:?}").into()
7763 } else {
7764 String::new().into()
7765 },
7766 if let Some(email) = &self.email {
7767 format!("{email:?}").into()
7768 } else {
7769 String::new().into()
7770 },
7771 if let Some(password) = &self.password {
7772 format!("{password:?}").into()
7773 } else {
7774 String::new().into()
7775 },
7776 if let Some(first_name) = &self.first_name {
7777 format!("{first_name:?}").into()
7778 } else {
7779 String::new().into()
7780 },
7781 if let Some(last_name) = &self.last_name {
7782 format!("{last_name:?}").into()
7783 } else {
7784 String::new().into()
7785 },
7786 if let Some(date_joined) = &self.date_joined {
7787 format!("{date_joined:?}").into()
7788 } else {
7789 String::new().into()
7790 },
7791 if let Some(is_staff) = &self.is_staff {
7792 format!("{is_staff:?}").into()
7793 } else {
7794 String::new().into()
7795 },
7796 if let Some(is_active) = &self.is_active {
7797 format!("{is_active:?}").into()
7798 } else {
7799 String::new().into()
7800 },
7801 if let Some(is_superuser) = &self.is_superuser {
7802 format!("{is_superuser:?}").into()
7803 } else {
7804 String::new().into()
7805 },
7806 if let Some(groups) = &self.groups {
7807 format!("{groups:?}").into()
7808 } else {
7809 String::new().into()
7810 },
7811 if let Some(user_permissions) = &self.user_permissions {
7812 format!("{user_permissions:?}").into()
7813 } else {
7814 String::new().into()
7815 },
7816 ]
7817 }
7818
7819 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7820 vec![
7821 "username".into(),
7822 "email".into(),
7823 "password".into(),
7824 "first_name".into(),
7825 "last_name".into(),
7826 "date_joined".into(),
7827 "is_staff".into(),
7828 "is_active".into(),
7829 "is_superuser".into(),
7830 "groups".into(),
7831 "user_permissions".into(),
7832 ]
7833 }
7834}
7835
7836#[derive(
7837 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7838)]
7839#[allow(non_snake_case)]
7840pub struct PatchedWorkflowActionRequest {
7841 #[serde(default, skip_serializing_if = "Option::is_none")]
7842 pub id: Option<i64>,
7843 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
7844 pub type_: Option<WorkflowActionTypeEnum>,
7845 #[doc = "Assign a document title, must be a Jinja2 template, see documentation."]
7846 #[serde(default, skip_serializing_if = "Option::is_none")]
7847 pub assign_title: Option<String>,
7848 #[serde(default, skip_serializing_if = "Option::is_none")]
7849 pub assign_tags: Option<Vec<Option<i64>>>,
7850 #[serde(default, skip_serializing_if = "Option::is_none")]
7851 pub assign_correspondent: Option<i64>,
7852 #[serde(default, skip_serializing_if = "Option::is_none")]
7853 pub assign_document_type: Option<i64>,
7854 #[serde(default, skip_serializing_if = "Option::is_none")]
7855 pub assign_storage_path: Option<i64>,
7856 #[serde(default, skip_serializing_if = "Option::is_none")]
7857 pub assign_owner: Option<i64>,
7858 #[serde(default, skip_serializing_if = "Option::is_none")]
7859 pub assign_view_users: Option<Vec<i64>>,
7860 #[serde(default, skip_serializing_if = "Option::is_none")]
7861 pub assign_view_groups: Option<Vec<i64>>,
7862 #[serde(default, skip_serializing_if = "Option::is_none")]
7863 pub assign_change_users: Option<Vec<i64>>,
7864 #[serde(default, skip_serializing_if = "Option::is_none")]
7865 pub assign_change_groups: Option<Vec<i64>>,
7866 #[serde(default, skip_serializing_if = "Option::is_none")]
7867 pub assign_custom_fields: Option<Vec<i64>>,
7868 #[doc = "Optional values to assign to the custom fields."]
7869 #[serde(default, skip_serializing_if = "Option::is_none")]
7870 pub assign_custom_fields_values: Option<serde_json::Value>,
7871 #[serde(default, skip_serializing_if = "Option::is_none")]
7872 pub remove_all_tags: Option<bool>,
7873 #[serde(default, skip_serializing_if = "Option::is_none")]
7874 pub remove_tags: Option<Vec<i64>>,
7875 #[serde(default, skip_serializing_if = "Option::is_none")]
7876 pub remove_all_correspondents: Option<bool>,
7877 #[serde(default, skip_serializing_if = "Option::is_none")]
7878 pub remove_correspondents: Option<Vec<i64>>,
7879 #[serde(default, skip_serializing_if = "Option::is_none")]
7880 pub remove_all_document_types: Option<bool>,
7881 #[serde(default, skip_serializing_if = "Option::is_none")]
7882 pub remove_document_types: Option<Vec<i64>>,
7883 #[serde(default, skip_serializing_if = "Option::is_none")]
7884 pub remove_all_storage_paths: Option<bool>,
7885 #[serde(default, skip_serializing_if = "Option::is_none")]
7886 pub remove_storage_paths: Option<Vec<i64>>,
7887 #[serde(default, skip_serializing_if = "Option::is_none")]
7888 pub remove_custom_fields: Option<Vec<i64>>,
7889 #[serde(default, skip_serializing_if = "Option::is_none")]
7890 pub remove_all_custom_fields: Option<bool>,
7891 #[serde(default, skip_serializing_if = "Option::is_none")]
7892 pub remove_all_owners: Option<bool>,
7893 #[serde(default, skip_serializing_if = "Option::is_none")]
7894 pub remove_owners: Option<Vec<i64>>,
7895 #[serde(default, skip_serializing_if = "Option::is_none")]
7896 pub remove_all_permissions: Option<bool>,
7897 #[serde(default, skip_serializing_if = "Option::is_none")]
7898 pub remove_view_users: Option<Vec<i64>>,
7899 #[serde(default, skip_serializing_if = "Option::is_none")]
7900 pub remove_view_groups: Option<Vec<i64>>,
7901 #[serde(default, skip_serializing_if = "Option::is_none")]
7902 pub remove_change_users: Option<Vec<i64>>,
7903 #[serde(default, skip_serializing_if = "Option::is_none")]
7904 pub remove_change_groups: Option<Vec<i64>>,
7905 #[serde(default, skip_serializing_if = "Option::is_none")]
7906 pub email: Option<WorkflowActionEmailRequest>,
7907 #[serde(default, skip_serializing_if = "Option::is_none")]
7908 pub webhook: Option<WorkflowActionWebhookRequest>,
7909}
7910
7911impl std::fmt::Display for PatchedWorkflowActionRequest {
7912 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7913 write!(
7914 f,
7915 "{}",
7916 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7917 )
7918 }
7919}
7920
7921#[cfg(feature = "tabled")]
7922impl tabled::Tabled for PatchedWorkflowActionRequest {
7923 const LENGTH: usize = 33;
7924 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7925 vec![
7926 if let Some(id) = &self.id {
7927 format!("{id:?}").into()
7928 } else {
7929 String::new().into()
7930 },
7931 if let Some(type_) = &self.type_ {
7932 format!("{type_:?}").into()
7933 } else {
7934 String::new().into()
7935 },
7936 if let Some(assign_title) = &self.assign_title {
7937 format!("{assign_title:?}").into()
7938 } else {
7939 String::new().into()
7940 },
7941 if let Some(assign_tags) = &self.assign_tags {
7942 format!("{assign_tags:?}").into()
7943 } else {
7944 String::new().into()
7945 },
7946 if let Some(assign_correspondent) = &self.assign_correspondent {
7947 format!("{assign_correspondent:?}").into()
7948 } else {
7949 String::new().into()
7950 },
7951 if let Some(assign_document_type) = &self.assign_document_type {
7952 format!("{assign_document_type:?}").into()
7953 } else {
7954 String::new().into()
7955 },
7956 if let Some(assign_storage_path) = &self.assign_storage_path {
7957 format!("{assign_storage_path:?}").into()
7958 } else {
7959 String::new().into()
7960 },
7961 if let Some(assign_owner) = &self.assign_owner {
7962 format!("{assign_owner:?}").into()
7963 } else {
7964 String::new().into()
7965 },
7966 if let Some(assign_view_users) = &self.assign_view_users {
7967 format!("{assign_view_users:?}").into()
7968 } else {
7969 String::new().into()
7970 },
7971 if let Some(assign_view_groups) = &self.assign_view_groups {
7972 format!("{assign_view_groups:?}").into()
7973 } else {
7974 String::new().into()
7975 },
7976 if let Some(assign_change_users) = &self.assign_change_users {
7977 format!("{assign_change_users:?}").into()
7978 } else {
7979 String::new().into()
7980 },
7981 if let Some(assign_change_groups) = &self.assign_change_groups {
7982 format!("{assign_change_groups:?}").into()
7983 } else {
7984 String::new().into()
7985 },
7986 if let Some(assign_custom_fields) = &self.assign_custom_fields {
7987 format!("{assign_custom_fields:?}").into()
7988 } else {
7989 String::new().into()
7990 },
7991 if let Some(assign_custom_fields_values) = &self.assign_custom_fields_values {
7992 format!("{assign_custom_fields_values:?}").into()
7993 } else {
7994 String::new().into()
7995 },
7996 if let Some(remove_all_tags) = &self.remove_all_tags {
7997 format!("{remove_all_tags:?}").into()
7998 } else {
7999 String::new().into()
8000 },
8001 if let Some(remove_tags) = &self.remove_tags {
8002 format!("{remove_tags:?}").into()
8003 } else {
8004 String::new().into()
8005 },
8006 if let Some(remove_all_correspondents) = &self.remove_all_correspondents {
8007 format!("{remove_all_correspondents:?}").into()
8008 } else {
8009 String::new().into()
8010 },
8011 if let Some(remove_correspondents) = &self.remove_correspondents {
8012 format!("{remove_correspondents:?}").into()
8013 } else {
8014 String::new().into()
8015 },
8016 if let Some(remove_all_document_types) = &self.remove_all_document_types {
8017 format!("{remove_all_document_types:?}").into()
8018 } else {
8019 String::new().into()
8020 },
8021 if let Some(remove_document_types) = &self.remove_document_types {
8022 format!("{remove_document_types:?}").into()
8023 } else {
8024 String::new().into()
8025 },
8026 if let Some(remove_all_storage_paths) = &self.remove_all_storage_paths {
8027 format!("{remove_all_storage_paths:?}").into()
8028 } else {
8029 String::new().into()
8030 },
8031 if let Some(remove_storage_paths) = &self.remove_storage_paths {
8032 format!("{remove_storage_paths:?}").into()
8033 } else {
8034 String::new().into()
8035 },
8036 if let Some(remove_custom_fields) = &self.remove_custom_fields {
8037 format!("{remove_custom_fields:?}").into()
8038 } else {
8039 String::new().into()
8040 },
8041 if let Some(remove_all_custom_fields) = &self.remove_all_custom_fields {
8042 format!("{remove_all_custom_fields:?}").into()
8043 } else {
8044 String::new().into()
8045 },
8046 if let Some(remove_all_owners) = &self.remove_all_owners {
8047 format!("{remove_all_owners:?}").into()
8048 } else {
8049 String::new().into()
8050 },
8051 if let Some(remove_owners) = &self.remove_owners {
8052 format!("{remove_owners:?}").into()
8053 } else {
8054 String::new().into()
8055 },
8056 if let Some(remove_all_permissions) = &self.remove_all_permissions {
8057 format!("{remove_all_permissions:?}").into()
8058 } else {
8059 String::new().into()
8060 },
8061 if let Some(remove_view_users) = &self.remove_view_users {
8062 format!("{remove_view_users:?}").into()
8063 } else {
8064 String::new().into()
8065 },
8066 if let Some(remove_view_groups) = &self.remove_view_groups {
8067 format!("{remove_view_groups:?}").into()
8068 } else {
8069 String::new().into()
8070 },
8071 if let Some(remove_change_users) = &self.remove_change_users {
8072 format!("{remove_change_users:?}").into()
8073 } else {
8074 String::new().into()
8075 },
8076 if let Some(remove_change_groups) = &self.remove_change_groups {
8077 format!("{remove_change_groups:?}").into()
8078 } else {
8079 String::new().into()
8080 },
8081 if let Some(email) = &self.email {
8082 format!("{email:?}").into()
8083 } else {
8084 String::new().into()
8085 },
8086 if let Some(webhook) = &self.webhook {
8087 format!("{webhook:?}").into()
8088 } else {
8089 String::new().into()
8090 },
8091 ]
8092 }
8093
8094 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8095 vec![
8096 "id".into(),
8097 "type_".into(),
8098 "assign_title".into(),
8099 "assign_tags".into(),
8100 "assign_correspondent".into(),
8101 "assign_document_type".into(),
8102 "assign_storage_path".into(),
8103 "assign_owner".into(),
8104 "assign_view_users".into(),
8105 "assign_view_groups".into(),
8106 "assign_change_users".into(),
8107 "assign_change_groups".into(),
8108 "assign_custom_fields".into(),
8109 "assign_custom_fields_values".into(),
8110 "remove_all_tags".into(),
8111 "remove_tags".into(),
8112 "remove_all_correspondents".into(),
8113 "remove_correspondents".into(),
8114 "remove_all_document_types".into(),
8115 "remove_document_types".into(),
8116 "remove_all_storage_paths".into(),
8117 "remove_storage_paths".into(),
8118 "remove_custom_fields".into(),
8119 "remove_all_custom_fields".into(),
8120 "remove_all_owners".into(),
8121 "remove_owners".into(),
8122 "remove_all_permissions".into(),
8123 "remove_view_users".into(),
8124 "remove_view_groups".into(),
8125 "remove_change_users".into(),
8126 "remove_change_groups".into(),
8127 "email".into(),
8128 "webhook".into(),
8129 ]
8130 }
8131}
8132
8133#[derive(
8134 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8135)]
8136#[allow(non_snake_case)]
8137pub struct PatchedWorkflowRequest {
8138 #[serde(default, skip_serializing_if = "Option::is_none")]
8139 pub name: Option<String>,
8140 #[serde(default, skip_serializing_if = "Option::is_none")]
8141 pub order: Option<i64>,
8142 #[serde(default, skip_serializing_if = "Option::is_none")]
8143 pub enabled: Option<bool>,
8144 #[serde(default, skip_serializing_if = "Option::is_none")]
8145 pub triggers: Option<Vec<WorkflowTriggerRequest>>,
8146 #[serde(default, skip_serializing_if = "Option::is_none")]
8147 pub actions: Option<Vec<WorkflowActionRequest>>,
8148}
8149
8150impl std::fmt::Display for PatchedWorkflowRequest {
8151 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8152 write!(
8153 f,
8154 "{}",
8155 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8156 )
8157 }
8158}
8159
8160#[cfg(feature = "tabled")]
8161impl tabled::Tabled for PatchedWorkflowRequest {
8162 const LENGTH: usize = 5;
8163 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8164 vec![
8165 if let Some(name) = &self.name {
8166 format!("{name:?}").into()
8167 } else {
8168 String::new().into()
8169 },
8170 if let Some(order) = &self.order {
8171 format!("{order:?}").into()
8172 } else {
8173 String::new().into()
8174 },
8175 if let Some(enabled) = &self.enabled {
8176 format!("{enabled:?}").into()
8177 } else {
8178 String::new().into()
8179 },
8180 if let Some(triggers) = &self.triggers {
8181 format!("{triggers:?}").into()
8182 } else {
8183 String::new().into()
8184 },
8185 if let Some(actions) = &self.actions {
8186 format!("{actions:?}").into()
8187 } else {
8188 String::new().into()
8189 },
8190 ]
8191 }
8192
8193 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8194 vec![
8195 "name".into(),
8196 "order".into(),
8197 "enabled".into(),
8198 "triggers".into(),
8199 "actions".into(),
8200 ]
8201 }
8202}
8203
8204#[derive(
8205 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8206)]
8207#[allow(non_snake_case)]
8208pub struct PatchedWorkflowTriggerRequest {
8209 #[serde(default, skip_serializing_if = "Option::is_none")]
8210 pub id: Option<i64>,
8211 #[serde(default)]
8212 pub sources: Vec<SourcesEnum>,
8213 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
8214 pub type_: Option<WorkflowTriggerTypeEnum>,
8215 #[doc = "Only consume documents with a path that matches this if specified. Wildcards specified as * are allowed. Case insensitive."]
8216 #[serde(default, skip_serializing_if = "Option::is_none")]
8217 pub filter_path: Option<String>,
8218 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
8219 #[serde(default, skip_serializing_if = "Option::is_none")]
8220 pub filter_filename: Option<String>,
8221 #[serde(default, skip_serializing_if = "Option::is_none")]
8222 pub filter_mailrule: Option<i64>,
8223 #[serde(default, skip_serializing_if = "Option::is_none")]
8224 pub matching_algorithm: Option<WorkflowTriggerMatchingAlgorithmEnum>,
8225 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
8226 pub match_: Option<String>,
8227 #[serde(default, skip_serializing_if = "Option::is_none")]
8228 pub is_insensitive: Option<bool>,
8229 #[serde(default, skip_serializing_if = "Option::is_none")]
8230 pub filter_has_tags: Option<Vec<i64>>,
8231 #[serde(default, skip_serializing_if = "Option::is_none")]
8232 pub filter_has_all_tags: Option<Vec<i64>>,
8233 #[serde(default, skip_serializing_if = "Option::is_none")]
8234 pub filter_has_not_tags: Option<Vec<i64>>,
8235 #[doc = "JSON-encoded custom field query expression."]
8236 #[serde(default, skip_serializing_if = "Option::is_none")]
8237 pub filter_custom_field_query: Option<String>,
8238 #[serde(default, skip_serializing_if = "Option::is_none")]
8239 pub filter_has_not_correspondents: Option<Vec<i64>>,
8240 #[serde(default, skip_serializing_if = "Option::is_none")]
8241 pub filter_has_not_document_types: Option<Vec<i64>>,
8242 #[serde(default, skip_serializing_if = "Option::is_none")]
8243 pub filter_has_not_storage_paths: Option<Vec<i64>>,
8244 #[serde(default, skip_serializing_if = "Option::is_none")]
8245 pub filter_has_correspondent: Option<i64>,
8246 #[serde(default, skip_serializing_if = "Option::is_none")]
8247 pub filter_has_document_type: Option<i64>,
8248 #[serde(default, skip_serializing_if = "Option::is_none")]
8249 pub filter_has_storage_path: Option<i64>,
8250 #[doc = "The number of days to offset the schedule trigger by."]
8251 #[serde(default, skip_serializing_if = "Option::is_none")]
8252 pub schedule_offset_days: Option<i64>,
8253 #[doc = "If the schedule should be recurring."]
8254 #[serde(default, skip_serializing_if = "Option::is_none")]
8255 pub schedule_is_recurring: Option<bool>,
8256 #[doc = "The number of days between recurring schedule triggers."]
8257 #[serde(default, skip_serializing_if = "Option::is_none")]
8258 pub schedule_recurring_interval_days: Option<i64>,
8259 #[doc = "The field to check for a schedule trigger.\n\n* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
8260 #[serde(default, skip_serializing_if = "Option::is_none")]
8261 pub schedule_date_field: Option<ScheduleDateFieldEnum>,
8262 #[serde(default, skip_serializing_if = "Option::is_none")]
8263 pub schedule_date_custom_field: Option<i64>,
8264}
8265
8266impl std::fmt::Display for PatchedWorkflowTriggerRequest {
8267 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8268 write!(
8269 f,
8270 "{}",
8271 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8272 )
8273 }
8274}
8275
8276#[cfg(feature = "tabled")]
8277impl tabled::Tabled for PatchedWorkflowTriggerRequest {
8278 const LENGTH: usize = 24;
8279 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8280 vec![
8281 if let Some(id) = &self.id {
8282 format!("{id:?}").into()
8283 } else {
8284 String::new().into()
8285 },
8286 format!("{:?}", self.sources).into(),
8287 if let Some(type_) = &self.type_ {
8288 format!("{type_:?}").into()
8289 } else {
8290 String::new().into()
8291 },
8292 if let Some(filter_path) = &self.filter_path {
8293 format!("{filter_path:?}").into()
8294 } else {
8295 String::new().into()
8296 },
8297 if let Some(filter_filename) = &self.filter_filename {
8298 format!("{filter_filename:?}").into()
8299 } else {
8300 String::new().into()
8301 },
8302 if let Some(filter_mailrule) = &self.filter_mailrule {
8303 format!("{filter_mailrule:?}").into()
8304 } else {
8305 String::new().into()
8306 },
8307 if let Some(matching_algorithm) = &self.matching_algorithm {
8308 format!("{matching_algorithm:?}").into()
8309 } else {
8310 String::new().into()
8311 },
8312 if let Some(match_) = &self.match_ {
8313 format!("{match_:?}").into()
8314 } else {
8315 String::new().into()
8316 },
8317 if let Some(is_insensitive) = &self.is_insensitive {
8318 format!("{is_insensitive:?}").into()
8319 } else {
8320 String::new().into()
8321 },
8322 if let Some(filter_has_tags) = &self.filter_has_tags {
8323 format!("{filter_has_tags:?}").into()
8324 } else {
8325 String::new().into()
8326 },
8327 if let Some(filter_has_all_tags) = &self.filter_has_all_tags {
8328 format!("{filter_has_all_tags:?}").into()
8329 } else {
8330 String::new().into()
8331 },
8332 if let Some(filter_has_not_tags) = &self.filter_has_not_tags {
8333 format!("{filter_has_not_tags:?}").into()
8334 } else {
8335 String::new().into()
8336 },
8337 if let Some(filter_custom_field_query) = &self.filter_custom_field_query {
8338 format!("{filter_custom_field_query:?}").into()
8339 } else {
8340 String::new().into()
8341 },
8342 if let Some(filter_has_not_correspondents) = &self.filter_has_not_correspondents {
8343 format!("{filter_has_not_correspondents:?}").into()
8344 } else {
8345 String::new().into()
8346 },
8347 if let Some(filter_has_not_document_types) = &self.filter_has_not_document_types {
8348 format!("{filter_has_not_document_types:?}").into()
8349 } else {
8350 String::new().into()
8351 },
8352 if let Some(filter_has_not_storage_paths) = &self.filter_has_not_storage_paths {
8353 format!("{filter_has_not_storage_paths:?}").into()
8354 } else {
8355 String::new().into()
8356 },
8357 if let Some(filter_has_correspondent) = &self.filter_has_correspondent {
8358 format!("{filter_has_correspondent:?}").into()
8359 } else {
8360 String::new().into()
8361 },
8362 if let Some(filter_has_document_type) = &self.filter_has_document_type {
8363 format!("{filter_has_document_type:?}").into()
8364 } else {
8365 String::new().into()
8366 },
8367 if let Some(filter_has_storage_path) = &self.filter_has_storage_path {
8368 format!("{filter_has_storage_path:?}").into()
8369 } else {
8370 String::new().into()
8371 },
8372 if let Some(schedule_offset_days) = &self.schedule_offset_days {
8373 format!("{schedule_offset_days:?}").into()
8374 } else {
8375 String::new().into()
8376 },
8377 if let Some(schedule_is_recurring) = &self.schedule_is_recurring {
8378 format!("{schedule_is_recurring:?}").into()
8379 } else {
8380 String::new().into()
8381 },
8382 if let Some(schedule_recurring_interval_days) = &self.schedule_recurring_interval_days {
8383 format!("{schedule_recurring_interval_days:?}").into()
8384 } else {
8385 String::new().into()
8386 },
8387 if let Some(schedule_date_field) = &self.schedule_date_field {
8388 format!("{schedule_date_field:?}").into()
8389 } else {
8390 String::new().into()
8391 },
8392 if let Some(schedule_date_custom_field) = &self.schedule_date_custom_field {
8393 format!("{schedule_date_custom_field:?}").into()
8394 } else {
8395 String::new().into()
8396 },
8397 ]
8398 }
8399
8400 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8401 vec![
8402 "id".into(),
8403 "sources".into(),
8404 "type_".into(),
8405 "filter_path".into(),
8406 "filter_filename".into(),
8407 "filter_mailrule".into(),
8408 "matching_algorithm".into(),
8409 "match_".into(),
8410 "is_insensitive".into(),
8411 "filter_has_tags".into(),
8412 "filter_has_all_tags".into(),
8413 "filter_has_not_tags".into(),
8414 "filter_custom_field_query".into(),
8415 "filter_has_not_correspondents".into(),
8416 "filter_has_not_document_types".into(),
8417 "filter_has_not_storage_paths".into(),
8418 "filter_has_correspondent".into(),
8419 "filter_has_document_type".into(),
8420 "filter_has_storage_path".into(),
8421 "schedule_offset_days".into(),
8422 "schedule_is_recurring".into(),
8423 "schedule_recurring_interval_days".into(),
8424 "schedule_date_field".into(),
8425 "schedule_date_custom_field".into(),
8426 ]
8427 }
8428}
8429
8430#[doc = "* `0` - System default\n* `1` - Text, then HTML\n* `2` - HTML, then text\n* `3` - HTML only\n* `4` - Text only"]
8431#[derive(
8432 serde_repr :: Serialize_repr,
8433 serde_repr :: Deserialize_repr,
8434 PartialEq,
8435 Hash,
8436 Debug,
8437 Clone,
8438 Copy,
8439 schemars :: JsonSchema,
8440)]
8441#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
8442#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8443#[repr(i64)]
8444pub enum PdfLayoutEnum {
8445 #[doc = "System default"]
8446 SystemDefault = 0,
8447 #[doc = "Text, then HTML"]
8448 TextThenHTML = 1,
8449 #[doc = "HTML, then text"]
8450 HtmlThenText = 2,
8451 #[doc = "HTML only"]
8452 HtmlOnly = 3,
8453 #[doc = "Text only"]
8454 TextOnly = 4,
8455}
8456
8457#[derive(
8458 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8459)]
8460#[allow(non_snake_case)]
8461pub struct PostDocumentRequest {
8462 #[serde(default, skip_serializing_if = "Option::is_none")]
8463 pub created: Option<chrono::DateTime<chrono::Utc>>,
8464 pub document: bytes::Bytes,
8465 #[serde(default, skip_serializing_if = "Option::is_none")]
8466 pub title: Option<String>,
8467 #[serde(default, skip_serializing_if = "Option::is_none")]
8468 pub correspondent: Option<i64>,
8469 #[serde(default, skip_serializing_if = "Option::is_none")]
8470 pub document_type: Option<i64>,
8471 #[serde(default, skip_serializing_if = "Option::is_none")]
8472 pub storage_path: Option<i64>,
8473 #[serde(default, skip_serializing_if = "Option::is_none")]
8474 pub tags: Option<Vec<i64>>,
8475 #[serde(default, skip_serializing_if = "Option::is_none")]
8476 pub archive_serial_number: Option<i64>,
8477 #[serde(default, skip_serializing_if = "Option::is_none")]
8478 pub custom_fields: Option<serde_json::Value>,
8479 #[serde(default, skip_serializing_if = "Option::is_none")]
8480 pub from_webui: Option<bool>,
8481}
8482
8483impl std::fmt::Display for PostDocumentRequest {
8484 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8485 write!(
8486 f,
8487 "{}",
8488 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8489 )
8490 }
8491}
8492
8493#[cfg(feature = "tabled")]
8494impl tabled::Tabled for PostDocumentRequest {
8495 const LENGTH: usize = 10;
8496 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8497 vec![
8498 if let Some(created) = &self.created {
8499 format!("{created:?}").into()
8500 } else {
8501 String::new().into()
8502 },
8503 format!("{:?}", self.document).into(),
8504 if let Some(title) = &self.title {
8505 format!("{title:?}").into()
8506 } else {
8507 String::new().into()
8508 },
8509 if let Some(correspondent) = &self.correspondent {
8510 format!("{correspondent:?}").into()
8511 } else {
8512 String::new().into()
8513 },
8514 if let Some(document_type) = &self.document_type {
8515 format!("{document_type:?}").into()
8516 } else {
8517 String::new().into()
8518 },
8519 if let Some(storage_path) = &self.storage_path {
8520 format!("{storage_path:?}").into()
8521 } else {
8522 String::new().into()
8523 },
8524 if let Some(tags) = &self.tags {
8525 format!("{tags:?}").into()
8526 } else {
8527 String::new().into()
8528 },
8529 if let Some(archive_serial_number) = &self.archive_serial_number {
8530 format!("{archive_serial_number:?}").into()
8531 } else {
8532 String::new().into()
8533 },
8534 if let Some(custom_fields) = &self.custom_fields {
8535 format!("{custom_fields:?}").into()
8536 } else {
8537 String::new().into()
8538 },
8539 if let Some(from_webui) = &self.from_webui {
8540 format!("{from_webui:?}").into()
8541 } else {
8542 String::new().into()
8543 },
8544 ]
8545 }
8546
8547 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8548 vec![
8549 "created".into(),
8550 "document".into(),
8551 "title".into(),
8552 "correspondent".into(),
8553 "document_type".into(),
8554 "storage_path".into(),
8555 "tags".into(),
8556 "archive_serial_number".into(),
8557 "custom_fields".into(),
8558 "from_webui".into(),
8559 ]
8560 }
8561}
8562
8563#[derive(
8564 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8565)]
8566#[allow(non_snake_case)]
8567pub struct ProcessedMail {
8568 pub id: i64,
8569 #[serde(default, skip_serializing_if = "Option::is_none")]
8570 pub owner: Option<i64>,
8571 pub rule: i64,
8572 pub folder: String,
8573 pub uid: String,
8574 pub subject: String,
8575 pub received: chrono::DateTime<chrono::Utc>,
8576 pub processed: chrono::DateTime<chrono::Utc>,
8577 pub status: String,
8578 #[serde(default)]
8579 pub error: Option<String>,
8580}
8581
8582impl std::fmt::Display for ProcessedMail {
8583 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8584 write!(
8585 f,
8586 "{}",
8587 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8588 )
8589 }
8590}
8591
8592#[cfg(feature = "tabled")]
8593impl tabled::Tabled for ProcessedMail {
8594 const LENGTH: usize = 10;
8595 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8596 vec![
8597 format!("{:?}", self.id).into(),
8598 if let Some(owner) = &self.owner {
8599 format!("{owner:?}").into()
8600 } else {
8601 String::new().into()
8602 },
8603 format!("{:?}", self.rule).into(),
8604 self.folder.clone().into(),
8605 self.uid.clone().into(),
8606 self.subject.clone().into(),
8607 format!("{:?}", self.received).into(),
8608 format!("{:?}", self.processed).into(),
8609 self.status.clone().into(),
8610 format!("{:?}", self.error).into(),
8611 ]
8612 }
8613
8614 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8615 vec![
8616 "id".into(),
8617 "owner".into(),
8618 "rule".into(),
8619 "folder".into(),
8620 "uid".into(),
8621 "subject".into(),
8622 "received".into(),
8623 "processed".into(),
8624 "status".into(),
8625 "error".into(),
8626 ]
8627 }
8628}
8629
8630#[derive(
8631 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8632)]
8633#[allow(non_snake_case)]
8634pub struct ProcessedMailRequest {
8635 #[serde(default, skip_serializing_if = "Option::is_none")]
8636 pub owner: Option<i64>,
8637}
8638
8639impl std::fmt::Display for ProcessedMailRequest {
8640 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8641 write!(
8642 f,
8643 "{}",
8644 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8645 )
8646 }
8647}
8648
8649#[cfg(feature = "tabled")]
8650impl tabled::Tabled for ProcessedMailRequest {
8651 const LENGTH: usize = 1;
8652 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8653 vec![if let Some(owner) = &self.owner {
8654 format!("{owner:?}").into()
8655 } else {
8656 String::new().into()
8657 }]
8658 }
8659
8660 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8661 vec!["owner".into()]
8662 }
8663}
8664
8665#[derive(
8666 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8667)]
8668#[allow(non_snake_case)]
8669pub struct Profile {
8670 #[serde(default, skip_serializing_if = "Option::is_none")]
8671 pub email: Option<String>,
8672 #[serde(default, skip_serializing_if = "Option::is_none")]
8673 pub password: Option<String>,
8674 #[serde(default, skip_serializing_if = "Option::is_none")]
8675 pub first_name: Option<String>,
8676 #[serde(default, skip_serializing_if = "Option::is_none")]
8677 pub last_name: Option<String>,
8678 pub auth_token: String,
8679 pub social_accounts: Vec<SocialAccount>,
8680 pub has_usable_password: bool,
8681 pub is_mfa_enabled: bool,
8682}
8683
8684impl std::fmt::Display for Profile {
8685 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8686 write!(
8687 f,
8688 "{}",
8689 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8690 )
8691 }
8692}
8693
8694#[cfg(feature = "tabled")]
8695impl tabled::Tabled for Profile {
8696 const LENGTH: usize = 8;
8697 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8698 vec![
8699 if let Some(email) = &self.email {
8700 format!("{email:?}").into()
8701 } else {
8702 String::new().into()
8703 },
8704 if let Some(password) = &self.password {
8705 format!("{password:?}").into()
8706 } else {
8707 String::new().into()
8708 },
8709 if let Some(first_name) = &self.first_name {
8710 format!("{first_name:?}").into()
8711 } else {
8712 String::new().into()
8713 },
8714 if let Some(last_name) = &self.last_name {
8715 format!("{last_name:?}").into()
8716 } else {
8717 String::new().into()
8718 },
8719 self.auth_token.clone().into(),
8720 format!("{:?}", self.social_accounts).into(),
8721 format!("{:?}", self.has_usable_password).into(),
8722 format!("{:?}", self.is_mfa_enabled).into(),
8723 ]
8724 }
8725
8726 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8727 vec![
8728 "email".into(),
8729 "password".into(),
8730 "first_name".into(),
8731 "last_name".into(),
8732 "auth_token".into(),
8733 "social_accounts".into(),
8734 "has_usable_password".into(),
8735 "is_mfa_enabled".into(),
8736 ]
8737 }
8738}
8739
8740#[doc = "* `0` - title contains\n* `1` - content contains\n* `2` - ASN is\n* `3` - correspondent is\n* `4` - document type is\n* `5` - is in inbox\n* `6` - has tag\n* `7` - has any tag\n* `8` - created before\n* `9` - created after\n* `10` - created year is\n* `11` - created month is\n* `12` - created day is\n* `13` - added before\n* `14` - added after\n* `15` - modified before\n* `16` - modified after\n* `17` - does not have tag\n* `18` - does not have ASN\n* `19` - title or content contains\n* `20` - fulltext query\n* `21` - more like this\n* `22` - has tags in\n* `23` - ASN greater than\n* `24` - ASN less than\n* `25` - storage path is\n* `26` - has correspondent in\n* `27` - does not have correspondent in\n* `28` - has document type in\n* `29` - does not have document type in\n* `30` - has storage path in\n* `31` - does not have storage path in\n* `32` - owner is\n* `33` - has owner in\n* `34` - does not have owner\n* `35` - does not have owner in\n* `36` - has custom field value\n* `37` - is shared by me\n* `38` - has custom fields\n* `39` - has custom field in\n* `40` - does not have custom field in\n* `41` - does not have custom field\n* `42` - custom fields query\n* `43` - created to\n* `44` - created from\n* `45` - added to\n* `46` - added from\n* `47` - mime type is"]
8741#[derive(
8742 serde_repr :: Serialize_repr,
8743 serde_repr :: Deserialize_repr,
8744 PartialEq,
8745 Hash,
8746 Debug,
8747 Clone,
8748 Copy,
8749 schemars :: JsonSchema,
8750)]
8751#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
8752#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8753#[repr(i64)]
8754pub enum RuleTypeEnum {
8755 #[doc = "title contains"]
8756 TitleContains = 0,
8757 #[doc = "content contains"]
8758 ContentContains = 1,
8759 #[doc = "ASN is"]
8760 AsnIs = 2,
8761 #[doc = "correspondent is"]
8762 CorrespondentIs = 3,
8763 #[doc = "document type is"]
8764 DocumentTypeIs = 4,
8765 #[doc = "is in inbox"]
8766 IsInInbox = 5,
8767 #[doc = "has tag"]
8768 HasTag = 6,
8769 #[doc = "has any tag"]
8770 HasAnyTag = 7,
8771 #[doc = "created before"]
8772 CreatedBefore = 8,
8773 #[doc = "created after"]
8774 CreatedAfter = 9,
8775 #[doc = "created year is"]
8776 CreatedYearIs = 10,
8777 #[doc = "created month is"]
8778 CreatedMonthIs = 11,
8779 #[doc = "created day is"]
8780 CreatedDayIs = 12,
8781 #[doc = "added before"]
8782 AddedBefore = 13,
8783 #[doc = "added after"]
8784 AddedAfter = 14,
8785 #[doc = "modified before"]
8786 ModifiedBefore = 15,
8787 #[doc = "modified after"]
8788 ModifiedAfter = 16,
8789 #[doc = "does not have tag"]
8790 DoesNotHaveTag = 17,
8791 #[doc = "does not have ASN"]
8792 DoesNotHaveASN = 18,
8793 #[doc = "title or content contains"]
8794 TitleOrContentContains = 19,
8795 #[doc = "fulltext query"]
8796 FulltextQuery = 20,
8797 #[doc = "more like this"]
8798 MoreLikeThis = 21,
8799 #[doc = "has tags in"]
8800 HasTagsIn = 22,
8801 #[doc = "ASN greater than"]
8802 AsnGreaterThan = 23,
8803 #[doc = "ASN less than"]
8804 AsnLessThan = 24,
8805 #[doc = "storage path is"]
8806 StoragePathIs = 25,
8807 #[doc = "has correspondent in"]
8808 HasCorrespondentIn = 26,
8809 #[doc = "does not have correspondent in"]
8810 DoesNotHaveCorrespondentIn = 27,
8811 #[doc = "has document type in"]
8812 HasDocumentTypeIn = 28,
8813 #[doc = "does not have document type in"]
8814 DoesNotHaveDocumentTypeIn = 29,
8815 #[doc = "has storage path in"]
8816 HasStoragePathIn = 30,
8817 #[doc = "does not have storage path in"]
8818 DoesNotHaveStoragePathIn = 31,
8819 #[doc = "owner is"]
8820 OwnerIs = 32,
8821 #[doc = "has owner in"]
8822 HasOwnerIn = 33,
8823 #[doc = "does not have owner"]
8824 DoesNotHaveOwner = 34,
8825 #[doc = "does not have owner in"]
8826 DoesNotHaveOwnerIn = 35,
8827 #[doc = "has custom field value"]
8828 HasCustomFieldValue = 36,
8829 #[doc = "is shared by me"]
8830 IsSharedByMe = 37,
8831 #[doc = "has custom fields"]
8832 HasCustomFields = 38,
8833 #[doc = "has custom field in"]
8834 HasCustomFieldIn = 39,
8835 #[doc = "does not have custom field in"]
8836 DoesNotHaveCustomFieldIn = 40,
8837 #[doc = "does not have custom field"]
8838 DoesNotHaveCustomField = 41,
8839 #[doc = "custom fields query"]
8840 CustomFieldsQuery = 42,
8841 #[doc = "created to"]
8842 CreatedTo = 43,
8843 #[doc = "created from"]
8844 CreatedFrom = 44,
8845 #[doc = "added to"]
8846 AddedTo = 45,
8847 #[doc = "added from"]
8848 AddedFrom = 46,
8849 #[doc = "mime type is"]
8850 MimeTypeIs = 47,
8851}
8852
8853#[derive(
8854 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8855)]
8856#[allow(non_snake_case)]
8857pub struct SanityCheck {
8858 pub status: String,
8859 pub error: String,
8860 pub last_run: chrono::DateTime<chrono::Utc>,
8861}
8862
8863impl std::fmt::Display for SanityCheck {
8864 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8865 write!(
8866 f,
8867 "{}",
8868 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8869 )
8870 }
8871}
8872
8873#[cfg(feature = "tabled")]
8874impl tabled::Tabled for SanityCheck {
8875 const LENGTH: usize = 3;
8876 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8877 vec![
8878 self.status.clone().into(),
8879 self.error.clone().into(),
8880 format!("{:?}", self.last_run).into(),
8881 ]
8882 }
8883
8884 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8885 vec!["status".into(), "error".into(), "last_run".into()]
8886 }
8887}
8888
8889#[derive(
8890 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8891)]
8892#[allow(non_snake_case)]
8893pub struct SavedView {
8894 pub id: i64,
8895 pub name: String,
8896 pub show_on_dashboard: bool,
8897 pub show_in_sidebar: bool,
8898 #[serde(default, skip_serializing_if = "Option::is_none")]
8899 pub sort_field: Option<String>,
8900 #[serde(default, skip_serializing_if = "Option::is_none")]
8901 pub sort_reverse: Option<bool>,
8902 pub filter_rules: Vec<SavedViewFilterRule>,
8903 #[serde(default, skip_serializing_if = "Option::is_none")]
8904 pub page_size: Option<i64>,
8905 #[serde(default, skip_serializing_if = "Option::is_none")]
8906 pub display_mode: Option<DisplayMode>,
8907 #[serde(default, skip_serializing_if = "Option::is_none")]
8908 pub display_fields: Option<serde_json::Value>,
8909 #[serde(default, skip_serializing_if = "Option::is_none")]
8910 pub owner: Option<i64>,
8911 pub user_can_change: bool,
8912}
8913
8914impl std::fmt::Display for SavedView {
8915 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8916 write!(
8917 f,
8918 "{}",
8919 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8920 )
8921 }
8922}
8923
8924#[cfg(feature = "tabled")]
8925impl tabled::Tabled for SavedView {
8926 const LENGTH: usize = 12;
8927 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8928 vec![
8929 format!("{:?}", self.id).into(),
8930 self.name.clone().into(),
8931 format!("{:?}", self.show_on_dashboard).into(),
8932 format!("{:?}", self.show_in_sidebar).into(),
8933 if let Some(sort_field) = &self.sort_field {
8934 format!("{sort_field:?}").into()
8935 } else {
8936 String::new().into()
8937 },
8938 if let Some(sort_reverse) = &self.sort_reverse {
8939 format!("{sort_reverse:?}").into()
8940 } else {
8941 String::new().into()
8942 },
8943 format!("{:?}", self.filter_rules).into(),
8944 if let Some(page_size) = &self.page_size {
8945 format!("{page_size:?}").into()
8946 } else {
8947 String::new().into()
8948 },
8949 if let Some(display_mode) = &self.display_mode {
8950 format!("{display_mode:?}").into()
8951 } else {
8952 String::new().into()
8953 },
8954 if let Some(display_fields) = &self.display_fields {
8955 format!("{display_fields:?}").into()
8956 } else {
8957 String::new().into()
8958 },
8959 if let Some(owner) = &self.owner {
8960 format!("{owner:?}").into()
8961 } else {
8962 String::new().into()
8963 },
8964 format!("{:?}", self.user_can_change).into(),
8965 ]
8966 }
8967
8968 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8969 vec![
8970 "id".into(),
8971 "name".into(),
8972 "show_on_dashboard".into(),
8973 "show_in_sidebar".into(),
8974 "sort_field".into(),
8975 "sort_reverse".into(),
8976 "filter_rules".into(),
8977 "page_size".into(),
8978 "display_mode".into(),
8979 "display_fields".into(),
8980 "owner".into(),
8981 "user_can_change".into(),
8982 ]
8983 }
8984}
8985
8986#[derive(
8987 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8988)]
8989#[allow(non_snake_case)]
8990pub struct SavedViewFilterRule {
8991 pub rule_type: RuleTypeEnum,
8992 #[serde(default, skip_serializing_if = "Option::is_none")]
8993 pub value: Option<String>,
8994}
8995
8996impl std::fmt::Display for SavedViewFilterRule {
8997 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8998 write!(
8999 f,
9000 "{}",
9001 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9002 )
9003 }
9004}
9005
9006#[cfg(feature = "tabled")]
9007impl tabled::Tabled for SavedViewFilterRule {
9008 const LENGTH: usize = 2;
9009 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9010 vec![
9011 format!("{:?}", self.rule_type).into(),
9012 if let Some(value) = &self.value {
9013 format!("{value:?}").into()
9014 } else {
9015 String::new().into()
9016 },
9017 ]
9018 }
9019
9020 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9021 vec!["rule_type".into(), "value".into()]
9022 }
9023}
9024
9025#[derive(
9026 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9027)]
9028#[allow(non_snake_case)]
9029pub struct SavedViewFilterRuleRequest {
9030 pub rule_type: RuleTypeEnum,
9031 #[serde(default, skip_serializing_if = "Option::is_none")]
9032 pub value: Option<String>,
9033}
9034
9035impl std::fmt::Display for SavedViewFilterRuleRequest {
9036 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9037 write!(
9038 f,
9039 "{}",
9040 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9041 )
9042 }
9043}
9044
9045#[cfg(feature = "tabled")]
9046impl tabled::Tabled for SavedViewFilterRuleRequest {
9047 const LENGTH: usize = 2;
9048 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9049 vec![
9050 format!("{:?}", self.rule_type).into(),
9051 if let Some(value) = &self.value {
9052 format!("{value:?}").into()
9053 } else {
9054 String::new().into()
9055 },
9056 ]
9057 }
9058
9059 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9060 vec!["rule_type".into(), "value".into()]
9061 }
9062}
9063
9064#[derive(
9065 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9066)]
9067#[allow(non_snake_case)]
9068pub struct SavedViewRequest {
9069 pub name: String,
9070 pub show_on_dashboard: bool,
9071 pub show_in_sidebar: bool,
9072 #[serde(default, skip_serializing_if = "Option::is_none")]
9073 pub sort_field: Option<String>,
9074 #[serde(default, skip_serializing_if = "Option::is_none")]
9075 pub sort_reverse: Option<bool>,
9076 pub filter_rules: Vec<SavedViewFilterRuleRequest>,
9077 #[serde(default, skip_serializing_if = "Option::is_none")]
9078 pub page_size: Option<i64>,
9079 #[serde(default, skip_serializing_if = "Option::is_none")]
9080 pub display_mode: Option<DisplayMode>,
9081 #[serde(default, skip_serializing_if = "Option::is_none")]
9082 pub display_fields: Option<serde_json::Value>,
9083 #[serde(default, skip_serializing_if = "Option::is_none")]
9084 pub owner: Option<i64>,
9085}
9086
9087impl std::fmt::Display for SavedViewRequest {
9088 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9089 write!(
9090 f,
9091 "{}",
9092 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9093 )
9094 }
9095}
9096
9097#[cfg(feature = "tabled")]
9098impl tabled::Tabled for SavedViewRequest {
9099 const LENGTH: usize = 10;
9100 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9101 vec![
9102 self.name.clone().into(),
9103 format!("{:?}", self.show_on_dashboard).into(),
9104 format!("{:?}", self.show_in_sidebar).into(),
9105 if let Some(sort_field) = &self.sort_field {
9106 format!("{sort_field:?}").into()
9107 } else {
9108 String::new().into()
9109 },
9110 if let Some(sort_reverse) = &self.sort_reverse {
9111 format!("{sort_reverse:?}").into()
9112 } else {
9113 String::new().into()
9114 },
9115 format!("{:?}", self.filter_rules).into(),
9116 if let Some(page_size) = &self.page_size {
9117 format!("{page_size:?}").into()
9118 } else {
9119 String::new().into()
9120 },
9121 if let Some(display_mode) = &self.display_mode {
9122 format!("{display_mode:?}").into()
9123 } else {
9124 String::new().into()
9125 },
9126 if let Some(display_fields) = &self.display_fields {
9127 format!("{display_fields:?}").into()
9128 } else {
9129 String::new().into()
9130 },
9131 if let Some(owner) = &self.owner {
9132 format!("{owner:?}").into()
9133 } else {
9134 String::new().into()
9135 },
9136 ]
9137 }
9138
9139 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9140 vec![
9141 "name".into(),
9142 "show_on_dashboard".into(),
9143 "show_in_sidebar".into(),
9144 "sort_field".into(),
9145 "sort_reverse".into(),
9146 "filter_rules".into(),
9147 "page_size".into(),
9148 "display_mode".into(),
9149 "display_fields".into(),
9150 "owner".into(),
9151 ]
9152 }
9153}
9154
9155#[doc = "* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
9156#[derive(
9157 serde :: Serialize,
9158 serde :: Deserialize,
9159 PartialEq,
9160 Hash,
9161 Debug,
9162 Clone,
9163 schemars :: JsonSchema,
9164 parse_display :: FromStr,
9165 parse_display :: Display,
9166)]
9167#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9168#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9169pub enum ScheduleDateFieldEnum {
9170 #[serde(rename = "added")]
9171 #[display("added")]
9172 Added,
9173 #[serde(rename = "created")]
9174 #[display("created")]
9175 Created,
9176 #[serde(rename = "modified")]
9177 #[display("modified")]
9178 Modified,
9179 #[serde(rename = "custom_field")]
9180 #[display("custom_field")]
9181 CustomField,
9182}
9183
9184#[derive(
9185 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9186)]
9187#[allow(non_snake_case)]
9188pub struct SearchResult {
9189 pub total: i64,
9190 pub documents: Vec<Document>,
9191 pub saved_views: Vec<SavedView>,
9192 pub tags: Vec<Tag>,
9193 pub correspondents: Vec<Correspondent>,
9194 pub document_types: Vec<DocumentType>,
9195 pub storage_paths: Vec<StoragePath>,
9196 pub users: Vec<User>,
9197 pub groups: Vec<Group>,
9198 pub mail_rules: Vec<MailRule>,
9199 pub mail_accounts: Vec<MailAccount>,
9200 pub workflows: Vec<Workflow>,
9201 pub custom_fields: Vec<CustomField>,
9202}
9203
9204impl std::fmt::Display for SearchResult {
9205 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9206 write!(
9207 f,
9208 "{}",
9209 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9210 )
9211 }
9212}
9213
9214#[cfg(feature = "tabled")]
9215impl tabled::Tabled for SearchResult {
9216 const LENGTH: usize = 13;
9217 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9218 vec![
9219 format!("{:?}", self.total).into(),
9220 format!("{:?}", self.documents).into(),
9221 format!("{:?}", self.saved_views).into(),
9222 format!("{:?}", self.tags).into(),
9223 format!("{:?}", self.correspondents).into(),
9224 format!("{:?}", self.document_types).into(),
9225 format!("{:?}", self.storage_paths).into(),
9226 format!("{:?}", self.users).into(),
9227 format!("{:?}", self.groups).into(),
9228 format!("{:?}", self.mail_rules).into(),
9229 format!("{:?}", self.mail_accounts).into(),
9230 format!("{:?}", self.workflows).into(),
9231 format!("{:?}", self.custom_fields).into(),
9232 ]
9233 }
9234
9235 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9236 vec![
9237 "total".into(),
9238 "documents".into(),
9239 "saved_views".into(),
9240 "tags".into(),
9241 "correspondents".into(),
9242 "document_types".into(),
9243 "storage_paths".into(),
9244 "users".into(),
9245 "groups".into(),
9246 "mail_rules".into(),
9247 "mail_accounts".into(),
9248 "workflows".into(),
9249 "custom_fields".into(),
9250 ]
9251 }
9252}
9253
9254#[derive(
9255 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9256)]
9257#[allow(non_snake_case)]
9258pub struct SelectionData {
9259 pub selected_correspondents: Vec<CorrespondentCounts>,
9260 pub selected_tags: Vec<TagCounts>,
9261 pub selected_document_types: Vec<DocumentTypeCounts>,
9262 pub selected_storage_paths: Vec<StoragePathCounts>,
9263 pub selected_custom_fields: Vec<CustomFieldCounts>,
9264}
9265
9266impl std::fmt::Display for SelectionData {
9267 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9268 write!(
9269 f,
9270 "{}",
9271 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9272 )
9273 }
9274}
9275
9276#[cfg(feature = "tabled")]
9277impl tabled::Tabled for SelectionData {
9278 const LENGTH: usize = 5;
9279 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9280 vec![
9281 format!("{:?}", self.selected_correspondents).into(),
9282 format!("{:?}", self.selected_tags).into(),
9283 format!("{:?}", self.selected_document_types).into(),
9284 format!("{:?}", self.selected_storage_paths).into(),
9285 format!("{:?}", self.selected_custom_fields).into(),
9286 ]
9287 }
9288
9289 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9290 vec![
9291 "selected_correspondents".into(),
9292 "selected_tags".into(),
9293 "selected_document_types".into(),
9294 "selected_storage_paths".into(),
9295 "selected_custom_fields".into(),
9296 ]
9297 }
9298}
9299
9300#[derive(
9301 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9302)]
9303#[allow(non_snake_case)]
9304pub struct ShareLink {
9305 pub id: i64,
9306 pub created: chrono::DateTime<chrono::Utc>,
9307 #[serde(default, skip_serializing_if = "Option::is_none")]
9308 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
9309 pub slug: String,
9310 #[serde(default, skip_serializing_if = "Option::is_none")]
9311 pub document: Option<i64>,
9312 #[doc = "* `archive` - Archive\n* `original` - Original"]
9313 #[serde(default, skip_serializing_if = "Option::is_none")]
9314 pub file_version: Option<FileVersionEnum>,
9315}
9316
9317impl std::fmt::Display for ShareLink {
9318 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9319 write!(
9320 f,
9321 "{}",
9322 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9323 )
9324 }
9325}
9326
9327#[cfg(feature = "tabled")]
9328impl tabled::Tabled for ShareLink {
9329 const LENGTH: usize = 6;
9330 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9331 vec![
9332 format!("{:?}", self.id).into(),
9333 format!("{:?}", self.created).into(),
9334 if let Some(expiration) = &self.expiration {
9335 format!("{expiration:?}").into()
9336 } else {
9337 String::new().into()
9338 },
9339 self.slug.clone().into(),
9340 if let Some(document) = &self.document {
9341 format!("{document:?}").into()
9342 } else {
9343 String::new().into()
9344 },
9345 if let Some(file_version) = &self.file_version {
9346 format!("{file_version:?}").into()
9347 } else {
9348 String::new().into()
9349 },
9350 ]
9351 }
9352
9353 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9354 vec![
9355 "id".into(),
9356 "created".into(),
9357 "expiration".into(),
9358 "slug".into(),
9359 "document".into(),
9360 "file_version".into(),
9361 ]
9362 }
9363}
9364
9365#[derive(
9366 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9367)]
9368#[allow(non_snake_case)]
9369pub struct ShareLinkRequest {
9370 #[serde(default, skip_serializing_if = "Option::is_none")]
9371 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
9372 #[serde(default, skip_serializing_if = "Option::is_none")]
9373 pub document: Option<i64>,
9374 #[doc = "* `archive` - Archive\n* `original` - Original"]
9375 #[serde(default, skip_serializing_if = "Option::is_none")]
9376 pub file_version: Option<FileVersionEnum>,
9377}
9378
9379impl std::fmt::Display for ShareLinkRequest {
9380 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9381 write!(
9382 f,
9383 "{}",
9384 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9385 )
9386 }
9387}
9388
9389#[cfg(feature = "tabled")]
9390impl tabled::Tabled for ShareLinkRequest {
9391 const LENGTH: usize = 3;
9392 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9393 vec![
9394 if let Some(expiration) = &self.expiration {
9395 format!("{expiration:?}").into()
9396 } else {
9397 String::new().into()
9398 },
9399 if let Some(document) = &self.document {
9400 format!("{document:?}").into()
9401 } else {
9402 String::new().into()
9403 },
9404 if let Some(file_version) = &self.file_version {
9405 format!("{file_version:?}").into()
9406 } else {
9407 String::new().into()
9408 },
9409 ]
9410 }
9411
9412 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9413 vec![
9414 "expiration".into(),
9415 "document".into(),
9416 "file_version".into(),
9417 ]
9418 }
9419}
9420
9421#[doc = "* `never` - never\n* `with_text` - with_text\n* `always` - always"]
9422#[derive(
9423 serde :: Serialize,
9424 serde :: Deserialize,
9425 PartialEq,
9426 Hash,
9427 Debug,
9428 Clone,
9429 schemars :: JsonSchema,
9430 parse_display :: FromStr,
9431 parse_display :: Display,
9432)]
9433#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9434#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9435pub enum SkipArchiveFileEnum {
9436 #[serde(rename = "never")]
9437 #[display("never")]
9438 Never,
9439 #[serde(rename = "with_text")]
9440 #[display("with_text")]
9441 WithText,
9442 #[serde(rename = "always")]
9443 #[display("always")]
9444 Always,
9445 #[serde(rename = "")]
9446 #[display("")]
9447 Empty,
9448}
9449
9450#[derive(
9451 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9452)]
9453#[allow(non_snake_case)]
9454pub struct SocialAccount {
9455 pub id: i64,
9456 pub provider: String,
9457 pub name: String,
9458}
9459
9460impl std::fmt::Display for SocialAccount {
9461 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9462 write!(
9463 f,
9464 "{}",
9465 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9466 )
9467 }
9468}
9469
9470#[cfg(feature = "tabled")]
9471impl tabled::Tabled for SocialAccount {
9472 const LENGTH: usize = 3;
9473 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9474 vec![
9475 format!("{:?}", self.id).into(),
9476 self.provider.clone().into(),
9477 self.name.clone().into(),
9478 ]
9479 }
9480
9481 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9482 vec!["id".into(), "provider".into(), "name".into()]
9483 }
9484}
9485
9486#[derive(
9487 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9488)]
9489#[allow(non_snake_case)]
9490pub struct SocialAccountRequest {
9491 pub provider: String,
9492}
9493
9494impl std::fmt::Display for SocialAccountRequest {
9495 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9496 write!(
9497 f,
9498 "{}",
9499 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9500 )
9501 }
9502}
9503
9504#[cfg(feature = "tabled")]
9505impl tabled::Tabled for SocialAccountRequest {
9506 const LENGTH: usize = 1;
9507 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9508 vec![self.provider.clone().into()]
9509 }
9510
9511 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9512 vec!["provider".into()]
9513 }
9514}
9515
9516#[doc = "* `1` - Consume Folder\n* `2` - Api Upload\n* `3` - Mail Fetch\n* `4` - Web UI"]
9517#[derive(
9518 serde_repr :: Serialize_repr,
9519 serde_repr :: Deserialize_repr,
9520 PartialEq,
9521 Hash,
9522 Debug,
9523 Clone,
9524 Copy,
9525 schemars :: JsonSchema,
9526)]
9527#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9528#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9529#[repr(i64)]
9530pub enum SourcesEnum {
9531 #[doc = "Consume Folder"]
9532 ConsumeFolder = 1,
9533 #[doc = "Api Upload"]
9534 ApiUpload = 2,
9535 #[doc = "Mail Fetch"]
9536 MailFetch = 3,
9537 #[doc = "Web UI"]
9538 WebUI = 4,
9539}
9540
9541#[doc = "* `FAILURE` - FAILURE\n* `PENDING` - PENDING\n* `RECEIVED` - RECEIVED\n* `RETRY` - RETRY\n* `REVOKED` - REVOKED\n* `STARTED` - STARTED\n* `SUCCESS` - SUCCESS"]
9542#[derive(
9543 serde :: Serialize,
9544 serde :: Deserialize,
9545 PartialEq,
9546 Hash,
9547 Debug,
9548 Clone,
9549 schemars :: JsonSchema,
9550 parse_display :: FromStr,
9551 parse_display :: Display,
9552)]
9553#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9554#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9555pub enum StatusEnum {
9556 #[serde(rename = "FAILURE")]
9557 #[display("FAILURE")]
9558 Failure,
9559 #[serde(rename = "PENDING")]
9560 #[display("PENDING")]
9561 Pending,
9562 #[serde(rename = "RECEIVED")]
9563 #[display("RECEIVED")]
9564 Received,
9565 #[serde(rename = "RETRY")]
9566 #[display("RETRY")]
9567 Retry,
9568 #[serde(rename = "REVOKED")]
9569 #[display("REVOKED")]
9570 Revoked,
9571 #[serde(rename = "STARTED")]
9572 #[display("STARTED")]
9573 Started,
9574 #[serde(rename = "SUCCESS")]
9575 #[display("SUCCESS")]
9576 Success,
9577}
9578
9579#[derive(
9580 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9581)]
9582#[allow(non_snake_case)]
9583pub struct Storage {
9584 pub total: i64,
9585 pub available: i64,
9586}
9587
9588impl std::fmt::Display for Storage {
9589 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9590 write!(
9591 f,
9592 "{}",
9593 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9594 )
9595 }
9596}
9597
9598#[cfg(feature = "tabled")]
9599impl tabled::Tabled for Storage {
9600 const LENGTH: usize = 2;
9601 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9602 vec![
9603 format!("{:?}", self.total).into(),
9604 format!("{:?}", self.available).into(),
9605 ]
9606 }
9607
9608 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9609 vec!["total".into(), "available".into()]
9610 }
9611}
9612
9613#[derive(
9614 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9615)]
9616#[allow(non_snake_case)]
9617pub struct StoragePath {
9618 pub id: i64,
9619 pub slug: String,
9620 pub name: String,
9621 pub path: String,
9622 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9623 pub match_: Option<String>,
9624 #[serde(default, skip_serializing_if = "Option::is_none")]
9625 pub matching_algorithm: Option<MatchingAlgorithm>,
9626 #[serde(default, skip_serializing_if = "Option::is_none")]
9627 pub is_insensitive: Option<bool>,
9628 pub document_count: i64,
9629 #[serde(default, skip_serializing_if = "Option::is_none")]
9630 pub owner: Option<i64>,
9631 pub user_can_change: bool,
9632}
9633
9634impl std::fmt::Display for StoragePath {
9635 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9636 write!(
9637 f,
9638 "{}",
9639 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9640 )
9641 }
9642}
9643
9644#[cfg(feature = "tabled")]
9645impl tabled::Tabled for StoragePath {
9646 const LENGTH: usize = 10;
9647 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9648 vec![
9649 format!("{:?}", self.id).into(),
9650 self.slug.clone().into(),
9651 self.name.clone().into(),
9652 self.path.clone().into(),
9653 if let Some(match_) = &self.match_ {
9654 format!("{match_:?}").into()
9655 } else {
9656 String::new().into()
9657 },
9658 if let Some(matching_algorithm) = &self.matching_algorithm {
9659 format!("{matching_algorithm:?}").into()
9660 } else {
9661 String::new().into()
9662 },
9663 if let Some(is_insensitive) = &self.is_insensitive {
9664 format!("{is_insensitive:?}").into()
9665 } else {
9666 String::new().into()
9667 },
9668 format!("{:?}", self.document_count).into(),
9669 if let Some(owner) = &self.owner {
9670 format!("{owner:?}").into()
9671 } else {
9672 String::new().into()
9673 },
9674 format!("{:?}", self.user_can_change).into(),
9675 ]
9676 }
9677
9678 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9679 vec![
9680 "id".into(),
9681 "slug".into(),
9682 "name".into(),
9683 "path".into(),
9684 "match_".into(),
9685 "matching_algorithm".into(),
9686 "is_insensitive".into(),
9687 "document_count".into(),
9688 "owner".into(),
9689 "user_can_change".into(),
9690 ]
9691 }
9692}
9693
9694#[derive(
9695 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9696)]
9697#[allow(non_snake_case)]
9698pub struct StoragePathCounts {
9699 pub id: i64,
9700 pub document_count: i64,
9701}
9702
9703impl std::fmt::Display for StoragePathCounts {
9704 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9705 write!(
9706 f,
9707 "{}",
9708 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9709 )
9710 }
9711}
9712
9713#[cfg(feature = "tabled")]
9714impl tabled::Tabled for StoragePathCounts {
9715 const LENGTH: usize = 2;
9716 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9717 vec![
9718 format!("{:?}", self.id).into(),
9719 format!("{:?}", self.document_count).into(),
9720 ]
9721 }
9722
9723 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9724 vec!["id".into(), "document_count".into()]
9725 }
9726}
9727
9728#[derive(
9729 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9730)]
9731#[allow(non_snake_case)]
9732pub struct StoragePathRequest {
9733 pub name: String,
9734 pub path: String,
9735 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9736 pub match_: Option<String>,
9737 #[serde(default, skip_serializing_if = "Option::is_none")]
9738 pub matching_algorithm: Option<MatchingAlgorithm>,
9739 #[serde(default, skip_serializing_if = "Option::is_none")]
9740 pub is_insensitive: Option<bool>,
9741 #[serde(default, skip_serializing_if = "Option::is_none")]
9742 pub owner: Option<i64>,
9743 #[serde(default, skip_serializing_if = "Option::is_none")]
9744 pub set_permissions: Option<SetPermissions>,
9745}
9746
9747impl std::fmt::Display for StoragePathRequest {
9748 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9749 write!(
9750 f,
9751 "{}",
9752 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9753 )
9754 }
9755}
9756
9757#[cfg(feature = "tabled")]
9758impl tabled::Tabled for StoragePathRequest {
9759 const LENGTH: usize = 7;
9760 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9761 vec![
9762 self.name.clone().into(),
9763 self.path.clone().into(),
9764 if let Some(match_) = &self.match_ {
9765 format!("{match_:?}").into()
9766 } else {
9767 String::new().into()
9768 },
9769 if let Some(matching_algorithm) = &self.matching_algorithm {
9770 format!("{matching_algorithm:?}").into()
9771 } else {
9772 String::new().into()
9773 },
9774 if let Some(is_insensitive) = &self.is_insensitive {
9775 format!("{is_insensitive:?}").into()
9776 } else {
9777 String::new().into()
9778 },
9779 if let Some(owner) = &self.owner {
9780 format!("{owner:?}").into()
9781 } else {
9782 String::new().into()
9783 },
9784 if let Some(set_permissions) = &self.set_permissions {
9785 format!("{set_permissions:?}").into()
9786 } else {
9787 String::new().into()
9788 },
9789 ]
9790 }
9791
9792 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9793 vec![
9794 "name".into(),
9795 "path".into(),
9796 "match_".into(),
9797 "matching_algorithm".into(),
9798 "is_insensitive".into(),
9799 "owner".into(),
9800 "set_permissions".into(),
9801 ]
9802 }
9803}
9804
9805#[derive(
9806 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9807)]
9808#[allow(non_snake_case)]
9809pub struct Suggestions {
9810 pub correspondents: Vec<i64>,
9811 pub tags: Vec<i64>,
9812 pub document_types: Vec<i64>,
9813 pub storage_paths: Vec<i64>,
9814 pub dates: Vec<String>,
9815}
9816
9817impl std::fmt::Display for Suggestions {
9818 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9819 write!(
9820 f,
9821 "{}",
9822 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9823 )
9824 }
9825}
9826
9827#[cfg(feature = "tabled")]
9828impl tabled::Tabled for Suggestions {
9829 const LENGTH: usize = 5;
9830 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9831 vec![
9832 format!("{:?}", self.correspondents).into(),
9833 format!("{:?}", self.tags).into(),
9834 format!("{:?}", self.document_types).into(),
9835 format!("{:?}", self.storage_paths).into(),
9836 format!("{:?}", self.dates).into(),
9837 ]
9838 }
9839
9840 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9841 vec![
9842 "correspondents".into(),
9843 "tags".into(),
9844 "document_types".into(),
9845 "storage_paths".into(),
9846 "dates".into(),
9847 ]
9848 }
9849}
9850
9851#[derive(
9852 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9853)]
9854#[allow(non_snake_case)]
9855pub struct SystemStatus {
9856 pub pngx_version: String,
9857 pub server_os: String,
9858 pub install_type: String,
9859 pub storage: Storage,
9860 pub database: Database,
9861 pub tasks: Tasks,
9862 pub index: Index,
9863 pub classifier: Classifier,
9864 pub sanity_check: SanityCheck,
9865}
9866
9867impl std::fmt::Display for SystemStatus {
9868 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9869 write!(
9870 f,
9871 "{}",
9872 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9873 )
9874 }
9875}
9876
9877#[cfg(feature = "tabled")]
9878impl tabled::Tabled for SystemStatus {
9879 const LENGTH: usize = 9;
9880 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9881 vec![
9882 self.pngx_version.clone().into(),
9883 self.server_os.clone().into(),
9884 self.install_type.clone().into(),
9885 format!("{:?}", self.storage).into(),
9886 format!("{:?}", self.database).into(),
9887 format!("{:?}", self.tasks).into(),
9888 format!("{:?}", self.index).into(),
9889 format!("{:?}", self.classifier).into(),
9890 format!("{:?}", self.sanity_check).into(),
9891 ]
9892 }
9893
9894 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9895 vec![
9896 "pngx_version".into(),
9897 "server_os".into(),
9898 "install_type".into(),
9899 "storage".into(),
9900 "database".into(),
9901 "tasks".into(),
9902 "index".into(),
9903 "classifier".into(),
9904 "sanity_check".into(),
9905 ]
9906 }
9907}
9908
9909#[derive(
9910 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9911)]
9912#[allow(non_snake_case)]
9913pub struct Tag {
9914 pub id: i64,
9915 pub slug: String,
9916 pub name: String,
9917 #[serde(default, skip_serializing_if = "Option::is_none")]
9918 pub color: Option<String>,
9919 pub text_color: String,
9920 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9921 pub match_: Option<String>,
9922 #[serde(default, skip_serializing_if = "Option::is_none")]
9923 pub matching_algorithm: Option<MatchingAlgorithm>,
9924 #[serde(default, skip_serializing_if = "Option::is_none")]
9925 pub is_insensitive: Option<bool>,
9926 #[doc = "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."]
9927 #[serde(default, skip_serializing_if = "Option::is_none")]
9928 pub is_inbox_tag: Option<bool>,
9929 #[serde(default)]
9930 pub document_count: i64,
9931 #[serde(default, skip_serializing_if = "Option::is_none")]
9932 pub owner: Option<i64>,
9933 pub user_can_change: bool,
9934 #[serde(default, skip_serializing_if = "Option::is_none")]
9935 pub parent: Option<i64>,
9936 pub children: Vec<i64>,
9937}
9938
9939impl std::fmt::Display for Tag {
9940 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9941 write!(
9942 f,
9943 "{}",
9944 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9945 )
9946 }
9947}
9948
9949#[cfg(feature = "tabled")]
9950impl tabled::Tabled for Tag {
9951 const LENGTH: usize = 14;
9952 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9953 vec![
9954 format!("{:?}", self.id).into(),
9955 self.slug.clone().into(),
9956 self.name.clone().into(),
9957 if let Some(color) = &self.color {
9958 format!("{color:?}").into()
9959 } else {
9960 String::new().into()
9961 },
9962 self.text_color.clone().into(),
9963 if let Some(match_) = &self.match_ {
9964 format!("{match_:?}").into()
9965 } else {
9966 String::new().into()
9967 },
9968 if let Some(matching_algorithm) = &self.matching_algorithm {
9969 format!("{matching_algorithm:?}").into()
9970 } else {
9971 String::new().into()
9972 },
9973 if let Some(is_insensitive) = &self.is_insensitive {
9974 format!("{is_insensitive:?}").into()
9975 } else {
9976 String::new().into()
9977 },
9978 if let Some(is_inbox_tag) = &self.is_inbox_tag {
9979 format!("{is_inbox_tag:?}").into()
9980 } else {
9981 String::new().into()
9982 },
9983 format!("{:?}", self.document_count).into(),
9984 if let Some(owner) = &self.owner {
9985 format!("{owner:?}").into()
9986 } else {
9987 String::new().into()
9988 },
9989 format!("{:?}", self.user_can_change).into(),
9990 if let Some(parent) = &self.parent {
9991 format!("{parent:?}").into()
9992 } else {
9993 String::new().into()
9994 },
9995 format!("{:?}", self.children).into(),
9996 ]
9997 }
9998
9999 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10000 vec![
10001 "id".into(),
10002 "slug".into(),
10003 "name".into(),
10004 "color".into(),
10005 "text_color".into(),
10006 "match_".into(),
10007 "matching_algorithm".into(),
10008 "is_insensitive".into(),
10009 "is_inbox_tag".into(),
10010 "document_count".into(),
10011 "owner".into(),
10012 "user_can_change".into(),
10013 "parent".into(),
10014 "children".into(),
10015 ]
10016 }
10017}
10018
10019#[derive(
10020 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10021)]
10022#[allow(non_snake_case)]
10023pub struct TagCounts {
10024 pub id: i64,
10025 pub document_count: i64,
10026}
10027
10028impl std::fmt::Display for TagCounts {
10029 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10030 write!(
10031 f,
10032 "{}",
10033 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10034 )
10035 }
10036}
10037
10038#[cfg(feature = "tabled")]
10039impl tabled::Tabled for TagCounts {
10040 const LENGTH: usize = 2;
10041 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10042 vec![
10043 format!("{:?}", self.id).into(),
10044 format!("{:?}", self.document_count).into(),
10045 ]
10046 }
10047
10048 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10049 vec!["id".into(), "document_count".into()]
10050 }
10051}
10052
10053#[derive(
10054 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10055)]
10056#[allow(non_snake_case)]
10057pub struct TagRequest {
10058 pub name: String,
10059 #[serde(default, skip_serializing_if = "Option::is_none")]
10060 pub color: Option<String>,
10061 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
10062 pub match_: Option<String>,
10063 #[serde(default, skip_serializing_if = "Option::is_none")]
10064 pub matching_algorithm: Option<MatchingAlgorithm>,
10065 #[serde(default, skip_serializing_if = "Option::is_none")]
10066 pub is_insensitive: Option<bool>,
10067 #[doc = "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."]
10068 #[serde(default, skip_serializing_if = "Option::is_none")]
10069 pub is_inbox_tag: Option<bool>,
10070 #[serde(default, skip_serializing_if = "Option::is_none")]
10071 pub owner: Option<i64>,
10072 #[serde(default, skip_serializing_if = "Option::is_none")]
10073 pub set_permissions: Option<SetPermissions>,
10074 #[serde(default, skip_serializing_if = "Option::is_none")]
10075 pub parent: Option<i64>,
10076}
10077
10078impl std::fmt::Display for TagRequest {
10079 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10080 write!(
10081 f,
10082 "{}",
10083 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10084 )
10085 }
10086}
10087
10088#[cfg(feature = "tabled")]
10089impl tabled::Tabled for TagRequest {
10090 const LENGTH: usize = 9;
10091 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10092 vec![
10093 self.name.clone().into(),
10094 if let Some(color) = &self.color {
10095 format!("{color:?}").into()
10096 } else {
10097 String::new().into()
10098 },
10099 if let Some(match_) = &self.match_ {
10100 format!("{match_:?}").into()
10101 } else {
10102 String::new().into()
10103 },
10104 if let Some(matching_algorithm) = &self.matching_algorithm {
10105 format!("{matching_algorithm:?}").into()
10106 } else {
10107 String::new().into()
10108 },
10109 if let Some(is_insensitive) = &self.is_insensitive {
10110 format!("{is_insensitive:?}").into()
10111 } else {
10112 String::new().into()
10113 },
10114 if let Some(is_inbox_tag) = &self.is_inbox_tag {
10115 format!("{is_inbox_tag:?}").into()
10116 } else {
10117 String::new().into()
10118 },
10119 if let Some(owner) = &self.owner {
10120 format!("{owner:?}").into()
10121 } else {
10122 String::new().into()
10123 },
10124 if let Some(set_permissions) = &self.set_permissions {
10125 format!("{set_permissions:?}").into()
10126 } else {
10127 String::new().into()
10128 },
10129 if let Some(parent) = &self.parent {
10130 format!("{parent:?}").into()
10131 } else {
10132 String::new().into()
10133 },
10134 ]
10135 }
10136
10137 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10138 vec![
10139 "name".into(),
10140 "color".into(),
10141 "match_".into(),
10142 "matching_algorithm".into(),
10143 "is_insensitive".into(),
10144 "is_inbox_tag".into(),
10145 "owner".into(),
10146 "set_permissions".into(),
10147 "parent".into(),
10148 ]
10149 }
10150}
10151
10152#[doc = "* `consume_file` - Consume File\n* `train_classifier` - Train Classifier\n* `check_sanity` - Check Sanity\n* `index_optimize` - Index Optimize"]
10153#[derive(
10154 serde :: Serialize,
10155 serde :: Deserialize,
10156 PartialEq,
10157 Hash,
10158 Debug,
10159 Clone,
10160 schemars :: JsonSchema,
10161 parse_display :: FromStr,
10162 parse_display :: Display,
10163)]
10164#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10165#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10166pub enum TaskNameEnum {
10167 #[serde(rename = "consume_file")]
10168 #[display("consume_file")]
10169 ConsumeFile,
10170 #[serde(rename = "train_classifier")]
10171 #[display("train_classifier")]
10172 TrainClassifier,
10173 #[serde(rename = "check_sanity")]
10174 #[display("check_sanity")]
10175 CheckSanity,
10176 #[serde(rename = "index_optimize")]
10177 #[display("index_optimize")]
10178 IndexOptimize,
10179}
10180
10181#[derive(
10182 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10183)]
10184#[allow(non_snake_case)]
10185pub struct Tasks {
10186 pub redis_url: String,
10187 pub redis_status: String,
10188 pub redis_error: String,
10189 pub celery_status: String,
10190}
10191
10192impl std::fmt::Display for Tasks {
10193 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10194 write!(
10195 f,
10196 "{}",
10197 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10198 )
10199 }
10200}
10201
10202#[cfg(feature = "tabled")]
10203impl tabled::Tabled for Tasks {
10204 const LENGTH: usize = 4;
10205 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10206 vec![
10207 self.redis_url.clone().into(),
10208 self.redis_status.clone().into(),
10209 self.redis_error.clone().into(),
10210 self.celery_status.clone().into(),
10211 ]
10212 }
10213
10214 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10215 vec![
10216 "redis_url".into(),
10217 "redis_status".into(),
10218 "redis_error".into(),
10219 "celery_status".into(),
10220 ]
10221 }
10222}
10223
10224#[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"]
10225#[derive(
10226 serde :: Serialize,
10227 serde :: Deserialize,
10228 PartialEq,
10229 Hash,
10230 Debug,
10231 Clone,
10232 schemars :: JsonSchema,
10233 parse_display :: FromStr,
10234 parse_display :: Display,
10235)]
10236#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10237#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10238pub enum TaskName {
10239 #[serde(rename = "consume_file")]
10240 #[display("consume_file")]
10241 ConsumeFile,
10242 #[serde(rename = "train_classifier")]
10243 #[display("train_classifier")]
10244 TrainClassifier,
10245 #[serde(rename = "check_sanity")]
10246 #[display("check_sanity")]
10247 CheckSanity,
10248 #[serde(rename = "index_optimize")]
10249 #[display("index_optimize")]
10250 IndexOptimize,
10251}
10252
10253#[derive(
10254 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10255)]
10256#[allow(non_snake_case)]
10257pub struct TasksView {
10258 pub id: i64,
10259 #[doc = "Celery ID for the Task that was run"]
10260 pub task_id: String,
10261 #[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"]
10262 #[serde(default, skip_serializing_if = "Option::is_none")]
10263 pub task_name: Option<TaskName>,
10264 #[doc = "Name of the file which the Task was run for"]
10265 #[serde(default, skip_serializing_if = "Option::is_none")]
10266 pub task_file_name: Option<String>,
10267 #[doc = "Datetime field when the task result was created in UTC"]
10268 #[serde(default, skip_serializing_if = "Option::is_none")]
10269 pub date_created: Option<chrono::DateTime<chrono::Utc>>,
10270 #[doc = "Datetime field when the task was completed in UTC"]
10271 #[serde(default, skip_serializing_if = "Option::is_none")]
10272 pub date_done: Option<chrono::DateTime<chrono::Utc>>,
10273 #[doc = "The type of task that was run\n\n* `auto_task` - Auto Task\n* `scheduled_task` - Scheduled Task\n* `manual_task` - Manual Task"]
10274 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
10275 pub type_: Option<TasksViewTypeEnum>,
10276 #[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"]
10277 #[serde(default, skip_serializing_if = "Option::is_none")]
10278 pub status: Option<StatusEnum>,
10279 #[doc = "The data returned by the task"]
10280 #[serde(default, skip_serializing_if = "Option::is_none")]
10281 pub result: Option<String>,
10282 #[doc = "If the task is acknowledged via the frontend or API"]
10283 #[serde(default, skip_serializing_if = "Option::is_none")]
10284 pub acknowledged: Option<bool>,
10285 #[serde(default)]
10286 pub related_document: Option<String>,
10287 #[serde(default, skip_serializing_if = "Option::is_none")]
10288 pub owner: Option<i64>,
10289}
10290
10291impl std::fmt::Display for TasksView {
10292 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10293 write!(
10294 f,
10295 "{}",
10296 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10297 )
10298 }
10299}
10300
10301#[cfg(feature = "tabled")]
10302impl tabled::Tabled for TasksView {
10303 const LENGTH: usize = 12;
10304 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10305 vec![
10306 format!("{:?}", self.id).into(),
10307 self.task_id.clone().into(),
10308 if let Some(task_name) = &self.task_name {
10309 format!("{task_name:?}").into()
10310 } else {
10311 String::new().into()
10312 },
10313 if let Some(task_file_name) = &self.task_file_name {
10314 format!("{task_file_name:?}").into()
10315 } else {
10316 String::new().into()
10317 },
10318 if let Some(date_created) = &self.date_created {
10319 format!("{date_created:?}").into()
10320 } else {
10321 String::new().into()
10322 },
10323 if let Some(date_done) = &self.date_done {
10324 format!("{date_done:?}").into()
10325 } else {
10326 String::new().into()
10327 },
10328 if let Some(type_) = &self.type_ {
10329 format!("{type_:?}").into()
10330 } else {
10331 String::new().into()
10332 },
10333 if let Some(status) = &self.status {
10334 format!("{status:?}").into()
10335 } else {
10336 String::new().into()
10337 },
10338 if let Some(result) = &self.result {
10339 format!("{result:?}").into()
10340 } else {
10341 String::new().into()
10342 },
10343 if let Some(acknowledged) = &self.acknowledged {
10344 format!("{acknowledged:?}").into()
10345 } else {
10346 String::new().into()
10347 },
10348 format!("{:?}", self.related_document).into(),
10349 if let Some(owner) = &self.owner {
10350 format!("{owner:?}").into()
10351 } else {
10352 String::new().into()
10353 },
10354 ]
10355 }
10356
10357 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10358 vec![
10359 "id".into(),
10360 "task_id".into(),
10361 "task_name".into(),
10362 "task_file_name".into(),
10363 "date_created".into(),
10364 "date_done".into(),
10365 "type_".into(),
10366 "status".into(),
10367 "result".into(),
10368 "acknowledged".into(),
10369 "related_document".into(),
10370 "owner".into(),
10371 ]
10372 }
10373}
10374
10375#[derive(
10376 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10377)]
10378#[allow(non_snake_case)]
10379pub struct TasksViewRequest {
10380 #[doc = "Celery ID for the Task that was run"]
10381 pub task_id: String,
10382 #[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"]
10383 #[serde(default, skip_serializing_if = "Option::is_none")]
10384 pub task_name: Option<TaskName>,
10385 #[doc = "Name of the file which the Task was run for"]
10386 #[serde(default, skip_serializing_if = "Option::is_none")]
10387 pub task_file_name: Option<String>,
10388 #[doc = "Datetime field when the task result was created in UTC"]
10389 #[serde(default, skip_serializing_if = "Option::is_none")]
10390 pub date_created: Option<chrono::DateTime<chrono::Utc>>,
10391 #[doc = "Datetime field when the task was completed in UTC"]
10392 #[serde(default, skip_serializing_if = "Option::is_none")]
10393 pub date_done: Option<chrono::DateTime<chrono::Utc>>,
10394 #[doc = "The type of task that was run\n\n* `auto_task` - Auto Task\n* `scheduled_task` - Scheduled Task\n* `manual_task` - Manual Task"]
10395 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
10396 pub type_: Option<TasksViewTypeEnum>,
10397 #[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"]
10398 #[serde(default, skip_serializing_if = "Option::is_none")]
10399 pub status: Option<StatusEnum>,
10400 #[doc = "The data returned by the task"]
10401 #[serde(default, skip_serializing_if = "Option::is_none")]
10402 pub result: Option<String>,
10403 #[doc = "If the task is acknowledged via the frontend or API"]
10404 #[serde(default, skip_serializing_if = "Option::is_none")]
10405 pub acknowledged: Option<bool>,
10406 #[serde(default, skip_serializing_if = "Option::is_none")]
10407 pub owner: Option<i64>,
10408}
10409
10410impl std::fmt::Display for TasksViewRequest {
10411 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10412 write!(
10413 f,
10414 "{}",
10415 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10416 )
10417 }
10418}
10419
10420#[cfg(feature = "tabled")]
10421impl tabled::Tabled for TasksViewRequest {
10422 const LENGTH: usize = 10;
10423 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10424 vec![
10425 self.task_id.clone().into(),
10426 if let Some(task_name) = &self.task_name {
10427 format!("{task_name:?}").into()
10428 } else {
10429 String::new().into()
10430 },
10431 if let Some(task_file_name) = &self.task_file_name {
10432 format!("{task_file_name:?}").into()
10433 } else {
10434 String::new().into()
10435 },
10436 if let Some(date_created) = &self.date_created {
10437 format!("{date_created:?}").into()
10438 } else {
10439 String::new().into()
10440 },
10441 if let Some(date_done) = &self.date_done {
10442 format!("{date_done:?}").into()
10443 } else {
10444 String::new().into()
10445 },
10446 if let Some(type_) = &self.type_ {
10447 format!("{type_:?}").into()
10448 } else {
10449 String::new().into()
10450 },
10451 if let Some(status) = &self.status {
10452 format!("{status:?}").into()
10453 } else {
10454 String::new().into()
10455 },
10456 if let Some(result) = &self.result {
10457 format!("{result:?}").into()
10458 } else {
10459 String::new().into()
10460 },
10461 if let Some(acknowledged) = &self.acknowledged {
10462 format!("{acknowledged:?}").into()
10463 } else {
10464 String::new().into()
10465 },
10466 if let Some(owner) = &self.owner {
10467 format!("{owner:?}").into()
10468 } else {
10469 String::new().into()
10470 },
10471 ]
10472 }
10473
10474 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10475 vec![
10476 "task_id".into(),
10477 "task_name".into(),
10478 "task_file_name".into(),
10479 "date_created".into(),
10480 "date_done".into(),
10481 "type_".into(),
10482 "status".into(),
10483 "result".into(),
10484 "acknowledged".into(),
10485 "owner".into(),
10486 ]
10487 }
10488}
10489
10490#[doc = "* `auto_task` - Auto Task\n* `scheduled_task` - Scheduled Task\n* `manual_task` - Manual Task"]
10491#[derive(
10492 serde :: Serialize,
10493 serde :: Deserialize,
10494 PartialEq,
10495 Hash,
10496 Debug,
10497 Clone,
10498 schemars :: JsonSchema,
10499 parse_display :: FromStr,
10500 parse_display :: Display,
10501)]
10502#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10503#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10504pub enum TasksViewTypeEnum {
10505 #[serde(rename = "auto_task")]
10506 #[display("auto_task")]
10507 AutoTask,
10508 #[serde(rename = "scheduled_task")]
10509 #[display("scheduled_task")]
10510 ScheduledTask,
10511 #[serde(rename = "manual_task")]
10512 #[display("manual_task")]
10513 ManualTask,
10514}
10515
10516#[doc = "* `restore` - restore\n* `empty` - empty"]
10517#[derive(
10518 serde :: Serialize,
10519 serde :: Deserialize,
10520 PartialEq,
10521 Hash,
10522 Debug,
10523 Clone,
10524 schemars :: JsonSchema,
10525 parse_display :: FromStr,
10526 parse_display :: Display,
10527)]
10528#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10529#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10530pub enum TrashActionEnum {
10531 #[serde(rename = "restore")]
10532 #[display("restore")]
10533 Restore,
10534 #[serde(rename = "empty")]
10535 #[display("empty")]
10536 Empty,
10537}
10538
10539#[derive(
10540 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10541)]
10542#[allow(non_snake_case)]
10543pub struct TrashRequest {
10544 #[serde(default, skip_serializing_if = "Option::is_none")]
10545 pub documents: Option<Vec<i64>>,
10546 pub action: TrashActionEnum,
10547}
10548
10549impl std::fmt::Display for TrashRequest {
10550 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10551 write!(
10552 f,
10553 "{}",
10554 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10555 )
10556 }
10557}
10558
10559#[cfg(feature = "tabled")]
10560impl tabled::Tabled for TrashRequest {
10561 const LENGTH: usize = 2;
10562 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10563 vec![
10564 if let Some(documents) = &self.documents {
10565 format!("{documents:?}").into()
10566 } else {
10567 String::new().into()
10568 },
10569 format!("{:?}", self.action).into(),
10570 ]
10571 }
10572
10573 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10574 vec!["documents".into(), "action".into()]
10575 }
10576}
10577
10578#[derive(
10579 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10580)]
10581#[allow(non_snake_case)]
10582pub struct UiSettingsView {
10583 pub id: i64,
10584 #[serde(default, skip_serializing_if = "Option::is_none")]
10585 pub settings: Option<std::collections::HashMap<String, serde_json::Value>>,
10586}
10587
10588impl std::fmt::Display for UiSettingsView {
10589 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10590 write!(
10591 f,
10592 "{}",
10593 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10594 )
10595 }
10596}
10597
10598#[cfg(feature = "tabled")]
10599impl tabled::Tabled for UiSettingsView {
10600 const LENGTH: usize = 2;
10601 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10602 vec![
10603 format!("{:?}", self.id).into(),
10604 if let Some(settings) = &self.settings {
10605 format!("{settings:?}").into()
10606 } else {
10607 String::new().into()
10608 },
10609 ]
10610 }
10611
10612 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10613 vec!["id".into(), "settings".into()]
10614 }
10615}
10616
10617#[derive(
10618 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10619)]
10620#[allow(non_snake_case)]
10621pub struct UiSettingsViewRequest {
10622 #[serde(default, skip_serializing_if = "Option::is_none")]
10623 pub settings: Option<std::collections::HashMap<String, serde_json::Value>>,
10624}
10625
10626impl std::fmt::Display for UiSettingsViewRequest {
10627 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10628 write!(
10629 f,
10630 "{}",
10631 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10632 )
10633 }
10634}
10635
10636#[cfg(feature = "tabled")]
10637impl tabled::Tabled for UiSettingsViewRequest {
10638 const LENGTH: usize = 1;
10639 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10640 vec![if let Some(settings) = &self.settings {
10641 format!("{settings:?}").into()
10642 } else {
10643 String::new().into()
10644 }]
10645 }
10646
10647 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10648 vec!["settings".into()]
10649 }
10650}
10651
10652#[doc = "* `clean` - clean\n* `clean-final` - clean-final\n* `none` - none"]
10653#[derive(
10654 serde :: Serialize,
10655 serde :: Deserialize,
10656 PartialEq,
10657 Hash,
10658 Debug,
10659 Clone,
10660 schemars :: JsonSchema,
10661 parse_display :: FromStr,
10662 parse_display :: Display,
10663)]
10664#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10665#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10666pub enum UnpaperCleanEnum {
10667 #[serde(rename = "clean")]
10668 #[display("clean")]
10669 Clean,
10670 #[serde(rename = "clean-final")]
10671 #[display("clean-final")]
10672 CleanFinal,
10673 #[serde(rename = "none")]
10674 #[display("none")]
10675 None,
10676 #[serde(rename = "")]
10677 #[display("")]
10678 Empty,
10679}
10680
10681#[derive(
10682 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10683)]
10684#[allow(non_snake_case)]
10685pub struct User {
10686 pub id: i64,
10687 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
10688 pub username: String,
10689 #[serde(default, skip_serializing_if = "Option::is_none")]
10690 pub email: Option<String>,
10691 #[serde(default, skip_serializing_if = "Option::is_none")]
10692 pub password: Option<String>,
10693 #[serde(default, skip_serializing_if = "Option::is_none")]
10694 pub first_name: Option<String>,
10695 #[serde(default, skip_serializing_if = "Option::is_none")]
10696 pub last_name: Option<String>,
10697 #[serde(default, skip_serializing_if = "Option::is_none")]
10698 pub date_joined: Option<chrono::DateTime<chrono::Utc>>,
10699 #[doc = "Designates whether the user can log into this admin site."]
10700 #[serde(default, skip_serializing_if = "Option::is_none")]
10701 pub is_staff: Option<bool>,
10702 #[doc = "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."]
10703 #[serde(default, skip_serializing_if = "Option::is_none")]
10704 pub is_active: Option<bool>,
10705 #[doc = "Designates that this user has all permissions without explicitly assigning them."]
10706 #[serde(default, skip_serializing_if = "Option::is_none")]
10707 pub is_superuser: Option<bool>,
10708 #[doc = "The groups this user belongs to. A user will get all permissions granted to each of their groups."]
10709 #[serde(default, skip_serializing_if = "Option::is_none")]
10710 pub groups: Option<Vec<i64>>,
10711 #[serde(default, skip_serializing_if = "Option::is_none")]
10712 pub user_permissions: Option<Vec<String>>,
10713 pub inherited_permissions: Vec<String>,
10714 pub is_mfa_enabled: bool,
10715}
10716
10717impl std::fmt::Display for User {
10718 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10719 write!(
10720 f,
10721 "{}",
10722 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10723 )
10724 }
10725}
10726
10727#[cfg(feature = "tabled")]
10728impl tabled::Tabled for User {
10729 const LENGTH: usize = 14;
10730 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10731 vec![
10732 format!("{:?}", self.id).into(),
10733 self.username.clone().into(),
10734 if let Some(email) = &self.email {
10735 format!("{email:?}").into()
10736 } else {
10737 String::new().into()
10738 },
10739 if let Some(password) = &self.password {
10740 format!("{password:?}").into()
10741 } else {
10742 String::new().into()
10743 },
10744 if let Some(first_name) = &self.first_name {
10745 format!("{first_name:?}").into()
10746 } else {
10747 String::new().into()
10748 },
10749 if let Some(last_name) = &self.last_name {
10750 format!("{last_name:?}").into()
10751 } else {
10752 String::new().into()
10753 },
10754 if let Some(date_joined) = &self.date_joined {
10755 format!("{date_joined:?}").into()
10756 } else {
10757 String::new().into()
10758 },
10759 if let Some(is_staff) = &self.is_staff {
10760 format!("{is_staff:?}").into()
10761 } else {
10762 String::new().into()
10763 },
10764 if let Some(is_active) = &self.is_active {
10765 format!("{is_active:?}").into()
10766 } else {
10767 String::new().into()
10768 },
10769 if let Some(is_superuser) = &self.is_superuser {
10770 format!("{is_superuser:?}").into()
10771 } else {
10772 String::new().into()
10773 },
10774 if let Some(groups) = &self.groups {
10775 format!("{groups:?}").into()
10776 } else {
10777 String::new().into()
10778 },
10779 if let Some(user_permissions) = &self.user_permissions {
10780 format!("{user_permissions:?}").into()
10781 } else {
10782 String::new().into()
10783 },
10784 format!("{:?}", self.inherited_permissions).into(),
10785 format!("{:?}", self.is_mfa_enabled).into(),
10786 ]
10787 }
10788
10789 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10790 vec![
10791 "id".into(),
10792 "username".into(),
10793 "email".into(),
10794 "password".into(),
10795 "first_name".into(),
10796 "last_name".into(),
10797 "date_joined".into(),
10798 "is_staff".into(),
10799 "is_active".into(),
10800 "is_superuser".into(),
10801 "groups".into(),
10802 "user_permissions".into(),
10803 "inherited_permissions".into(),
10804 "is_mfa_enabled".into(),
10805 ]
10806 }
10807}
10808
10809#[derive(
10810 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10811)]
10812#[allow(non_snake_case)]
10813pub struct UserRequest {
10814 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
10815 pub username: String,
10816 #[serde(default, skip_serializing_if = "Option::is_none")]
10817 pub email: Option<String>,
10818 #[serde(default, skip_serializing_if = "Option::is_none")]
10819 pub password: Option<String>,
10820 #[serde(default, skip_serializing_if = "Option::is_none")]
10821 pub first_name: Option<String>,
10822 #[serde(default, skip_serializing_if = "Option::is_none")]
10823 pub last_name: Option<String>,
10824 #[serde(default, skip_serializing_if = "Option::is_none")]
10825 pub date_joined: Option<chrono::DateTime<chrono::Utc>>,
10826 #[doc = "Designates whether the user can log into this admin site."]
10827 #[serde(default, skip_serializing_if = "Option::is_none")]
10828 pub is_staff: Option<bool>,
10829 #[doc = "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."]
10830 #[serde(default, skip_serializing_if = "Option::is_none")]
10831 pub is_active: Option<bool>,
10832 #[doc = "Designates that this user has all permissions without explicitly assigning them."]
10833 #[serde(default, skip_serializing_if = "Option::is_none")]
10834 pub is_superuser: Option<bool>,
10835 #[doc = "The groups this user belongs to. A user will get all permissions granted to each of their groups."]
10836 #[serde(default, skip_serializing_if = "Option::is_none")]
10837 pub groups: Option<Vec<i64>>,
10838 #[serde(default, skip_serializing_if = "Option::is_none")]
10839 pub user_permissions: Option<Vec<String>>,
10840}
10841
10842impl std::fmt::Display for UserRequest {
10843 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10844 write!(
10845 f,
10846 "{}",
10847 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10848 )
10849 }
10850}
10851
10852#[cfg(feature = "tabled")]
10853impl tabled::Tabled for UserRequest {
10854 const LENGTH: usize = 11;
10855 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10856 vec![
10857 self.username.clone().into(),
10858 if let Some(email) = &self.email {
10859 format!("{email:?}").into()
10860 } else {
10861 String::new().into()
10862 },
10863 if let Some(password) = &self.password {
10864 format!("{password:?}").into()
10865 } else {
10866 String::new().into()
10867 },
10868 if let Some(first_name) = &self.first_name {
10869 format!("{first_name:?}").into()
10870 } else {
10871 String::new().into()
10872 },
10873 if let Some(last_name) = &self.last_name {
10874 format!("{last_name:?}").into()
10875 } else {
10876 String::new().into()
10877 },
10878 if let Some(date_joined) = &self.date_joined {
10879 format!("{date_joined:?}").into()
10880 } else {
10881 String::new().into()
10882 },
10883 if let Some(is_staff) = &self.is_staff {
10884 format!("{is_staff:?}").into()
10885 } else {
10886 String::new().into()
10887 },
10888 if let Some(is_active) = &self.is_active {
10889 format!("{is_active:?}").into()
10890 } else {
10891 String::new().into()
10892 },
10893 if let Some(is_superuser) = &self.is_superuser {
10894 format!("{is_superuser:?}").into()
10895 } else {
10896 String::new().into()
10897 },
10898 if let Some(groups) = &self.groups {
10899 format!("{groups:?}").into()
10900 } else {
10901 String::new().into()
10902 },
10903 if let Some(user_permissions) = &self.user_permissions {
10904 format!("{user_permissions:?}").into()
10905 } else {
10906 String::new().into()
10907 },
10908 ]
10909 }
10910
10911 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10912 vec![
10913 "username".into(),
10914 "email".into(),
10915 "password".into(),
10916 "first_name".into(),
10917 "last_name".into(),
10918 "date_joined".into(),
10919 "is_staff".into(),
10920 "is_active".into(),
10921 "is_superuser".into(),
10922 "groups".into(),
10923 "user_permissions".into(),
10924 ]
10925 }
10926}
10927
10928#[derive(
10929 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10930)]
10931#[allow(non_snake_case)]
10932pub struct Workflow {
10933 pub id: i64,
10934 pub name: String,
10935 #[serde(default, skip_serializing_if = "Option::is_none")]
10936 pub order: Option<i64>,
10937 #[serde(default, skip_serializing_if = "Option::is_none")]
10938 pub enabled: Option<bool>,
10939 pub triggers: Vec<WorkflowTrigger>,
10940 pub actions: Vec<WorkflowAction>,
10941}
10942
10943impl std::fmt::Display for Workflow {
10944 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10945 write!(
10946 f,
10947 "{}",
10948 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10949 )
10950 }
10951}
10952
10953#[cfg(feature = "tabled")]
10954impl tabled::Tabled for Workflow {
10955 const LENGTH: usize = 6;
10956 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10957 vec![
10958 format!("{:?}", self.id).into(),
10959 self.name.clone().into(),
10960 if let Some(order) = &self.order {
10961 format!("{order:?}").into()
10962 } else {
10963 String::new().into()
10964 },
10965 if let Some(enabled) = &self.enabled {
10966 format!("{enabled:?}").into()
10967 } else {
10968 String::new().into()
10969 },
10970 format!("{:?}", self.triggers).into(),
10971 format!("{:?}", self.actions).into(),
10972 ]
10973 }
10974
10975 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10976 vec![
10977 "id".into(),
10978 "name".into(),
10979 "order".into(),
10980 "enabled".into(),
10981 "triggers".into(),
10982 "actions".into(),
10983 ]
10984 }
10985}
10986
10987#[derive(
10988 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10989)]
10990#[allow(non_snake_case)]
10991pub struct WorkflowAction {
10992 #[serde(default, skip_serializing_if = "Option::is_none")]
10993 pub id: Option<i64>,
10994 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
10995 pub type_: Option<WorkflowActionTypeEnum>,
10996 #[doc = "Assign a document title, must be a Jinja2 template, see documentation."]
10997 #[serde(default, skip_serializing_if = "Option::is_none")]
10998 pub assign_title: Option<String>,
10999 #[serde(default, skip_serializing_if = "Option::is_none")]
11000 pub assign_tags: Option<Vec<Option<i64>>>,
11001 #[serde(default, skip_serializing_if = "Option::is_none")]
11002 pub assign_correspondent: Option<i64>,
11003 #[serde(default, skip_serializing_if = "Option::is_none")]
11004 pub assign_document_type: Option<i64>,
11005 #[serde(default, skip_serializing_if = "Option::is_none")]
11006 pub assign_storage_path: Option<i64>,
11007 #[serde(default, skip_serializing_if = "Option::is_none")]
11008 pub assign_owner: Option<i64>,
11009 #[serde(default, skip_serializing_if = "Option::is_none")]
11010 pub assign_view_users: Option<Vec<i64>>,
11011 #[serde(default, skip_serializing_if = "Option::is_none")]
11012 pub assign_view_groups: Option<Vec<i64>>,
11013 #[serde(default, skip_serializing_if = "Option::is_none")]
11014 pub assign_change_users: Option<Vec<i64>>,
11015 #[serde(default, skip_serializing_if = "Option::is_none")]
11016 pub assign_change_groups: Option<Vec<i64>>,
11017 #[serde(default, skip_serializing_if = "Option::is_none")]
11018 pub assign_custom_fields: Option<Vec<i64>>,
11019 #[doc = "Optional values to assign to the custom fields."]
11020 #[serde(default, skip_serializing_if = "Option::is_none")]
11021 pub assign_custom_fields_values: Option<serde_json::Value>,
11022 #[serde(default, skip_serializing_if = "Option::is_none")]
11023 pub remove_all_tags: Option<bool>,
11024 #[serde(default, skip_serializing_if = "Option::is_none")]
11025 pub remove_tags: Option<Vec<i64>>,
11026 #[serde(default, skip_serializing_if = "Option::is_none")]
11027 pub remove_all_correspondents: Option<bool>,
11028 #[serde(default, skip_serializing_if = "Option::is_none")]
11029 pub remove_correspondents: Option<Vec<i64>>,
11030 #[serde(default, skip_serializing_if = "Option::is_none")]
11031 pub remove_all_document_types: Option<bool>,
11032 #[serde(default, skip_serializing_if = "Option::is_none")]
11033 pub remove_document_types: Option<Vec<i64>>,
11034 #[serde(default, skip_serializing_if = "Option::is_none")]
11035 pub remove_all_storage_paths: Option<bool>,
11036 #[serde(default, skip_serializing_if = "Option::is_none")]
11037 pub remove_storage_paths: Option<Vec<i64>>,
11038 #[serde(default, skip_serializing_if = "Option::is_none")]
11039 pub remove_custom_fields: Option<Vec<i64>>,
11040 #[serde(default, skip_serializing_if = "Option::is_none")]
11041 pub remove_all_custom_fields: Option<bool>,
11042 #[serde(default, skip_serializing_if = "Option::is_none")]
11043 pub remove_all_owners: Option<bool>,
11044 #[serde(default, skip_serializing_if = "Option::is_none")]
11045 pub remove_owners: Option<Vec<i64>>,
11046 #[serde(default, skip_serializing_if = "Option::is_none")]
11047 pub remove_all_permissions: Option<bool>,
11048 #[serde(default, skip_serializing_if = "Option::is_none")]
11049 pub remove_view_users: Option<Vec<i64>>,
11050 #[serde(default, skip_serializing_if = "Option::is_none")]
11051 pub remove_view_groups: Option<Vec<i64>>,
11052 #[serde(default, skip_serializing_if = "Option::is_none")]
11053 pub remove_change_users: Option<Vec<i64>>,
11054 #[serde(default, skip_serializing_if = "Option::is_none")]
11055 pub remove_change_groups: Option<Vec<i64>>,
11056 #[serde(default, skip_serializing_if = "Option::is_none")]
11057 pub email: Option<WorkflowActionEmail>,
11058 #[serde(default, skip_serializing_if = "Option::is_none")]
11059 pub webhook: Option<WorkflowActionWebhook>,
11060}
11061
11062impl std::fmt::Display for WorkflowAction {
11063 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11064 write!(
11065 f,
11066 "{}",
11067 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11068 )
11069 }
11070}
11071
11072#[cfg(feature = "tabled")]
11073impl tabled::Tabled for WorkflowAction {
11074 const LENGTH: usize = 33;
11075 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11076 vec![
11077 if let Some(id) = &self.id {
11078 format!("{id:?}").into()
11079 } else {
11080 String::new().into()
11081 },
11082 if let Some(type_) = &self.type_ {
11083 format!("{type_:?}").into()
11084 } else {
11085 String::new().into()
11086 },
11087 if let Some(assign_title) = &self.assign_title {
11088 format!("{assign_title:?}").into()
11089 } else {
11090 String::new().into()
11091 },
11092 if let Some(assign_tags) = &self.assign_tags {
11093 format!("{assign_tags:?}").into()
11094 } else {
11095 String::new().into()
11096 },
11097 if let Some(assign_correspondent) = &self.assign_correspondent {
11098 format!("{assign_correspondent:?}").into()
11099 } else {
11100 String::new().into()
11101 },
11102 if let Some(assign_document_type) = &self.assign_document_type {
11103 format!("{assign_document_type:?}").into()
11104 } else {
11105 String::new().into()
11106 },
11107 if let Some(assign_storage_path) = &self.assign_storage_path {
11108 format!("{assign_storage_path:?}").into()
11109 } else {
11110 String::new().into()
11111 },
11112 if let Some(assign_owner) = &self.assign_owner {
11113 format!("{assign_owner:?}").into()
11114 } else {
11115 String::new().into()
11116 },
11117 if let Some(assign_view_users) = &self.assign_view_users {
11118 format!("{assign_view_users:?}").into()
11119 } else {
11120 String::new().into()
11121 },
11122 if let Some(assign_view_groups) = &self.assign_view_groups {
11123 format!("{assign_view_groups:?}").into()
11124 } else {
11125 String::new().into()
11126 },
11127 if let Some(assign_change_users) = &self.assign_change_users {
11128 format!("{assign_change_users:?}").into()
11129 } else {
11130 String::new().into()
11131 },
11132 if let Some(assign_change_groups) = &self.assign_change_groups {
11133 format!("{assign_change_groups:?}").into()
11134 } else {
11135 String::new().into()
11136 },
11137 if let Some(assign_custom_fields) = &self.assign_custom_fields {
11138 format!("{assign_custom_fields:?}").into()
11139 } else {
11140 String::new().into()
11141 },
11142 if let Some(assign_custom_fields_values) = &self.assign_custom_fields_values {
11143 format!("{assign_custom_fields_values:?}").into()
11144 } else {
11145 String::new().into()
11146 },
11147 if let Some(remove_all_tags) = &self.remove_all_tags {
11148 format!("{remove_all_tags:?}").into()
11149 } else {
11150 String::new().into()
11151 },
11152 if let Some(remove_tags) = &self.remove_tags {
11153 format!("{remove_tags:?}").into()
11154 } else {
11155 String::new().into()
11156 },
11157 if let Some(remove_all_correspondents) = &self.remove_all_correspondents {
11158 format!("{remove_all_correspondents:?}").into()
11159 } else {
11160 String::new().into()
11161 },
11162 if let Some(remove_correspondents) = &self.remove_correspondents {
11163 format!("{remove_correspondents:?}").into()
11164 } else {
11165 String::new().into()
11166 },
11167 if let Some(remove_all_document_types) = &self.remove_all_document_types {
11168 format!("{remove_all_document_types:?}").into()
11169 } else {
11170 String::new().into()
11171 },
11172 if let Some(remove_document_types) = &self.remove_document_types {
11173 format!("{remove_document_types:?}").into()
11174 } else {
11175 String::new().into()
11176 },
11177 if let Some(remove_all_storage_paths) = &self.remove_all_storage_paths {
11178 format!("{remove_all_storage_paths:?}").into()
11179 } else {
11180 String::new().into()
11181 },
11182 if let Some(remove_storage_paths) = &self.remove_storage_paths {
11183 format!("{remove_storage_paths:?}").into()
11184 } else {
11185 String::new().into()
11186 },
11187 if let Some(remove_custom_fields) = &self.remove_custom_fields {
11188 format!("{remove_custom_fields:?}").into()
11189 } else {
11190 String::new().into()
11191 },
11192 if let Some(remove_all_custom_fields) = &self.remove_all_custom_fields {
11193 format!("{remove_all_custom_fields:?}").into()
11194 } else {
11195 String::new().into()
11196 },
11197 if let Some(remove_all_owners) = &self.remove_all_owners {
11198 format!("{remove_all_owners:?}").into()
11199 } else {
11200 String::new().into()
11201 },
11202 if let Some(remove_owners) = &self.remove_owners {
11203 format!("{remove_owners:?}").into()
11204 } else {
11205 String::new().into()
11206 },
11207 if let Some(remove_all_permissions) = &self.remove_all_permissions {
11208 format!("{remove_all_permissions:?}").into()
11209 } else {
11210 String::new().into()
11211 },
11212 if let Some(remove_view_users) = &self.remove_view_users {
11213 format!("{remove_view_users:?}").into()
11214 } else {
11215 String::new().into()
11216 },
11217 if let Some(remove_view_groups) = &self.remove_view_groups {
11218 format!("{remove_view_groups:?}").into()
11219 } else {
11220 String::new().into()
11221 },
11222 if let Some(remove_change_users) = &self.remove_change_users {
11223 format!("{remove_change_users:?}").into()
11224 } else {
11225 String::new().into()
11226 },
11227 if let Some(remove_change_groups) = &self.remove_change_groups {
11228 format!("{remove_change_groups:?}").into()
11229 } else {
11230 String::new().into()
11231 },
11232 if let Some(email) = &self.email {
11233 format!("{email:?}").into()
11234 } else {
11235 String::new().into()
11236 },
11237 if let Some(webhook) = &self.webhook {
11238 format!("{webhook:?}").into()
11239 } else {
11240 String::new().into()
11241 },
11242 ]
11243 }
11244
11245 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11246 vec![
11247 "id".into(),
11248 "type_".into(),
11249 "assign_title".into(),
11250 "assign_tags".into(),
11251 "assign_correspondent".into(),
11252 "assign_document_type".into(),
11253 "assign_storage_path".into(),
11254 "assign_owner".into(),
11255 "assign_view_users".into(),
11256 "assign_view_groups".into(),
11257 "assign_change_users".into(),
11258 "assign_change_groups".into(),
11259 "assign_custom_fields".into(),
11260 "assign_custom_fields_values".into(),
11261 "remove_all_tags".into(),
11262 "remove_tags".into(),
11263 "remove_all_correspondents".into(),
11264 "remove_correspondents".into(),
11265 "remove_all_document_types".into(),
11266 "remove_document_types".into(),
11267 "remove_all_storage_paths".into(),
11268 "remove_storage_paths".into(),
11269 "remove_custom_fields".into(),
11270 "remove_all_custom_fields".into(),
11271 "remove_all_owners".into(),
11272 "remove_owners".into(),
11273 "remove_all_permissions".into(),
11274 "remove_view_users".into(),
11275 "remove_view_groups".into(),
11276 "remove_change_users".into(),
11277 "remove_change_groups".into(),
11278 "email".into(),
11279 "webhook".into(),
11280 ]
11281 }
11282}
11283
11284#[derive(
11285 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11286)]
11287#[allow(non_snake_case)]
11288pub struct WorkflowActionEmail {
11289 #[serde(default, skip_serializing_if = "Option::is_none")]
11290 pub id: Option<i64>,
11291 #[doc = "The subject of the email, can include some placeholders, see documentation."]
11292 pub subject: String,
11293 #[doc = "The body (message) of the email, can include some placeholders, see documentation."]
11294 pub body: String,
11295 #[doc = "The destination email addresses, comma separated."]
11296 pub to: String,
11297 #[serde(default, skip_serializing_if = "Option::is_none")]
11298 pub include_document: Option<bool>,
11299}
11300
11301impl std::fmt::Display for WorkflowActionEmail {
11302 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11303 write!(
11304 f,
11305 "{}",
11306 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11307 )
11308 }
11309}
11310
11311#[cfg(feature = "tabled")]
11312impl tabled::Tabled for WorkflowActionEmail {
11313 const LENGTH: usize = 5;
11314 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11315 vec![
11316 if let Some(id) = &self.id {
11317 format!("{id:?}").into()
11318 } else {
11319 String::new().into()
11320 },
11321 self.subject.clone().into(),
11322 self.body.clone().into(),
11323 self.to.clone().into(),
11324 if let Some(include_document) = &self.include_document {
11325 format!("{include_document:?}").into()
11326 } else {
11327 String::new().into()
11328 },
11329 ]
11330 }
11331
11332 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11333 vec![
11334 "id".into(),
11335 "subject".into(),
11336 "body".into(),
11337 "to".into(),
11338 "include_document".into(),
11339 ]
11340 }
11341}
11342
11343#[derive(
11344 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11345)]
11346#[allow(non_snake_case)]
11347pub struct WorkflowActionEmailRequest {
11348 #[serde(default, skip_serializing_if = "Option::is_none")]
11349 pub id: Option<i64>,
11350 #[doc = "The subject of the email, can include some placeholders, see documentation."]
11351 pub subject: String,
11352 #[doc = "The body (message) of the email, can include some placeholders, see documentation."]
11353 pub body: String,
11354 #[doc = "The destination email addresses, comma separated."]
11355 pub to: String,
11356 #[serde(default, skip_serializing_if = "Option::is_none")]
11357 pub include_document: Option<bool>,
11358}
11359
11360impl std::fmt::Display for WorkflowActionEmailRequest {
11361 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11362 write!(
11363 f,
11364 "{}",
11365 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11366 )
11367 }
11368}
11369
11370#[cfg(feature = "tabled")]
11371impl tabled::Tabled for WorkflowActionEmailRequest {
11372 const LENGTH: usize = 5;
11373 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11374 vec![
11375 if let Some(id) = &self.id {
11376 format!("{id:?}").into()
11377 } else {
11378 String::new().into()
11379 },
11380 self.subject.clone().into(),
11381 self.body.clone().into(),
11382 self.to.clone().into(),
11383 if let Some(include_document) = &self.include_document {
11384 format!("{include_document:?}").into()
11385 } else {
11386 String::new().into()
11387 },
11388 ]
11389 }
11390
11391 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11392 vec![
11393 "id".into(),
11394 "subject".into(),
11395 "body".into(),
11396 "to".into(),
11397 "include_document".into(),
11398 ]
11399 }
11400}
11401
11402#[derive(
11403 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11404)]
11405#[allow(non_snake_case)]
11406pub struct WorkflowActionRequest {
11407 #[serde(default, skip_serializing_if = "Option::is_none")]
11408 pub id: Option<i64>,
11409 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
11410 pub type_: Option<WorkflowActionTypeEnum>,
11411 #[doc = "Assign a document title, must be a Jinja2 template, see documentation."]
11412 #[serde(default, skip_serializing_if = "Option::is_none")]
11413 pub assign_title: Option<String>,
11414 #[serde(default, skip_serializing_if = "Option::is_none")]
11415 pub assign_tags: Option<Vec<Option<i64>>>,
11416 #[serde(default, skip_serializing_if = "Option::is_none")]
11417 pub assign_correspondent: Option<i64>,
11418 #[serde(default, skip_serializing_if = "Option::is_none")]
11419 pub assign_document_type: Option<i64>,
11420 #[serde(default, skip_serializing_if = "Option::is_none")]
11421 pub assign_storage_path: Option<i64>,
11422 #[serde(default, skip_serializing_if = "Option::is_none")]
11423 pub assign_owner: Option<i64>,
11424 #[serde(default, skip_serializing_if = "Option::is_none")]
11425 pub assign_view_users: Option<Vec<i64>>,
11426 #[serde(default, skip_serializing_if = "Option::is_none")]
11427 pub assign_view_groups: Option<Vec<i64>>,
11428 #[serde(default, skip_serializing_if = "Option::is_none")]
11429 pub assign_change_users: Option<Vec<i64>>,
11430 #[serde(default, skip_serializing_if = "Option::is_none")]
11431 pub assign_change_groups: Option<Vec<i64>>,
11432 #[serde(default, skip_serializing_if = "Option::is_none")]
11433 pub assign_custom_fields: Option<Vec<i64>>,
11434 #[doc = "Optional values to assign to the custom fields."]
11435 #[serde(default, skip_serializing_if = "Option::is_none")]
11436 pub assign_custom_fields_values: Option<serde_json::Value>,
11437 #[serde(default, skip_serializing_if = "Option::is_none")]
11438 pub remove_all_tags: Option<bool>,
11439 #[serde(default, skip_serializing_if = "Option::is_none")]
11440 pub remove_tags: Option<Vec<i64>>,
11441 #[serde(default, skip_serializing_if = "Option::is_none")]
11442 pub remove_all_correspondents: Option<bool>,
11443 #[serde(default, skip_serializing_if = "Option::is_none")]
11444 pub remove_correspondents: Option<Vec<i64>>,
11445 #[serde(default, skip_serializing_if = "Option::is_none")]
11446 pub remove_all_document_types: Option<bool>,
11447 #[serde(default, skip_serializing_if = "Option::is_none")]
11448 pub remove_document_types: Option<Vec<i64>>,
11449 #[serde(default, skip_serializing_if = "Option::is_none")]
11450 pub remove_all_storage_paths: Option<bool>,
11451 #[serde(default, skip_serializing_if = "Option::is_none")]
11452 pub remove_storage_paths: Option<Vec<i64>>,
11453 #[serde(default, skip_serializing_if = "Option::is_none")]
11454 pub remove_custom_fields: Option<Vec<i64>>,
11455 #[serde(default, skip_serializing_if = "Option::is_none")]
11456 pub remove_all_custom_fields: Option<bool>,
11457 #[serde(default, skip_serializing_if = "Option::is_none")]
11458 pub remove_all_owners: Option<bool>,
11459 #[serde(default, skip_serializing_if = "Option::is_none")]
11460 pub remove_owners: Option<Vec<i64>>,
11461 #[serde(default, skip_serializing_if = "Option::is_none")]
11462 pub remove_all_permissions: Option<bool>,
11463 #[serde(default, skip_serializing_if = "Option::is_none")]
11464 pub remove_view_users: Option<Vec<i64>>,
11465 #[serde(default, skip_serializing_if = "Option::is_none")]
11466 pub remove_view_groups: Option<Vec<i64>>,
11467 #[serde(default, skip_serializing_if = "Option::is_none")]
11468 pub remove_change_users: Option<Vec<i64>>,
11469 #[serde(default, skip_serializing_if = "Option::is_none")]
11470 pub remove_change_groups: Option<Vec<i64>>,
11471 #[serde(default, skip_serializing_if = "Option::is_none")]
11472 pub email: Option<WorkflowActionEmailRequest>,
11473 #[serde(default, skip_serializing_if = "Option::is_none")]
11474 pub webhook: Option<WorkflowActionWebhookRequest>,
11475}
11476
11477impl std::fmt::Display for WorkflowActionRequest {
11478 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11479 write!(
11480 f,
11481 "{}",
11482 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11483 )
11484 }
11485}
11486
11487#[cfg(feature = "tabled")]
11488impl tabled::Tabled for WorkflowActionRequest {
11489 const LENGTH: usize = 33;
11490 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11491 vec![
11492 if let Some(id) = &self.id {
11493 format!("{id:?}").into()
11494 } else {
11495 String::new().into()
11496 },
11497 if let Some(type_) = &self.type_ {
11498 format!("{type_:?}").into()
11499 } else {
11500 String::new().into()
11501 },
11502 if let Some(assign_title) = &self.assign_title {
11503 format!("{assign_title:?}").into()
11504 } else {
11505 String::new().into()
11506 },
11507 if let Some(assign_tags) = &self.assign_tags {
11508 format!("{assign_tags:?}").into()
11509 } else {
11510 String::new().into()
11511 },
11512 if let Some(assign_correspondent) = &self.assign_correspondent {
11513 format!("{assign_correspondent:?}").into()
11514 } else {
11515 String::new().into()
11516 },
11517 if let Some(assign_document_type) = &self.assign_document_type {
11518 format!("{assign_document_type:?}").into()
11519 } else {
11520 String::new().into()
11521 },
11522 if let Some(assign_storage_path) = &self.assign_storage_path {
11523 format!("{assign_storage_path:?}").into()
11524 } else {
11525 String::new().into()
11526 },
11527 if let Some(assign_owner) = &self.assign_owner {
11528 format!("{assign_owner:?}").into()
11529 } else {
11530 String::new().into()
11531 },
11532 if let Some(assign_view_users) = &self.assign_view_users {
11533 format!("{assign_view_users:?}").into()
11534 } else {
11535 String::new().into()
11536 },
11537 if let Some(assign_view_groups) = &self.assign_view_groups {
11538 format!("{assign_view_groups:?}").into()
11539 } else {
11540 String::new().into()
11541 },
11542 if let Some(assign_change_users) = &self.assign_change_users {
11543 format!("{assign_change_users:?}").into()
11544 } else {
11545 String::new().into()
11546 },
11547 if let Some(assign_change_groups) = &self.assign_change_groups {
11548 format!("{assign_change_groups:?}").into()
11549 } else {
11550 String::new().into()
11551 },
11552 if let Some(assign_custom_fields) = &self.assign_custom_fields {
11553 format!("{assign_custom_fields:?}").into()
11554 } else {
11555 String::new().into()
11556 },
11557 if let Some(assign_custom_fields_values) = &self.assign_custom_fields_values {
11558 format!("{assign_custom_fields_values:?}").into()
11559 } else {
11560 String::new().into()
11561 },
11562 if let Some(remove_all_tags) = &self.remove_all_tags {
11563 format!("{remove_all_tags:?}").into()
11564 } else {
11565 String::new().into()
11566 },
11567 if let Some(remove_tags) = &self.remove_tags {
11568 format!("{remove_tags:?}").into()
11569 } else {
11570 String::new().into()
11571 },
11572 if let Some(remove_all_correspondents) = &self.remove_all_correspondents {
11573 format!("{remove_all_correspondents:?}").into()
11574 } else {
11575 String::new().into()
11576 },
11577 if let Some(remove_correspondents) = &self.remove_correspondents {
11578 format!("{remove_correspondents:?}").into()
11579 } else {
11580 String::new().into()
11581 },
11582 if let Some(remove_all_document_types) = &self.remove_all_document_types {
11583 format!("{remove_all_document_types:?}").into()
11584 } else {
11585 String::new().into()
11586 },
11587 if let Some(remove_document_types) = &self.remove_document_types {
11588 format!("{remove_document_types:?}").into()
11589 } else {
11590 String::new().into()
11591 },
11592 if let Some(remove_all_storage_paths) = &self.remove_all_storage_paths {
11593 format!("{remove_all_storage_paths:?}").into()
11594 } else {
11595 String::new().into()
11596 },
11597 if let Some(remove_storage_paths) = &self.remove_storage_paths {
11598 format!("{remove_storage_paths:?}").into()
11599 } else {
11600 String::new().into()
11601 },
11602 if let Some(remove_custom_fields) = &self.remove_custom_fields {
11603 format!("{remove_custom_fields:?}").into()
11604 } else {
11605 String::new().into()
11606 },
11607 if let Some(remove_all_custom_fields) = &self.remove_all_custom_fields {
11608 format!("{remove_all_custom_fields:?}").into()
11609 } else {
11610 String::new().into()
11611 },
11612 if let Some(remove_all_owners) = &self.remove_all_owners {
11613 format!("{remove_all_owners:?}").into()
11614 } else {
11615 String::new().into()
11616 },
11617 if let Some(remove_owners) = &self.remove_owners {
11618 format!("{remove_owners:?}").into()
11619 } else {
11620 String::new().into()
11621 },
11622 if let Some(remove_all_permissions) = &self.remove_all_permissions {
11623 format!("{remove_all_permissions:?}").into()
11624 } else {
11625 String::new().into()
11626 },
11627 if let Some(remove_view_users) = &self.remove_view_users {
11628 format!("{remove_view_users:?}").into()
11629 } else {
11630 String::new().into()
11631 },
11632 if let Some(remove_view_groups) = &self.remove_view_groups {
11633 format!("{remove_view_groups:?}").into()
11634 } else {
11635 String::new().into()
11636 },
11637 if let Some(remove_change_users) = &self.remove_change_users {
11638 format!("{remove_change_users:?}").into()
11639 } else {
11640 String::new().into()
11641 },
11642 if let Some(remove_change_groups) = &self.remove_change_groups {
11643 format!("{remove_change_groups:?}").into()
11644 } else {
11645 String::new().into()
11646 },
11647 if let Some(email) = &self.email {
11648 format!("{email:?}").into()
11649 } else {
11650 String::new().into()
11651 },
11652 if let Some(webhook) = &self.webhook {
11653 format!("{webhook:?}").into()
11654 } else {
11655 String::new().into()
11656 },
11657 ]
11658 }
11659
11660 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11661 vec![
11662 "id".into(),
11663 "type_".into(),
11664 "assign_title".into(),
11665 "assign_tags".into(),
11666 "assign_correspondent".into(),
11667 "assign_document_type".into(),
11668 "assign_storage_path".into(),
11669 "assign_owner".into(),
11670 "assign_view_users".into(),
11671 "assign_view_groups".into(),
11672 "assign_change_users".into(),
11673 "assign_change_groups".into(),
11674 "assign_custom_fields".into(),
11675 "assign_custom_fields_values".into(),
11676 "remove_all_tags".into(),
11677 "remove_tags".into(),
11678 "remove_all_correspondents".into(),
11679 "remove_correspondents".into(),
11680 "remove_all_document_types".into(),
11681 "remove_document_types".into(),
11682 "remove_all_storage_paths".into(),
11683 "remove_storage_paths".into(),
11684 "remove_custom_fields".into(),
11685 "remove_all_custom_fields".into(),
11686 "remove_all_owners".into(),
11687 "remove_owners".into(),
11688 "remove_all_permissions".into(),
11689 "remove_view_users".into(),
11690 "remove_view_groups".into(),
11691 "remove_change_users".into(),
11692 "remove_change_groups".into(),
11693 "email".into(),
11694 "webhook".into(),
11695 ]
11696 }
11697}
11698
11699#[doc = "* `1` - Assignment\n* `2` - Removal\n* `3` - Email\n* `4` - Webhook"]
11700#[derive(
11701 serde_repr :: Serialize_repr,
11702 serde_repr :: Deserialize_repr,
11703 PartialEq,
11704 Hash,
11705 Debug,
11706 Clone,
11707 Copy,
11708 schemars :: JsonSchema,
11709)]
11710#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
11711#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
11712#[repr(i64)]
11713pub enum WorkflowActionTypeEnum {
11714 #[doc = "Assignment"]
11715 Assignment = 1,
11716 #[doc = "Removal"]
11717 Removal = 2,
11718 #[doc = "Email"]
11719 Email = 3,
11720 #[doc = "Webhook"]
11721 Webhook = 4,
11722}
11723
11724#[derive(
11725 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11726)]
11727#[allow(non_snake_case)]
11728pub struct WorkflowActionWebhook {
11729 #[serde(default, skip_serializing_if = "Option::is_none")]
11730 pub id: Option<i64>,
11731 #[doc = "The destination URL for the notification."]
11732 pub url: String,
11733 #[serde(default, skip_serializing_if = "Option::is_none")]
11734 pub use_params: Option<bool>,
11735 #[serde(default, skip_serializing_if = "Option::is_none")]
11736 pub as_json: Option<bool>,
11737 #[doc = "The parameters to send with the webhook URL if body not used."]
11738 #[serde(default, skip_serializing_if = "Option::is_none")]
11739 pub params: Option<serde_json::Value>,
11740 #[doc = "The body to send with the webhook URL if parameters not used."]
11741 #[serde(default, skip_serializing_if = "Option::is_none")]
11742 pub body: Option<String>,
11743 #[doc = "The headers to send with the webhook URL."]
11744 #[serde(default, skip_serializing_if = "Option::is_none")]
11745 pub headers: Option<serde_json::Value>,
11746 #[serde(default, skip_serializing_if = "Option::is_none")]
11747 pub include_document: Option<bool>,
11748}
11749
11750impl std::fmt::Display for WorkflowActionWebhook {
11751 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11752 write!(
11753 f,
11754 "{}",
11755 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11756 )
11757 }
11758}
11759
11760#[cfg(feature = "tabled")]
11761impl tabled::Tabled for WorkflowActionWebhook {
11762 const LENGTH: usize = 8;
11763 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11764 vec![
11765 if let Some(id) = &self.id {
11766 format!("{id:?}").into()
11767 } else {
11768 String::new().into()
11769 },
11770 self.url.clone().into(),
11771 if let Some(use_params) = &self.use_params {
11772 format!("{use_params:?}").into()
11773 } else {
11774 String::new().into()
11775 },
11776 if let Some(as_json) = &self.as_json {
11777 format!("{as_json:?}").into()
11778 } else {
11779 String::new().into()
11780 },
11781 if let Some(params) = &self.params {
11782 format!("{params:?}").into()
11783 } else {
11784 String::new().into()
11785 },
11786 if let Some(body) = &self.body {
11787 format!("{body:?}").into()
11788 } else {
11789 String::new().into()
11790 },
11791 if let Some(headers) = &self.headers {
11792 format!("{headers:?}").into()
11793 } else {
11794 String::new().into()
11795 },
11796 if let Some(include_document) = &self.include_document {
11797 format!("{include_document:?}").into()
11798 } else {
11799 String::new().into()
11800 },
11801 ]
11802 }
11803
11804 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11805 vec![
11806 "id".into(),
11807 "url".into(),
11808 "use_params".into(),
11809 "as_json".into(),
11810 "params".into(),
11811 "body".into(),
11812 "headers".into(),
11813 "include_document".into(),
11814 ]
11815 }
11816}
11817
11818#[derive(
11819 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11820)]
11821#[allow(non_snake_case)]
11822pub struct WorkflowActionWebhookRequest {
11823 #[serde(default, skip_serializing_if = "Option::is_none")]
11824 pub id: Option<i64>,
11825 #[doc = "The destination URL for the notification."]
11826 pub url: String,
11827 #[serde(default, skip_serializing_if = "Option::is_none")]
11828 pub use_params: Option<bool>,
11829 #[serde(default, skip_serializing_if = "Option::is_none")]
11830 pub as_json: Option<bool>,
11831 #[doc = "The parameters to send with the webhook URL if body not used."]
11832 #[serde(default, skip_serializing_if = "Option::is_none")]
11833 pub params: Option<serde_json::Value>,
11834 #[doc = "The body to send with the webhook URL if parameters not used."]
11835 #[serde(default, skip_serializing_if = "Option::is_none")]
11836 pub body: Option<String>,
11837 #[doc = "The headers to send with the webhook URL."]
11838 #[serde(default, skip_serializing_if = "Option::is_none")]
11839 pub headers: Option<serde_json::Value>,
11840 #[serde(default, skip_serializing_if = "Option::is_none")]
11841 pub include_document: Option<bool>,
11842}
11843
11844impl std::fmt::Display for WorkflowActionWebhookRequest {
11845 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11846 write!(
11847 f,
11848 "{}",
11849 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11850 )
11851 }
11852}
11853
11854#[cfg(feature = "tabled")]
11855impl tabled::Tabled for WorkflowActionWebhookRequest {
11856 const LENGTH: usize = 8;
11857 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11858 vec![
11859 if let Some(id) = &self.id {
11860 format!("{id:?}").into()
11861 } else {
11862 String::new().into()
11863 },
11864 self.url.clone().into(),
11865 if let Some(use_params) = &self.use_params {
11866 format!("{use_params:?}").into()
11867 } else {
11868 String::new().into()
11869 },
11870 if let Some(as_json) = &self.as_json {
11871 format!("{as_json:?}").into()
11872 } else {
11873 String::new().into()
11874 },
11875 if let Some(params) = &self.params {
11876 format!("{params:?}").into()
11877 } else {
11878 String::new().into()
11879 },
11880 if let Some(body) = &self.body {
11881 format!("{body:?}").into()
11882 } else {
11883 String::new().into()
11884 },
11885 if let Some(headers) = &self.headers {
11886 format!("{headers:?}").into()
11887 } else {
11888 String::new().into()
11889 },
11890 if let Some(include_document) = &self.include_document {
11891 format!("{include_document:?}").into()
11892 } else {
11893 String::new().into()
11894 },
11895 ]
11896 }
11897
11898 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11899 vec![
11900 "id".into(),
11901 "url".into(),
11902 "use_params".into(),
11903 "as_json".into(),
11904 "params".into(),
11905 "body".into(),
11906 "headers".into(),
11907 "include_document".into(),
11908 ]
11909 }
11910}
11911
11912#[derive(
11913 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11914)]
11915#[allow(non_snake_case)]
11916pub struct WorkflowRequest {
11917 pub name: String,
11918 #[serde(default, skip_serializing_if = "Option::is_none")]
11919 pub order: Option<i64>,
11920 #[serde(default, skip_serializing_if = "Option::is_none")]
11921 pub enabled: Option<bool>,
11922 pub triggers: Vec<WorkflowTriggerRequest>,
11923 pub actions: Vec<WorkflowActionRequest>,
11924}
11925
11926impl std::fmt::Display for WorkflowRequest {
11927 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11928 write!(
11929 f,
11930 "{}",
11931 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11932 )
11933 }
11934}
11935
11936#[cfg(feature = "tabled")]
11937impl tabled::Tabled for WorkflowRequest {
11938 const LENGTH: usize = 5;
11939 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11940 vec![
11941 self.name.clone().into(),
11942 if let Some(order) = &self.order {
11943 format!("{order:?}").into()
11944 } else {
11945 String::new().into()
11946 },
11947 if let Some(enabled) = &self.enabled {
11948 format!("{enabled:?}").into()
11949 } else {
11950 String::new().into()
11951 },
11952 format!("{:?}", self.triggers).into(),
11953 format!("{:?}", self.actions).into(),
11954 ]
11955 }
11956
11957 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11958 vec![
11959 "name".into(),
11960 "order".into(),
11961 "enabled".into(),
11962 "triggers".into(),
11963 "actions".into(),
11964 ]
11965 }
11966}
11967
11968#[derive(
11969 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11970)]
11971#[allow(non_snake_case)]
11972pub struct WorkflowTrigger {
11973 #[serde(default, skip_serializing_if = "Option::is_none")]
11974 pub id: Option<i64>,
11975 #[serde(default)]
11976 pub sources: Vec<SourcesEnum>,
11977 #[serde(rename = "type")]
11978 pub type_: WorkflowTriggerTypeEnum,
11979 #[doc = "Only consume documents with a path that matches this if specified. Wildcards specified as * are allowed. Case insensitive."]
11980 #[serde(default, skip_serializing_if = "Option::is_none")]
11981 pub filter_path: Option<String>,
11982 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
11983 #[serde(default, skip_serializing_if = "Option::is_none")]
11984 pub filter_filename: Option<String>,
11985 #[serde(default, skip_serializing_if = "Option::is_none")]
11986 pub filter_mailrule: Option<i64>,
11987 #[serde(default, skip_serializing_if = "Option::is_none")]
11988 pub matching_algorithm: Option<WorkflowTriggerMatchingAlgorithmEnum>,
11989 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
11990 pub match_: Option<String>,
11991 #[serde(default, skip_serializing_if = "Option::is_none")]
11992 pub is_insensitive: Option<bool>,
11993 #[serde(default, skip_serializing_if = "Option::is_none")]
11994 pub filter_has_tags: Option<Vec<i64>>,
11995 #[serde(default, skip_serializing_if = "Option::is_none")]
11996 pub filter_has_all_tags: Option<Vec<i64>>,
11997 #[serde(default, skip_serializing_if = "Option::is_none")]
11998 pub filter_has_not_tags: Option<Vec<i64>>,
11999 #[doc = "JSON-encoded custom field query expression."]
12000 #[serde(default, skip_serializing_if = "Option::is_none")]
12001 pub filter_custom_field_query: Option<String>,
12002 #[serde(default, skip_serializing_if = "Option::is_none")]
12003 pub filter_has_not_correspondents: Option<Vec<i64>>,
12004 #[serde(default, skip_serializing_if = "Option::is_none")]
12005 pub filter_has_not_document_types: Option<Vec<i64>>,
12006 #[serde(default, skip_serializing_if = "Option::is_none")]
12007 pub filter_has_not_storage_paths: Option<Vec<i64>>,
12008 #[serde(default, skip_serializing_if = "Option::is_none")]
12009 pub filter_has_correspondent: Option<i64>,
12010 #[serde(default, skip_serializing_if = "Option::is_none")]
12011 pub filter_has_document_type: Option<i64>,
12012 #[serde(default, skip_serializing_if = "Option::is_none")]
12013 pub filter_has_storage_path: Option<i64>,
12014 #[doc = "The number of days to offset the schedule trigger by."]
12015 #[serde(default, skip_serializing_if = "Option::is_none")]
12016 pub schedule_offset_days: Option<i64>,
12017 #[doc = "If the schedule should be recurring."]
12018 #[serde(default, skip_serializing_if = "Option::is_none")]
12019 pub schedule_is_recurring: Option<bool>,
12020 #[doc = "The number of days between recurring schedule triggers."]
12021 #[serde(default, skip_serializing_if = "Option::is_none")]
12022 pub schedule_recurring_interval_days: Option<i64>,
12023 #[doc = "The field to check for a schedule trigger.\n\n* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
12024 #[serde(default, skip_serializing_if = "Option::is_none")]
12025 pub schedule_date_field: Option<ScheduleDateFieldEnum>,
12026 #[serde(default, skip_serializing_if = "Option::is_none")]
12027 pub schedule_date_custom_field: Option<i64>,
12028}
12029
12030impl std::fmt::Display for WorkflowTrigger {
12031 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12032 write!(
12033 f,
12034 "{}",
12035 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12036 )
12037 }
12038}
12039
12040#[cfg(feature = "tabled")]
12041impl tabled::Tabled for WorkflowTrigger {
12042 const LENGTH: usize = 24;
12043 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12044 vec![
12045 if let Some(id) = &self.id {
12046 format!("{id:?}").into()
12047 } else {
12048 String::new().into()
12049 },
12050 format!("{:?}", self.sources).into(),
12051 format!("{:?}", self.type_).into(),
12052 if let Some(filter_path) = &self.filter_path {
12053 format!("{filter_path:?}").into()
12054 } else {
12055 String::new().into()
12056 },
12057 if let Some(filter_filename) = &self.filter_filename {
12058 format!("{filter_filename:?}").into()
12059 } else {
12060 String::new().into()
12061 },
12062 if let Some(filter_mailrule) = &self.filter_mailrule {
12063 format!("{filter_mailrule:?}").into()
12064 } else {
12065 String::new().into()
12066 },
12067 if let Some(matching_algorithm) = &self.matching_algorithm {
12068 format!("{matching_algorithm:?}").into()
12069 } else {
12070 String::new().into()
12071 },
12072 if let Some(match_) = &self.match_ {
12073 format!("{match_:?}").into()
12074 } else {
12075 String::new().into()
12076 },
12077 if let Some(is_insensitive) = &self.is_insensitive {
12078 format!("{is_insensitive:?}").into()
12079 } else {
12080 String::new().into()
12081 },
12082 if let Some(filter_has_tags) = &self.filter_has_tags {
12083 format!("{filter_has_tags:?}").into()
12084 } else {
12085 String::new().into()
12086 },
12087 if let Some(filter_has_all_tags) = &self.filter_has_all_tags {
12088 format!("{filter_has_all_tags:?}").into()
12089 } else {
12090 String::new().into()
12091 },
12092 if let Some(filter_has_not_tags) = &self.filter_has_not_tags {
12093 format!("{filter_has_not_tags:?}").into()
12094 } else {
12095 String::new().into()
12096 },
12097 if let Some(filter_custom_field_query) = &self.filter_custom_field_query {
12098 format!("{filter_custom_field_query:?}").into()
12099 } else {
12100 String::new().into()
12101 },
12102 if let Some(filter_has_not_correspondents) = &self.filter_has_not_correspondents {
12103 format!("{filter_has_not_correspondents:?}").into()
12104 } else {
12105 String::new().into()
12106 },
12107 if let Some(filter_has_not_document_types) = &self.filter_has_not_document_types {
12108 format!("{filter_has_not_document_types:?}").into()
12109 } else {
12110 String::new().into()
12111 },
12112 if let Some(filter_has_not_storage_paths) = &self.filter_has_not_storage_paths {
12113 format!("{filter_has_not_storage_paths:?}").into()
12114 } else {
12115 String::new().into()
12116 },
12117 if let Some(filter_has_correspondent) = &self.filter_has_correspondent {
12118 format!("{filter_has_correspondent:?}").into()
12119 } else {
12120 String::new().into()
12121 },
12122 if let Some(filter_has_document_type) = &self.filter_has_document_type {
12123 format!("{filter_has_document_type:?}").into()
12124 } else {
12125 String::new().into()
12126 },
12127 if let Some(filter_has_storage_path) = &self.filter_has_storage_path {
12128 format!("{filter_has_storage_path:?}").into()
12129 } else {
12130 String::new().into()
12131 },
12132 if let Some(schedule_offset_days) = &self.schedule_offset_days {
12133 format!("{schedule_offset_days:?}").into()
12134 } else {
12135 String::new().into()
12136 },
12137 if let Some(schedule_is_recurring) = &self.schedule_is_recurring {
12138 format!("{schedule_is_recurring:?}").into()
12139 } else {
12140 String::new().into()
12141 },
12142 if let Some(schedule_recurring_interval_days) = &self.schedule_recurring_interval_days {
12143 format!("{schedule_recurring_interval_days:?}").into()
12144 } else {
12145 String::new().into()
12146 },
12147 if let Some(schedule_date_field) = &self.schedule_date_field {
12148 format!("{schedule_date_field:?}").into()
12149 } else {
12150 String::new().into()
12151 },
12152 if let Some(schedule_date_custom_field) = &self.schedule_date_custom_field {
12153 format!("{schedule_date_custom_field:?}").into()
12154 } else {
12155 String::new().into()
12156 },
12157 ]
12158 }
12159
12160 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12161 vec![
12162 "id".into(),
12163 "sources".into(),
12164 "type_".into(),
12165 "filter_path".into(),
12166 "filter_filename".into(),
12167 "filter_mailrule".into(),
12168 "matching_algorithm".into(),
12169 "match_".into(),
12170 "is_insensitive".into(),
12171 "filter_has_tags".into(),
12172 "filter_has_all_tags".into(),
12173 "filter_has_not_tags".into(),
12174 "filter_custom_field_query".into(),
12175 "filter_has_not_correspondents".into(),
12176 "filter_has_not_document_types".into(),
12177 "filter_has_not_storage_paths".into(),
12178 "filter_has_correspondent".into(),
12179 "filter_has_document_type".into(),
12180 "filter_has_storage_path".into(),
12181 "schedule_offset_days".into(),
12182 "schedule_is_recurring".into(),
12183 "schedule_recurring_interval_days".into(),
12184 "schedule_date_field".into(),
12185 "schedule_date_custom_field".into(),
12186 ]
12187 }
12188}
12189
12190#[doc = "* `0` - None\n* `1` - Any word\n* `2` - All words\n* `3` - Exact match\n* `4` - Regular expression\n* `5` - Fuzzy word"]
12191#[derive(
12192 serde_repr :: Serialize_repr,
12193 serde_repr :: Deserialize_repr,
12194 PartialEq,
12195 Hash,
12196 Debug,
12197 Clone,
12198 Copy,
12199 schemars :: JsonSchema,
12200)]
12201#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
12202#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
12203#[repr(i64)]
12204pub enum WorkflowTriggerMatchingAlgorithmEnum {
12205 #[doc = "None"]
12206 None = 0,
12207 #[doc = "Any word"]
12208 AnyWord = 1,
12209 #[doc = "All words"]
12210 AllWords = 2,
12211 #[doc = "Exact match"]
12212 ExactMatch = 3,
12213 #[doc = "Regular expression"]
12214 RegularExpression = 4,
12215 #[doc = "Fuzzy word"]
12216 FuzzyWord = 5,
12217}
12218
12219#[derive(
12220 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12221)]
12222#[allow(non_snake_case)]
12223pub struct WorkflowTriggerRequest {
12224 #[serde(default, skip_serializing_if = "Option::is_none")]
12225 pub id: Option<i64>,
12226 #[serde(default)]
12227 pub sources: Vec<SourcesEnum>,
12228 #[serde(rename = "type")]
12229 pub type_: WorkflowTriggerTypeEnum,
12230 #[doc = "Only consume documents with a path that matches this if specified. Wildcards specified as * are allowed. Case insensitive."]
12231 #[serde(default, skip_serializing_if = "Option::is_none")]
12232 pub filter_path: Option<String>,
12233 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
12234 #[serde(default, skip_serializing_if = "Option::is_none")]
12235 pub filter_filename: Option<String>,
12236 #[serde(default, skip_serializing_if = "Option::is_none")]
12237 pub filter_mailrule: Option<i64>,
12238 #[serde(default, skip_serializing_if = "Option::is_none")]
12239 pub matching_algorithm: Option<WorkflowTriggerMatchingAlgorithmEnum>,
12240 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
12241 pub match_: Option<String>,
12242 #[serde(default, skip_serializing_if = "Option::is_none")]
12243 pub is_insensitive: Option<bool>,
12244 #[serde(default, skip_serializing_if = "Option::is_none")]
12245 pub filter_has_tags: Option<Vec<i64>>,
12246 #[serde(default, skip_serializing_if = "Option::is_none")]
12247 pub filter_has_all_tags: Option<Vec<i64>>,
12248 #[serde(default, skip_serializing_if = "Option::is_none")]
12249 pub filter_has_not_tags: Option<Vec<i64>>,
12250 #[doc = "JSON-encoded custom field query expression."]
12251 #[serde(default, skip_serializing_if = "Option::is_none")]
12252 pub filter_custom_field_query: Option<String>,
12253 #[serde(default, skip_serializing_if = "Option::is_none")]
12254 pub filter_has_not_correspondents: Option<Vec<i64>>,
12255 #[serde(default, skip_serializing_if = "Option::is_none")]
12256 pub filter_has_not_document_types: Option<Vec<i64>>,
12257 #[serde(default, skip_serializing_if = "Option::is_none")]
12258 pub filter_has_not_storage_paths: Option<Vec<i64>>,
12259 #[serde(default, skip_serializing_if = "Option::is_none")]
12260 pub filter_has_correspondent: Option<i64>,
12261 #[serde(default, skip_serializing_if = "Option::is_none")]
12262 pub filter_has_document_type: Option<i64>,
12263 #[serde(default, skip_serializing_if = "Option::is_none")]
12264 pub filter_has_storage_path: Option<i64>,
12265 #[doc = "The number of days to offset the schedule trigger by."]
12266 #[serde(default, skip_serializing_if = "Option::is_none")]
12267 pub schedule_offset_days: Option<i64>,
12268 #[doc = "If the schedule should be recurring."]
12269 #[serde(default, skip_serializing_if = "Option::is_none")]
12270 pub schedule_is_recurring: Option<bool>,
12271 #[doc = "The number of days between recurring schedule triggers."]
12272 #[serde(default, skip_serializing_if = "Option::is_none")]
12273 pub schedule_recurring_interval_days: Option<i64>,
12274 #[doc = "The field to check for a schedule trigger.\n\n* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
12275 #[serde(default, skip_serializing_if = "Option::is_none")]
12276 pub schedule_date_field: Option<ScheduleDateFieldEnum>,
12277 #[serde(default, skip_serializing_if = "Option::is_none")]
12278 pub schedule_date_custom_field: Option<i64>,
12279}
12280
12281impl std::fmt::Display for WorkflowTriggerRequest {
12282 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12283 write!(
12284 f,
12285 "{}",
12286 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12287 )
12288 }
12289}
12290
12291#[cfg(feature = "tabled")]
12292impl tabled::Tabled for WorkflowTriggerRequest {
12293 const LENGTH: usize = 24;
12294 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12295 vec![
12296 if let Some(id) = &self.id {
12297 format!("{id:?}").into()
12298 } else {
12299 String::new().into()
12300 },
12301 format!("{:?}", self.sources).into(),
12302 format!("{:?}", self.type_).into(),
12303 if let Some(filter_path) = &self.filter_path {
12304 format!("{filter_path:?}").into()
12305 } else {
12306 String::new().into()
12307 },
12308 if let Some(filter_filename) = &self.filter_filename {
12309 format!("{filter_filename:?}").into()
12310 } else {
12311 String::new().into()
12312 },
12313 if let Some(filter_mailrule) = &self.filter_mailrule {
12314 format!("{filter_mailrule:?}").into()
12315 } else {
12316 String::new().into()
12317 },
12318 if let Some(matching_algorithm) = &self.matching_algorithm {
12319 format!("{matching_algorithm:?}").into()
12320 } else {
12321 String::new().into()
12322 },
12323 if let Some(match_) = &self.match_ {
12324 format!("{match_:?}").into()
12325 } else {
12326 String::new().into()
12327 },
12328 if let Some(is_insensitive) = &self.is_insensitive {
12329 format!("{is_insensitive:?}").into()
12330 } else {
12331 String::new().into()
12332 },
12333 if let Some(filter_has_tags) = &self.filter_has_tags {
12334 format!("{filter_has_tags:?}").into()
12335 } else {
12336 String::new().into()
12337 },
12338 if let Some(filter_has_all_tags) = &self.filter_has_all_tags {
12339 format!("{filter_has_all_tags:?}").into()
12340 } else {
12341 String::new().into()
12342 },
12343 if let Some(filter_has_not_tags) = &self.filter_has_not_tags {
12344 format!("{filter_has_not_tags:?}").into()
12345 } else {
12346 String::new().into()
12347 },
12348 if let Some(filter_custom_field_query) = &self.filter_custom_field_query {
12349 format!("{filter_custom_field_query:?}").into()
12350 } else {
12351 String::new().into()
12352 },
12353 if let Some(filter_has_not_correspondents) = &self.filter_has_not_correspondents {
12354 format!("{filter_has_not_correspondents:?}").into()
12355 } else {
12356 String::new().into()
12357 },
12358 if let Some(filter_has_not_document_types) = &self.filter_has_not_document_types {
12359 format!("{filter_has_not_document_types:?}").into()
12360 } else {
12361 String::new().into()
12362 },
12363 if let Some(filter_has_not_storage_paths) = &self.filter_has_not_storage_paths {
12364 format!("{filter_has_not_storage_paths:?}").into()
12365 } else {
12366 String::new().into()
12367 },
12368 if let Some(filter_has_correspondent) = &self.filter_has_correspondent {
12369 format!("{filter_has_correspondent:?}").into()
12370 } else {
12371 String::new().into()
12372 },
12373 if let Some(filter_has_document_type) = &self.filter_has_document_type {
12374 format!("{filter_has_document_type:?}").into()
12375 } else {
12376 String::new().into()
12377 },
12378 if let Some(filter_has_storage_path) = &self.filter_has_storage_path {
12379 format!("{filter_has_storage_path:?}").into()
12380 } else {
12381 String::new().into()
12382 },
12383 if let Some(schedule_offset_days) = &self.schedule_offset_days {
12384 format!("{schedule_offset_days:?}").into()
12385 } else {
12386 String::new().into()
12387 },
12388 if let Some(schedule_is_recurring) = &self.schedule_is_recurring {
12389 format!("{schedule_is_recurring:?}").into()
12390 } else {
12391 String::new().into()
12392 },
12393 if let Some(schedule_recurring_interval_days) = &self.schedule_recurring_interval_days {
12394 format!("{schedule_recurring_interval_days:?}").into()
12395 } else {
12396 String::new().into()
12397 },
12398 if let Some(schedule_date_field) = &self.schedule_date_field {
12399 format!("{schedule_date_field:?}").into()
12400 } else {
12401 String::new().into()
12402 },
12403 if let Some(schedule_date_custom_field) = &self.schedule_date_custom_field {
12404 format!("{schedule_date_custom_field:?}").into()
12405 } else {
12406 String::new().into()
12407 },
12408 ]
12409 }
12410
12411 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12412 vec![
12413 "id".into(),
12414 "sources".into(),
12415 "type_".into(),
12416 "filter_path".into(),
12417 "filter_filename".into(),
12418 "filter_mailrule".into(),
12419 "matching_algorithm".into(),
12420 "match_".into(),
12421 "is_insensitive".into(),
12422 "filter_has_tags".into(),
12423 "filter_has_all_tags".into(),
12424 "filter_has_not_tags".into(),
12425 "filter_custom_field_query".into(),
12426 "filter_has_not_correspondents".into(),
12427 "filter_has_not_document_types".into(),
12428 "filter_has_not_storage_paths".into(),
12429 "filter_has_correspondent".into(),
12430 "filter_has_document_type".into(),
12431 "filter_has_storage_path".into(),
12432 "schedule_offset_days".into(),
12433 "schedule_is_recurring".into(),
12434 "schedule_recurring_interval_days".into(),
12435 "schedule_date_field".into(),
12436 "schedule_date_custom_field".into(),
12437 ]
12438 }
12439}
12440
12441#[doc = "* `1` - Consumption Started\n* `2` - Document Added\n* `3` - Document Updated\n* `4` - Scheduled"]
12442#[derive(
12443 serde_repr :: Serialize_repr,
12444 serde_repr :: Deserialize_repr,
12445 PartialEq,
12446 Hash,
12447 Debug,
12448 Clone,
12449 Copy,
12450 schemars :: JsonSchema,
12451)]
12452#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
12453#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
12454#[repr(i64)]
12455pub enum WorkflowTriggerTypeEnum {
12456 #[doc = "Consumption Started"]
12457 ConsumptionStarted = 1,
12458 #[doc = "Document Added"]
12459 DocumentAdded = 2,
12460 #[doc = "Document Updated"]
12461 DocumentUpdated = 3,
12462 #[doc = "Scheduled"]
12463 Scheduled = 4,
12464}
12465
12466#[derive(
12467 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12468)]
12469#[allow(non_snake_case)]
12470pub struct DocumentShareLinksResponse {
12471 #[serde(default, skip_serializing_if = "Option::is_none")]
12472 pub id: Option<i64>,
12473 #[serde(default, skip_serializing_if = "Option::is_none")]
12474 pub created: Option<chrono::DateTime<chrono::Utc>>,
12475 #[serde(default, skip_serializing_if = "Option::is_none")]
12476 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
12477 #[serde(default, skip_serializing_if = "Option::is_none")]
12478 pub slug: Option<String>,
12479}
12480
12481impl std::fmt::Display for DocumentShareLinksResponse {
12482 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12483 write!(
12484 f,
12485 "{}",
12486 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12487 )
12488 }
12489}
12490
12491#[cfg(feature = "tabled")]
12492impl tabled::Tabled for DocumentShareLinksResponse {
12493 const LENGTH: usize = 4;
12494 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12495 vec![
12496 if let Some(id) = &self.id {
12497 format!("{id:?}").into()
12498 } else {
12499 String::new().into()
12500 },
12501 if let Some(created) = &self.created {
12502 format!("{created:?}").into()
12503 } else {
12504 String::new().into()
12505 },
12506 if let Some(expiration) = &self.expiration {
12507 format!("{expiration:?}").into()
12508 } else {
12509 String::new().into()
12510 },
12511 if let Some(slug) = &self.slug {
12512 format!("{slug:?}").into()
12513 } else {
12514 String::new().into()
12515 },
12516 ]
12517 }
12518
12519 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12520 vec![
12521 "id".into(),
12522 "created".into(),
12523 "expiration".into(),
12524 "slug".into(),
12525 ]
12526 }
12527}
12528
12529#[derive(
12530 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12531)]
12532#[allow(non_snake_case)]
12533pub struct ProfileDisconnectSocialAccountCreateRequestBody {
12534 pub id: i64,
12535}
12536
12537impl std::fmt::Display for ProfileDisconnectSocialAccountCreateRequestBody {
12538 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12539 write!(
12540 f,
12541 "{}",
12542 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12543 )
12544 }
12545}
12546
12547#[cfg(feature = "tabled")]
12548impl tabled::Tabled for ProfileDisconnectSocialAccountCreateRequestBody {
12549 const LENGTH: usize = 1;
12550 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12551 vec![format!("{:?}", self.id).into()]
12552 }
12553
12554 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12555 vec!["id".into()]
12556 }
12557}
12558
12559#[derive(
12560 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12561)]
12562#[allow(non_snake_case)]
12563pub struct ProfileTotpCreateRequestBody {
12564 pub secret: String,
12565 pub code: String,
12566}
12567
12568impl std::fmt::Display for ProfileTotpCreateRequestBody {
12569 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12570 write!(
12571 f,
12572 "{}",
12573 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12574 )
12575 }
12576}
12577
12578#[cfg(feature = "tabled")]
12579impl tabled::Tabled for ProfileTotpCreateRequestBody {
12580 const LENGTH: usize = 2;
12581 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12582 vec![self.secret.clone().into(), self.code.clone().into()]
12583 }
12584
12585 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12586 vec!["secret".into(), "code".into()]
12587 }
12588}
12589
12590#[derive(
12591 serde :: Serialize,
12592 serde :: Deserialize,
12593 PartialEq,
12594 Hash,
12595 Debug,
12596 Clone,
12597 schemars :: JsonSchema,
12598 parse_display :: FromStr,
12599 parse_display :: Display,
12600)]
12601#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
12602#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
12603pub enum Status {
12604 #[serde(rename = "FAILURE")]
12605 #[display("FAILURE")]
12606 Failure,
12607 #[serde(rename = "PENDING")]
12608 #[display("PENDING")]
12609 Pending,
12610 #[serde(rename = "RECEIVED")]
12611 #[display("RECEIVED")]
12612 Received,
12613 #[serde(rename = "RETRY")]
12614 #[display("RETRY")]
12615 Retry,
12616 #[serde(rename = "REVOKED")]
12617 #[display("REVOKED")]
12618 Revoked,
12619 #[serde(rename = "STARTED")]
12620 #[display("STARTED")]
12621 Started,
12622 #[serde(rename = "SUCCESS")]
12623 #[display("SUCCESS")]
12624 Success,
12625}
12626
12627#[derive(
12628 serde :: Serialize,
12629 serde :: Deserialize,
12630 PartialEq,
12631 Hash,
12632 Debug,
12633 Clone,
12634 schemars :: JsonSchema,
12635 parse_display :: FromStr,
12636 parse_display :: Display,
12637)]
12638#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
12639#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
12640pub enum ListTaskName {
12641 #[serde(rename = "check_sanity")]
12642 #[display("check_sanity")]
12643 CheckSanity,
12644 #[serde(rename = "consume_file")]
12645 #[display("consume_file")]
12646 ConsumeFile,
12647 #[serde(rename = "index_optimize")]
12648 #[display("index_optimize")]
12649 IndexOptimize,
12650 #[serde(rename = "train_classifier")]
12651 #[display("train_classifier")]
12652 TrainClassifier,
12653}
12654
12655#[derive(
12656 serde :: Serialize,
12657 serde :: Deserialize,
12658 PartialEq,
12659 Hash,
12660 Debug,
12661 Clone,
12662 schemars :: JsonSchema,
12663 parse_display :: FromStr,
12664 parse_display :: Display,
12665)]
12666#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
12667#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
12668pub enum Type {
12669 #[serde(rename = "auto_task")]
12670 #[display("auto_task")]
12671 AutoTask,
12672 #[serde(rename = "manual_task")]
12673 #[display("manual_task")]
12674 ManualTask,
12675 #[serde(rename = "scheduled_task")]
12676 #[display("scheduled_task")]
12677 ScheduledTask,
12678}
12679
12680#[derive(
12681 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12682)]
12683#[allow(non_snake_case)]
12684pub struct AcknowledgeTasksRequestBody {
12685 pub tasks: Vec<i64>,
12686}
12687
12688impl std::fmt::Display for AcknowledgeTasksRequestBody {
12689 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12690 write!(
12691 f,
12692 "{}",
12693 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12694 )
12695 }
12696}
12697
12698#[cfg(feature = "tabled")]
12699impl tabled::Tabled for AcknowledgeTasksRequestBody {
12700 const LENGTH: usize = 1;
12701 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12702 vec![format!("{:?}", self.tasks).into()]
12703 }
12704
12705 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12706 vec!["tasks".into()]
12707 }
12708}