1#![doc = r" This module contains the generated types for the library."]
2#[cfg(feature = "tabled")]
3use tabled::Tabled;
4pub mod base64 {
5 #![doc = " Base64 data that encodes to url safe base64, but can decode from multiple"]
6 #![doc = " base64 implementations to account for various clients and libraries. Compatible"]
7 #![doc = " with serde and JsonSchema."]
8 use serde::{
9 de::{Error, Unexpected, Visitor},
10 Deserialize, Deserializer, Serialize, Serializer,
11 };
12 use std::{convert::TryFrom, fmt};
13 static ALLOWED_DECODING_FORMATS: &[data_encoding::Encoding] = &[
14 data_encoding::BASE64,
15 data_encoding::BASE64URL,
16 data_encoding::BASE64URL_NOPAD,
17 data_encoding::BASE64_MIME,
18 data_encoding::BASE64_NOPAD,
19 ];
20 #[derive(Debug, Clone, PartialEq, Eq)]
21 #[doc = " A container for binary that should be base64 encoded in serialisation. In reverse"]
22 #[doc = " when deserializing, will decode from many different types of base64 possible."]
23 pub struct Base64Data(pub Vec<u8>);
24 impl Base64Data {
25 #[doc = " Return is the data is empty."]
26 pub fn is_empty(&self) -> bool {
27 self.0.is_empty()
28 }
29 }
30
31 impl fmt::Display for Base64Data {
32 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
33 write!(f, "{}", data_encoding::BASE64URL_NOPAD.encode(&self.0))
34 }
35 }
36
37 impl From<Base64Data> for Vec<u8> {
38 fn from(data: Base64Data) -> Vec<u8> {
39 data.0
40 }
41 }
42
43 impl From<Vec<u8>> for Base64Data {
44 fn from(data: Vec<u8>) -> Base64Data {
45 Base64Data(data)
46 }
47 }
48
49 impl AsRef<[u8]> for Base64Data {
50 fn as_ref(&self) -> &[u8] {
51 &self.0
52 }
53 }
54
55 impl TryFrom<&str> for Base64Data {
56 type Error = anyhow::Error;
57 fn try_from(v: &str) -> Result<Self, Self::Error> {
58 for config in ALLOWED_DECODING_FORMATS {
59 if let Ok(data) = config.decode(v.as_bytes()) {
60 return Ok(Base64Data(data));
61 }
62 }
63 anyhow::bail!("Could not decode base64 data: {v}");
64 }
65 }
66
67 struct Base64DataVisitor;
68 impl Visitor<'_> for Base64DataVisitor {
69 type Value = Base64Data;
70 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
71 write!(formatter, "a base64 encoded string")
72 }
73
74 fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
75 where
76 E: Error,
77 {
78 for config in ALLOWED_DECODING_FORMATS {
79 if let Ok(data) = config.decode(v.as_bytes()) {
80 return Ok(Base64Data(data));
81 }
82 }
83 Err(serde::de::Error::invalid_value(Unexpected::Str(v), &self))
84 }
85 }
86
87 impl<'de> Deserialize<'de> for Base64Data {
88 fn deserialize<D>(deserializer: D) -> Result<Self, <D as Deserializer<'de>>::Error>
89 where
90 D: Deserializer<'de>,
91 {
92 deserializer.deserialize_str(Base64DataVisitor)
93 }
94 }
95
96 impl Serialize for Base64Data {
97 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
98 where
99 S: Serializer,
100 {
101 let encoded = data_encoding::BASE64URL_NOPAD.encode(&self.0);
102 serializer.serialize_str(&encoded)
103 }
104 }
105
106 impl schemars::JsonSchema for Base64Data {
107 fn schema_name() -> String {
108 "Base64Data".to_string()
109 }
110
111 fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
112 let mut obj = gen.root_schema_for::<String>().schema;
113 obj.format = Some("byte".to_string());
114 schemars::schema::Schema::Object(obj)
115 }
116
117 fn is_referenceable() -> bool {
118 false
119 }
120 }
121
122 #[cfg(test)]
123 mod tests {
124 use super::Base64Data;
125 use std::convert::TryFrom;
126 #[test]
127 fn test_base64_try_from() {
128 assert!(Base64Data::try_from("aGVsbG8=").is_ok());
129 assert!(Base64Data::try_from("abcdefghij").is_err());
130 }
131 }
132}
133
134#[cfg(feature = "requests")]
135pub mod multipart {
136 #![doc = " Multipart form data types."]
137 use std::path::PathBuf;
138 #[doc = " An attachement to a multipart form."]
139 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
140 pub struct Attachment {
141 #[doc = " The name of the field."]
142 pub name: String,
143 #[doc = " The file path of the attachment."]
144 pub filepath: Option<PathBuf>,
145 #[doc = " The content type of the attachment."]
146 pub content_type: Option<String>,
147 #[doc = " The data of the attachment."]
148 pub data: Vec<u8>,
149 }
150
151 impl std::convert::TryFrom<Attachment> for reqwest::multipart::Part {
152 type Error = reqwest::Error;
153 fn try_from(attachment: Attachment) -> Result<Self, Self::Error> {
154 let mut part = reqwest::multipart::Part::bytes(attachment.data);
155 if let Some(filepath) = attachment.filepath {
156 part = part.file_name(filepath.to_string_lossy().to_string());
157 }
158 if let Some(content_type) = attachment.content_type {
159 part = part.mime_str(&content_type)?;
160 }
161 Ok(part)
162 }
163 }
164
165 impl std::convert::TryFrom<std::path::PathBuf> for Attachment {
166 type Error = std::io::Error;
167 fn try_from(path: std::path::PathBuf) -> Result<Self, Self::Error> {
168 let content_type = mime_guess::from_path(&path).first_raw();
169 let data = std::fs::read(&path)?;
170 Ok(Attachment {
171 name: "file".to_string(),
172 filepath: Some(path),
173 content_type: content_type.map(|s| s.to_string()),
174 data,
175 })
176 }
177 }
178}
179
180#[cfg(feature = "requests")]
181pub mod paginate {
182 #![doc = " Utility functions used for pagination."]
183 use anyhow::Result;
184 #[doc = " A trait for types that allow pagination."]
185 pub trait Pagination {
186 #[doc = " The item that is paginated."]
187 type Item: serde::de::DeserializeOwned;
188 #[doc = " Returns true if the response has more pages."]
189 fn has_more_pages(&self) -> bool;
190 #[doc = " Returns the next page token."]
191 fn next_page_token(&self) -> Option<String>;
192 #[doc = " Modify a request to get the next page."]
193 fn next_page(
194 &self,
195 req: reqwest::Request,
196 ) -> Result<reqwest::Request, crate::types::error::Error>;
197 #[doc = " Get the items from a page."]
198 fn items(&self) -> Vec<Self::Item>;
199 }
200}
201
202pub mod phone_number {
203 #![doc = " A library to implement phone numbers for our database and JSON serialization and deserialization."]
204 use schemars::JsonSchema;
205 use std::str::FromStr;
206 #[doc = " A phone number."]
207 #[derive(Debug, Default, Clone, PartialEq, Hash, Eq)]
208 pub struct PhoneNumber(pub Option<phonenumber::PhoneNumber>);
209 impl From<phonenumber::PhoneNumber> for PhoneNumber {
210 fn from(id: phonenumber::PhoneNumber) -> PhoneNumber {
211 PhoneNumber(Some(id))
212 }
213 }
214
215 impl AsRef<Option<phonenumber::PhoneNumber>> for PhoneNumber {
216 fn as_ref(&self) -> &Option<phonenumber::PhoneNumber> {
217 &self.0
218 }
219 }
220
221 impl std::ops::Deref for PhoneNumber {
222 type Target = Option<phonenumber::PhoneNumber>;
223 fn deref(&self) -> &Self::Target {
224 &self.0
225 }
226 }
227
228 impl serde::ser::Serialize for PhoneNumber {
229 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
230 where
231 S: serde::ser::Serializer,
232 {
233 serializer.serialize_str(&self.to_string())
234 }
235 }
236
237 impl<'de> serde::de::Deserialize<'de> for PhoneNumber {
238 fn deserialize<D>(deserializer: D) -> Result<PhoneNumber, D::Error>
239 where
240 D: serde::de::Deserializer<'de>,
241 {
242 let s = String::deserialize(deserializer).unwrap_or_default();
243 PhoneNumber::from_str(&s).map_err(serde::de::Error::custom)
244 }
245 }
246
247 impl std::str::FromStr for PhoneNumber {
248 type Err = anyhow::Error;
249 fn from_str(s: &str) -> Result<Self, Self::Err> {
250 if s.trim().is_empty() {
251 return Ok(PhoneNumber(None));
252 }
253 let s = if !s.trim().starts_with('+') {
254 format!("+1{s}")
255 } else {
256 s.to_string()
257 }
258 .replace(['-', '(', ')', ' '], "");
259 Ok(PhoneNumber(Some(phonenumber::parse(None, &s).map_err(
260 |e| anyhow::anyhow!("invalid phone number `{s}`: {e}"),
261 )?)))
262 }
263 }
264
265 impl std::fmt::Display for PhoneNumber {
266 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
267 let s = if let Some(phone) = &self.0 {
268 phone
269 .format()
270 .mode(phonenumber::Mode::International)
271 .to_string()
272 } else {
273 String::new()
274 };
275 write!(f, "{s}")
276 }
277 }
278
279 impl JsonSchema for PhoneNumber {
280 fn schema_name() -> String {
281 "PhoneNumber".to_string()
282 }
283
284 fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
285 let mut obj = gen.root_schema_for::<String>().schema;
286 obj.format = Some("phone".to_string());
287 schemars::schema::Schema::Object(obj)
288 }
289
290 fn is_referenceable() -> bool {
291 false
292 }
293 }
294
295 #[cfg(test)]
296 mod test {
297 use super::PhoneNumber;
298 use pretty_assertions::assert_eq;
299 #[test]
300 fn test_parse_phone_number() {
301 let mut phone = "+1-555-555-5555";
302 let mut phone_parsed: PhoneNumber =
303 serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
304 let mut expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
305 assert_eq!(phone_parsed, expected);
306 let mut expected_str = "+1 555-555-5555";
307 assert_eq!(expected_str, serde_json::json!(phone_parsed));
308 phone = "555-555-5555";
309 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
310 assert_eq!(phone_parsed, expected);
311 assert_eq!(expected_str, serde_json::json!(phone_parsed));
312 phone = "+1 555-555-5555";
313 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
314 assert_eq!(phone_parsed, expected);
315 assert_eq!(expected_str, serde_json::json!(phone_parsed));
316 phone = "5555555555";
317 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
318 assert_eq!(phone_parsed, expected);
319 assert_eq!(expected_str, serde_json::json!(phone_parsed));
320 phone = "(510) 864-1234";
321 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
322 expected = PhoneNumber(Some(phonenumber::parse(None, "+15108641234").unwrap()));
323 assert_eq!(phone_parsed, expected);
324 expected_str = "+1 510-864-1234";
325 assert_eq!(expected_str, serde_json::json!(phone_parsed));
326 phone = "(510)8641234";
327 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
328 assert_eq!(phone_parsed, expected);
329 expected_str = "+1 510-864-1234";
330 assert_eq!(expected_str, serde_json::json!(phone_parsed));
331 phone = "";
332 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
333 assert_eq!(phone_parsed, PhoneNumber(None));
334 assert_eq!("", serde_json::json!(phone_parsed));
335 phone = "+49 30 1234 1234";
336 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
337 expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
338 assert_eq!(phone_parsed, expected);
339 expected_str = "+49 30 12341234";
340 assert_eq!(expected_str, serde_json::json!(phone_parsed));
341 }
342 }
343}
344
345#[cfg(feature = "requests")]
346pub mod error {
347 #![doc = " Error methods."]
348 #[doc = " Error produced by generated client methods."]
349 pub enum Error {
350 #[doc = " The request did not conform to API requirements."]
351 InvalidRequest(String),
352 #[cfg(feature = "retry")]
353 #[doc = " A server error either due to the data, or with the connection."]
354 CommunicationError(reqwest_middleware::Error),
355 #[doc = " A request error, caused when building the request."]
356 RequestError(reqwest::Error),
357 #[doc = " An expected response whose deserialization failed."]
358 SerdeError {
359 #[doc = " The error."]
360 error: format_serde_error::SerdeError,
361 #[doc = " The response status."]
362 status: reqwest::StatusCode,
363 },
364 #[doc = " An expected error response."]
365 InvalidResponsePayload {
366 #[cfg(feature = "retry")]
367 #[doc = " The error."]
368 error: reqwest_middleware::Error,
369 #[cfg(not(feature = "retry"))]
370 #[doc = " The error."]
371 error: reqwest::Error,
372 #[doc = " The full response."]
373 response: reqwest::Response,
374 },
375 #[doc = " An error from the server."]
376 Server {
377 #[doc = " The text from the body."]
378 body: String,
379 #[doc = " The response status."]
380 status: reqwest::StatusCode,
381 },
382 #[doc = " A response not listed in the API description. This may represent a"]
383 #[doc = " success or failure response; check `status().is_success()`."]
384 UnexpectedResponse(reqwest::Response),
385 }
386
387 impl Error {
388 #[doc = " Returns the status code, if the error was generated from a response."]
389 pub fn status(&self) -> Option<reqwest::StatusCode> {
390 match self {
391 Error::InvalidRequest(_) => None,
392 Error::RequestError(e) => e.status(),
393 #[cfg(feature = "retry")]
394 Error::CommunicationError(reqwest_middleware::Error::Reqwest(e)) => e.status(),
395 #[cfg(feature = "retry")]
396 Error::CommunicationError(reqwest_middleware::Error::Middleware(_)) => None,
397 Error::SerdeError { error: _, status } => Some(*status),
398 Error::InvalidResponsePayload { error: _, response } => Some(response.status()),
399 Error::Server { body: _, status } => Some(*status),
400 Error::UnexpectedResponse(r) => Some(r.status()),
401 }
402 }
403
404 #[doc = " Creates a new error from a response status and a serde error."]
405 pub fn from_serde_error(
406 e: format_serde_error::SerdeError,
407 status: reqwest::StatusCode,
408 ) -> Self {
409 Self::SerdeError { error: e, status }
410 }
411 }
412
413 #[cfg(feature = "retry")]
414 impl From<reqwest_middleware::Error> for Error {
415 fn from(e: reqwest_middleware::Error) -> Self {
416 Self::CommunicationError(e)
417 }
418 }
419
420 impl From<reqwest::Error> for Error {
421 fn from(e: reqwest::Error) -> Self {
422 Self::RequestError(e)
423 }
424 }
425
426 impl From<serde_json::Error> for Error {
427 fn from(e: serde_json::Error) -> Self {
428 Self::SerdeError {
429 error: format_serde_error::SerdeError::new(String::new(), e),
430 status: reqwest::StatusCode::INTERNAL_SERVER_ERROR,
431 }
432 }
433 }
434
435 impl std::fmt::Display for Error {
436 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
437 match self {
438 Error::InvalidRequest(s) => {
439 write!(f, "Invalid Request: {s}")
440 }
441 #[cfg(feature = "retry")]
442 Error::CommunicationError(e) => {
443 write!(f, "Communication Error: {e}")
444 }
445 Error::RequestError(e) => {
446 write!(f, "Request Error: {e}")
447 }
448 Error::SerdeError { error, status: _ } => {
449 write!(f, "Serde Error: {error}")
450 }
451 Error::InvalidResponsePayload { error, response: _ } => {
452 write!(f, "Invalid Response Payload: {error}")
453 }
454 Error::Server { body, status } => {
455 write!(f, "Server Error: {status} {body}")
456 }
457 Error::UnexpectedResponse(r) => {
458 write!(f, "Unexpected Response: {r:?}")
459 }
460 }
461 }
462 }
463
464 impl std::fmt::Debug for Error {
465 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
466 std::fmt::Display::fmt(self, f)
467 }
468 }
469
470 impl std::error::Error for Error {
471 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
472 match self {
473 #[cfg(feature = "retry")]
474 Error::CommunicationError(e) => Some(e),
475 Error::SerdeError { error, status: _ } => Some(error),
476 Error::InvalidResponsePayload { error, response: _ } => Some(error),
477 _ => None,
478 }
479 }
480 }
481}
482
483#[derive(
484 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
485)]
486#[allow(non_snake_case)]
487pub struct AcknowledgeTasks {
488 pub result: i64,
489}
490
491impl std::fmt::Display for AcknowledgeTasks {
492 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
493 write!(
494 f,
495 "{}",
496 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
497 )
498 }
499}
500
501#[cfg(feature = "tabled")]
502impl tabled::Tabled for AcknowledgeTasks {
503 const LENGTH: usize = 1;
504 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
505 vec![format!("{:?}", self.result).into()]
506 }
507
508 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
509 vec!["result".into()]
510 }
511}
512
513#[derive(
514 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
515)]
516#[allow(non_snake_case)]
517pub struct Actor {
518 pub id: i64,
519 pub username: String,
520}
521
522impl std::fmt::Display for Actor {
523 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
524 write!(
525 f,
526 "{}",
527 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
528 )
529 }
530}
531
532#[cfg(feature = "tabled")]
533impl tabled::Tabled for Actor {
534 const LENGTH: usize = 2;
535 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
536 vec![
537 format!("{:?}", self.id).into(),
538 self.username.clone().into(),
539 ]
540 }
541
542 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
543 vec!["id".into(), "username".into()]
544 }
545}
546
547#[derive(
548 serde :: Serialize,
549 serde :: Deserialize,
550 PartialEq,
551 Hash,
552 Debug,
553 Clone,
554 schemars :: JsonSchema,
555 parse_display :: FromStr,
556 parse_display :: Display,
557)]
558#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
559#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
560pub enum OutputType {
561 #[serde(rename = "pdf")]
562 #[display("pdf")]
563 Pdf,
564 #[serde(rename = "pdfa")]
565 #[display("pdfa")]
566 Pdfa,
567 #[serde(rename = "pdfa-1")]
568 #[display("pdfa-1")]
569 Pdfa1,
570 #[serde(rename = "pdfa-2")]
571 #[display("pdfa-2")]
572 Pdfa2,
573 #[serde(rename = "pdfa-3")]
574 #[display("pdfa-3")]
575 Pdfa3,
576 #[serde(rename = "")]
577 #[display("")]
578 Empty,
579}
580
581#[derive(
582 serde :: Serialize,
583 serde :: Deserialize,
584 PartialEq,
585 Hash,
586 Debug,
587 Clone,
588 schemars :: JsonSchema,
589 parse_display :: FromStr,
590 parse_display :: Display,
591)]
592#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
593#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
594pub enum Mode {
595 #[serde(rename = "skip")]
596 #[display("skip")]
597 Skip,
598 #[serde(rename = "redo")]
599 #[display("redo")]
600 Redo,
601 #[serde(rename = "force")]
602 #[display("force")]
603 Force,
604 #[serde(rename = "skip_noarchive")]
605 #[display("skip_noarchive")]
606 SkipNoarchive,
607 #[serde(rename = "")]
608 #[display("")]
609 Empty,
610}
611
612#[derive(
613 serde :: Serialize,
614 serde :: Deserialize,
615 PartialEq,
616 Hash,
617 Debug,
618 Clone,
619 schemars :: JsonSchema,
620 parse_display :: FromStr,
621 parse_display :: Display,
622)]
623#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
624#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
625pub enum SkipArchiveFile {
626 #[serde(rename = "never")]
627 #[display("never")]
628 Never,
629 #[serde(rename = "with_text")]
630 #[display("with_text")]
631 WithText,
632 #[serde(rename = "always")]
633 #[display("always")]
634 Always,
635 #[serde(rename = "")]
636 #[display("")]
637 Empty,
638}
639
640#[derive(
641 serde :: Serialize,
642 serde :: Deserialize,
643 PartialEq,
644 Hash,
645 Debug,
646 Clone,
647 schemars :: JsonSchema,
648 parse_display :: FromStr,
649 parse_display :: Display,
650)]
651#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
652#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
653pub enum UnpaperClean {
654 #[serde(rename = "clean")]
655 #[display("clean")]
656 Clean,
657 #[serde(rename = "clean-final")]
658 #[display("clean-final")]
659 CleanFinal,
660 #[serde(rename = "none")]
661 #[display("none")]
662 None,
663 #[serde(rename = "")]
664 #[display("")]
665 Empty,
666}
667
668#[derive(
669 serde :: Serialize,
670 serde :: Deserialize,
671 PartialEq,
672 Hash,
673 Debug,
674 Clone,
675 schemars :: JsonSchema,
676 parse_display :: FromStr,
677 parse_display :: Display,
678)]
679#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
680#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
681pub enum ColorConversionStrategy {
682 LeaveColorUnchanged,
683 #[serde(rename = "RGB")]
684 #[display("RGB")]
685 Rgb,
686 UseDeviceIndependentColor,
687 Gray,
688 #[serde(rename = "CMYK")]
689 #[display("CMYK")]
690 Cmyk,
691 #[serde(rename = "")]
692 #[display("")]
693 Empty,
694}
695
696#[derive(
697 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
698)]
699#[allow(non_snake_case)]
700pub struct ApplicationConfiguration {
701 pub id: i64,
702 #[serde(default)]
703 pub user_args: Option<serde_json::Value>,
704 #[serde(default)]
705 pub barcode_tag_mapping: Option<serde_json::Value>,
706 #[serde(default, skip_serializing_if = "Option::is_none")]
707 pub output_type: Option<OutputType>,
708 #[serde(default, skip_serializing_if = "Option::is_none")]
709 pub pages: Option<i64>,
710 #[serde(default, skip_serializing_if = "Option::is_none")]
711 pub language: Option<String>,
712 #[serde(default, skip_serializing_if = "Option::is_none")]
713 pub mode: Option<Mode>,
714 #[serde(default, skip_serializing_if = "Option::is_none")]
715 pub skip_archive_file: Option<SkipArchiveFile>,
716 #[serde(default, skip_serializing_if = "Option::is_none")]
717 pub image_dpi: Option<i64>,
718 #[serde(default, skip_serializing_if = "Option::is_none")]
719 pub unpaper_clean: Option<UnpaperClean>,
720 #[serde(default, skip_serializing_if = "Option::is_none")]
721 pub deskew: Option<bool>,
722 #[serde(default, skip_serializing_if = "Option::is_none")]
723 pub rotate_pages: Option<bool>,
724 #[serde(default, skip_serializing_if = "Option::is_none")]
725 pub rotate_pages_threshold: Option<f64>,
726 #[serde(default, skip_serializing_if = "Option::is_none")]
727 pub max_image_pixels: Option<f64>,
728 #[serde(default, skip_serializing_if = "Option::is_none")]
729 pub color_conversion_strategy: Option<ColorConversionStrategy>,
730 #[serde(default, skip_serializing_if = "Option::is_none")]
731 pub app_title: Option<String>,
732 #[serde(default, skip_serializing_if = "Option::is_none")]
733 pub app_logo: Option<String>,
734 #[serde(default, skip_serializing_if = "Option::is_none")]
735 pub barcodes_enabled: Option<bool>,
736 #[serde(default, skip_serializing_if = "Option::is_none")]
737 pub barcode_enable_tiff_support: Option<bool>,
738 #[serde(default, skip_serializing_if = "Option::is_none")]
739 pub barcode_string: Option<String>,
740 #[serde(default, skip_serializing_if = "Option::is_none")]
741 pub barcode_retain_split_pages: Option<bool>,
742 #[serde(default, skip_serializing_if = "Option::is_none")]
743 pub barcode_enable_asn: Option<bool>,
744 #[serde(default, skip_serializing_if = "Option::is_none")]
745 pub barcode_asn_prefix: Option<String>,
746 #[serde(default, skip_serializing_if = "Option::is_none")]
747 pub barcode_upscale: Option<f64>,
748 #[serde(default, skip_serializing_if = "Option::is_none")]
749 pub barcode_dpi: Option<i64>,
750 #[serde(default, skip_serializing_if = "Option::is_none")]
751 pub barcode_max_pages: Option<i64>,
752 #[serde(default, skip_serializing_if = "Option::is_none")]
753 pub barcode_enable_tag: Option<bool>,
754}
755
756impl std::fmt::Display for ApplicationConfiguration {
757 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
758 write!(
759 f,
760 "{}",
761 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
762 )
763 }
764}
765
766#[cfg(feature = "tabled")]
767impl tabled::Tabled for ApplicationConfiguration {
768 const LENGTH: usize = 27;
769 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
770 vec![
771 format!("{:?}", self.id).into(),
772 format!("{:?}", self.user_args).into(),
773 format!("{:?}", self.barcode_tag_mapping).into(),
774 if let Some(output_type) = &self.output_type {
775 format!("{output_type:?}").into()
776 } else {
777 String::new().into()
778 },
779 if let Some(pages) = &self.pages {
780 format!("{pages:?}").into()
781 } else {
782 String::new().into()
783 },
784 if let Some(language) = &self.language {
785 format!("{language:?}").into()
786 } else {
787 String::new().into()
788 },
789 if let Some(mode) = &self.mode {
790 format!("{mode:?}").into()
791 } else {
792 String::new().into()
793 },
794 if let Some(skip_archive_file) = &self.skip_archive_file {
795 format!("{skip_archive_file:?}").into()
796 } else {
797 String::new().into()
798 },
799 if let Some(image_dpi) = &self.image_dpi {
800 format!("{image_dpi:?}").into()
801 } else {
802 String::new().into()
803 },
804 if let Some(unpaper_clean) = &self.unpaper_clean {
805 format!("{unpaper_clean:?}").into()
806 } else {
807 String::new().into()
808 },
809 if let Some(deskew) = &self.deskew {
810 format!("{deskew:?}").into()
811 } else {
812 String::new().into()
813 },
814 if let Some(rotate_pages) = &self.rotate_pages {
815 format!("{rotate_pages:?}").into()
816 } else {
817 String::new().into()
818 },
819 if let Some(rotate_pages_threshold) = &self.rotate_pages_threshold {
820 format!("{rotate_pages_threshold:?}").into()
821 } else {
822 String::new().into()
823 },
824 if let Some(max_image_pixels) = &self.max_image_pixels {
825 format!("{max_image_pixels:?}").into()
826 } else {
827 String::new().into()
828 },
829 if let Some(color_conversion_strategy) = &self.color_conversion_strategy {
830 format!("{color_conversion_strategy:?}").into()
831 } else {
832 String::new().into()
833 },
834 if let Some(app_title) = &self.app_title {
835 format!("{app_title:?}").into()
836 } else {
837 String::new().into()
838 },
839 if let Some(app_logo) = &self.app_logo {
840 format!("{app_logo:?}").into()
841 } else {
842 String::new().into()
843 },
844 if let Some(barcodes_enabled) = &self.barcodes_enabled {
845 format!("{barcodes_enabled:?}").into()
846 } else {
847 String::new().into()
848 },
849 if let Some(barcode_enable_tiff_support) = &self.barcode_enable_tiff_support {
850 format!("{barcode_enable_tiff_support:?}").into()
851 } else {
852 String::new().into()
853 },
854 if let Some(barcode_string) = &self.barcode_string {
855 format!("{barcode_string:?}").into()
856 } else {
857 String::new().into()
858 },
859 if let Some(barcode_retain_split_pages) = &self.barcode_retain_split_pages {
860 format!("{barcode_retain_split_pages:?}").into()
861 } else {
862 String::new().into()
863 },
864 if let Some(barcode_enable_asn) = &self.barcode_enable_asn {
865 format!("{barcode_enable_asn:?}").into()
866 } else {
867 String::new().into()
868 },
869 if let Some(barcode_asn_prefix) = &self.barcode_asn_prefix {
870 format!("{barcode_asn_prefix:?}").into()
871 } else {
872 String::new().into()
873 },
874 if let Some(barcode_upscale) = &self.barcode_upscale {
875 format!("{barcode_upscale:?}").into()
876 } else {
877 String::new().into()
878 },
879 if let Some(barcode_dpi) = &self.barcode_dpi {
880 format!("{barcode_dpi:?}").into()
881 } else {
882 String::new().into()
883 },
884 if let Some(barcode_max_pages) = &self.barcode_max_pages {
885 format!("{barcode_max_pages:?}").into()
886 } else {
887 String::new().into()
888 },
889 if let Some(barcode_enable_tag) = &self.barcode_enable_tag {
890 format!("{barcode_enable_tag:?}").into()
891 } else {
892 String::new().into()
893 },
894 ]
895 }
896
897 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
898 vec![
899 "id".into(),
900 "user_args".into(),
901 "barcode_tag_mapping".into(),
902 "output_type".into(),
903 "pages".into(),
904 "language".into(),
905 "mode".into(),
906 "skip_archive_file".into(),
907 "image_dpi".into(),
908 "unpaper_clean".into(),
909 "deskew".into(),
910 "rotate_pages".into(),
911 "rotate_pages_threshold".into(),
912 "max_image_pixels".into(),
913 "color_conversion_strategy".into(),
914 "app_title".into(),
915 "app_logo".into(),
916 "barcodes_enabled".into(),
917 "barcode_enable_tiff_support".into(),
918 "barcode_string".into(),
919 "barcode_retain_split_pages".into(),
920 "barcode_enable_asn".into(),
921 "barcode_asn_prefix".into(),
922 "barcode_upscale".into(),
923 "barcode_dpi".into(),
924 "barcode_max_pages".into(),
925 "barcode_enable_tag".into(),
926 ]
927 }
928}
929
930#[derive(
931 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
932)]
933#[allow(non_snake_case)]
934pub struct ApplicationConfigurationRequest {
935 #[serde(default)]
936 pub user_args: Option<serde_json::Value>,
937 #[serde(default)]
938 pub barcode_tag_mapping: Option<serde_json::Value>,
939 #[serde(default, skip_serializing_if = "Option::is_none")]
940 pub output_type: Option<OutputType>,
941 #[serde(default, skip_serializing_if = "Option::is_none")]
942 pub pages: Option<i64>,
943 #[serde(default, skip_serializing_if = "Option::is_none")]
944 pub language: Option<String>,
945 #[serde(default, skip_serializing_if = "Option::is_none")]
946 pub mode: Option<Mode>,
947 #[serde(default, skip_serializing_if = "Option::is_none")]
948 pub skip_archive_file: Option<SkipArchiveFile>,
949 #[serde(default, skip_serializing_if = "Option::is_none")]
950 pub image_dpi: Option<i64>,
951 #[serde(default, skip_serializing_if = "Option::is_none")]
952 pub unpaper_clean: Option<UnpaperClean>,
953 #[serde(default, skip_serializing_if = "Option::is_none")]
954 pub deskew: Option<bool>,
955 #[serde(default, skip_serializing_if = "Option::is_none")]
956 pub rotate_pages: Option<bool>,
957 #[serde(default, skip_serializing_if = "Option::is_none")]
958 pub rotate_pages_threshold: Option<f64>,
959 #[serde(default, skip_serializing_if = "Option::is_none")]
960 pub max_image_pixels: Option<f64>,
961 #[serde(default, skip_serializing_if = "Option::is_none")]
962 pub color_conversion_strategy: Option<ColorConversionStrategy>,
963 #[serde(default, skip_serializing_if = "Option::is_none")]
964 pub app_title: Option<String>,
965 #[serde(default, skip_serializing_if = "Option::is_none")]
966 pub app_logo: Option<bytes::Bytes>,
967 #[serde(default, skip_serializing_if = "Option::is_none")]
968 pub barcodes_enabled: Option<bool>,
969 #[serde(default, skip_serializing_if = "Option::is_none")]
970 pub barcode_enable_tiff_support: Option<bool>,
971 #[serde(default, skip_serializing_if = "Option::is_none")]
972 pub barcode_string: Option<String>,
973 #[serde(default, skip_serializing_if = "Option::is_none")]
974 pub barcode_retain_split_pages: Option<bool>,
975 #[serde(default, skip_serializing_if = "Option::is_none")]
976 pub barcode_enable_asn: Option<bool>,
977 #[serde(default, skip_serializing_if = "Option::is_none")]
978 pub barcode_asn_prefix: Option<String>,
979 #[serde(default, skip_serializing_if = "Option::is_none")]
980 pub barcode_upscale: Option<f64>,
981 #[serde(default, skip_serializing_if = "Option::is_none")]
982 pub barcode_dpi: Option<i64>,
983 #[serde(default, skip_serializing_if = "Option::is_none")]
984 pub barcode_max_pages: Option<i64>,
985 #[serde(default, skip_serializing_if = "Option::is_none")]
986 pub barcode_enable_tag: Option<bool>,
987}
988
989impl std::fmt::Display for ApplicationConfigurationRequest {
990 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
991 write!(
992 f,
993 "{}",
994 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
995 )
996 }
997}
998
999#[cfg(feature = "tabled")]
1000impl tabled::Tabled for ApplicationConfigurationRequest {
1001 const LENGTH: usize = 26;
1002 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1003 vec![
1004 format!("{:?}", self.user_args).into(),
1005 format!("{:?}", self.barcode_tag_mapping).into(),
1006 if let Some(output_type) = &self.output_type {
1007 format!("{output_type:?}").into()
1008 } else {
1009 String::new().into()
1010 },
1011 if let Some(pages) = &self.pages {
1012 format!("{pages:?}").into()
1013 } else {
1014 String::new().into()
1015 },
1016 if let Some(language) = &self.language {
1017 format!("{language:?}").into()
1018 } else {
1019 String::new().into()
1020 },
1021 if let Some(mode) = &self.mode {
1022 format!("{mode:?}").into()
1023 } else {
1024 String::new().into()
1025 },
1026 if let Some(skip_archive_file) = &self.skip_archive_file {
1027 format!("{skip_archive_file:?}").into()
1028 } else {
1029 String::new().into()
1030 },
1031 if let Some(image_dpi) = &self.image_dpi {
1032 format!("{image_dpi:?}").into()
1033 } else {
1034 String::new().into()
1035 },
1036 if let Some(unpaper_clean) = &self.unpaper_clean {
1037 format!("{unpaper_clean:?}").into()
1038 } else {
1039 String::new().into()
1040 },
1041 if let Some(deskew) = &self.deskew {
1042 format!("{deskew:?}").into()
1043 } else {
1044 String::new().into()
1045 },
1046 if let Some(rotate_pages) = &self.rotate_pages {
1047 format!("{rotate_pages:?}").into()
1048 } else {
1049 String::new().into()
1050 },
1051 if let Some(rotate_pages_threshold) = &self.rotate_pages_threshold {
1052 format!("{rotate_pages_threshold:?}").into()
1053 } else {
1054 String::new().into()
1055 },
1056 if let Some(max_image_pixels) = &self.max_image_pixels {
1057 format!("{max_image_pixels:?}").into()
1058 } else {
1059 String::new().into()
1060 },
1061 if let Some(color_conversion_strategy) = &self.color_conversion_strategy {
1062 format!("{color_conversion_strategy:?}").into()
1063 } else {
1064 String::new().into()
1065 },
1066 if let Some(app_title) = &self.app_title {
1067 format!("{app_title:?}").into()
1068 } else {
1069 String::new().into()
1070 },
1071 if let Some(app_logo) = &self.app_logo {
1072 format!("{app_logo:?}").into()
1073 } else {
1074 String::new().into()
1075 },
1076 if let Some(barcodes_enabled) = &self.barcodes_enabled {
1077 format!("{barcodes_enabled:?}").into()
1078 } else {
1079 String::new().into()
1080 },
1081 if let Some(barcode_enable_tiff_support) = &self.barcode_enable_tiff_support {
1082 format!("{barcode_enable_tiff_support:?}").into()
1083 } else {
1084 String::new().into()
1085 },
1086 if let Some(barcode_string) = &self.barcode_string {
1087 format!("{barcode_string:?}").into()
1088 } else {
1089 String::new().into()
1090 },
1091 if let Some(barcode_retain_split_pages) = &self.barcode_retain_split_pages {
1092 format!("{barcode_retain_split_pages:?}").into()
1093 } else {
1094 String::new().into()
1095 },
1096 if let Some(barcode_enable_asn) = &self.barcode_enable_asn {
1097 format!("{barcode_enable_asn:?}").into()
1098 } else {
1099 String::new().into()
1100 },
1101 if let Some(barcode_asn_prefix) = &self.barcode_asn_prefix {
1102 format!("{barcode_asn_prefix:?}").into()
1103 } else {
1104 String::new().into()
1105 },
1106 if let Some(barcode_upscale) = &self.barcode_upscale {
1107 format!("{barcode_upscale:?}").into()
1108 } else {
1109 String::new().into()
1110 },
1111 if let Some(barcode_dpi) = &self.barcode_dpi {
1112 format!("{barcode_dpi:?}").into()
1113 } else {
1114 String::new().into()
1115 },
1116 if let Some(barcode_max_pages) = &self.barcode_max_pages {
1117 format!("{barcode_max_pages:?}").into()
1118 } else {
1119 String::new().into()
1120 },
1121 if let Some(barcode_enable_tag) = &self.barcode_enable_tag {
1122 format!("{barcode_enable_tag:?}").into()
1123 } else {
1124 String::new().into()
1125 },
1126 ]
1127 }
1128
1129 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1130 vec![
1131 "user_args".into(),
1132 "barcode_tag_mapping".into(),
1133 "output_type".into(),
1134 "pages".into(),
1135 "language".into(),
1136 "mode".into(),
1137 "skip_archive_file".into(),
1138 "image_dpi".into(),
1139 "unpaper_clean".into(),
1140 "deskew".into(),
1141 "rotate_pages".into(),
1142 "rotate_pages_threshold".into(),
1143 "max_image_pixels".into(),
1144 "color_conversion_strategy".into(),
1145 "app_title".into(),
1146 "app_logo".into(),
1147 "barcodes_enabled".into(),
1148 "barcode_enable_tiff_support".into(),
1149 "barcode_string".into(),
1150 "barcode_retain_split_pages".into(),
1151 "barcode_enable_asn".into(),
1152 "barcode_asn_prefix".into(),
1153 "barcode_upscale".into(),
1154 "barcode_dpi".into(),
1155 "barcode_max_pages".into(),
1156 "barcode_enable_tag".into(),
1157 ]
1158 }
1159}
1160
1161#[derive(
1162 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1163)]
1164#[allow(non_snake_case)]
1165pub struct BasicUser {
1166 pub id: i64,
1167 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
1168 pub username: String,
1169 #[serde(default, skip_serializing_if = "Option::is_none")]
1170 pub first_name: Option<String>,
1171 #[serde(default, skip_serializing_if = "Option::is_none")]
1172 pub last_name: Option<String>,
1173}
1174
1175impl std::fmt::Display for BasicUser {
1176 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1177 write!(
1178 f,
1179 "{}",
1180 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1181 )
1182 }
1183}
1184
1185#[cfg(feature = "tabled")]
1186impl tabled::Tabled for BasicUser {
1187 const LENGTH: usize = 4;
1188 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1189 vec![
1190 format!("{:?}", self.id).into(),
1191 self.username.clone().into(),
1192 if let Some(first_name) = &self.first_name {
1193 format!("{first_name:?}").into()
1194 } else {
1195 String::new().into()
1196 },
1197 if let Some(last_name) = &self.last_name {
1198 format!("{last_name:?}").into()
1199 } else {
1200 String::new().into()
1201 },
1202 ]
1203 }
1204
1205 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1206 vec![
1207 "id".into(),
1208 "username".into(),
1209 "first_name".into(),
1210 "last_name".into(),
1211 ]
1212 }
1213}
1214
1215#[derive(
1216 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1217)]
1218#[allow(non_snake_case)]
1219pub struct BasicUserRequest {
1220 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
1221 pub username: String,
1222 #[serde(default, skip_serializing_if = "Option::is_none")]
1223 pub first_name: Option<String>,
1224 #[serde(default, skip_serializing_if = "Option::is_none")]
1225 pub last_name: Option<String>,
1226}
1227
1228impl std::fmt::Display for BasicUserRequest {
1229 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1230 write!(
1231 f,
1232 "{}",
1233 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1234 )
1235 }
1236}
1237
1238#[cfg(feature = "tabled")]
1239impl tabled::Tabled for BasicUserRequest {
1240 const LENGTH: usize = 3;
1241 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1242 vec![
1243 self.username.clone().into(),
1244 if let Some(first_name) = &self.first_name {
1245 format!("{first_name:?}").into()
1246 } else {
1247 String::new().into()
1248 },
1249 if let Some(last_name) = &self.last_name {
1250 format!("{last_name:?}").into()
1251 } else {
1252 String::new().into()
1253 },
1254 ]
1255 }
1256
1257 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1258 vec!["username".into(), "first_name".into(), "last_name".into()]
1259 }
1260}
1261
1262#[derive(
1263 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1264)]
1265#[allow(non_snake_case)]
1266pub struct BulkDownload {
1267 #[serde(default, skip_serializing_if = "Option::is_none")]
1268 pub content: Option<ContentEnum>,
1269 #[serde(default, skip_serializing_if = "Option::is_none")]
1270 pub compression: Option<CompressionEnum>,
1271 #[serde(default)]
1272 pub follow_formatting: bool,
1273}
1274
1275impl std::fmt::Display for BulkDownload {
1276 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1277 write!(
1278 f,
1279 "{}",
1280 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1281 )
1282 }
1283}
1284
1285#[cfg(feature = "tabled")]
1286impl tabled::Tabled for BulkDownload {
1287 const LENGTH: usize = 3;
1288 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1289 vec![
1290 if let Some(content) = &self.content {
1291 format!("{content:?}").into()
1292 } else {
1293 String::new().into()
1294 },
1295 if let Some(compression) = &self.compression {
1296 format!("{compression:?}").into()
1297 } else {
1298 String::new().into()
1299 },
1300 format!("{:?}", self.follow_formatting).into(),
1301 ]
1302 }
1303
1304 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1305 vec![
1306 "content".into(),
1307 "compression".into(),
1308 "follow_formatting".into(),
1309 ]
1310 }
1311}
1312
1313#[derive(
1314 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1315)]
1316#[allow(non_snake_case)]
1317pub struct BulkDownloadRequest {
1318 pub documents: Vec<i64>,
1319 #[serde(default, skip_serializing_if = "Option::is_none")]
1320 pub content: Option<ContentEnum>,
1321 #[serde(default, skip_serializing_if = "Option::is_none")]
1322 pub compression: Option<CompressionEnum>,
1323 #[serde(default)]
1324 pub follow_formatting: bool,
1325}
1326
1327impl std::fmt::Display for BulkDownloadRequest {
1328 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1329 write!(
1330 f,
1331 "{}",
1332 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1333 )
1334 }
1335}
1336
1337#[cfg(feature = "tabled")]
1338impl tabled::Tabled for BulkDownloadRequest {
1339 const LENGTH: usize = 4;
1340 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1341 vec![
1342 format!("{:?}", self.documents).into(),
1343 if let Some(content) = &self.content {
1344 format!("{content:?}").into()
1345 } else {
1346 String::new().into()
1347 },
1348 if let Some(compression) = &self.compression {
1349 format!("{compression:?}").into()
1350 } else {
1351 String::new().into()
1352 },
1353 format!("{:?}", self.follow_formatting).into(),
1354 ]
1355 }
1356
1357 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1358 vec![
1359 "documents".into(),
1360 "content".into(),
1361 "compression".into(),
1362 "follow_formatting".into(),
1363 ]
1364 }
1365}
1366
1367#[derive(
1368 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1369)]
1370#[allow(non_snake_case)]
1371pub struct BulkEditDocumentsResult {
1372 pub result: String,
1373}
1374
1375impl std::fmt::Display for BulkEditDocumentsResult {
1376 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1377 write!(
1378 f,
1379 "{}",
1380 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1381 )
1382 }
1383}
1384
1385#[cfg(feature = "tabled")]
1386impl tabled::Tabled for BulkEditDocumentsResult {
1387 const LENGTH: usize = 1;
1388 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1389 vec![self.result.clone().into()]
1390 }
1391
1392 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1393 vec!["result".into()]
1394 }
1395}
1396
1397#[derive(
1398 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1399)]
1400#[allow(non_snake_case)]
1401pub struct BulkEditObjectsRequest {
1402 pub objects: Vec<i64>,
1403 pub object_type: ObjectTypeEnum,
1404 pub operation: OperationEnum,
1405 #[serde(default, skip_serializing_if = "Option::is_none")]
1406 pub owner: Option<i64>,
1407 #[serde(default, skip_serializing_if = "Option::is_none")]
1408 pub permissions: Option<std::collections::HashMap<String, serde_json::Value>>,
1409 #[serde(default)]
1410 pub merge: bool,
1411}
1412
1413impl std::fmt::Display for BulkEditObjectsRequest {
1414 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1415 write!(
1416 f,
1417 "{}",
1418 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1419 )
1420 }
1421}
1422
1423#[cfg(feature = "tabled")]
1424impl tabled::Tabled for BulkEditObjectsRequest {
1425 const LENGTH: usize = 6;
1426 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1427 vec![
1428 format!("{:?}", self.objects).into(),
1429 format!("{:?}", self.object_type).into(),
1430 format!("{:?}", self.operation).into(),
1431 if let Some(owner) = &self.owner {
1432 format!("{owner:?}").into()
1433 } else {
1434 String::new().into()
1435 },
1436 if let Some(permissions) = &self.permissions {
1437 format!("{permissions:?}").into()
1438 } else {
1439 String::new().into()
1440 },
1441 format!("{:?}", self.merge).into(),
1442 ]
1443 }
1444
1445 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1446 vec![
1447 "objects".into(),
1448 "object_type".into(),
1449 "operation".into(),
1450 "owner".into(),
1451 "permissions".into(),
1452 "merge".into(),
1453 ]
1454 }
1455}
1456
1457#[derive(
1458 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1459)]
1460#[allow(non_snake_case)]
1461pub struct BulkEditRequest {
1462 pub documents: Vec<i64>,
1463 pub method: MethodEnum,
1464 #[serde(default, skip_serializing_if = "Option::is_none")]
1465 pub parameters: Option<std::collections::HashMap<String, serde_json::Value>>,
1466}
1467
1468impl std::fmt::Display for BulkEditRequest {
1469 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1470 write!(
1471 f,
1472 "{}",
1473 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1474 )
1475 }
1476}
1477
1478#[cfg(feature = "tabled")]
1479impl tabled::Tabled for BulkEditRequest {
1480 const LENGTH: usize = 3;
1481 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1482 vec![
1483 format!("{:?}", self.documents).into(),
1484 format!("{:?}", self.method).into(),
1485 if let Some(parameters) = &self.parameters {
1486 format!("{parameters:?}").into()
1487 } else {
1488 String::new().into()
1489 },
1490 ]
1491 }
1492
1493 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1494 vec!["documents".into(), "method".into(), "parameters".into()]
1495 }
1496}
1497
1498#[derive(
1499 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1500)]
1501#[allow(non_snake_case)]
1502pub struct BulkEditResult {
1503 pub result: String,
1504}
1505
1506impl std::fmt::Display for BulkEditResult {
1507 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1508 write!(
1509 f,
1510 "{}",
1511 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1512 )
1513 }
1514}
1515
1516#[cfg(feature = "tabled")]
1517impl tabled::Tabled for BulkEditResult {
1518 const LENGTH: usize = 1;
1519 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1520 vec![self.result.clone().into()]
1521 }
1522
1523 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1524 vec!["result".into()]
1525 }
1526}
1527
1528#[derive(
1529 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1530)]
1531#[allow(non_snake_case)]
1532pub struct Classifier {
1533 pub status: String,
1534 pub error: String,
1535 pub last_trained: chrono::DateTime<chrono::Utc>,
1536}
1537
1538impl std::fmt::Display for Classifier {
1539 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1540 write!(
1541 f,
1542 "{}",
1543 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1544 )
1545 }
1546}
1547
1548#[cfg(feature = "tabled")]
1549impl tabled::Tabled for Classifier {
1550 const LENGTH: usize = 3;
1551 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1552 vec![
1553 self.status.clone().into(),
1554 self.error.clone().into(),
1555 format!("{:?}", self.last_trained).into(),
1556 ]
1557 }
1558
1559 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1560 vec!["status".into(), "error".into(), "last_trained".into()]
1561 }
1562}
1563
1564#[doc = "* `LeaveColorUnchanged` - LeaveColorUnchanged\n* `RGB` - RGB\n* `UseDeviceIndependentColor` - UseDeviceIndependentColor\n* `Gray` - Gray\n* `CMYK` - CMYK"]
1565#[derive(
1566 serde :: Serialize,
1567 serde :: Deserialize,
1568 PartialEq,
1569 Hash,
1570 Debug,
1571 Clone,
1572 schemars :: JsonSchema,
1573 parse_display :: FromStr,
1574 parse_display :: Display,
1575)]
1576#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1577#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1578pub enum ColorConversionStrategyEnum {
1579 LeaveColorUnchanged,
1580 #[serde(rename = "RGB")]
1581 #[display("RGB")]
1582 Rgb,
1583 UseDeviceIndependentColor,
1584 Gray,
1585 #[serde(rename = "CMYK")]
1586 #[display("CMYK")]
1587 Cmyk,
1588 #[serde(rename = "")]
1589 #[display("")]
1590 Empty,
1591}
1592
1593#[doc = "* `none` - none\n* `deflated` - deflated\n* `bzip2` - bzip2\n* `lzma` - lzma"]
1594#[derive(
1595 serde :: Serialize,
1596 serde :: Deserialize,
1597 PartialEq,
1598 Hash,
1599 Debug,
1600 Clone,
1601 schemars :: JsonSchema,
1602 parse_display :: FromStr,
1603 parse_display :: Display,
1604)]
1605#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1606#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1607pub enum CompressionEnum {
1608 #[serde(rename = "none")]
1609 #[display("none")]
1610 None,
1611 #[serde(rename = "deflated")]
1612 #[display("deflated")]
1613 Deflated,
1614 #[serde(rename = "bzip2")]
1615 #[display("bzip2")]
1616 Bzip2,
1617 #[serde(rename = "lzma")]
1618 #[display("lzma")]
1619 Lzma,
1620}
1621
1622#[doc = "* `archive` - archive\n* `originals` - originals\n* `both` - both"]
1623#[derive(
1624 serde :: Serialize,
1625 serde :: Deserialize,
1626 PartialEq,
1627 Hash,
1628 Debug,
1629 Clone,
1630 schemars :: JsonSchema,
1631 parse_display :: FromStr,
1632 parse_display :: Display,
1633)]
1634#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1635#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1636pub enum ContentEnum {
1637 #[serde(rename = "archive")]
1638 #[display("archive")]
1639 Archive,
1640 #[serde(rename = "originals")]
1641 #[display("originals")]
1642 Originals,
1643 #[serde(rename = "both")]
1644 #[display("both")]
1645 Both,
1646}
1647
1648#[derive(
1649 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1650)]
1651#[allow(non_snake_case)]
1652pub struct View {
1653 #[serde(default, skip_serializing_if = "Option::is_none")]
1654 pub users: Option<Vec<i64>>,
1655 #[serde(default, skip_serializing_if = "Option::is_none")]
1656 pub groups: Option<Vec<i64>>,
1657}
1658
1659impl std::fmt::Display for View {
1660 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1661 write!(
1662 f,
1663 "{}",
1664 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1665 )
1666 }
1667}
1668
1669#[cfg(feature = "tabled")]
1670impl tabled::Tabled for View {
1671 const LENGTH: usize = 2;
1672 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1673 vec![
1674 if let Some(users) = &self.users {
1675 format!("{users:?}").into()
1676 } else {
1677 String::new().into()
1678 },
1679 if let Some(groups) = &self.groups {
1680 format!("{groups:?}").into()
1681 } else {
1682 String::new().into()
1683 },
1684 ]
1685 }
1686
1687 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1688 vec!["users".into(), "groups".into()]
1689 }
1690}
1691
1692#[derive(
1693 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1694)]
1695#[allow(non_snake_case)]
1696pub struct Change {
1697 #[serde(default, skip_serializing_if = "Option::is_none")]
1698 pub users: Option<Vec<i64>>,
1699 #[serde(default, skip_serializing_if = "Option::is_none")]
1700 pub groups: Option<Vec<i64>>,
1701}
1702
1703impl std::fmt::Display for Change {
1704 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1705 write!(
1706 f,
1707 "{}",
1708 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1709 )
1710 }
1711}
1712
1713#[cfg(feature = "tabled")]
1714impl tabled::Tabled for Change {
1715 const LENGTH: usize = 2;
1716 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1717 vec![
1718 if let Some(users) = &self.users {
1719 format!("{users:?}").into()
1720 } else {
1721 String::new().into()
1722 },
1723 if let Some(groups) = &self.groups {
1724 format!("{groups:?}").into()
1725 } else {
1726 String::new().into()
1727 },
1728 ]
1729 }
1730
1731 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1732 vec!["users".into(), "groups".into()]
1733 }
1734}
1735
1736#[derive(
1737 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1738)]
1739#[allow(non_snake_case)]
1740pub struct Permissions {
1741 #[serde(default, skip_serializing_if = "Option::is_none")]
1742 pub view: Option<View>,
1743 #[serde(default, skip_serializing_if = "Option::is_none")]
1744 pub change: Option<Change>,
1745}
1746
1747impl std::fmt::Display for Permissions {
1748 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1749 write!(
1750 f,
1751 "{}",
1752 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1753 )
1754 }
1755}
1756
1757#[cfg(feature = "tabled")]
1758impl tabled::Tabled for Permissions {
1759 const LENGTH: usize = 2;
1760 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1761 vec![
1762 if let Some(view) = &self.view {
1763 format!("{view:?}").into()
1764 } else {
1765 String::new().into()
1766 },
1767 if let Some(change) = &self.change {
1768 format!("{change:?}").into()
1769 } else {
1770 String::new().into()
1771 },
1772 ]
1773 }
1774
1775 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1776 vec!["view".into(), "change".into()]
1777 }
1778}
1779
1780#[derive(
1781 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1782)]
1783#[allow(non_snake_case)]
1784pub struct Correspondent {
1785 pub id: i64,
1786 pub slug: String,
1787 pub name: String,
1788 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
1789 pub match_: Option<String>,
1790 #[serde(default, skip_serializing_if = "Option::is_none")]
1791 pub matching_algorithm: Option<i64>,
1792 #[serde(default, skip_serializing_if = "Option::is_none")]
1793 pub is_insensitive: Option<bool>,
1794 pub document_count: i64,
1795 pub last_correspondence: chrono::NaiveDate,
1796 #[serde(default, skip_serializing_if = "Option::is_none")]
1797 pub owner: Option<i64>,
1798 pub permissions: Permissions,
1799 pub user_can_change: bool,
1800}
1801
1802impl std::fmt::Display for Correspondent {
1803 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1804 write!(
1805 f,
1806 "{}",
1807 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1808 )
1809 }
1810}
1811
1812#[cfg(feature = "tabled")]
1813impl tabled::Tabled for Correspondent {
1814 const LENGTH: usize = 11;
1815 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1816 vec![
1817 format!("{:?}", self.id).into(),
1818 self.slug.clone().into(),
1819 self.name.clone().into(),
1820 if let Some(match_) = &self.match_ {
1821 format!("{match_:?}").into()
1822 } else {
1823 String::new().into()
1824 },
1825 if let Some(matching_algorithm) = &self.matching_algorithm {
1826 format!("{matching_algorithm:?}").into()
1827 } else {
1828 String::new().into()
1829 },
1830 if let Some(is_insensitive) = &self.is_insensitive {
1831 format!("{is_insensitive:?}").into()
1832 } else {
1833 String::new().into()
1834 },
1835 format!("{:?}", self.document_count).into(),
1836 format!("{:?}", self.last_correspondence).into(),
1837 if let Some(owner) = &self.owner {
1838 format!("{owner:?}").into()
1839 } else {
1840 String::new().into()
1841 },
1842 format!("{:?}", self.permissions).into(),
1843 format!("{:?}", self.user_can_change).into(),
1844 ]
1845 }
1846
1847 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1848 vec![
1849 "id".into(),
1850 "slug".into(),
1851 "name".into(),
1852 "match_".into(),
1853 "matching_algorithm".into(),
1854 "is_insensitive".into(),
1855 "document_count".into(),
1856 "last_correspondence".into(),
1857 "owner".into(),
1858 "permissions".into(),
1859 "user_can_change".into(),
1860 ]
1861 }
1862}
1863
1864#[derive(
1865 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1866)]
1867#[allow(non_snake_case)]
1868pub struct CorrespondentCounts {
1869 pub id: i64,
1870 pub document_count: i64,
1871}
1872
1873impl std::fmt::Display for CorrespondentCounts {
1874 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1875 write!(
1876 f,
1877 "{}",
1878 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1879 )
1880 }
1881}
1882
1883#[cfg(feature = "tabled")]
1884impl tabled::Tabled for CorrespondentCounts {
1885 const LENGTH: usize = 2;
1886 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1887 vec![
1888 format!("{:?}", self.id).into(),
1889 format!("{:?}", self.document_count).into(),
1890 ]
1891 }
1892
1893 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1894 vec!["id".into(), "document_count".into()]
1895 }
1896}
1897
1898#[derive(
1899 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1900)]
1901#[allow(non_snake_case)]
1902pub struct SetPermissions {
1903 #[serde(default, skip_serializing_if = "Option::is_none")]
1904 pub view: Option<View>,
1905 #[serde(default, skip_serializing_if = "Option::is_none")]
1906 pub change: Option<Change>,
1907}
1908
1909impl std::fmt::Display for SetPermissions {
1910 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1911 write!(
1912 f,
1913 "{}",
1914 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1915 )
1916 }
1917}
1918
1919#[cfg(feature = "tabled")]
1920impl tabled::Tabled for SetPermissions {
1921 const LENGTH: usize = 2;
1922 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1923 vec![
1924 if let Some(view) = &self.view {
1925 format!("{view:?}").into()
1926 } else {
1927 String::new().into()
1928 },
1929 if let Some(change) = &self.change {
1930 format!("{change:?}").into()
1931 } else {
1932 String::new().into()
1933 },
1934 ]
1935 }
1936
1937 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1938 vec!["view".into(), "change".into()]
1939 }
1940}
1941
1942#[derive(
1943 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1944)]
1945#[allow(non_snake_case)]
1946pub struct CorrespondentRequest {
1947 pub name: String,
1948 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
1949 pub match_: Option<String>,
1950 #[serde(default, skip_serializing_if = "Option::is_none")]
1951 pub matching_algorithm: Option<i64>,
1952 #[serde(default, skip_serializing_if = "Option::is_none")]
1953 pub is_insensitive: Option<bool>,
1954 #[serde(default, skip_serializing_if = "Option::is_none")]
1955 pub owner: Option<i64>,
1956 #[serde(default, skip_serializing_if = "Option::is_none")]
1957 pub set_permissions: Option<SetPermissions>,
1958}
1959
1960impl std::fmt::Display for CorrespondentRequest {
1961 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1962 write!(
1963 f,
1964 "{}",
1965 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1966 )
1967 }
1968}
1969
1970#[cfg(feature = "tabled")]
1971impl tabled::Tabled for CorrespondentRequest {
1972 const LENGTH: usize = 6;
1973 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1974 vec![
1975 self.name.clone().into(),
1976 if let Some(match_) = &self.match_ {
1977 format!("{match_:?}").into()
1978 } else {
1979 String::new().into()
1980 },
1981 if let Some(matching_algorithm) = &self.matching_algorithm {
1982 format!("{matching_algorithm:?}").into()
1983 } else {
1984 String::new().into()
1985 },
1986 if let Some(is_insensitive) = &self.is_insensitive {
1987 format!("{is_insensitive:?}").into()
1988 } else {
1989 String::new().into()
1990 },
1991 if let Some(owner) = &self.owner {
1992 format!("{owner:?}").into()
1993 } else {
1994 String::new().into()
1995 },
1996 if let Some(set_permissions) = &self.set_permissions {
1997 format!("{set_permissions:?}").into()
1998 } else {
1999 String::new().into()
2000 },
2001 ]
2002 }
2003
2004 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2005 vec![
2006 "name".into(),
2007 "match_".into(),
2008 "matching_algorithm".into(),
2009 "is_insensitive".into(),
2010 "owner".into(),
2011 "set_permissions".into(),
2012 ]
2013 }
2014}
2015
2016#[derive(
2017 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2018)]
2019#[allow(non_snake_case)]
2020pub struct CustomField {
2021 pub id: i64,
2022 pub name: String,
2023 #[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"]
2024 pub data_type: DataTypeEnum,
2025 #[doc = "Extra data for the custom field, such as select options"]
2026 #[serde(default, skip_serializing_if = "Option::is_none")]
2027 pub extra_data: Option<serde_json::Value>,
2028 pub document_count: i64,
2029}
2030
2031impl std::fmt::Display for CustomField {
2032 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2033 write!(
2034 f,
2035 "{}",
2036 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2037 )
2038 }
2039}
2040
2041#[cfg(feature = "tabled")]
2042impl tabled::Tabled for CustomField {
2043 const LENGTH: usize = 5;
2044 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2045 vec![
2046 format!("{:?}", self.id).into(),
2047 self.name.clone().into(),
2048 format!("{:?}", self.data_type).into(),
2049 if let Some(extra_data) = &self.extra_data {
2050 format!("{extra_data:?}").into()
2051 } else {
2052 String::new().into()
2053 },
2054 format!("{:?}", self.document_count).into(),
2055 ]
2056 }
2057
2058 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2059 vec![
2060 "id".into(),
2061 "name".into(),
2062 "data_type".into(),
2063 "extra_data".into(),
2064 "document_count".into(),
2065 ]
2066 }
2067}
2068
2069#[derive(
2070 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2071)]
2072#[allow(non_snake_case)]
2073pub struct CustomFieldCounts {
2074 pub id: i64,
2075 pub document_count: i64,
2076}
2077
2078impl std::fmt::Display for CustomFieldCounts {
2079 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2080 write!(
2081 f,
2082 "{}",
2083 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2084 )
2085 }
2086}
2087
2088#[cfg(feature = "tabled")]
2089impl tabled::Tabled for CustomFieldCounts {
2090 const LENGTH: usize = 2;
2091 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2092 vec![
2093 format!("{:?}", self.id).into(),
2094 format!("{:?}", self.document_count).into(),
2095 ]
2096 }
2097
2098 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2099 vec!["id".into(), "document_count".into()]
2100 }
2101}
2102
2103#[derive(
2104 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2105)]
2106#[allow(non_snake_case)]
2107pub struct CustomFieldInstance {
2108 #[doc = "Given the *incoming* primitive data, return the value for this field\nthat should be validated and transformed to a native value."]
2109 #[serde(default, skip_serializing_if = "Option::is_none")]
2110 pub value: Option<serde_json::Value>,
2111 pub field: i64,
2112}
2113
2114impl std::fmt::Display for CustomFieldInstance {
2115 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2116 write!(
2117 f,
2118 "{}",
2119 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2120 )
2121 }
2122}
2123
2124#[cfg(feature = "tabled")]
2125impl tabled::Tabled for CustomFieldInstance {
2126 const LENGTH: usize = 2;
2127 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2128 vec![
2129 if let Some(value) = &self.value {
2130 format!("{value:?}").into()
2131 } else {
2132 String::new().into()
2133 },
2134 format!("{:?}", self.field).into(),
2135 ]
2136 }
2137
2138 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2139 vec!["value".into(), "field".into()]
2140 }
2141}
2142
2143#[derive(
2144 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2145)]
2146#[allow(non_snake_case)]
2147pub struct CustomFieldInstanceRequest {
2148 #[doc = "Given the *incoming* primitive data, return the value for this field\nthat should be validated and transformed to a native value."]
2149 #[serde(default)]
2150 pub value: Option<serde_json::Value>,
2151 pub field: i64,
2152}
2153
2154impl std::fmt::Display for CustomFieldInstanceRequest {
2155 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2156 write!(
2157 f,
2158 "{}",
2159 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2160 )
2161 }
2162}
2163
2164#[cfg(feature = "tabled")]
2165impl tabled::Tabled for CustomFieldInstanceRequest {
2166 const LENGTH: usize = 2;
2167 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2168 vec![
2169 format!("{:?}", self.value).into(),
2170 format!("{:?}", self.field).into(),
2171 ]
2172 }
2173
2174 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2175 vec!["value".into(), "field".into()]
2176 }
2177}
2178
2179#[derive(
2180 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2181)]
2182#[allow(non_snake_case)]
2183pub struct CustomFieldRequest {
2184 pub name: String,
2185 #[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"]
2186 pub data_type: DataTypeEnum,
2187 #[doc = "Extra data for the custom field, such as select options"]
2188 #[serde(default, skip_serializing_if = "Option::is_none")]
2189 pub extra_data: Option<serde_json::Value>,
2190}
2191
2192impl std::fmt::Display for CustomFieldRequest {
2193 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2194 write!(
2195 f,
2196 "{}",
2197 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2198 )
2199 }
2200}
2201
2202#[cfg(feature = "tabled")]
2203impl tabled::Tabled for CustomFieldRequest {
2204 const LENGTH: usize = 3;
2205 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2206 vec![
2207 self.name.clone().into(),
2208 format!("{:?}", self.data_type).into(),
2209 if let Some(extra_data) = &self.extra_data {
2210 format!("{extra_data:?}").into()
2211 } else {
2212 String::new().into()
2213 },
2214 ]
2215 }
2216
2217 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2218 vec!["name".into(), "data_type".into(), "extra_data".into()]
2219 }
2220}
2221
2222#[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"]
2223#[derive(
2224 serde :: Serialize,
2225 serde :: Deserialize,
2226 PartialEq,
2227 Hash,
2228 Debug,
2229 Clone,
2230 schemars :: JsonSchema,
2231 parse_display :: FromStr,
2232 parse_display :: Display,
2233)]
2234#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2235#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2236pub enum DataTypeEnum {
2237 #[serde(rename = "string")]
2238 #[display("string")]
2239 String,
2240 #[serde(rename = "url")]
2241 #[display("url")]
2242 Url,
2243 #[serde(rename = "date")]
2244 #[display("date")]
2245 Date,
2246 #[serde(rename = "boolean")]
2247 #[display("boolean")]
2248 Boolean,
2249 #[serde(rename = "integer")]
2250 #[display("integer")]
2251 Integer,
2252 #[serde(rename = "float")]
2253 #[display("float")]
2254 Float,
2255 #[serde(rename = "monetary")]
2256 #[display("monetary")]
2257 Monetary,
2258 #[serde(rename = "documentlink")]
2259 #[display("documentlink")]
2260 Documentlink,
2261 #[serde(rename = "select")]
2262 #[display("select")]
2263 Select,
2264}
2265
2266#[derive(
2267 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2268)]
2269#[allow(non_snake_case)]
2270pub struct Database {
2271 #[serde(rename = "type")]
2272 pub type_: String,
2273 pub url: String,
2274 pub status: String,
2275 pub error: String,
2276 pub migration_status: MigrationStatus,
2277}
2278
2279impl std::fmt::Display for Database {
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 Database {
2291 const LENGTH: usize = 5;
2292 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2293 vec![
2294 self.type_.clone().into(),
2295 self.url.clone().into(),
2296 self.status.clone().into(),
2297 self.error.clone().into(),
2298 format!("{:?}", self.migration_status).into(),
2299 ]
2300 }
2301
2302 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2303 vec![
2304 "type_".into(),
2305 "url".into(),
2306 "status".into(),
2307 "error".into(),
2308 "migration_status".into(),
2309 ]
2310 }
2311}
2312
2313#[doc = "* `table` - Table\n* `smallCards` - Small Cards\n* `largeCards` - Large Cards"]
2314#[derive(
2315 serde :: Serialize,
2316 serde :: Deserialize,
2317 PartialEq,
2318 Hash,
2319 Debug,
2320 Clone,
2321 schemars :: JsonSchema,
2322 parse_display :: FromStr,
2323 parse_display :: Display,
2324)]
2325#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2326#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2327pub enum DisplayModeEnum {
2328 #[serde(rename = "table")]
2329 #[display("table")]
2330 Table,
2331 #[serde(rename = "smallCards")]
2332 #[display("smallCards")]
2333 SmallCards,
2334 #[serde(rename = "largeCards")]
2335 #[display("largeCards")]
2336 LargeCards,
2337 #[serde(rename = "")]
2338 #[display("")]
2339 Empty,
2340}
2341
2342#[doc = "Adds update nested feature"]
2343#[derive(
2344 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2345)]
2346#[allow(non_snake_case)]
2347pub struct Document {
2348 pub id: i64,
2349 #[serde(default)]
2350 pub correspondent: Option<i64>,
2351 #[serde(default)]
2352 pub document_type: Option<i64>,
2353 #[serde(default)]
2354 pub storage_path: Option<i64>,
2355 #[serde(default, skip_serializing_if = "Option::is_none")]
2356 pub title: Option<String>,
2357 #[doc = "The raw, text-only data of the document. This field is primarily used for searching."]
2358 #[serde(default, skip_serializing_if = "Option::is_none")]
2359 pub content: Option<String>,
2360 pub tags: Vec<i64>,
2361 #[serde(default, skip_serializing_if = "Option::is_none")]
2362 pub created: Option<chrono::NaiveDate>,
2363 #[serde(default, skip_serializing_if = "Option::is_none")]
2364 #[deprecated]
2365 pub created_date: Option<chrono::NaiveDate>,
2366 pub modified: chrono::DateTime<chrono::Utc>,
2367 pub added: chrono::DateTime<chrono::Utc>,
2368 #[serde(default, skip_serializing_if = "Option::is_none")]
2369 pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
2370 #[doc = "The position of this document in your physical document archive."]
2371 #[serde(default, skip_serializing_if = "Option::is_none")]
2372 pub archive_serial_number: Option<i64>,
2373 #[serde(default)]
2374 pub original_file_name: Option<String>,
2375 #[serde(default)]
2376 pub archived_file_name: Option<String>,
2377 #[serde(default, skip_serializing_if = "Option::is_none")]
2378 pub owner: Option<i64>,
2379 #[serde(default, skip_serializing_if = "Option::is_none")]
2380 pub permissions: Option<Permissions>,
2381 #[serde(default)]
2382 pub user_can_change: Option<bool>,
2383 #[serde(default)]
2384 pub is_shared_by_requester: Option<bool>,
2385 pub notes: Vec<Notes>,
2386 #[serde(default, skip_serializing_if = "Option::is_none")]
2387 pub custom_fields: Option<Vec<CustomFieldInstance>>,
2388 #[serde(default)]
2389 pub page_count: Option<i64>,
2390 pub mime_type: String,
2391}
2392
2393impl std::fmt::Display for Document {
2394 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2395 write!(
2396 f,
2397 "{}",
2398 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2399 )
2400 }
2401}
2402
2403#[cfg(feature = "tabled")]
2404impl tabled::Tabled for Document {
2405 const LENGTH: usize = 23;
2406 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2407 vec![
2408 format!("{:?}", self.id).into(),
2409 format!("{:?}", self.correspondent).into(),
2410 format!("{:?}", self.document_type).into(),
2411 format!("{:?}", self.storage_path).into(),
2412 if let Some(title) = &self.title {
2413 format!("{title:?}").into()
2414 } else {
2415 String::new().into()
2416 },
2417 if let Some(content) = &self.content {
2418 format!("{content:?}").into()
2419 } else {
2420 String::new().into()
2421 },
2422 format!("{:?}", self.tags).into(),
2423 if let Some(created) = &self.created {
2424 format!("{created:?}").into()
2425 } else {
2426 String::new().into()
2427 },
2428 if let Some(created_date) = &self.created_date {
2429 format!("{created_date:?}").into()
2430 } else {
2431 String::new().into()
2432 },
2433 format!("{:?}", self.modified).into(),
2434 format!("{:?}", self.added).into(),
2435 if let Some(deleted_at) = &self.deleted_at {
2436 format!("{deleted_at:?}").into()
2437 } else {
2438 String::new().into()
2439 },
2440 if let Some(archive_serial_number) = &self.archive_serial_number {
2441 format!("{archive_serial_number:?}").into()
2442 } else {
2443 String::new().into()
2444 },
2445 format!("{:?}", self.original_file_name).into(),
2446 format!("{:?}", self.archived_file_name).into(),
2447 if let Some(owner) = &self.owner {
2448 format!("{owner:?}").into()
2449 } else {
2450 String::new().into()
2451 },
2452 if let Some(permissions) = &self.permissions {
2453 format!("{permissions:?}").into()
2454 } else {
2455 String::new().into()
2456 },
2457 format!("{:?}", self.user_can_change).into(),
2458 format!("{:?}", self.is_shared_by_requester).into(),
2459 format!("{:?}", self.notes).into(),
2460 if let Some(custom_fields) = &self.custom_fields {
2461 format!("{custom_fields:?}").into()
2462 } else {
2463 String::new().into()
2464 },
2465 format!("{:?}", self.page_count).into(),
2466 self.mime_type.clone().into(),
2467 ]
2468 }
2469
2470 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2471 vec![
2472 "id".into(),
2473 "correspondent".into(),
2474 "document_type".into(),
2475 "storage_path".into(),
2476 "title".into(),
2477 "content".into(),
2478 "tags".into(),
2479 "created".into(),
2480 "created_date".into(),
2481 "modified".into(),
2482 "added".into(),
2483 "deleted_at".into(),
2484 "archive_serial_number".into(),
2485 "original_file_name".into(),
2486 "archived_file_name".into(),
2487 "owner".into(),
2488 "permissions".into(),
2489 "user_can_change".into(),
2490 "is_shared_by_requester".into(),
2491 "notes".into(),
2492 "custom_fields".into(),
2493 "page_count".into(),
2494 "mime_type".into(),
2495 ]
2496 }
2497}
2498
2499#[derive(
2500 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2501)]
2502#[allow(non_snake_case)]
2503pub struct DocumentListRequest {
2504 pub documents: Vec<i64>,
2505}
2506
2507impl std::fmt::Display for DocumentListRequest {
2508 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2509 write!(
2510 f,
2511 "{}",
2512 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2513 )
2514 }
2515}
2516
2517#[cfg(feature = "tabled")]
2518impl tabled::Tabled for DocumentListRequest {
2519 const LENGTH: usize = 1;
2520 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2521 vec![format!("{:?}", self.documents).into()]
2522 }
2523
2524 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2525 vec!["documents".into()]
2526 }
2527}
2528
2529#[doc = "Adds update nested feature"]
2530#[derive(
2531 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2532)]
2533#[allow(non_snake_case)]
2534pub struct DocumentRequest {
2535 #[serde(default)]
2536 pub correspondent: Option<i64>,
2537 #[serde(default)]
2538 pub document_type: Option<i64>,
2539 #[serde(default)]
2540 pub storage_path: Option<i64>,
2541 #[serde(default, skip_serializing_if = "Option::is_none")]
2542 pub title: Option<String>,
2543 #[doc = "The raw, text-only data of the document. This field is primarily used for searching."]
2544 #[serde(default, skip_serializing_if = "Option::is_none")]
2545 pub content: Option<String>,
2546 pub tags: Vec<i64>,
2547 #[serde(default, skip_serializing_if = "Option::is_none")]
2548 pub created: Option<chrono::NaiveDate>,
2549 #[serde(default, skip_serializing_if = "Option::is_none")]
2550 #[deprecated]
2551 pub created_date: Option<chrono::NaiveDate>,
2552 #[serde(default, skip_serializing_if = "Option::is_none")]
2553 pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
2554 #[doc = "The position of this document in your physical document archive."]
2555 #[serde(default, skip_serializing_if = "Option::is_none")]
2556 pub archive_serial_number: Option<i64>,
2557 #[serde(default, skip_serializing_if = "Option::is_none")]
2558 pub owner: Option<i64>,
2559 #[serde(default, skip_serializing_if = "Option::is_none")]
2560 pub set_permissions: Option<SetPermissions>,
2561 #[serde(default, skip_serializing_if = "Option::is_none")]
2562 pub custom_fields: Option<Vec<CustomFieldInstanceRequest>>,
2563 #[serde(default, skip_serializing_if = "Option::is_none")]
2564 pub remove_inbox_tags: Option<bool>,
2565}
2566
2567impl std::fmt::Display for DocumentRequest {
2568 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2569 write!(
2570 f,
2571 "{}",
2572 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2573 )
2574 }
2575}
2576
2577#[cfg(feature = "tabled")]
2578impl tabled::Tabled for DocumentRequest {
2579 const LENGTH: usize = 14;
2580 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2581 vec![
2582 format!("{:?}", self.correspondent).into(),
2583 format!("{:?}", self.document_type).into(),
2584 format!("{:?}", self.storage_path).into(),
2585 if let Some(title) = &self.title {
2586 format!("{title:?}").into()
2587 } else {
2588 String::new().into()
2589 },
2590 if let Some(content) = &self.content {
2591 format!("{content:?}").into()
2592 } else {
2593 String::new().into()
2594 },
2595 format!("{:?}", self.tags).into(),
2596 if let Some(created) = &self.created {
2597 format!("{created:?}").into()
2598 } else {
2599 String::new().into()
2600 },
2601 if let Some(created_date) = &self.created_date {
2602 format!("{created_date:?}").into()
2603 } else {
2604 String::new().into()
2605 },
2606 if let Some(deleted_at) = &self.deleted_at {
2607 format!("{deleted_at:?}").into()
2608 } else {
2609 String::new().into()
2610 },
2611 if let Some(archive_serial_number) = &self.archive_serial_number {
2612 format!("{archive_serial_number:?}").into()
2613 } else {
2614 String::new().into()
2615 },
2616 if let Some(owner) = &self.owner {
2617 format!("{owner:?}").into()
2618 } else {
2619 String::new().into()
2620 },
2621 if let Some(set_permissions) = &self.set_permissions {
2622 format!("{set_permissions:?}").into()
2623 } else {
2624 String::new().into()
2625 },
2626 if let Some(custom_fields) = &self.custom_fields {
2627 format!("{custom_fields:?}").into()
2628 } else {
2629 String::new().into()
2630 },
2631 if let Some(remove_inbox_tags) = &self.remove_inbox_tags {
2632 format!("{remove_inbox_tags:?}").into()
2633 } else {
2634 String::new().into()
2635 },
2636 ]
2637 }
2638
2639 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2640 vec![
2641 "correspondent".into(),
2642 "document_type".into(),
2643 "storage_path".into(),
2644 "title".into(),
2645 "content".into(),
2646 "tags".into(),
2647 "created".into(),
2648 "created_date".into(),
2649 "deleted_at".into(),
2650 "archive_serial_number".into(),
2651 "owner".into(),
2652 "set_permissions".into(),
2653 "custom_fields".into(),
2654 "remove_inbox_tags".into(),
2655 ]
2656 }
2657}
2658
2659#[derive(
2660 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2661)]
2662#[allow(non_snake_case)]
2663pub struct DocumentType {
2664 pub id: i64,
2665 pub slug: String,
2666 pub name: String,
2667 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
2668 pub match_: Option<String>,
2669 #[serde(default, skip_serializing_if = "Option::is_none")]
2670 pub matching_algorithm: Option<i64>,
2671 #[serde(default, skip_serializing_if = "Option::is_none")]
2672 pub is_insensitive: Option<bool>,
2673 pub document_count: i64,
2674 #[serde(default, skip_serializing_if = "Option::is_none")]
2675 pub owner: Option<i64>,
2676 pub permissions: Permissions,
2677 pub user_can_change: bool,
2678}
2679
2680impl std::fmt::Display for DocumentType {
2681 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2682 write!(
2683 f,
2684 "{}",
2685 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2686 )
2687 }
2688}
2689
2690#[cfg(feature = "tabled")]
2691impl tabled::Tabled for DocumentType {
2692 const LENGTH: usize = 10;
2693 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2694 vec![
2695 format!("{:?}", self.id).into(),
2696 self.slug.clone().into(),
2697 self.name.clone().into(),
2698 if let Some(match_) = &self.match_ {
2699 format!("{match_:?}").into()
2700 } else {
2701 String::new().into()
2702 },
2703 if let Some(matching_algorithm) = &self.matching_algorithm {
2704 format!("{matching_algorithm:?}").into()
2705 } else {
2706 String::new().into()
2707 },
2708 if let Some(is_insensitive) = &self.is_insensitive {
2709 format!("{is_insensitive:?}").into()
2710 } else {
2711 String::new().into()
2712 },
2713 format!("{:?}", self.document_count).into(),
2714 if let Some(owner) = &self.owner {
2715 format!("{owner:?}").into()
2716 } else {
2717 String::new().into()
2718 },
2719 format!("{:?}", self.permissions).into(),
2720 format!("{:?}", self.user_can_change).into(),
2721 ]
2722 }
2723
2724 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2725 vec![
2726 "id".into(),
2727 "slug".into(),
2728 "name".into(),
2729 "match_".into(),
2730 "matching_algorithm".into(),
2731 "is_insensitive".into(),
2732 "document_count".into(),
2733 "owner".into(),
2734 "permissions".into(),
2735 "user_can_change".into(),
2736 ]
2737 }
2738}
2739
2740#[derive(
2741 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2742)]
2743#[allow(non_snake_case)]
2744pub struct DocumentTypeCounts {
2745 pub id: i64,
2746 pub document_count: i64,
2747}
2748
2749impl std::fmt::Display for DocumentTypeCounts {
2750 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2751 write!(
2752 f,
2753 "{}",
2754 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2755 )
2756 }
2757}
2758
2759#[cfg(feature = "tabled")]
2760impl tabled::Tabled for DocumentTypeCounts {
2761 const LENGTH: usize = 2;
2762 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2763 vec![
2764 format!("{:?}", self.id).into(),
2765 format!("{:?}", self.document_count).into(),
2766 ]
2767 }
2768
2769 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2770 vec!["id".into(), "document_count".into()]
2771 }
2772}
2773
2774#[derive(
2775 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2776)]
2777#[allow(non_snake_case)]
2778pub struct DocumentTypeRequest {
2779 pub name: String,
2780 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
2781 pub match_: Option<String>,
2782 #[serde(default, skip_serializing_if = "Option::is_none")]
2783 pub matching_algorithm: Option<i64>,
2784 #[serde(default, skip_serializing_if = "Option::is_none")]
2785 pub is_insensitive: Option<bool>,
2786 #[serde(default, skip_serializing_if = "Option::is_none")]
2787 pub owner: Option<i64>,
2788 #[serde(default, skip_serializing_if = "Option::is_none")]
2789 pub set_permissions: Option<SetPermissions>,
2790}
2791
2792impl std::fmt::Display for DocumentTypeRequest {
2793 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2794 write!(
2795 f,
2796 "{}",
2797 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2798 )
2799 }
2800}
2801
2802#[cfg(feature = "tabled")]
2803impl tabled::Tabled for DocumentTypeRequest {
2804 const LENGTH: usize = 6;
2805 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2806 vec![
2807 self.name.clone().into(),
2808 if let Some(match_) = &self.match_ {
2809 format!("{match_:?}").into()
2810 } else {
2811 String::new().into()
2812 },
2813 if let Some(matching_algorithm) = &self.matching_algorithm {
2814 format!("{matching_algorithm:?}").into()
2815 } else {
2816 String::new().into()
2817 },
2818 if let Some(is_insensitive) = &self.is_insensitive {
2819 format!("{is_insensitive:?}").into()
2820 } else {
2821 String::new().into()
2822 },
2823 if let Some(owner) = &self.owner {
2824 format!("{owner:?}").into()
2825 } else {
2826 String::new().into()
2827 },
2828 if let Some(set_permissions) = &self.set_permissions {
2829 format!("{set_permissions:?}").into()
2830 } else {
2831 String::new().into()
2832 },
2833 ]
2834 }
2835
2836 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2837 vec![
2838 "name".into(),
2839 "match_".into(),
2840 "matching_algorithm".into(),
2841 "is_insensitive".into(),
2842 "owner".into(),
2843 "set_permissions".into(),
2844 ]
2845 }
2846}
2847
2848#[derive(
2849 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2850)]
2851#[allow(non_snake_case)]
2852pub struct EmailRequestRequest {
2853 pub addresses: String,
2854 pub subject: String,
2855 pub message: String,
2856 #[serde(default)]
2857 pub use_archive_version: bool,
2858}
2859
2860impl std::fmt::Display for EmailRequestRequest {
2861 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2862 write!(
2863 f,
2864 "{}",
2865 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2866 )
2867 }
2868}
2869
2870#[cfg(feature = "tabled")]
2871impl tabled::Tabled for EmailRequestRequest {
2872 const LENGTH: usize = 4;
2873 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2874 vec![
2875 self.addresses.clone().into(),
2876 self.subject.clone().into(),
2877 self.message.clone().into(),
2878 format!("{:?}", self.use_archive_version).into(),
2879 ]
2880 }
2881
2882 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2883 vec![
2884 "addresses".into(),
2885 "subject".into(),
2886 "message".into(),
2887 "use_archive_version".into(),
2888 ]
2889 }
2890}
2891
2892#[derive(
2893 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2894)]
2895#[allow(non_snake_case)]
2896pub struct EmailResponse {
2897 pub message: String,
2898}
2899
2900impl std::fmt::Display for EmailResponse {
2901 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2902 write!(
2903 f,
2904 "{}",
2905 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2906 )
2907 }
2908}
2909
2910#[cfg(feature = "tabled")]
2911impl tabled::Tabled for EmailResponse {
2912 const LENGTH: usize = 1;
2913 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2914 vec![self.message.clone().into()]
2915 }
2916
2917 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2918 vec!["message".into()]
2919 }
2920}
2921
2922#[doc = "* `archive` - Archive\n* `original` - Original"]
2923#[derive(
2924 serde :: Serialize,
2925 serde :: Deserialize,
2926 PartialEq,
2927 Hash,
2928 Debug,
2929 Clone,
2930 schemars :: JsonSchema,
2931 parse_display :: FromStr,
2932 parse_display :: Display,
2933)]
2934#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2935#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2936pub enum FileVersionEnum {
2937 #[serde(rename = "archive")]
2938 #[display("archive")]
2939 Archive,
2940 #[serde(rename = "original")]
2941 #[display("original")]
2942 Original,
2943}
2944
2945#[derive(
2946 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2947)]
2948#[allow(non_snake_case)]
2949pub struct Group {
2950 pub id: i64,
2951 pub name: String,
2952 pub permissions: Vec<String>,
2953}
2954
2955impl std::fmt::Display for Group {
2956 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2957 write!(
2958 f,
2959 "{}",
2960 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2961 )
2962 }
2963}
2964
2965#[cfg(feature = "tabled")]
2966impl tabled::Tabled for Group {
2967 const LENGTH: usize = 3;
2968 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2969 vec![
2970 format!("{:?}", self.id).into(),
2971 self.name.clone().into(),
2972 format!("{:?}", self.permissions).into(),
2973 ]
2974 }
2975
2976 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2977 vec!["id".into(), "name".into(), "permissions".into()]
2978 }
2979}
2980
2981#[derive(
2982 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2983)]
2984#[allow(non_snake_case)]
2985pub struct GroupRequest {
2986 pub name: String,
2987 pub permissions: Vec<String>,
2988}
2989
2990impl std::fmt::Display for GroupRequest {
2991 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2992 write!(
2993 f,
2994 "{}",
2995 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2996 )
2997 }
2998}
2999
3000#[cfg(feature = "tabled")]
3001impl tabled::Tabled for GroupRequest {
3002 const LENGTH: usize = 2;
3003 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3004 vec![
3005 self.name.clone().into(),
3006 format!("{:?}", self.permissions).into(),
3007 ]
3008 }
3009
3010 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3011 vec!["name".into(), "permissions".into()]
3012 }
3013}
3014
3015#[derive(
3016 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3017)]
3018#[allow(non_snake_case)]
3019pub struct Index {
3020 pub status: String,
3021 pub error: String,
3022 pub last_modified: chrono::DateTime<chrono::Utc>,
3023}
3024
3025impl std::fmt::Display for Index {
3026 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3027 write!(
3028 f,
3029 "{}",
3030 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3031 )
3032 }
3033}
3034
3035#[cfg(feature = "tabled")]
3036impl tabled::Tabled for Index {
3037 const LENGTH: usize = 3;
3038 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3039 vec![
3040 self.status.clone().into(),
3041 self.error.clone().into(),
3042 format!("{:?}", self.last_modified).into(),
3043 ]
3044 }
3045
3046 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3047 vec!["status".into(), "error".into(), "last_modified".into()]
3048 }
3049}
3050
3051#[derive(
3052 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3053)]
3054#[allow(non_snake_case)]
3055pub struct LogEntry {
3056 pub id: i64,
3057 pub timestamp: chrono::DateTime<chrono::Utc>,
3058 pub action: String,
3059 pub changes: std::collections::HashMap<String, serde_json::Value>,
3060 pub actor: Actor,
3061}
3062
3063impl std::fmt::Display for LogEntry {
3064 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3065 write!(
3066 f,
3067 "{}",
3068 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3069 )
3070 }
3071}
3072
3073#[cfg(feature = "tabled")]
3074impl tabled::Tabled for LogEntry {
3075 const LENGTH: usize = 5;
3076 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3077 vec![
3078 format!("{:?}", self.id).into(),
3079 format!("{:?}", self.timestamp).into(),
3080 self.action.clone().into(),
3081 format!("{:?}", self.changes).into(),
3082 format!("{:?}", self.actor).into(),
3083 ]
3084 }
3085
3086 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3087 vec![
3088 "id".into(),
3089 "timestamp".into(),
3090 "action".into(),
3091 "changes".into(),
3092 "actor".into(),
3093 ]
3094 }
3095}
3096
3097#[derive(
3098 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3099)]
3100#[allow(non_snake_case)]
3101pub struct MailAccount {
3102 pub id: i64,
3103 pub name: String,
3104 pub imap_server: String,
3105 #[doc = "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."]
3106 #[serde(default, skip_serializing_if = "Option::is_none")]
3107 pub imap_port: Option<i64>,
3108 #[serde(default, skip_serializing_if = "Option::is_none")]
3109 pub imap_security: Option<i64>,
3110 pub username: String,
3111 pub password: String,
3112 #[doc = "The character set to use when communicating with the mail server, such as 'UTF-8' or 'US-ASCII'."]
3113 #[serde(default, skip_serializing_if = "Option::is_none")]
3114 pub character_set: Option<String>,
3115 #[serde(default, skip_serializing_if = "Option::is_none")]
3116 pub is_token: Option<bool>,
3117 #[serde(default, skip_serializing_if = "Option::is_none")]
3118 pub owner: Option<i64>,
3119 pub user_can_change: bool,
3120 #[serde(default, skip_serializing_if = "Option::is_none")]
3121 pub account_type: Option<i64>,
3122 #[doc = "The expiration date of the refresh token. "]
3123 #[serde(default, skip_serializing_if = "Option::is_none")]
3124 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
3125}
3126
3127impl std::fmt::Display for MailAccount {
3128 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3129 write!(
3130 f,
3131 "{}",
3132 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3133 )
3134 }
3135}
3136
3137#[cfg(feature = "tabled")]
3138impl tabled::Tabled for MailAccount {
3139 const LENGTH: usize = 13;
3140 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3141 vec![
3142 format!("{:?}", self.id).into(),
3143 self.name.clone().into(),
3144 self.imap_server.clone().into(),
3145 if let Some(imap_port) = &self.imap_port {
3146 format!("{imap_port:?}").into()
3147 } else {
3148 String::new().into()
3149 },
3150 if let Some(imap_security) = &self.imap_security {
3151 format!("{imap_security:?}").into()
3152 } else {
3153 String::new().into()
3154 },
3155 self.username.clone().into(),
3156 self.password.clone().into(),
3157 if let Some(character_set) = &self.character_set {
3158 format!("{character_set:?}").into()
3159 } else {
3160 String::new().into()
3161 },
3162 if let Some(is_token) = &self.is_token {
3163 format!("{is_token:?}").into()
3164 } else {
3165 String::new().into()
3166 },
3167 if let Some(owner) = &self.owner {
3168 format!("{owner:?}").into()
3169 } else {
3170 String::new().into()
3171 },
3172 format!("{:?}", self.user_can_change).into(),
3173 if let Some(account_type) = &self.account_type {
3174 format!("{account_type:?}").into()
3175 } else {
3176 String::new().into()
3177 },
3178 if let Some(expiration) = &self.expiration {
3179 format!("{expiration:?}").into()
3180 } else {
3181 String::new().into()
3182 },
3183 ]
3184 }
3185
3186 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3187 vec![
3188 "id".into(),
3189 "name".into(),
3190 "imap_server".into(),
3191 "imap_port".into(),
3192 "imap_security".into(),
3193 "username".into(),
3194 "password".into(),
3195 "character_set".into(),
3196 "is_token".into(),
3197 "owner".into(),
3198 "user_can_change".into(),
3199 "account_type".into(),
3200 "expiration".into(),
3201 ]
3202 }
3203}
3204
3205#[derive(
3206 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3207)]
3208#[allow(non_snake_case)]
3209pub struct MailAccountProcessResponse {
3210 #[serde(default, skip_serializing_if = "Option::is_none")]
3211 pub result: Option<String>,
3212}
3213
3214impl std::fmt::Display for MailAccountProcessResponse {
3215 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3216 write!(
3217 f,
3218 "{}",
3219 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3220 )
3221 }
3222}
3223
3224#[cfg(feature = "tabled")]
3225impl tabled::Tabled for MailAccountProcessResponse {
3226 const LENGTH: usize = 1;
3227 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3228 vec![if let Some(result) = &self.result {
3229 format!("{result:?}").into()
3230 } else {
3231 String::new().into()
3232 }]
3233 }
3234
3235 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3236 vec!["result".into()]
3237 }
3238}
3239
3240#[derive(
3241 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3242)]
3243#[allow(non_snake_case)]
3244pub struct MailAccountRequest {
3245 pub name: String,
3246 pub imap_server: String,
3247 #[doc = "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."]
3248 #[serde(default, skip_serializing_if = "Option::is_none")]
3249 pub imap_port: Option<i64>,
3250 #[serde(default, skip_serializing_if = "Option::is_none")]
3251 pub imap_security: Option<i64>,
3252 pub username: String,
3253 pub password: String,
3254 #[doc = "The character set to use when communicating with the mail server, such as 'UTF-8' or 'US-ASCII'."]
3255 #[serde(default, skip_serializing_if = "Option::is_none")]
3256 pub character_set: Option<String>,
3257 #[serde(default, skip_serializing_if = "Option::is_none")]
3258 pub is_token: Option<bool>,
3259 #[serde(default, skip_serializing_if = "Option::is_none")]
3260 pub owner: Option<i64>,
3261 #[serde(default, skip_serializing_if = "Option::is_none")]
3262 pub set_permissions: Option<SetPermissions>,
3263 #[serde(default, skip_serializing_if = "Option::is_none")]
3264 pub account_type: Option<i64>,
3265 #[doc = "The expiration date of the refresh token. "]
3266 #[serde(default, skip_serializing_if = "Option::is_none")]
3267 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
3268}
3269
3270impl std::fmt::Display for MailAccountRequest {
3271 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3272 write!(
3273 f,
3274 "{}",
3275 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3276 )
3277 }
3278}
3279
3280#[cfg(feature = "tabled")]
3281impl tabled::Tabled for MailAccountRequest {
3282 const LENGTH: usize = 12;
3283 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3284 vec![
3285 self.name.clone().into(),
3286 self.imap_server.clone().into(),
3287 if let Some(imap_port) = &self.imap_port {
3288 format!("{imap_port:?}").into()
3289 } else {
3290 String::new().into()
3291 },
3292 if let Some(imap_security) = &self.imap_security {
3293 format!("{imap_security:?}").into()
3294 } else {
3295 String::new().into()
3296 },
3297 self.username.clone().into(),
3298 self.password.clone().into(),
3299 if let Some(character_set) = &self.character_set {
3300 format!("{character_set:?}").into()
3301 } else {
3302 String::new().into()
3303 },
3304 if let Some(is_token) = &self.is_token {
3305 format!("{is_token:?}").into()
3306 } else {
3307 String::new().into()
3308 },
3309 if let Some(owner) = &self.owner {
3310 format!("{owner:?}").into()
3311 } else {
3312 String::new().into()
3313 },
3314 if let Some(set_permissions) = &self.set_permissions {
3315 format!("{set_permissions:?}").into()
3316 } else {
3317 String::new().into()
3318 },
3319 if let Some(account_type) = &self.account_type {
3320 format!("{account_type:?}").into()
3321 } else {
3322 String::new().into()
3323 },
3324 if let Some(expiration) = &self.expiration {
3325 format!("{expiration:?}").into()
3326 } else {
3327 String::new().into()
3328 },
3329 ]
3330 }
3331
3332 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3333 vec![
3334 "name".into(),
3335 "imap_server".into(),
3336 "imap_port".into(),
3337 "imap_security".into(),
3338 "username".into(),
3339 "password".into(),
3340 "character_set".into(),
3341 "is_token".into(),
3342 "owner".into(),
3343 "set_permissions".into(),
3344 "account_type".into(),
3345 "expiration".into(),
3346 ]
3347 }
3348}
3349
3350#[derive(
3351 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3352)]
3353#[allow(non_snake_case)]
3354pub struct MailAccountTestResponse {
3355 pub success: bool,
3356}
3357
3358impl std::fmt::Display for MailAccountTestResponse {
3359 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3360 write!(
3361 f,
3362 "{}",
3363 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3364 )
3365 }
3366}
3367
3368#[cfg(feature = "tabled")]
3369impl tabled::Tabled for MailAccountTestResponse {
3370 const LENGTH: usize = 1;
3371 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3372 vec![format!("{:?}", self.success).into()]
3373 }
3374
3375 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3376 vec!["success".into()]
3377 }
3378}
3379
3380#[derive(
3381 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3382)]
3383#[allow(non_snake_case)]
3384pub struct MailRule {
3385 pub id: i64,
3386 pub name: String,
3387 pub account: i64,
3388 #[serde(default, skip_serializing_if = "Option::is_none")]
3389 pub enabled: Option<bool>,
3390 #[doc = "Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server."]
3391 #[serde(default, skip_serializing_if = "Option::is_none")]
3392 pub folder: Option<String>,
3393 #[serde(default, skip_serializing_if = "Option::is_none")]
3394 pub filter_from: Option<String>,
3395 #[serde(default, skip_serializing_if = "Option::is_none")]
3396 pub filter_to: Option<String>,
3397 #[serde(default, skip_serializing_if = "Option::is_none")]
3398 pub filter_subject: Option<String>,
3399 #[serde(default, skip_serializing_if = "Option::is_none")]
3400 pub filter_body: Option<String>,
3401 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3402 #[serde(default, skip_serializing_if = "Option::is_none")]
3403 pub filter_attachment_filename_include: Option<String>,
3404 #[doc = "Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3405 #[serde(default, skip_serializing_if = "Option::is_none")]
3406 pub filter_attachment_filename_exclude: Option<String>,
3407 #[doc = "Specified in days."]
3408 #[serde(default, skip_serializing_if = "Option::is_none")]
3409 pub maximum_age: Option<i64>,
3410 #[serde(default, skip_serializing_if = "Option::is_none")]
3411 pub action: Option<i64>,
3412 #[serde(default, skip_serializing_if = "Option::is_none")]
3413 pub action_parameter: Option<String>,
3414 #[serde(default, skip_serializing_if = "Option::is_none")]
3415 pub assign_title_from: Option<i64>,
3416 #[serde(default, skip_serializing_if = "Option::is_none")]
3417 pub assign_tags: Option<Vec<Option<i64>>>,
3418 #[serde(default, skip_serializing_if = "Option::is_none")]
3419 pub assign_correspondent_from: Option<i64>,
3420 #[serde(default, skip_serializing_if = "Option::is_none")]
3421 pub assign_correspondent: Option<i64>,
3422 #[serde(default, skip_serializing_if = "Option::is_none")]
3423 pub assign_document_type: Option<i64>,
3424 #[serde(default, skip_serializing_if = "Option::is_none")]
3425 pub assign_owner_from_rule: Option<bool>,
3426 #[serde(default, skip_serializing_if = "Option::is_none")]
3427 pub order: Option<i64>,
3428 #[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."]
3429 #[serde(default, skip_serializing_if = "Option::is_none")]
3430 pub attachment_type: Option<i64>,
3431 #[serde(default, skip_serializing_if = "Option::is_none")]
3432 pub consumption_scope: Option<i64>,
3433 #[serde(default, skip_serializing_if = "Option::is_none")]
3434 pub pdf_layout: Option<i64>,
3435 #[serde(default, skip_serializing_if = "Option::is_none")]
3436 pub owner: Option<i64>,
3437 pub user_can_change: bool,
3438}
3439
3440impl std::fmt::Display for MailRule {
3441 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3442 write!(
3443 f,
3444 "{}",
3445 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3446 )
3447 }
3448}
3449
3450#[cfg(feature = "tabled")]
3451impl tabled::Tabled for MailRule {
3452 const LENGTH: usize = 26;
3453 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3454 vec![
3455 format!("{:?}", self.id).into(),
3456 self.name.clone().into(),
3457 format!("{:?}", self.account).into(),
3458 if let Some(enabled) = &self.enabled {
3459 format!("{enabled:?}").into()
3460 } else {
3461 String::new().into()
3462 },
3463 if let Some(folder) = &self.folder {
3464 format!("{folder:?}").into()
3465 } else {
3466 String::new().into()
3467 },
3468 if let Some(filter_from) = &self.filter_from {
3469 format!("{filter_from:?}").into()
3470 } else {
3471 String::new().into()
3472 },
3473 if let Some(filter_to) = &self.filter_to {
3474 format!("{filter_to:?}").into()
3475 } else {
3476 String::new().into()
3477 },
3478 if let Some(filter_subject) = &self.filter_subject {
3479 format!("{filter_subject:?}").into()
3480 } else {
3481 String::new().into()
3482 },
3483 if let Some(filter_body) = &self.filter_body {
3484 format!("{filter_body:?}").into()
3485 } else {
3486 String::new().into()
3487 },
3488 if let Some(filter_attachment_filename_include) =
3489 &self.filter_attachment_filename_include
3490 {
3491 format!("{filter_attachment_filename_include:?}").into()
3492 } else {
3493 String::new().into()
3494 },
3495 if let Some(filter_attachment_filename_exclude) =
3496 &self.filter_attachment_filename_exclude
3497 {
3498 format!("{filter_attachment_filename_exclude:?}").into()
3499 } else {
3500 String::new().into()
3501 },
3502 if let Some(maximum_age) = &self.maximum_age {
3503 format!("{maximum_age:?}").into()
3504 } else {
3505 String::new().into()
3506 },
3507 if let Some(action) = &self.action {
3508 format!("{action:?}").into()
3509 } else {
3510 String::new().into()
3511 },
3512 if let Some(action_parameter) = &self.action_parameter {
3513 format!("{action_parameter:?}").into()
3514 } else {
3515 String::new().into()
3516 },
3517 if let Some(assign_title_from) = &self.assign_title_from {
3518 format!("{assign_title_from:?}").into()
3519 } else {
3520 String::new().into()
3521 },
3522 if let Some(assign_tags) = &self.assign_tags {
3523 format!("{assign_tags:?}").into()
3524 } else {
3525 String::new().into()
3526 },
3527 if let Some(assign_correspondent_from) = &self.assign_correspondent_from {
3528 format!("{assign_correspondent_from:?}").into()
3529 } else {
3530 String::new().into()
3531 },
3532 if let Some(assign_correspondent) = &self.assign_correspondent {
3533 format!("{assign_correspondent:?}").into()
3534 } else {
3535 String::new().into()
3536 },
3537 if let Some(assign_document_type) = &self.assign_document_type {
3538 format!("{assign_document_type:?}").into()
3539 } else {
3540 String::new().into()
3541 },
3542 if let Some(assign_owner_from_rule) = &self.assign_owner_from_rule {
3543 format!("{assign_owner_from_rule:?}").into()
3544 } else {
3545 String::new().into()
3546 },
3547 if let Some(order) = &self.order {
3548 format!("{order:?}").into()
3549 } else {
3550 String::new().into()
3551 },
3552 if let Some(attachment_type) = &self.attachment_type {
3553 format!("{attachment_type:?}").into()
3554 } else {
3555 String::new().into()
3556 },
3557 if let Some(consumption_scope) = &self.consumption_scope {
3558 format!("{consumption_scope:?}").into()
3559 } else {
3560 String::new().into()
3561 },
3562 if let Some(pdf_layout) = &self.pdf_layout {
3563 format!("{pdf_layout:?}").into()
3564 } else {
3565 String::new().into()
3566 },
3567 if let Some(owner) = &self.owner {
3568 format!("{owner:?}").into()
3569 } else {
3570 String::new().into()
3571 },
3572 format!("{:?}", self.user_can_change).into(),
3573 ]
3574 }
3575
3576 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3577 vec![
3578 "id".into(),
3579 "name".into(),
3580 "account".into(),
3581 "enabled".into(),
3582 "folder".into(),
3583 "filter_from".into(),
3584 "filter_to".into(),
3585 "filter_subject".into(),
3586 "filter_body".into(),
3587 "filter_attachment_filename_include".into(),
3588 "filter_attachment_filename_exclude".into(),
3589 "maximum_age".into(),
3590 "action".into(),
3591 "action_parameter".into(),
3592 "assign_title_from".into(),
3593 "assign_tags".into(),
3594 "assign_correspondent_from".into(),
3595 "assign_correspondent".into(),
3596 "assign_document_type".into(),
3597 "assign_owner_from_rule".into(),
3598 "order".into(),
3599 "attachment_type".into(),
3600 "consumption_scope".into(),
3601 "pdf_layout".into(),
3602 "owner".into(),
3603 "user_can_change".into(),
3604 ]
3605 }
3606}
3607
3608#[derive(
3609 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3610)]
3611#[allow(non_snake_case)]
3612pub struct MailRuleRequest {
3613 pub name: String,
3614 pub account: i64,
3615 #[serde(default, skip_serializing_if = "Option::is_none")]
3616 pub enabled: Option<bool>,
3617 #[doc = "Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server."]
3618 #[serde(default, skip_serializing_if = "Option::is_none")]
3619 pub folder: Option<String>,
3620 #[serde(default, skip_serializing_if = "Option::is_none")]
3621 pub filter_from: Option<String>,
3622 #[serde(default, skip_serializing_if = "Option::is_none")]
3623 pub filter_to: Option<String>,
3624 #[serde(default, skip_serializing_if = "Option::is_none")]
3625 pub filter_subject: Option<String>,
3626 #[serde(default, skip_serializing_if = "Option::is_none")]
3627 pub filter_body: Option<String>,
3628 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3629 #[serde(default, skip_serializing_if = "Option::is_none")]
3630 pub filter_attachment_filename_include: Option<String>,
3631 #[doc = "Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
3632 #[serde(default, skip_serializing_if = "Option::is_none")]
3633 pub filter_attachment_filename_exclude: Option<String>,
3634 #[doc = "Specified in days."]
3635 #[serde(default, skip_serializing_if = "Option::is_none")]
3636 pub maximum_age: Option<i64>,
3637 #[serde(default, skip_serializing_if = "Option::is_none")]
3638 pub action: Option<i64>,
3639 #[serde(default, skip_serializing_if = "Option::is_none")]
3640 pub action_parameter: Option<String>,
3641 #[serde(default, skip_serializing_if = "Option::is_none")]
3642 pub assign_title_from: Option<i64>,
3643 #[serde(default, skip_serializing_if = "Option::is_none")]
3644 pub assign_tags: Option<Vec<Option<i64>>>,
3645 #[serde(default, skip_serializing_if = "Option::is_none")]
3646 pub assign_correspondent_from: Option<i64>,
3647 #[serde(default, skip_serializing_if = "Option::is_none")]
3648 pub assign_correspondent: Option<i64>,
3649 #[serde(default, skip_serializing_if = "Option::is_none")]
3650 pub assign_document_type: Option<i64>,
3651 #[serde(default, skip_serializing_if = "Option::is_none")]
3652 pub assign_owner_from_rule: Option<bool>,
3653 #[serde(default, skip_serializing_if = "Option::is_none")]
3654 pub order: Option<i64>,
3655 #[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."]
3656 #[serde(default, skip_serializing_if = "Option::is_none")]
3657 pub attachment_type: Option<i64>,
3658 #[serde(default, skip_serializing_if = "Option::is_none")]
3659 pub consumption_scope: Option<i64>,
3660 #[serde(default, skip_serializing_if = "Option::is_none")]
3661 pub pdf_layout: Option<i64>,
3662 #[serde(default, skip_serializing_if = "Option::is_none")]
3663 pub owner: Option<i64>,
3664 #[serde(default, skip_serializing_if = "Option::is_none")]
3665 pub set_permissions: Option<SetPermissions>,
3666}
3667
3668impl std::fmt::Display for MailRuleRequest {
3669 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3670 write!(
3671 f,
3672 "{}",
3673 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3674 )
3675 }
3676}
3677
3678#[cfg(feature = "tabled")]
3679impl tabled::Tabled for MailRuleRequest {
3680 const LENGTH: usize = 25;
3681 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3682 vec![
3683 self.name.clone().into(),
3684 format!("{:?}", self.account).into(),
3685 if let Some(enabled) = &self.enabled {
3686 format!("{enabled:?}").into()
3687 } else {
3688 String::new().into()
3689 },
3690 if let Some(folder) = &self.folder {
3691 format!("{folder:?}").into()
3692 } else {
3693 String::new().into()
3694 },
3695 if let Some(filter_from) = &self.filter_from {
3696 format!("{filter_from:?}").into()
3697 } else {
3698 String::new().into()
3699 },
3700 if let Some(filter_to) = &self.filter_to {
3701 format!("{filter_to:?}").into()
3702 } else {
3703 String::new().into()
3704 },
3705 if let Some(filter_subject) = &self.filter_subject {
3706 format!("{filter_subject:?}").into()
3707 } else {
3708 String::new().into()
3709 },
3710 if let Some(filter_body) = &self.filter_body {
3711 format!("{filter_body:?}").into()
3712 } else {
3713 String::new().into()
3714 },
3715 if let Some(filter_attachment_filename_include) =
3716 &self.filter_attachment_filename_include
3717 {
3718 format!("{filter_attachment_filename_include:?}").into()
3719 } else {
3720 String::new().into()
3721 },
3722 if let Some(filter_attachment_filename_exclude) =
3723 &self.filter_attachment_filename_exclude
3724 {
3725 format!("{filter_attachment_filename_exclude:?}").into()
3726 } else {
3727 String::new().into()
3728 },
3729 if let Some(maximum_age) = &self.maximum_age {
3730 format!("{maximum_age:?}").into()
3731 } else {
3732 String::new().into()
3733 },
3734 if let Some(action) = &self.action {
3735 format!("{action:?}").into()
3736 } else {
3737 String::new().into()
3738 },
3739 if let Some(action_parameter) = &self.action_parameter {
3740 format!("{action_parameter:?}").into()
3741 } else {
3742 String::new().into()
3743 },
3744 if let Some(assign_title_from) = &self.assign_title_from {
3745 format!("{assign_title_from:?}").into()
3746 } else {
3747 String::new().into()
3748 },
3749 if let Some(assign_tags) = &self.assign_tags {
3750 format!("{assign_tags:?}").into()
3751 } else {
3752 String::new().into()
3753 },
3754 if let Some(assign_correspondent_from) = &self.assign_correspondent_from {
3755 format!("{assign_correspondent_from:?}").into()
3756 } else {
3757 String::new().into()
3758 },
3759 if let Some(assign_correspondent) = &self.assign_correspondent {
3760 format!("{assign_correspondent:?}").into()
3761 } else {
3762 String::new().into()
3763 },
3764 if let Some(assign_document_type) = &self.assign_document_type {
3765 format!("{assign_document_type:?}").into()
3766 } else {
3767 String::new().into()
3768 },
3769 if let Some(assign_owner_from_rule) = &self.assign_owner_from_rule {
3770 format!("{assign_owner_from_rule:?}").into()
3771 } else {
3772 String::new().into()
3773 },
3774 if let Some(order) = &self.order {
3775 format!("{order:?}").into()
3776 } else {
3777 String::new().into()
3778 },
3779 if let Some(attachment_type) = &self.attachment_type {
3780 format!("{attachment_type:?}").into()
3781 } else {
3782 String::new().into()
3783 },
3784 if let Some(consumption_scope) = &self.consumption_scope {
3785 format!("{consumption_scope:?}").into()
3786 } else {
3787 String::new().into()
3788 },
3789 if let Some(pdf_layout) = &self.pdf_layout {
3790 format!("{pdf_layout:?}").into()
3791 } else {
3792 String::new().into()
3793 },
3794 if let Some(owner) = &self.owner {
3795 format!("{owner:?}").into()
3796 } else {
3797 String::new().into()
3798 },
3799 if let Some(set_permissions) = &self.set_permissions {
3800 format!("{set_permissions:?}").into()
3801 } else {
3802 String::new().into()
3803 },
3804 ]
3805 }
3806
3807 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3808 vec![
3809 "name".into(),
3810 "account".into(),
3811 "enabled".into(),
3812 "folder".into(),
3813 "filter_from".into(),
3814 "filter_to".into(),
3815 "filter_subject".into(),
3816 "filter_body".into(),
3817 "filter_attachment_filename_include".into(),
3818 "filter_attachment_filename_exclude".into(),
3819 "maximum_age".into(),
3820 "action".into(),
3821 "action_parameter".into(),
3822 "assign_title_from".into(),
3823 "assign_tags".into(),
3824 "assign_correspondent_from".into(),
3825 "assign_correspondent".into(),
3826 "assign_document_type".into(),
3827 "assign_owner_from_rule".into(),
3828 "order".into(),
3829 "attachment_type".into(),
3830 "consumption_scope".into(),
3831 "pdf_layout".into(),
3832 "owner".into(),
3833 "set_permissions".into(),
3834 ]
3835 }
3836}
3837
3838#[derive(
3839 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3840)]
3841#[allow(non_snake_case)]
3842pub struct Metadata {
3843 pub original_checksum: String,
3844 pub original_size: i64,
3845 pub original_mime_type: String,
3846 pub media_filename: String,
3847 pub has_archive_version: bool,
3848 pub original_metadata: std::collections::HashMap<String, serde_json::Value>,
3849 pub archive_checksum: String,
3850 pub archive_media_filename: String,
3851 pub original_filename: String,
3852 pub archive_size: i64,
3853 pub archive_metadata: std::collections::HashMap<String, serde_json::Value>,
3854 pub lang: String,
3855}
3856
3857impl std::fmt::Display for Metadata {
3858 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3859 write!(
3860 f,
3861 "{}",
3862 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3863 )
3864 }
3865}
3866
3867#[cfg(feature = "tabled")]
3868impl tabled::Tabled for Metadata {
3869 const LENGTH: usize = 12;
3870 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3871 vec![
3872 self.original_checksum.clone().into(),
3873 format!("{:?}", self.original_size).into(),
3874 self.original_mime_type.clone().into(),
3875 self.media_filename.clone().into(),
3876 format!("{:?}", self.has_archive_version).into(),
3877 format!("{:?}", self.original_metadata).into(),
3878 self.archive_checksum.clone().into(),
3879 self.archive_media_filename.clone().into(),
3880 self.original_filename.clone().into(),
3881 format!("{:?}", self.archive_size).into(),
3882 format!("{:?}", self.archive_metadata).into(),
3883 self.lang.clone().into(),
3884 ]
3885 }
3886
3887 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3888 vec![
3889 "original_checksum".into(),
3890 "original_size".into(),
3891 "original_mime_type".into(),
3892 "media_filename".into(),
3893 "has_archive_version".into(),
3894 "original_metadata".into(),
3895 "archive_checksum".into(),
3896 "archive_media_filename".into(),
3897 "original_filename".into(),
3898 "archive_size".into(),
3899 "archive_metadata".into(),
3900 "lang".into(),
3901 ]
3902 }
3903}
3904
3905#[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"]
3906#[derive(
3907 serde :: Serialize,
3908 serde :: Deserialize,
3909 PartialEq,
3910 Hash,
3911 Debug,
3912 Clone,
3913 schemars :: JsonSchema,
3914 parse_display :: FromStr,
3915 parse_display :: Display,
3916)]
3917#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
3918#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
3919pub enum MethodEnum {
3920 #[serde(rename = "set_correspondent")]
3921 #[display("set_correspondent")]
3922 SetCorrespondent,
3923 #[serde(rename = "set_document_type")]
3924 #[display("set_document_type")]
3925 SetDocumentType,
3926 #[serde(rename = "set_storage_path")]
3927 #[display("set_storage_path")]
3928 SetStoragePath,
3929 #[serde(rename = "add_tag")]
3930 #[display("add_tag")]
3931 AddTag,
3932 #[serde(rename = "remove_tag")]
3933 #[display("remove_tag")]
3934 RemoveTag,
3935 #[serde(rename = "modify_tags")]
3936 #[display("modify_tags")]
3937 ModifyTags,
3938 #[serde(rename = "modify_custom_fields")]
3939 #[display("modify_custom_fields")]
3940 ModifyCustomFields,
3941 #[serde(rename = "delete")]
3942 #[display("delete")]
3943 Delete,
3944 #[serde(rename = "reprocess")]
3945 #[display("reprocess")]
3946 Reprocess,
3947 #[serde(rename = "set_permissions")]
3948 #[display("set_permissions")]
3949 SetPermissions,
3950 #[serde(rename = "rotate")]
3951 #[display("rotate")]
3952 Rotate,
3953 #[serde(rename = "merge")]
3954 #[display("merge")]
3955 Merge,
3956 #[serde(rename = "split")]
3957 #[display("split")]
3958 Split,
3959 #[serde(rename = "delete_pages")]
3960 #[display("delete_pages")]
3961 DeletePages,
3962 #[serde(rename = "edit_pdf")]
3963 #[display("edit_pdf")]
3964 EditPdf,
3965}
3966
3967#[derive(
3968 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3969)]
3970#[allow(non_snake_case)]
3971pub struct MigrationStatus {
3972 pub latest_migration: String,
3973 pub unapplied_migrations: Vec<String>,
3974}
3975
3976impl std::fmt::Display for MigrationStatus {
3977 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3978 write!(
3979 f,
3980 "{}",
3981 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3982 )
3983 }
3984}
3985
3986#[cfg(feature = "tabled")]
3987impl tabled::Tabled for MigrationStatus {
3988 const LENGTH: usize = 2;
3989 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3990 vec![
3991 self.latest_migration.clone().into(),
3992 format!("{:?}", self.unapplied_migrations).into(),
3993 ]
3994 }
3995
3996 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3997 vec!["latest_migration".into(), "unapplied_migrations".into()]
3998 }
3999}
4000
4001#[doc = "* `skip` - skip\n* `redo` - redo\n* `force` - force\n* `skip_noarchive` - skip_noarchive"]
4002#[derive(
4003 serde :: Serialize,
4004 serde :: Deserialize,
4005 PartialEq,
4006 Hash,
4007 Debug,
4008 Clone,
4009 schemars :: JsonSchema,
4010 parse_display :: FromStr,
4011 parse_display :: Display,
4012)]
4013#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4014#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4015pub enum ModeEnum {
4016 #[serde(rename = "skip")]
4017 #[display("skip")]
4018 Skip,
4019 #[serde(rename = "redo")]
4020 #[display("redo")]
4021 Redo,
4022 #[serde(rename = "force")]
4023 #[display("force")]
4024 Force,
4025 #[serde(rename = "skip_noarchive")]
4026 #[display("skip_noarchive")]
4027 SkipNoarchive,
4028 #[serde(rename = "")]
4029 #[display("")]
4030 Empty,
4031}
4032
4033#[derive(
4034 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4035)]
4036#[allow(non_snake_case)]
4037pub struct NoteCreateRequestRequest {
4038 pub note: String,
4039}
4040
4041impl std::fmt::Display for NoteCreateRequestRequest {
4042 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4043 write!(
4044 f,
4045 "{}",
4046 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4047 )
4048 }
4049}
4050
4051#[cfg(feature = "tabled")]
4052impl tabled::Tabled for NoteCreateRequestRequest {
4053 const LENGTH: usize = 1;
4054 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4055 vec![self.note.clone().into()]
4056 }
4057
4058 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4059 vec!["note".into()]
4060 }
4061}
4062
4063#[derive(
4064 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4065)]
4066#[allow(non_snake_case)]
4067pub struct Notes {
4068 pub id: i64,
4069 #[doc = "Note for the document"]
4070 #[serde(default, skip_serializing_if = "Option::is_none")]
4071 pub note: Option<String>,
4072 #[serde(default, skip_serializing_if = "Option::is_none")]
4073 pub created: Option<chrono::DateTime<chrono::Utc>>,
4074 pub user: BasicUser,
4075}
4076
4077impl std::fmt::Display for Notes {
4078 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4079 write!(
4080 f,
4081 "{}",
4082 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4083 )
4084 }
4085}
4086
4087#[cfg(feature = "tabled")]
4088impl tabled::Tabled for Notes {
4089 const LENGTH: usize = 4;
4090 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4091 vec![
4092 format!("{:?}", self.id).into(),
4093 if let Some(note) = &self.note {
4094 format!("{note:?}").into()
4095 } else {
4096 String::new().into()
4097 },
4098 if let Some(created) = &self.created {
4099 format!("{created:?}").into()
4100 } else {
4101 String::new().into()
4102 },
4103 format!("{:?}", self.user).into(),
4104 ]
4105 }
4106
4107 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4108 vec!["id".into(), "note".into(), "created".into(), "user".into()]
4109 }
4110}
4111
4112#[derive(
4113 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4114)]
4115#[allow(non_snake_case)]
4116pub struct NotesRequest {
4117 #[doc = "Note for the document"]
4118 #[serde(default, skip_serializing_if = "Option::is_none")]
4119 pub note: Option<String>,
4120 #[serde(default, skip_serializing_if = "Option::is_none")]
4121 pub created: Option<chrono::DateTime<chrono::Utc>>,
4122}
4123
4124impl std::fmt::Display for NotesRequest {
4125 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4126 write!(
4127 f,
4128 "{}",
4129 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4130 )
4131 }
4132}
4133
4134#[cfg(feature = "tabled")]
4135impl tabled::Tabled for NotesRequest {
4136 const LENGTH: usize = 2;
4137 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4138 vec![
4139 if let Some(note) = &self.note {
4140 format!("{note:?}").into()
4141 } else {
4142 String::new().into()
4143 },
4144 if let Some(created) = &self.created {
4145 format!("{created:?}").into()
4146 } else {
4147 String::new().into()
4148 },
4149 ]
4150 }
4151
4152 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4153 vec!["note".into(), "created".into()]
4154 }
4155}
4156
4157#[doc = "* `tags` - tags\n* `correspondents` - correspondents\n* `document_types` - document_types\n* `storage_paths` - storage_paths"]
4158#[derive(
4159 serde :: Serialize,
4160 serde :: Deserialize,
4161 PartialEq,
4162 Hash,
4163 Debug,
4164 Clone,
4165 schemars :: JsonSchema,
4166 parse_display :: FromStr,
4167 parse_display :: Display,
4168)]
4169#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4170#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4171pub enum ObjectTypeEnum {
4172 #[serde(rename = "tags")]
4173 #[display("tags")]
4174 Tags,
4175 #[serde(rename = "correspondents")]
4176 #[display("correspondents")]
4177 Correspondents,
4178 #[serde(rename = "document_types")]
4179 #[display("document_types")]
4180 DocumentTypes,
4181 #[serde(rename = "storage_paths")]
4182 #[display("storage_paths")]
4183 StoragePaths,
4184}
4185
4186#[doc = "* `set_permissions` - set_permissions\n* `delete` - delete"]
4187#[derive(
4188 serde :: Serialize,
4189 serde :: Deserialize,
4190 PartialEq,
4191 Hash,
4192 Debug,
4193 Clone,
4194 schemars :: JsonSchema,
4195 parse_display :: FromStr,
4196 parse_display :: Display,
4197)]
4198#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4199#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4200pub enum OperationEnum {
4201 #[serde(rename = "set_permissions")]
4202 #[display("set_permissions")]
4203 SetPermissions,
4204 #[serde(rename = "delete")]
4205 #[display("delete")]
4206 Delete,
4207}
4208
4209#[doc = "* `pdf` - pdf\n* `pdfa` - pdfa\n* `pdfa-1` - pdfa-1\n* `pdfa-2` - pdfa-2\n* `pdfa-3` - pdfa-3"]
4210#[derive(
4211 serde :: Serialize,
4212 serde :: Deserialize,
4213 PartialEq,
4214 Hash,
4215 Debug,
4216 Clone,
4217 schemars :: JsonSchema,
4218 parse_display :: FromStr,
4219 parse_display :: Display,
4220)]
4221#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4222#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4223pub enum OutputTypeEnum {
4224 #[serde(rename = "pdf")]
4225 #[display("pdf")]
4226 Pdf,
4227 #[serde(rename = "pdfa")]
4228 #[display("pdfa")]
4229 Pdfa,
4230 #[serde(rename = "pdfa-1")]
4231 #[display("pdfa-1")]
4232 Pdfa1,
4233 #[serde(rename = "pdfa-2")]
4234 #[display("pdfa-2")]
4235 Pdfa2,
4236 #[serde(rename = "pdfa-3")]
4237 #[display("pdfa-3")]
4238 Pdfa3,
4239 #[serde(rename = "")]
4240 #[display("")]
4241 Empty,
4242}
4243
4244#[derive(
4245 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4246)]
4247#[allow(non_snake_case)]
4248pub struct PaginatedCorrespondentList {
4249 pub count: i64,
4250 #[serde(default, skip_serializing_if = "Option::is_none")]
4251 pub next: Option<String>,
4252 #[serde(default, skip_serializing_if = "Option::is_none")]
4253 pub previous: Option<String>,
4254 pub results: Vec<Correspondent>,
4255 #[serde(default, skip_serializing_if = "Option::is_none")]
4256 pub all: Option<Vec<i64>>,
4257}
4258
4259impl std::fmt::Display for PaginatedCorrespondentList {
4260 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4261 write!(
4262 f,
4263 "{}",
4264 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4265 )
4266 }
4267}
4268
4269#[cfg(feature = "requests")]
4270impl crate::types::paginate::Pagination for PaginatedCorrespondentList {
4271 type Item = Correspondent;
4272 fn has_more_pages(&self) -> bool {
4273 self.next.is_some()
4274 }
4275
4276 fn next_page_token(&self) -> Option<String> {
4277 self.next.clone()
4278 }
4279
4280 fn next_page(
4281 &self,
4282 req: reqwest::Request,
4283 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4284 let mut req = req.try_clone().ok_or_else(|| {
4285 crate::types::error::Error::InvalidRequest(format!(
4286 "failed to clone request: {req:?}"
4287 ))
4288 })?;
4289 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4290 crate::types::error::Error::InvalidRequest(format!(
4291 "failed to parse url: {:?}",
4292 self.next
4293 ))
4294 })?;
4295 Ok(req)
4296 }
4297
4298 fn items(&self) -> Vec<Self::Item> {
4299 self.results.clone()
4300 }
4301}
4302
4303#[cfg(feature = "tabled")]
4304impl tabled::Tabled for PaginatedCorrespondentList {
4305 const LENGTH: usize = 5;
4306 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4307 vec![
4308 format!("{:?}", self.count).into(),
4309 if let Some(next) = &self.next {
4310 format!("{next:?}").into()
4311 } else {
4312 String::new().into()
4313 },
4314 if let Some(previous) = &self.previous {
4315 format!("{previous:?}").into()
4316 } else {
4317 String::new().into()
4318 },
4319 format!("{:?}", self.results).into(),
4320 if let Some(all) = &self.all {
4321 format!("{all:?}").into()
4322 } else {
4323 String::new().into()
4324 },
4325 ]
4326 }
4327
4328 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4329 vec![
4330 "count".into(),
4331 "next".into(),
4332 "previous".into(),
4333 "results".into(),
4334 "all".into(),
4335 ]
4336 }
4337}
4338
4339#[derive(
4340 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4341)]
4342#[allow(non_snake_case)]
4343pub struct PaginatedCustomFieldList {
4344 pub count: i64,
4345 #[serde(default, skip_serializing_if = "Option::is_none")]
4346 pub next: Option<String>,
4347 #[serde(default, skip_serializing_if = "Option::is_none")]
4348 pub previous: Option<String>,
4349 pub results: Vec<CustomField>,
4350 #[serde(default, skip_serializing_if = "Option::is_none")]
4351 pub all: Option<Vec<i64>>,
4352}
4353
4354impl std::fmt::Display for PaginatedCustomFieldList {
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 = "requests")]
4365impl crate::types::paginate::Pagination for PaginatedCustomFieldList {
4366 type Item = CustomField;
4367 fn has_more_pages(&self) -> bool {
4368 self.next.is_some()
4369 }
4370
4371 fn next_page_token(&self) -> Option<String> {
4372 self.next.clone()
4373 }
4374
4375 fn next_page(
4376 &self,
4377 req: reqwest::Request,
4378 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4379 let mut req = req.try_clone().ok_or_else(|| {
4380 crate::types::error::Error::InvalidRequest(format!(
4381 "failed to clone request: {req:?}"
4382 ))
4383 })?;
4384 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4385 crate::types::error::Error::InvalidRequest(format!(
4386 "failed to parse url: {:?}",
4387 self.next
4388 ))
4389 })?;
4390 Ok(req)
4391 }
4392
4393 fn items(&self) -> Vec<Self::Item> {
4394 self.results.clone()
4395 }
4396}
4397
4398#[cfg(feature = "tabled")]
4399impl tabled::Tabled for PaginatedCustomFieldList {
4400 const LENGTH: usize = 5;
4401 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4402 vec![
4403 format!("{:?}", self.count).into(),
4404 if let Some(next) = &self.next {
4405 format!("{next:?}").into()
4406 } else {
4407 String::new().into()
4408 },
4409 if let Some(previous) = &self.previous {
4410 format!("{previous:?}").into()
4411 } else {
4412 String::new().into()
4413 },
4414 format!("{:?}", self.results).into(),
4415 if let Some(all) = &self.all {
4416 format!("{all:?}").into()
4417 } else {
4418 String::new().into()
4419 },
4420 ]
4421 }
4422
4423 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4424 vec![
4425 "count".into(),
4426 "next".into(),
4427 "previous".into(),
4428 "results".into(),
4429 "all".into(),
4430 ]
4431 }
4432}
4433
4434#[derive(
4435 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4436)]
4437#[allow(non_snake_case)]
4438pub struct PaginatedDocumentList {
4439 pub count: i64,
4440 #[serde(default, skip_serializing_if = "Option::is_none")]
4441 pub next: Option<String>,
4442 #[serde(default, skip_serializing_if = "Option::is_none")]
4443 pub previous: Option<String>,
4444 pub results: Vec<Document>,
4445 #[serde(default, skip_serializing_if = "Option::is_none")]
4446 pub all: Option<Vec<i64>>,
4447}
4448
4449impl std::fmt::Display for PaginatedDocumentList {
4450 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4451 write!(
4452 f,
4453 "{}",
4454 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4455 )
4456 }
4457}
4458
4459#[cfg(feature = "requests")]
4460impl crate::types::paginate::Pagination for PaginatedDocumentList {
4461 type Item = Document;
4462 fn has_more_pages(&self) -> bool {
4463 self.next.is_some()
4464 }
4465
4466 fn next_page_token(&self) -> Option<String> {
4467 self.next.clone()
4468 }
4469
4470 fn next_page(
4471 &self,
4472 req: reqwest::Request,
4473 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4474 let mut req = req.try_clone().ok_or_else(|| {
4475 crate::types::error::Error::InvalidRequest(format!(
4476 "failed to clone request: {req:?}"
4477 ))
4478 })?;
4479 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4480 crate::types::error::Error::InvalidRequest(format!(
4481 "failed to parse url: {:?}",
4482 self.next
4483 ))
4484 })?;
4485 Ok(req)
4486 }
4487
4488 fn items(&self) -> Vec<Self::Item> {
4489 self.results.clone()
4490 }
4491}
4492
4493#[cfg(feature = "tabled")]
4494impl tabled::Tabled for PaginatedDocumentList {
4495 const LENGTH: usize = 5;
4496 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4497 vec![
4498 format!("{:?}", self.count).into(),
4499 if let Some(next) = &self.next {
4500 format!("{next:?}").into()
4501 } else {
4502 String::new().into()
4503 },
4504 if let Some(previous) = &self.previous {
4505 format!("{previous:?}").into()
4506 } else {
4507 String::new().into()
4508 },
4509 format!("{:?}", self.results).into(),
4510 if let Some(all) = &self.all {
4511 format!("{all:?}").into()
4512 } else {
4513 String::new().into()
4514 },
4515 ]
4516 }
4517
4518 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4519 vec![
4520 "count".into(),
4521 "next".into(),
4522 "previous".into(),
4523 "results".into(),
4524 "all".into(),
4525 ]
4526 }
4527}
4528
4529#[derive(
4530 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4531)]
4532#[allow(non_snake_case)]
4533pub struct PaginatedDocumentTypeList {
4534 pub count: i64,
4535 #[serde(default, skip_serializing_if = "Option::is_none")]
4536 pub next: Option<String>,
4537 #[serde(default, skip_serializing_if = "Option::is_none")]
4538 pub previous: Option<String>,
4539 pub results: Vec<DocumentType>,
4540 #[serde(default, skip_serializing_if = "Option::is_none")]
4541 pub all: Option<Vec<i64>>,
4542}
4543
4544impl std::fmt::Display for PaginatedDocumentTypeList {
4545 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4546 write!(
4547 f,
4548 "{}",
4549 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4550 )
4551 }
4552}
4553
4554#[cfg(feature = "requests")]
4555impl crate::types::paginate::Pagination for PaginatedDocumentTypeList {
4556 type Item = DocumentType;
4557 fn has_more_pages(&self) -> bool {
4558 self.next.is_some()
4559 }
4560
4561 fn next_page_token(&self) -> Option<String> {
4562 self.next.clone()
4563 }
4564
4565 fn next_page(
4566 &self,
4567 req: reqwest::Request,
4568 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4569 let mut req = req.try_clone().ok_or_else(|| {
4570 crate::types::error::Error::InvalidRequest(format!(
4571 "failed to clone request: {req:?}"
4572 ))
4573 })?;
4574 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4575 crate::types::error::Error::InvalidRequest(format!(
4576 "failed to parse url: {:?}",
4577 self.next
4578 ))
4579 })?;
4580 Ok(req)
4581 }
4582
4583 fn items(&self) -> Vec<Self::Item> {
4584 self.results.clone()
4585 }
4586}
4587
4588#[cfg(feature = "tabled")]
4589impl tabled::Tabled for PaginatedDocumentTypeList {
4590 const LENGTH: usize = 5;
4591 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4592 vec![
4593 format!("{:?}", self.count).into(),
4594 if let Some(next) = &self.next {
4595 format!("{next:?}").into()
4596 } else {
4597 String::new().into()
4598 },
4599 if let Some(previous) = &self.previous {
4600 format!("{previous:?}").into()
4601 } else {
4602 String::new().into()
4603 },
4604 format!("{:?}", self.results).into(),
4605 if let Some(all) = &self.all {
4606 format!("{all:?}").into()
4607 } else {
4608 String::new().into()
4609 },
4610 ]
4611 }
4612
4613 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4614 vec![
4615 "count".into(),
4616 "next".into(),
4617 "previous".into(),
4618 "results".into(),
4619 "all".into(),
4620 ]
4621 }
4622}
4623
4624#[derive(
4625 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4626)]
4627#[allow(non_snake_case)]
4628pub struct PaginatedGroupList {
4629 pub count: i64,
4630 #[serde(default, skip_serializing_if = "Option::is_none")]
4631 pub next: Option<String>,
4632 #[serde(default, skip_serializing_if = "Option::is_none")]
4633 pub previous: Option<String>,
4634 pub results: Vec<Group>,
4635 #[serde(default, skip_serializing_if = "Option::is_none")]
4636 pub all: Option<Vec<i64>>,
4637}
4638
4639impl std::fmt::Display for PaginatedGroupList {
4640 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4641 write!(
4642 f,
4643 "{}",
4644 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4645 )
4646 }
4647}
4648
4649#[cfg(feature = "requests")]
4650impl crate::types::paginate::Pagination for PaginatedGroupList {
4651 type Item = Group;
4652 fn has_more_pages(&self) -> bool {
4653 self.next.is_some()
4654 }
4655
4656 fn next_page_token(&self) -> Option<String> {
4657 self.next.clone()
4658 }
4659
4660 fn next_page(
4661 &self,
4662 req: reqwest::Request,
4663 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4664 let mut req = req.try_clone().ok_or_else(|| {
4665 crate::types::error::Error::InvalidRequest(format!(
4666 "failed to clone request: {req:?}"
4667 ))
4668 })?;
4669 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4670 crate::types::error::Error::InvalidRequest(format!(
4671 "failed to parse url: {:?}",
4672 self.next
4673 ))
4674 })?;
4675 Ok(req)
4676 }
4677
4678 fn items(&self) -> Vec<Self::Item> {
4679 self.results.clone()
4680 }
4681}
4682
4683#[cfg(feature = "tabled")]
4684impl tabled::Tabled for PaginatedGroupList {
4685 const LENGTH: usize = 5;
4686 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4687 vec![
4688 format!("{:?}", self.count).into(),
4689 if let Some(next) = &self.next {
4690 format!("{next:?}").into()
4691 } else {
4692 String::new().into()
4693 },
4694 if let Some(previous) = &self.previous {
4695 format!("{previous:?}").into()
4696 } else {
4697 String::new().into()
4698 },
4699 format!("{:?}", self.results).into(),
4700 if let Some(all) = &self.all {
4701 format!("{all:?}").into()
4702 } else {
4703 String::new().into()
4704 },
4705 ]
4706 }
4707
4708 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4709 vec![
4710 "count".into(),
4711 "next".into(),
4712 "previous".into(),
4713 "results".into(),
4714 "all".into(),
4715 ]
4716 }
4717}
4718
4719#[derive(
4720 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4721)]
4722#[allow(non_snake_case)]
4723pub struct PaginatedLogEntryList {
4724 pub count: i64,
4725 #[serde(default, skip_serializing_if = "Option::is_none")]
4726 pub next: Option<String>,
4727 #[serde(default, skip_serializing_if = "Option::is_none")]
4728 pub previous: Option<String>,
4729 pub results: Vec<LogEntry>,
4730 #[serde(default, skip_serializing_if = "Option::is_none")]
4731 pub all: Option<Vec<i64>>,
4732}
4733
4734impl std::fmt::Display for PaginatedLogEntryList {
4735 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4736 write!(
4737 f,
4738 "{}",
4739 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4740 )
4741 }
4742}
4743
4744#[cfg(feature = "requests")]
4745impl crate::types::paginate::Pagination for PaginatedLogEntryList {
4746 type Item = LogEntry;
4747 fn has_more_pages(&self) -> bool {
4748 self.next.is_some()
4749 }
4750
4751 fn next_page_token(&self) -> Option<String> {
4752 self.next.clone()
4753 }
4754
4755 fn next_page(
4756 &self,
4757 req: reqwest::Request,
4758 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4759 let mut req = req.try_clone().ok_or_else(|| {
4760 crate::types::error::Error::InvalidRequest(format!(
4761 "failed to clone request: {req:?}"
4762 ))
4763 })?;
4764 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4765 crate::types::error::Error::InvalidRequest(format!(
4766 "failed to parse url: {:?}",
4767 self.next
4768 ))
4769 })?;
4770 Ok(req)
4771 }
4772
4773 fn items(&self) -> Vec<Self::Item> {
4774 self.results.clone()
4775 }
4776}
4777
4778#[cfg(feature = "tabled")]
4779impl tabled::Tabled for PaginatedLogEntryList {
4780 const LENGTH: usize = 5;
4781 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4782 vec![
4783 format!("{:?}", self.count).into(),
4784 if let Some(next) = &self.next {
4785 format!("{next:?}").into()
4786 } else {
4787 String::new().into()
4788 },
4789 if let Some(previous) = &self.previous {
4790 format!("{previous:?}").into()
4791 } else {
4792 String::new().into()
4793 },
4794 format!("{:?}", self.results).into(),
4795 if let Some(all) = &self.all {
4796 format!("{all:?}").into()
4797 } else {
4798 String::new().into()
4799 },
4800 ]
4801 }
4802
4803 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4804 vec![
4805 "count".into(),
4806 "next".into(),
4807 "previous".into(),
4808 "results".into(),
4809 "all".into(),
4810 ]
4811 }
4812}
4813
4814#[derive(
4815 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4816)]
4817#[allow(non_snake_case)]
4818pub struct PaginatedMailAccountList {
4819 pub count: i64,
4820 #[serde(default, skip_serializing_if = "Option::is_none")]
4821 pub next: Option<String>,
4822 #[serde(default, skip_serializing_if = "Option::is_none")]
4823 pub previous: Option<String>,
4824 pub results: Vec<MailAccount>,
4825 #[serde(default, skip_serializing_if = "Option::is_none")]
4826 pub all: Option<Vec<i64>>,
4827}
4828
4829impl std::fmt::Display for PaginatedMailAccountList {
4830 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4831 write!(
4832 f,
4833 "{}",
4834 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4835 )
4836 }
4837}
4838
4839#[cfg(feature = "requests")]
4840impl crate::types::paginate::Pagination for PaginatedMailAccountList {
4841 type Item = MailAccount;
4842 fn has_more_pages(&self) -> bool {
4843 self.next.is_some()
4844 }
4845
4846 fn next_page_token(&self) -> Option<String> {
4847 self.next.clone()
4848 }
4849
4850 fn next_page(
4851 &self,
4852 req: reqwest::Request,
4853 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4854 let mut req = req.try_clone().ok_or_else(|| {
4855 crate::types::error::Error::InvalidRequest(format!(
4856 "failed to clone request: {req:?}"
4857 ))
4858 })?;
4859 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4860 crate::types::error::Error::InvalidRequest(format!(
4861 "failed to parse url: {:?}",
4862 self.next
4863 ))
4864 })?;
4865 Ok(req)
4866 }
4867
4868 fn items(&self) -> Vec<Self::Item> {
4869 self.results.clone()
4870 }
4871}
4872
4873#[cfg(feature = "tabled")]
4874impl tabled::Tabled for PaginatedMailAccountList {
4875 const LENGTH: usize = 5;
4876 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4877 vec![
4878 format!("{:?}", self.count).into(),
4879 if let Some(next) = &self.next {
4880 format!("{next:?}").into()
4881 } else {
4882 String::new().into()
4883 },
4884 if let Some(previous) = &self.previous {
4885 format!("{previous:?}").into()
4886 } else {
4887 String::new().into()
4888 },
4889 format!("{:?}", self.results).into(),
4890 if let Some(all) = &self.all {
4891 format!("{all:?}").into()
4892 } else {
4893 String::new().into()
4894 },
4895 ]
4896 }
4897
4898 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4899 vec![
4900 "count".into(),
4901 "next".into(),
4902 "previous".into(),
4903 "results".into(),
4904 "all".into(),
4905 ]
4906 }
4907}
4908
4909#[derive(
4910 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4911)]
4912#[allow(non_snake_case)]
4913pub struct PaginatedMailRuleList {
4914 pub count: i64,
4915 #[serde(default, skip_serializing_if = "Option::is_none")]
4916 pub next: Option<String>,
4917 #[serde(default, skip_serializing_if = "Option::is_none")]
4918 pub previous: Option<String>,
4919 pub results: Vec<MailRule>,
4920 #[serde(default, skip_serializing_if = "Option::is_none")]
4921 pub all: Option<Vec<i64>>,
4922}
4923
4924impl std::fmt::Display for PaginatedMailRuleList {
4925 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4926 write!(
4927 f,
4928 "{}",
4929 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4930 )
4931 }
4932}
4933
4934#[cfg(feature = "requests")]
4935impl crate::types::paginate::Pagination for PaginatedMailRuleList {
4936 type Item = MailRule;
4937 fn has_more_pages(&self) -> bool {
4938 self.next.is_some()
4939 }
4940
4941 fn next_page_token(&self) -> Option<String> {
4942 self.next.clone()
4943 }
4944
4945 fn next_page(
4946 &self,
4947 req: reqwest::Request,
4948 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
4949 let mut req = req.try_clone().ok_or_else(|| {
4950 crate::types::error::Error::InvalidRequest(format!(
4951 "failed to clone request: {req:?}"
4952 ))
4953 })?;
4954 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
4955 crate::types::error::Error::InvalidRequest(format!(
4956 "failed to parse url: {:?}",
4957 self.next
4958 ))
4959 })?;
4960 Ok(req)
4961 }
4962
4963 fn items(&self) -> Vec<Self::Item> {
4964 self.results.clone()
4965 }
4966}
4967
4968#[cfg(feature = "tabled")]
4969impl tabled::Tabled for PaginatedMailRuleList {
4970 const LENGTH: usize = 5;
4971 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4972 vec![
4973 format!("{:?}", self.count).into(),
4974 if let Some(next) = &self.next {
4975 format!("{next:?}").into()
4976 } else {
4977 String::new().into()
4978 },
4979 if let Some(previous) = &self.previous {
4980 format!("{previous:?}").into()
4981 } else {
4982 String::new().into()
4983 },
4984 format!("{:?}", self.results).into(),
4985 if let Some(all) = &self.all {
4986 format!("{all:?}").into()
4987 } else {
4988 String::new().into()
4989 },
4990 ]
4991 }
4992
4993 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4994 vec![
4995 "count".into(),
4996 "next".into(),
4997 "previous".into(),
4998 "results".into(),
4999 "all".into(),
5000 ]
5001 }
5002}
5003
5004#[derive(
5005 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5006)]
5007#[allow(non_snake_case)]
5008pub struct PaginatedNotesList {
5009 pub count: i64,
5010 #[serde(default, skip_serializing_if = "Option::is_none")]
5011 pub next: Option<String>,
5012 #[serde(default, skip_serializing_if = "Option::is_none")]
5013 pub previous: Option<String>,
5014 pub results: Vec<Notes>,
5015 #[serde(default, skip_serializing_if = "Option::is_none")]
5016 pub all: Option<Vec<i64>>,
5017}
5018
5019impl std::fmt::Display for PaginatedNotesList {
5020 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5021 write!(
5022 f,
5023 "{}",
5024 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5025 )
5026 }
5027}
5028
5029#[cfg(feature = "requests")]
5030impl crate::types::paginate::Pagination for PaginatedNotesList {
5031 type Item = Notes;
5032 fn has_more_pages(&self) -> bool {
5033 self.next.is_some()
5034 }
5035
5036 fn next_page_token(&self) -> Option<String> {
5037 self.next.clone()
5038 }
5039
5040 fn next_page(
5041 &self,
5042 req: reqwest::Request,
5043 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5044 let mut req = req.try_clone().ok_or_else(|| {
5045 crate::types::error::Error::InvalidRequest(format!(
5046 "failed to clone request: {req:?}"
5047 ))
5048 })?;
5049 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5050 crate::types::error::Error::InvalidRequest(format!(
5051 "failed to parse url: {:?}",
5052 self.next
5053 ))
5054 })?;
5055 Ok(req)
5056 }
5057
5058 fn items(&self) -> Vec<Self::Item> {
5059 self.results.clone()
5060 }
5061}
5062
5063#[cfg(feature = "tabled")]
5064impl tabled::Tabled for PaginatedNotesList {
5065 const LENGTH: usize = 5;
5066 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5067 vec![
5068 format!("{:?}", self.count).into(),
5069 if let Some(next) = &self.next {
5070 format!("{next:?}").into()
5071 } else {
5072 String::new().into()
5073 },
5074 if let Some(previous) = &self.previous {
5075 format!("{previous:?}").into()
5076 } else {
5077 String::new().into()
5078 },
5079 format!("{:?}", self.results).into(),
5080 if let Some(all) = &self.all {
5081 format!("{all:?}").into()
5082 } else {
5083 String::new().into()
5084 },
5085 ]
5086 }
5087
5088 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5089 vec![
5090 "count".into(),
5091 "next".into(),
5092 "previous".into(),
5093 "results".into(),
5094 "all".into(),
5095 ]
5096 }
5097}
5098
5099#[derive(
5100 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5101)]
5102#[allow(non_snake_case)]
5103pub struct PaginatedSavedViewList {
5104 pub count: i64,
5105 #[serde(default, skip_serializing_if = "Option::is_none")]
5106 pub next: Option<String>,
5107 #[serde(default, skip_serializing_if = "Option::is_none")]
5108 pub previous: Option<String>,
5109 pub results: Vec<SavedView>,
5110 #[serde(default, skip_serializing_if = "Option::is_none")]
5111 pub all: Option<Vec<i64>>,
5112}
5113
5114impl std::fmt::Display for PaginatedSavedViewList {
5115 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5116 write!(
5117 f,
5118 "{}",
5119 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5120 )
5121 }
5122}
5123
5124#[cfg(feature = "requests")]
5125impl crate::types::paginate::Pagination for PaginatedSavedViewList {
5126 type Item = SavedView;
5127 fn has_more_pages(&self) -> bool {
5128 self.next.is_some()
5129 }
5130
5131 fn next_page_token(&self) -> Option<String> {
5132 self.next.clone()
5133 }
5134
5135 fn next_page(
5136 &self,
5137 req: reqwest::Request,
5138 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5139 let mut req = req.try_clone().ok_or_else(|| {
5140 crate::types::error::Error::InvalidRequest(format!(
5141 "failed to clone request: {req:?}"
5142 ))
5143 })?;
5144 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5145 crate::types::error::Error::InvalidRequest(format!(
5146 "failed to parse url: {:?}",
5147 self.next
5148 ))
5149 })?;
5150 Ok(req)
5151 }
5152
5153 fn items(&self) -> Vec<Self::Item> {
5154 self.results.clone()
5155 }
5156}
5157
5158#[cfg(feature = "tabled")]
5159impl tabled::Tabled for PaginatedSavedViewList {
5160 const LENGTH: usize = 5;
5161 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5162 vec![
5163 format!("{:?}", self.count).into(),
5164 if let Some(next) = &self.next {
5165 format!("{next:?}").into()
5166 } else {
5167 String::new().into()
5168 },
5169 if let Some(previous) = &self.previous {
5170 format!("{previous:?}").into()
5171 } else {
5172 String::new().into()
5173 },
5174 format!("{:?}", self.results).into(),
5175 if let Some(all) = &self.all {
5176 format!("{all:?}").into()
5177 } else {
5178 String::new().into()
5179 },
5180 ]
5181 }
5182
5183 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5184 vec![
5185 "count".into(),
5186 "next".into(),
5187 "previous".into(),
5188 "results".into(),
5189 "all".into(),
5190 ]
5191 }
5192}
5193
5194#[derive(
5195 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5196)]
5197#[allow(non_snake_case)]
5198pub struct PaginatedShareLinkList {
5199 pub count: i64,
5200 #[serde(default, skip_serializing_if = "Option::is_none")]
5201 pub next: Option<String>,
5202 #[serde(default, skip_serializing_if = "Option::is_none")]
5203 pub previous: Option<String>,
5204 pub results: Vec<ShareLink>,
5205 #[serde(default, skip_serializing_if = "Option::is_none")]
5206 pub all: Option<Vec<i64>>,
5207}
5208
5209impl std::fmt::Display for PaginatedShareLinkList {
5210 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5211 write!(
5212 f,
5213 "{}",
5214 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5215 )
5216 }
5217}
5218
5219#[cfg(feature = "requests")]
5220impl crate::types::paginate::Pagination for PaginatedShareLinkList {
5221 type Item = ShareLink;
5222 fn has_more_pages(&self) -> bool {
5223 self.next.is_some()
5224 }
5225
5226 fn next_page_token(&self) -> Option<String> {
5227 self.next.clone()
5228 }
5229
5230 fn next_page(
5231 &self,
5232 req: reqwest::Request,
5233 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5234 let mut req = req.try_clone().ok_or_else(|| {
5235 crate::types::error::Error::InvalidRequest(format!(
5236 "failed to clone request: {req:?}"
5237 ))
5238 })?;
5239 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5240 crate::types::error::Error::InvalidRequest(format!(
5241 "failed to parse url: {:?}",
5242 self.next
5243 ))
5244 })?;
5245 Ok(req)
5246 }
5247
5248 fn items(&self) -> Vec<Self::Item> {
5249 self.results.clone()
5250 }
5251}
5252
5253#[cfg(feature = "tabled")]
5254impl tabled::Tabled for PaginatedShareLinkList {
5255 const LENGTH: usize = 5;
5256 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5257 vec![
5258 format!("{:?}", self.count).into(),
5259 if let Some(next) = &self.next {
5260 format!("{next:?}").into()
5261 } else {
5262 String::new().into()
5263 },
5264 if let Some(previous) = &self.previous {
5265 format!("{previous:?}").into()
5266 } else {
5267 String::new().into()
5268 },
5269 format!("{:?}", self.results).into(),
5270 if let Some(all) = &self.all {
5271 format!("{all:?}").into()
5272 } else {
5273 String::new().into()
5274 },
5275 ]
5276 }
5277
5278 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5279 vec![
5280 "count".into(),
5281 "next".into(),
5282 "previous".into(),
5283 "results".into(),
5284 "all".into(),
5285 ]
5286 }
5287}
5288
5289#[derive(
5290 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5291)]
5292#[allow(non_snake_case)]
5293pub struct PaginatedStoragePathList {
5294 pub count: i64,
5295 #[serde(default, skip_serializing_if = "Option::is_none")]
5296 pub next: Option<String>,
5297 #[serde(default, skip_serializing_if = "Option::is_none")]
5298 pub previous: Option<String>,
5299 pub results: Vec<StoragePath>,
5300 #[serde(default, skip_serializing_if = "Option::is_none")]
5301 pub all: Option<Vec<i64>>,
5302}
5303
5304impl std::fmt::Display for PaginatedStoragePathList {
5305 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5306 write!(
5307 f,
5308 "{}",
5309 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5310 )
5311 }
5312}
5313
5314#[cfg(feature = "requests")]
5315impl crate::types::paginate::Pagination for PaginatedStoragePathList {
5316 type Item = StoragePath;
5317 fn has_more_pages(&self) -> bool {
5318 self.next.is_some()
5319 }
5320
5321 fn next_page_token(&self) -> Option<String> {
5322 self.next.clone()
5323 }
5324
5325 fn next_page(
5326 &self,
5327 req: reqwest::Request,
5328 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5329 let mut req = req.try_clone().ok_or_else(|| {
5330 crate::types::error::Error::InvalidRequest(format!(
5331 "failed to clone request: {req:?}"
5332 ))
5333 })?;
5334 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5335 crate::types::error::Error::InvalidRequest(format!(
5336 "failed to parse url: {:?}",
5337 self.next
5338 ))
5339 })?;
5340 Ok(req)
5341 }
5342
5343 fn items(&self) -> Vec<Self::Item> {
5344 self.results.clone()
5345 }
5346}
5347
5348#[cfg(feature = "tabled")]
5349impl tabled::Tabled for PaginatedStoragePathList {
5350 const LENGTH: usize = 5;
5351 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5352 vec![
5353 format!("{:?}", self.count).into(),
5354 if let Some(next) = &self.next {
5355 format!("{next:?}").into()
5356 } else {
5357 String::new().into()
5358 },
5359 if let Some(previous) = &self.previous {
5360 format!("{previous:?}").into()
5361 } else {
5362 String::new().into()
5363 },
5364 format!("{:?}", self.results).into(),
5365 if let Some(all) = &self.all {
5366 format!("{all:?}").into()
5367 } else {
5368 String::new().into()
5369 },
5370 ]
5371 }
5372
5373 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5374 vec![
5375 "count".into(),
5376 "next".into(),
5377 "previous".into(),
5378 "results".into(),
5379 "all".into(),
5380 ]
5381 }
5382}
5383
5384#[derive(
5385 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5386)]
5387#[allow(non_snake_case)]
5388pub struct PaginatedTagList {
5389 pub count: i64,
5390 #[serde(default, skip_serializing_if = "Option::is_none")]
5391 pub next: Option<String>,
5392 #[serde(default, skip_serializing_if = "Option::is_none")]
5393 pub previous: Option<String>,
5394 pub results: Vec<Tag>,
5395 #[serde(default, skip_serializing_if = "Option::is_none")]
5396 pub all: Option<Vec<i64>>,
5397}
5398
5399impl std::fmt::Display for PaginatedTagList {
5400 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5401 write!(
5402 f,
5403 "{}",
5404 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5405 )
5406 }
5407}
5408
5409#[cfg(feature = "requests")]
5410impl crate::types::paginate::Pagination for PaginatedTagList {
5411 type Item = Tag;
5412 fn has_more_pages(&self) -> bool {
5413 self.next.is_some()
5414 }
5415
5416 fn next_page_token(&self) -> Option<String> {
5417 self.next.clone()
5418 }
5419
5420 fn next_page(
5421 &self,
5422 req: reqwest::Request,
5423 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5424 let mut req = req.try_clone().ok_or_else(|| {
5425 crate::types::error::Error::InvalidRequest(format!(
5426 "failed to clone request: {req:?}"
5427 ))
5428 })?;
5429 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5430 crate::types::error::Error::InvalidRequest(format!(
5431 "failed to parse url: {:?}",
5432 self.next
5433 ))
5434 })?;
5435 Ok(req)
5436 }
5437
5438 fn items(&self) -> Vec<Self::Item> {
5439 self.results.clone()
5440 }
5441}
5442
5443#[cfg(feature = "tabled")]
5444impl tabled::Tabled for PaginatedTagList {
5445 const LENGTH: usize = 5;
5446 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5447 vec![
5448 format!("{:?}", self.count).into(),
5449 if let Some(next) = &self.next {
5450 format!("{next:?}").into()
5451 } else {
5452 String::new().into()
5453 },
5454 if let Some(previous) = &self.previous {
5455 format!("{previous:?}").into()
5456 } else {
5457 String::new().into()
5458 },
5459 format!("{:?}", self.results).into(),
5460 if let Some(all) = &self.all {
5461 format!("{all:?}").into()
5462 } else {
5463 String::new().into()
5464 },
5465 ]
5466 }
5467
5468 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5469 vec![
5470 "count".into(),
5471 "next".into(),
5472 "previous".into(),
5473 "results".into(),
5474 "all".into(),
5475 ]
5476 }
5477}
5478
5479#[derive(
5480 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5481)]
5482#[allow(non_snake_case)]
5483pub struct PaginatedUserList {
5484 pub count: i64,
5485 #[serde(default, skip_serializing_if = "Option::is_none")]
5486 pub next: Option<String>,
5487 #[serde(default, skip_serializing_if = "Option::is_none")]
5488 pub previous: Option<String>,
5489 pub results: Vec<User>,
5490 #[serde(default, skip_serializing_if = "Option::is_none")]
5491 pub all: Option<Vec<i64>>,
5492}
5493
5494impl std::fmt::Display for PaginatedUserList {
5495 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5496 write!(
5497 f,
5498 "{}",
5499 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5500 )
5501 }
5502}
5503
5504#[cfg(feature = "requests")]
5505impl crate::types::paginate::Pagination for PaginatedUserList {
5506 type Item = User;
5507 fn has_more_pages(&self) -> bool {
5508 self.next.is_some()
5509 }
5510
5511 fn next_page_token(&self) -> Option<String> {
5512 self.next.clone()
5513 }
5514
5515 fn next_page(
5516 &self,
5517 req: reqwest::Request,
5518 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5519 let mut req = req.try_clone().ok_or_else(|| {
5520 crate::types::error::Error::InvalidRequest(format!(
5521 "failed to clone request: {req:?}"
5522 ))
5523 })?;
5524 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5525 crate::types::error::Error::InvalidRequest(format!(
5526 "failed to parse url: {:?}",
5527 self.next
5528 ))
5529 })?;
5530 Ok(req)
5531 }
5532
5533 fn items(&self) -> Vec<Self::Item> {
5534 self.results.clone()
5535 }
5536}
5537
5538#[cfg(feature = "tabled")]
5539impl tabled::Tabled for PaginatedUserList {
5540 const LENGTH: usize = 5;
5541 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5542 vec![
5543 format!("{:?}", self.count).into(),
5544 if let Some(next) = &self.next {
5545 format!("{next:?}").into()
5546 } else {
5547 String::new().into()
5548 },
5549 if let Some(previous) = &self.previous {
5550 format!("{previous:?}").into()
5551 } else {
5552 String::new().into()
5553 },
5554 format!("{:?}", self.results).into(),
5555 if let Some(all) = &self.all {
5556 format!("{all:?}").into()
5557 } else {
5558 String::new().into()
5559 },
5560 ]
5561 }
5562
5563 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5564 vec![
5565 "count".into(),
5566 "next".into(),
5567 "previous".into(),
5568 "results".into(),
5569 "all".into(),
5570 ]
5571 }
5572}
5573
5574#[derive(
5575 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5576)]
5577#[allow(non_snake_case)]
5578pub struct PaginatedWorkflowActionList {
5579 pub count: i64,
5580 #[serde(default, skip_serializing_if = "Option::is_none")]
5581 pub next: Option<String>,
5582 #[serde(default, skip_serializing_if = "Option::is_none")]
5583 pub previous: Option<String>,
5584 pub results: Vec<WorkflowAction>,
5585 #[serde(default, skip_serializing_if = "Option::is_none")]
5586 pub all: Option<Vec<i64>>,
5587}
5588
5589impl std::fmt::Display for PaginatedWorkflowActionList {
5590 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5591 write!(
5592 f,
5593 "{}",
5594 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5595 )
5596 }
5597}
5598
5599#[cfg(feature = "requests")]
5600impl crate::types::paginate::Pagination for PaginatedWorkflowActionList {
5601 type Item = WorkflowAction;
5602 fn has_more_pages(&self) -> bool {
5603 self.next.is_some()
5604 }
5605
5606 fn next_page_token(&self) -> Option<String> {
5607 self.next.clone()
5608 }
5609
5610 fn next_page(
5611 &self,
5612 req: reqwest::Request,
5613 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5614 let mut req = req.try_clone().ok_or_else(|| {
5615 crate::types::error::Error::InvalidRequest(format!(
5616 "failed to clone request: {req:?}"
5617 ))
5618 })?;
5619 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5620 crate::types::error::Error::InvalidRequest(format!(
5621 "failed to parse url: {:?}",
5622 self.next
5623 ))
5624 })?;
5625 Ok(req)
5626 }
5627
5628 fn items(&self) -> Vec<Self::Item> {
5629 self.results.clone()
5630 }
5631}
5632
5633#[cfg(feature = "tabled")]
5634impl tabled::Tabled for PaginatedWorkflowActionList {
5635 const LENGTH: usize = 5;
5636 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5637 vec![
5638 format!("{:?}", self.count).into(),
5639 if let Some(next) = &self.next {
5640 format!("{next:?}").into()
5641 } else {
5642 String::new().into()
5643 },
5644 if let Some(previous) = &self.previous {
5645 format!("{previous:?}").into()
5646 } else {
5647 String::new().into()
5648 },
5649 format!("{:?}", self.results).into(),
5650 if let Some(all) = &self.all {
5651 format!("{all:?}").into()
5652 } else {
5653 String::new().into()
5654 },
5655 ]
5656 }
5657
5658 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5659 vec![
5660 "count".into(),
5661 "next".into(),
5662 "previous".into(),
5663 "results".into(),
5664 "all".into(),
5665 ]
5666 }
5667}
5668
5669#[derive(
5670 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5671)]
5672#[allow(non_snake_case)]
5673pub struct PaginatedWorkflowList {
5674 pub count: i64,
5675 #[serde(default, skip_serializing_if = "Option::is_none")]
5676 pub next: Option<String>,
5677 #[serde(default, skip_serializing_if = "Option::is_none")]
5678 pub previous: Option<String>,
5679 pub results: Vec<Workflow>,
5680 #[serde(default, skip_serializing_if = "Option::is_none")]
5681 pub all: Option<Vec<i64>>,
5682}
5683
5684impl std::fmt::Display for PaginatedWorkflowList {
5685 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5686 write!(
5687 f,
5688 "{}",
5689 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5690 )
5691 }
5692}
5693
5694#[cfg(feature = "requests")]
5695impl crate::types::paginate::Pagination for PaginatedWorkflowList {
5696 type Item = Workflow;
5697 fn has_more_pages(&self) -> bool {
5698 self.next.is_some()
5699 }
5700
5701 fn next_page_token(&self) -> Option<String> {
5702 self.next.clone()
5703 }
5704
5705 fn next_page(
5706 &self,
5707 req: reqwest::Request,
5708 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5709 let mut req = req.try_clone().ok_or_else(|| {
5710 crate::types::error::Error::InvalidRequest(format!(
5711 "failed to clone request: {req:?}"
5712 ))
5713 })?;
5714 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5715 crate::types::error::Error::InvalidRequest(format!(
5716 "failed to parse url: {:?}",
5717 self.next
5718 ))
5719 })?;
5720 Ok(req)
5721 }
5722
5723 fn items(&self) -> Vec<Self::Item> {
5724 self.results.clone()
5725 }
5726}
5727
5728#[cfg(feature = "tabled")]
5729impl tabled::Tabled for PaginatedWorkflowList {
5730 const LENGTH: usize = 5;
5731 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5732 vec![
5733 format!("{:?}", self.count).into(),
5734 if let Some(next) = &self.next {
5735 format!("{next:?}").into()
5736 } else {
5737 String::new().into()
5738 },
5739 if let Some(previous) = &self.previous {
5740 format!("{previous:?}").into()
5741 } else {
5742 String::new().into()
5743 },
5744 format!("{:?}", self.results).into(),
5745 if let Some(all) = &self.all {
5746 format!("{all:?}").into()
5747 } else {
5748 String::new().into()
5749 },
5750 ]
5751 }
5752
5753 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5754 vec![
5755 "count".into(),
5756 "next".into(),
5757 "previous".into(),
5758 "results".into(),
5759 "all".into(),
5760 ]
5761 }
5762}
5763
5764#[derive(
5765 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5766)]
5767#[allow(non_snake_case)]
5768pub struct PaginatedWorkflowTriggerList {
5769 pub count: i64,
5770 #[serde(default, skip_serializing_if = "Option::is_none")]
5771 pub next: Option<String>,
5772 #[serde(default, skip_serializing_if = "Option::is_none")]
5773 pub previous: Option<String>,
5774 pub results: Vec<WorkflowTrigger>,
5775 #[serde(default, skip_serializing_if = "Option::is_none")]
5776 pub all: Option<Vec<i64>>,
5777}
5778
5779impl std::fmt::Display for PaginatedWorkflowTriggerList {
5780 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5781 write!(
5782 f,
5783 "{}",
5784 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5785 )
5786 }
5787}
5788
5789#[cfg(feature = "requests")]
5790impl crate::types::paginate::Pagination for PaginatedWorkflowTriggerList {
5791 type Item = WorkflowTrigger;
5792 fn has_more_pages(&self) -> bool {
5793 self.next.is_some()
5794 }
5795
5796 fn next_page_token(&self) -> Option<String> {
5797 self.next.clone()
5798 }
5799
5800 fn next_page(
5801 &self,
5802 req: reqwest::Request,
5803 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
5804 let mut req = req.try_clone().ok_or_else(|| {
5805 crate::types::error::Error::InvalidRequest(format!(
5806 "failed to clone request: {req:?}"
5807 ))
5808 })?;
5809 *req.url_mut() = url::Url::parse(self.next.as_deref().unwrap_or("")).map_err(|_| {
5810 crate::types::error::Error::InvalidRequest(format!(
5811 "failed to parse url: {:?}",
5812 self.next
5813 ))
5814 })?;
5815 Ok(req)
5816 }
5817
5818 fn items(&self) -> Vec<Self::Item> {
5819 self.results.clone()
5820 }
5821}
5822
5823#[cfg(feature = "tabled")]
5824impl tabled::Tabled for PaginatedWorkflowTriggerList {
5825 const LENGTH: usize = 5;
5826 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5827 vec![
5828 format!("{:?}", self.count).into(),
5829 if let Some(next) = &self.next {
5830 format!("{next:?}").into()
5831 } else {
5832 String::new().into()
5833 },
5834 if let Some(previous) = &self.previous {
5835 format!("{previous:?}").into()
5836 } else {
5837 String::new().into()
5838 },
5839 format!("{:?}", self.results).into(),
5840 if let Some(all) = &self.all {
5841 format!("{all:?}").into()
5842 } else {
5843 String::new().into()
5844 },
5845 ]
5846 }
5847
5848 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5849 vec![
5850 "count".into(),
5851 "next".into(),
5852 "previous".into(),
5853 "results".into(),
5854 "all".into(),
5855 ]
5856 }
5857}
5858
5859#[derive(
5860 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5861)]
5862#[allow(non_snake_case)]
5863pub struct PaperlessAuthToken {
5864 pub token: String,
5865}
5866
5867impl std::fmt::Display for PaperlessAuthToken {
5868 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5869 write!(
5870 f,
5871 "{}",
5872 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5873 )
5874 }
5875}
5876
5877#[cfg(feature = "tabled")]
5878impl tabled::Tabled for PaperlessAuthToken {
5879 const LENGTH: usize = 1;
5880 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5881 vec![self.token.clone().into()]
5882 }
5883
5884 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5885 vec!["token".into()]
5886 }
5887}
5888
5889#[derive(
5890 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5891)]
5892#[allow(non_snake_case)]
5893pub struct PaperlessAuthTokenRequest {
5894 pub username: String,
5895 pub password: String,
5896 #[serde(default, skip_serializing_if = "Option::is_none")]
5897 pub code: Option<String>,
5898}
5899
5900impl std::fmt::Display for PaperlessAuthTokenRequest {
5901 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5902 write!(
5903 f,
5904 "{}",
5905 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5906 )
5907 }
5908}
5909
5910#[cfg(feature = "tabled")]
5911impl tabled::Tabled for PaperlessAuthTokenRequest {
5912 const LENGTH: usize = 3;
5913 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5914 vec![
5915 self.username.clone().into(),
5916 self.password.clone().into(),
5917 if let Some(code) = &self.code {
5918 format!("{code:?}").into()
5919 } else {
5920 String::new().into()
5921 },
5922 ]
5923 }
5924
5925 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5926 vec!["username".into(), "password".into(), "code".into()]
5927 }
5928}
5929
5930#[derive(
5931 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5932)]
5933#[allow(non_snake_case)]
5934pub struct PatchedApplicationConfigurationRequest {
5935 #[serde(default, skip_serializing_if = "Option::is_none")]
5936 pub user_args: Option<serde_json::Value>,
5937 #[serde(default, skip_serializing_if = "Option::is_none")]
5938 pub barcode_tag_mapping: Option<serde_json::Value>,
5939 #[serde(default, skip_serializing_if = "Option::is_none")]
5940 pub output_type: Option<OutputType>,
5941 #[serde(default, skip_serializing_if = "Option::is_none")]
5942 pub pages: Option<i64>,
5943 #[serde(default, skip_serializing_if = "Option::is_none")]
5944 pub language: Option<String>,
5945 #[serde(default, skip_serializing_if = "Option::is_none")]
5946 pub mode: Option<Mode>,
5947 #[serde(default, skip_serializing_if = "Option::is_none")]
5948 pub skip_archive_file: Option<SkipArchiveFile>,
5949 #[serde(default, skip_serializing_if = "Option::is_none")]
5950 pub image_dpi: Option<i64>,
5951 #[serde(default, skip_serializing_if = "Option::is_none")]
5952 pub unpaper_clean: Option<UnpaperClean>,
5953 #[serde(default, skip_serializing_if = "Option::is_none")]
5954 pub deskew: Option<bool>,
5955 #[serde(default, skip_serializing_if = "Option::is_none")]
5956 pub rotate_pages: Option<bool>,
5957 #[serde(default, skip_serializing_if = "Option::is_none")]
5958 pub rotate_pages_threshold: Option<f64>,
5959 #[serde(default, skip_serializing_if = "Option::is_none")]
5960 pub max_image_pixels: Option<f64>,
5961 #[serde(default, skip_serializing_if = "Option::is_none")]
5962 pub color_conversion_strategy: Option<ColorConversionStrategy>,
5963 #[serde(default, skip_serializing_if = "Option::is_none")]
5964 pub app_title: Option<String>,
5965 #[serde(default, skip_serializing_if = "Option::is_none")]
5966 pub app_logo: Option<bytes::Bytes>,
5967 #[serde(default, skip_serializing_if = "Option::is_none")]
5968 pub barcodes_enabled: Option<bool>,
5969 #[serde(default, skip_serializing_if = "Option::is_none")]
5970 pub barcode_enable_tiff_support: Option<bool>,
5971 #[serde(default, skip_serializing_if = "Option::is_none")]
5972 pub barcode_string: Option<String>,
5973 #[serde(default, skip_serializing_if = "Option::is_none")]
5974 pub barcode_retain_split_pages: Option<bool>,
5975 #[serde(default, skip_serializing_if = "Option::is_none")]
5976 pub barcode_enable_asn: Option<bool>,
5977 #[serde(default, skip_serializing_if = "Option::is_none")]
5978 pub barcode_asn_prefix: Option<String>,
5979 #[serde(default, skip_serializing_if = "Option::is_none")]
5980 pub barcode_upscale: Option<f64>,
5981 #[serde(default, skip_serializing_if = "Option::is_none")]
5982 pub barcode_dpi: Option<i64>,
5983 #[serde(default, skip_serializing_if = "Option::is_none")]
5984 pub barcode_max_pages: Option<i64>,
5985 #[serde(default, skip_serializing_if = "Option::is_none")]
5986 pub barcode_enable_tag: Option<bool>,
5987}
5988
5989impl std::fmt::Display for PatchedApplicationConfigurationRequest {
5990 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5991 write!(
5992 f,
5993 "{}",
5994 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5995 )
5996 }
5997}
5998
5999#[cfg(feature = "tabled")]
6000impl tabled::Tabled for PatchedApplicationConfigurationRequest {
6001 const LENGTH: usize = 26;
6002 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6003 vec![
6004 if let Some(user_args) = &self.user_args {
6005 format!("{user_args:?}").into()
6006 } else {
6007 String::new().into()
6008 },
6009 if let Some(barcode_tag_mapping) = &self.barcode_tag_mapping {
6010 format!("{barcode_tag_mapping:?}").into()
6011 } else {
6012 String::new().into()
6013 },
6014 if let Some(output_type) = &self.output_type {
6015 format!("{output_type:?}").into()
6016 } else {
6017 String::new().into()
6018 },
6019 if let Some(pages) = &self.pages {
6020 format!("{pages:?}").into()
6021 } else {
6022 String::new().into()
6023 },
6024 if let Some(language) = &self.language {
6025 format!("{language:?}").into()
6026 } else {
6027 String::new().into()
6028 },
6029 if let Some(mode) = &self.mode {
6030 format!("{mode:?}").into()
6031 } else {
6032 String::new().into()
6033 },
6034 if let Some(skip_archive_file) = &self.skip_archive_file {
6035 format!("{skip_archive_file:?}").into()
6036 } else {
6037 String::new().into()
6038 },
6039 if let Some(image_dpi) = &self.image_dpi {
6040 format!("{image_dpi:?}").into()
6041 } else {
6042 String::new().into()
6043 },
6044 if let Some(unpaper_clean) = &self.unpaper_clean {
6045 format!("{unpaper_clean:?}").into()
6046 } else {
6047 String::new().into()
6048 },
6049 if let Some(deskew) = &self.deskew {
6050 format!("{deskew:?}").into()
6051 } else {
6052 String::new().into()
6053 },
6054 if let Some(rotate_pages) = &self.rotate_pages {
6055 format!("{rotate_pages:?}").into()
6056 } else {
6057 String::new().into()
6058 },
6059 if let Some(rotate_pages_threshold) = &self.rotate_pages_threshold {
6060 format!("{rotate_pages_threshold:?}").into()
6061 } else {
6062 String::new().into()
6063 },
6064 if let Some(max_image_pixels) = &self.max_image_pixels {
6065 format!("{max_image_pixels:?}").into()
6066 } else {
6067 String::new().into()
6068 },
6069 if let Some(color_conversion_strategy) = &self.color_conversion_strategy {
6070 format!("{color_conversion_strategy:?}").into()
6071 } else {
6072 String::new().into()
6073 },
6074 if let Some(app_title) = &self.app_title {
6075 format!("{app_title:?}").into()
6076 } else {
6077 String::new().into()
6078 },
6079 if let Some(app_logo) = &self.app_logo {
6080 format!("{app_logo:?}").into()
6081 } else {
6082 String::new().into()
6083 },
6084 if let Some(barcodes_enabled) = &self.barcodes_enabled {
6085 format!("{barcodes_enabled:?}").into()
6086 } else {
6087 String::new().into()
6088 },
6089 if let Some(barcode_enable_tiff_support) = &self.barcode_enable_tiff_support {
6090 format!("{barcode_enable_tiff_support:?}").into()
6091 } else {
6092 String::new().into()
6093 },
6094 if let Some(barcode_string) = &self.barcode_string {
6095 format!("{barcode_string:?}").into()
6096 } else {
6097 String::new().into()
6098 },
6099 if let Some(barcode_retain_split_pages) = &self.barcode_retain_split_pages {
6100 format!("{barcode_retain_split_pages:?}").into()
6101 } else {
6102 String::new().into()
6103 },
6104 if let Some(barcode_enable_asn) = &self.barcode_enable_asn {
6105 format!("{barcode_enable_asn:?}").into()
6106 } else {
6107 String::new().into()
6108 },
6109 if let Some(barcode_asn_prefix) = &self.barcode_asn_prefix {
6110 format!("{barcode_asn_prefix:?}").into()
6111 } else {
6112 String::new().into()
6113 },
6114 if let Some(barcode_upscale) = &self.barcode_upscale {
6115 format!("{barcode_upscale:?}").into()
6116 } else {
6117 String::new().into()
6118 },
6119 if let Some(barcode_dpi) = &self.barcode_dpi {
6120 format!("{barcode_dpi:?}").into()
6121 } else {
6122 String::new().into()
6123 },
6124 if let Some(barcode_max_pages) = &self.barcode_max_pages {
6125 format!("{barcode_max_pages:?}").into()
6126 } else {
6127 String::new().into()
6128 },
6129 if let Some(barcode_enable_tag) = &self.barcode_enable_tag {
6130 format!("{barcode_enable_tag:?}").into()
6131 } else {
6132 String::new().into()
6133 },
6134 ]
6135 }
6136
6137 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6138 vec![
6139 "user_args".into(),
6140 "barcode_tag_mapping".into(),
6141 "output_type".into(),
6142 "pages".into(),
6143 "language".into(),
6144 "mode".into(),
6145 "skip_archive_file".into(),
6146 "image_dpi".into(),
6147 "unpaper_clean".into(),
6148 "deskew".into(),
6149 "rotate_pages".into(),
6150 "rotate_pages_threshold".into(),
6151 "max_image_pixels".into(),
6152 "color_conversion_strategy".into(),
6153 "app_title".into(),
6154 "app_logo".into(),
6155 "barcodes_enabled".into(),
6156 "barcode_enable_tiff_support".into(),
6157 "barcode_string".into(),
6158 "barcode_retain_split_pages".into(),
6159 "barcode_enable_asn".into(),
6160 "barcode_asn_prefix".into(),
6161 "barcode_upscale".into(),
6162 "barcode_dpi".into(),
6163 "barcode_max_pages".into(),
6164 "barcode_enable_tag".into(),
6165 ]
6166 }
6167}
6168
6169#[derive(
6170 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6171)]
6172#[allow(non_snake_case)]
6173pub struct PatchedCorrespondentRequest {
6174 #[serde(default, skip_serializing_if = "Option::is_none")]
6175 pub name: Option<String>,
6176 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
6177 pub match_: Option<String>,
6178 #[serde(default, skip_serializing_if = "Option::is_none")]
6179 pub matching_algorithm: Option<i64>,
6180 #[serde(default, skip_serializing_if = "Option::is_none")]
6181 pub is_insensitive: Option<bool>,
6182 #[serde(default, skip_serializing_if = "Option::is_none")]
6183 pub owner: Option<i64>,
6184 #[serde(default, skip_serializing_if = "Option::is_none")]
6185 pub set_permissions: Option<SetPermissions>,
6186}
6187
6188impl std::fmt::Display for PatchedCorrespondentRequest {
6189 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6190 write!(
6191 f,
6192 "{}",
6193 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6194 )
6195 }
6196}
6197
6198#[cfg(feature = "tabled")]
6199impl tabled::Tabled for PatchedCorrespondentRequest {
6200 const LENGTH: usize = 6;
6201 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6202 vec![
6203 if let Some(name) = &self.name {
6204 format!("{name:?}").into()
6205 } else {
6206 String::new().into()
6207 },
6208 if let Some(match_) = &self.match_ {
6209 format!("{match_:?}").into()
6210 } else {
6211 String::new().into()
6212 },
6213 if let Some(matching_algorithm) = &self.matching_algorithm {
6214 format!("{matching_algorithm:?}").into()
6215 } else {
6216 String::new().into()
6217 },
6218 if let Some(is_insensitive) = &self.is_insensitive {
6219 format!("{is_insensitive:?}").into()
6220 } else {
6221 String::new().into()
6222 },
6223 if let Some(owner) = &self.owner {
6224 format!("{owner:?}").into()
6225 } else {
6226 String::new().into()
6227 },
6228 if let Some(set_permissions) = &self.set_permissions {
6229 format!("{set_permissions:?}").into()
6230 } else {
6231 String::new().into()
6232 },
6233 ]
6234 }
6235
6236 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6237 vec![
6238 "name".into(),
6239 "match_".into(),
6240 "matching_algorithm".into(),
6241 "is_insensitive".into(),
6242 "owner".into(),
6243 "set_permissions".into(),
6244 ]
6245 }
6246}
6247
6248#[derive(
6249 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6250)]
6251#[allow(non_snake_case)]
6252pub struct PatchedCustomFieldRequest {
6253 #[serde(default, skip_serializing_if = "Option::is_none")]
6254 pub name: Option<String>,
6255 #[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"]
6256 #[serde(default, skip_serializing_if = "Option::is_none")]
6257 pub data_type: Option<DataTypeEnum>,
6258 #[doc = "Extra data for the custom field, such as select options"]
6259 #[serde(default, skip_serializing_if = "Option::is_none")]
6260 pub extra_data: Option<serde_json::Value>,
6261}
6262
6263impl std::fmt::Display for PatchedCustomFieldRequest {
6264 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6265 write!(
6266 f,
6267 "{}",
6268 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6269 )
6270 }
6271}
6272
6273#[cfg(feature = "tabled")]
6274impl tabled::Tabled for PatchedCustomFieldRequest {
6275 const LENGTH: usize = 3;
6276 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6277 vec![
6278 if let Some(name) = &self.name {
6279 format!("{name:?}").into()
6280 } else {
6281 String::new().into()
6282 },
6283 if let Some(data_type) = &self.data_type {
6284 format!("{data_type:?}").into()
6285 } else {
6286 String::new().into()
6287 },
6288 if let Some(extra_data) = &self.extra_data {
6289 format!("{extra_data:?}").into()
6290 } else {
6291 String::new().into()
6292 },
6293 ]
6294 }
6295
6296 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6297 vec!["name".into(), "data_type".into(), "extra_data".into()]
6298 }
6299}
6300
6301#[doc = "Adds update nested feature"]
6302#[derive(
6303 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6304)]
6305#[allow(non_snake_case)]
6306pub struct PatchedDocumentRequest {
6307 #[serde(default, skip_serializing_if = "Option::is_none")]
6308 pub correspondent: Option<i64>,
6309 #[serde(default, skip_serializing_if = "Option::is_none")]
6310 pub document_type: Option<i64>,
6311 #[serde(default, skip_serializing_if = "Option::is_none")]
6312 pub storage_path: Option<i64>,
6313 #[serde(default, skip_serializing_if = "Option::is_none")]
6314 pub title: Option<String>,
6315 #[doc = "The raw, text-only data of the document. This field is primarily used for searching."]
6316 #[serde(default, skip_serializing_if = "Option::is_none")]
6317 pub content: Option<String>,
6318 #[serde(default, skip_serializing_if = "Option::is_none")]
6319 pub tags: Option<Vec<i64>>,
6320 #[serde(default, skip_serializing_if = "Option::is_none")]
6321 pub created: Option<chrono::NaiveDate>,
6322 #[serde(default, skip_serializing_if = "Option::is_none")]
6323 #[deprecated]
6324 pub created_date: Option<chrono::NaiveDate>,
6325 #[serde(default, skip_serializing_if = "Option::is_none")]
6326 pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
6327 #[doc = "The position of this document in your physical document archive."]
6328 #[serde(default, skip_serializing_if = "Option::is_none")]
6329 pub archive_serial_number: Option<i64>,
6330 #[serde(default, skip_serializing_if = "Option::is_none")]
6331 pub owner: Option<i64>,
6332 #[serde(default, skip_serializing_if = "Option::is_none")]
6333 pub set_permissions: Option<SetPermissions>,
6334 #[serde(default, skip_serializing_if = "Option::is_none")]
6335 pub custom_fields: Option<Vec<CustomFieldInstanceRequest>>,
6336 #[serde(default, skip_serializing_if = "Option::is_none")]
6337 pub remove_inbox_tags: Option<bool>,
6338}
6339
6340impl std::fmt::Display for PatchedDocumentRequest {
6341 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6342 write!(
6343 f,
6344 "{}",
6345 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6346 )
6347 }
6348}
6349
6350#[cfg(feature = "tabled")]
6351impl tabled::Tabled for PatchedDocumentRequest {
6352 const LENGTH: usize = 14;
6353 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6354 vec![
6355 if let Some(correspondent) = &self.correspondent {
6356 format!("{correspondent:?}").into()
6357 } else {
6358 String::new().into()
6359 },
6360 if let Some(document_type) = &self.document_type {
6361 format!("{document_type:?}").into()
6362 } else {
6363 String::new().into()
6364 },
6365 if let Some(storage_path) = &self.storage_path {
6366 format!("{storage_path:?}").into()
6367 } else {
6368 String::new().into()
6369 },
6370 if let Some(title) = &self.title {
6371 format!("{title:?}").into()
6372 } else {
6373 String::new().into()
6374 },
6375 if let Some(content) = &self.content {
6376 format!("{content:?}").into()
6377 } else {
6378 String::new().into()
6379 },
6380 if let Some(tags) = &self.tags {
6381 format!("{tags:?}").into()
6382 } else {
6383 String::new().into()
6384 },
6385 if let Some(created) = &self.created {
6386 format!("{created:?}").into()
6387 } else {
6388 String::new().into()
6389 },
6390 if let Some(created_date) = &self.created_date {
6391 format!("{created_date:?}").into()
6392 } else {
6393 String::new().into()
6394 },
6395 if let Some(deleted_at) = &self.deleted_at {
6396 format!("{deleted_at:?}").into()
6397 } else {
6398 String::new().into()
6399 },
6400 if let Some(archive_serial_number) = &self.archive_serial_number {
6401 format!("{archive_serial_number:?}").into()
6402 } else {
6403 String::new().into()
6404 },
6405 if let Some(owner) = &self.owner {
6406 format!("{owner:?}").into()
6407 } else {
6408 String::new().into()
6409 },
6410 if let Some(set_permissions) = &self.set_permissions {
6411 format!("{set_permissions:?}").into()
6412 } else {
6413 String::new().into()
6414 },
6415 if let Some(custom_fields) = &self.custom_fields {
6416 format!("{custom_fields:?}").into()
6417 } else {
6418 String::new().into()
6419 },
6420 if let Some(remove_inbox_tags) = &self.remove_inbox_tags {
6421 format!("{remove_inbox_tags:?}").into()
6422 } else {
6423 String::new().into()
6424 },
6425 ]
6426 }
6427
6428 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6429 vec![
6430 "correspondent".into(),
6431 "document_type".into(),
6432 "storage_path".into(),
6433 "title".into(),
6434 "content".into(),
6435 "tags".into(),
6436 "created".into(),
6437 "created_date".into(),
6438 "deleted_at".into(),
6439 "archive_serial_number".into(),
6440 "owner".into(),
6441 "set_permissions".into(),
6442 "custom_fields".into(),
6443 "remove_inbox_tags".into(),
6444 ]
6445 }
6446}
6447
6448#[derive(
6449 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6450)]
6451#[allow(non_snake_case)]
6452pub struct PatchedDocumentTypeRequest {
6453 #[serde(default, skip_serializing_if = "Option::is_none")]
6454 pub name: Option<String>,
6455 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
6456 pub match_: Option<String>,
6457 #[serde(default, skip_serializing_if = "Option::is_none")]
6458 pub matching_algorithm: Option<i64>,
6459 #[serde(default, skip_serializing_if = "Option::is_none")]
6460 pub is_insensitive: Option<bool>,
6461 #[serde(default, skip_serializing_if = "Option::is_none")]
6462 pub owner: Option<i64>,
6463 #[serde(default, skip_serializing_if = "Option::is_none")]
6464 pub set_permissions: Option<SetPermissions>,
6465}
6466
6467impl std::fmt::Display for PatchedDocumentTypeRequest {
6468 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6469 write!(
6470 f,
6471 "{}",
6472 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6473 )
6474 }
6475}
6476
6477#[cfg(feature = "tabled")]
6478impl tabled::Tabled for PatchedDocumentTypeRequest {
6479 const LENGTH: usize = 6;
6480 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6481 vec![
6482 if let Some(name) = &self.name {
6483 format!("{name:?}").into()
6484 } else {
6485 String::new().into()
6486 },
6487 if let Some(match_) = &self.match_ {
6488 format!("{match_:?}").into()
6489 } else {
6490 String::new().into()
6491 },
6492 if let Some(matching_algorithm) = &self.matching_algorithm {
6493 format!("{matching_algorithm:?}").into()
6494 } else {
6495 String::new().into()
6496 },
6497 if let Some(is_insensitive) = &self.is_insensitive {
6498 format!("{is_insensitive:?}").into()
6499 } else {
6500 String::new().into()
6501 },
6502 if let Some(owner) = &self.owner {
6503 format!("{owner:?}").into()
6504 } else {
6505 String::new().into()
6506 },
6507 if let Some(set_permissions) = &self.set_permissions {
6508 format!("{set_permissions:?}").into()
6509 } else {
6510 String::new().into()
6511 },
6512 ]
6513 }
6514
6515 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6516 vec![
6517 "name".into(),
6518 "match_".into(),
6519 "matching_algorithm".into(),
6520 "is_insensitive".into(),
6521 "owner".into(),
6522 "set_permissions".into(),
6523 ]
6524 }
6525}
6526
6527#[derive(
6528 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6529)]
6530#[allow(non_snake_case)]
6531pub struct PatchedGroupRequest {
6532 #[serde(default, skip_serializing_if = "Option::is_none")]
6533 pub name: Option<String>,
6534 #[serde(default, skip_serializing_if = "Option::is_none")]
6535 pub permissions: Option<Vec<String>>,
6536}
6537
6538impl std::fmt::Display for PatchedGroupRequest {
6539 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6540 write!(
6541 f,
6542 "{}",
6543 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6544 )
6545 }
6546}
6547
6548#[cfg(feature = "tabled")]
6549impl tabled::Tabled for PatchedGroupRequest {
6550 const LENGTH: usize = 2;
6551 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6552 vec![
6553 if let Some(name) = &self.name {
6554 format!("{name:?}").into()
6555 } else {
6556 String::new().into()
6557 },
6558 if let Some(permissions) = &self.permissions {
6559 format!("{permissions:?}").into()
6560 } else {
6561 String::new().into()
6562 },
6563 ]
6564 }
6565
6566 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6567 vec!["name".into(), "permissions".into()]
6568 }
6569}
6570
6571#[derive(
6572 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6573)]
6574#[allow(non_snake_case)]
6575pub struct PatchedMailAccountRequest {
6576 #[serde(default, skip_serializing_if = "Option::is_none")]
6577 pub name: Option<String>,
6578 #[serde(default, skip_serializing_if = "Option::is_none")]
6579 pub imap_server: Option<String>,
6580 #[doc = "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."]
6581 #[serde(default, skip_serializing_if = "Option::is_none")]
6582 pub imap_port: Option<i64>,
6583 #[serde(default, skip_serializing_if = "Option::is_none")]
6584 pub imap_security: Option<i64>,
6585 #[serde(default, skip_serializing_if = "Option::is_none")]
6586 pub username: Option<String>,
6587 #[serde(default, skip_serializing_if = "Option::is_none")]
6588 pub password: Option<String>,
6589 #[doc = "The character set to use when communicating with the mail server, such as 'UTF-8' or 'US-ASCII'."]
6590 #[serde(default, skip_serializing_if = "Option::is_none")]
6591 pub character_set: Option<String>,
6592 #[serde(default, skip_serializing_if = "Option::is_none")]
6593 pub is_token: Option<bool>,
6594 #[serde(default, skip_serializing_if = "Option::is_none")]
6595 pub owner: Option<i64>,
6596 #[serde(default, skip_serializing_if = "Option::is_none")]
6597 pub set_permissions: Option<SetPermissions>,
6598 #[serde(default, skip_serializing_if = "Option::is_none")]
6599 pub account_type: Option<i64>,
6600 #[doc = "The expiration date of the refresh token. "]
6601 #[serde(default, skip_serializing_if = "Option::is_none")]
6602 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
6603}
6604
6605impl std::fmt::Display for PatchedMailAccountRequest {
6606 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6607 write!(
6608 f,
6609 "{}",
6610 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6611 )
6612 }
6613}
6614
6615#[cfg(feature = "tabled")]
6616impl tabled::Tabled for PatchedMailAccountRequest {
6617 const LENGTH: usize = 12;
6618 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6619 vec![
6620 if let Some(name) = &self.name {
6621 format!("{name:?}").into()
6622 } else {
6623 String::new().into()
6624 },
6625 if let Some(imap_server) = &self.imap_server {
6626 format!("{imap_server:?}").into()
6627 } else {
6628 String::new().into()
6629 },
6630 if let Some(imap_port) = &self.imap_port {
6631 format!("{imap_port:?}").into()
6632 } else {
6633 String::new().into()
6634 },
6635 if let Some(imap_security) = &self.imap_security {
6636 format!("{imap_security:?}").into()
6637 } else {
6638 String::new().into()
6639 },
6640 if let Some(username) = &self.username {
6641 format!("{username:?}").into()
6642 } else {
6643 String::new().into()
6644 },
6645 if let Some(password) = &self.password {
6646 format!("{password:?}").into()
6647 } else {
6648 String::new().into()
6649 },
6650 if let Some(character_set) = &self.character_set {
6651 format!("{character_set:?}").into()
6652 } else {
6653 String::new().into()
6654 },
6655 if let Some(is_token) = &self.is_token {
6656 format!("{is_token:?}").into()
6657 } else {
6658 String::new().into()
6659 },
6660 if let Some(owner) = &self.owner {
6661 format!("{owner:?}").into()
6662 } else {
6663 String::new().into()
6664 },
6665 if let Some(set_permissions) = &self.set_permissions {
6666 format!("{set_permissions:?}").into()
6667 } else {
6668 String::new().into()
6669 },
6670 if let Some(account_type) = &self.account_type {
6671 format!("{account_type:?}").into()
6672 } else {
6673 String::new().into()
6674 },
6675 if let Some(expiration) = &self.expiration {
6676 format!("{expiration:?}").into()
6677 } else {
6678 String::new().into()
6679 },
6680 ]
6681 }
6682
6683 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6684 vec![
6685 "name".into(),
6686 "imap_server".into(),
6687 "imap_port".into(),
6688 "imap_security".into(),
6689 "username".into(),
6690 "password".into(),
6691 "character_set".into(),
6692 "is_token".into(),
6693 "owner".into(),
6694 "set_permissions".into(),
6695 "account_type".into(),
6696 "expiration".into(),
6697 ]
6698 }
6699}
6700
6701#[derive(
6702 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6703)]
6704#[allow(non_snake_case)]
6705pub struct PatchedMailRuleRequest {
6706 #[serde(default, skip_serializing_if = "Option::is_none")]
6707 pub name: Option<String>,
6708 #[serde(default, skip_serializing_if = "Option::is_none")]
6709 pub account: Option<i64>,
6710 #[serde(default, skip_serializing_if = "Option::is_none")]
6711 pub enabled: Option<bool>,
6712 #[doc = "Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server."]
6713 #[serde(default, skip_serializing_if = "Option::is_none")]
6714 pub folder: Option<String>,
6715 #[serde(default, skip_serializing_if = "Option::is_none")]
6716 pub filter_from: Option<String>,
6717 #[serde(default, skip_serializing_if = "Option::is_none")]
6718 pub filter_to: Option<String>,
6719 #[serde(default, skip_serializing_if = "Option::is_none")]
6720 pub filter_subject: Option<String>,
6721 #[serde(default, skip_serializing_if = "Option::is_none")]
6722 pub filter_body: Option<String>,
6723 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
6724 #[serde(default, skip_serializing_if = "Option::is_none")]
6725 pub filter_attachment_filename_include: Option<String>,
6726 #[doc = "Do not consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
6727 #[serde(default, skip_serializing_if = "Option::is_none")]
6728 pub filter_attachment_filename_exclude: Option<String>,
6729 #[doc = "Specified in days."]
6730 #[serde(default, skip_serializing_if = "Option::is_none")]
6731 pub maximum_age: Option<i64>,
6732 #[serde(default, skip_serializing_if = "Option::is_none")]
6733 pub action: Option<i64>,
6734 #[serde(default, skip_serializing_if = "Option::is_none")]
6735 pub action_parameter: Option<String>,
6736 #[serde(default, skip_serializing_if = "Option::is_none")]
6737 pub assign_title_from: Option<i64>,
6738 #[serde(default, skip_serializing_if = "Option::is_none")]
6739 pub assign_tags: Option<Vec<Option<i64>>>,
6740 #[serde(default, skip_serializing_if = "Option::is_none")]
6741 pub assign_correspondent_from: Option<i64>,
6742 #[serde(default, skip_serializing_if = "Option::is_none")]
6743 pub assign_correspondent: Option<i64>,
6744 #[serde(default, skip_serializing_if = "Option::is_none")]
6745 pub assign_document_type: Option<i64>,
6746 #[serde(default, skip_serializing_if = "Option::is_none")]
6747 pub assign_owner_from_rule: Option<bool>,
6748 #[serde(default, skip_serializing_if = "Option::is_none")]
6749 pub order: Option<i64>,
6750 #[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."]
6751 #[serde(default, skip_serializing_if = "Option::is_none")]
6752 pub attachment_type: Option<i64>,
6753 #[serde(default, skip_serializing_if = "Option::is_none")]
6754 pub consumption_scope: Option<i64>,
6755 #[serde(default, skip_serializing_if = "Option::is_none")]
6756 pub pdf_layout: Option<i64>,
6757 #[serde(default, skip_serializing_if = "Option::is_none")]
6758 pub owner: Option<i64>,
6759 #[serde(default, skip_serializing_if = "Option::is_none")]
6760 pub set_permissions: Option<SetPermissions>,
6761}
6762
6763impl std::fmt::Display for PatchedMailRuleRequest {
6764 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6765 write!(
6766 f,
6767 "{}",
6768 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6769 )
6770 }
6771}
6772
6773#[cfg(feature = "tabled")]
6774impl tabled::Tabled for PatchedMailRuleRequest {
6775 const LENGTH: usize = 25;
6776 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6777 vec![
6778 if let Some(name) = &self.name {
6779 format!("{name:?}").into()
6780 } else {
6781 String::new().into()
6782 },
6783 if let Some(account) = &self.account {
6784 format!("{account:?}").into()
6785 } else {
6786 String::new().into()
6787 },
6788 if let Some(enabled) = &self.enabled {
6789 format!("{enabled:?}").into()
6790 } else {
6791 String::new().into()
6792 },
6793 if let Some(folder) = &self.folder {
6794 format!("{folder:?}").into()
6795 } else {
6796 String::new().into()
6797 },
6798 if let Some(filter_from) = &self.filter_from {
6799 format!("{filter_from:?}").into()
6800 } else {
6801 String::new().into()
6802 },
6803 if let Some(filter_to) = &self.filter_to {
6804 format!("{filter_to:?}").into()
6805 } else {
6806 String::new().into()
6807 },
6808 if let Some(filter_subject) = &self.filter_subject {
6809 format!("{filter_subject:?}").into()
6810 } else {
6811 String::new().into()
6812 },
6813 if let Some(filter_body) = &self.filter_body {
6814 format!("{filter_body:?}").into()
6815 } else {
6816 String::new().into()
6817 },
6818 if let Some(filter_attachment_filename_include) =
6819 &self.filter_attachment_filename_include
6820 {
6821 format!("{filter_attachment_filename_include:?}").into()
6822 } else {
6823 String::new().into()
6824 },
6825 if let Some(filter_attachment_filename_exclude) =
6826 &self.filter_attachment_filename_exclude
6827 {
6828 format!("{filter_attachment_filename_exclude:?}").into()
6829 } else {
6830 String::new().into()
6831 },
6832 if let Some(maximum_age) = &self.maximum_age {
6833 format!("{maximum_age:?}").into()
6834 } else {
6835 String::new().into()
6836 },
6837 if let Some(action) = &self.action {
6838 format!("{action:?}").into()
6839 } else {
6840 String::new().into()
6841 },
6842 if let Some(action_parameter) = &self.action_parameter {
6843 format!("{action_parameter:?}").into()
6844 } else {
6845 String::new().into()
6846 },
6847 if let Some(assign_title_from) = &self.assign_title_from {
6848 format!("{assign_title_from:?}").into()
6849 } else {
6850 String::new().into()
6851 },
6852 if let Some(assign_tags) = &self.assign_tags {
6853 format!("{assign_tags:?}").into()
6854 } else {
6855 String::new().into()
6856 },
6857 if let Some(assign_correspondent_from) = &self.assign_correspondent_from {
6858 format!("{assign_correspondent_from:?}").into()
6859 } else {
6860 String::new().into()
6861 },
6862 if let Some(assign_correspondent) = &self.assign_correspondent {
6863 format!("{assign_correspondent:?}").into()
6864 } else {
6865 String::new().into()
6866 },
6867 if let Some(assign_document_type) = &self.assign_document_type {
6868 format!("{assign_document_type:?}").into()
6869 } else {
6870 String::new().into()
6871 },
6872 if let Some(assign_owner_from_rule) = &self.assign_owner_from_rule {
6873 format!("{assign_owner_from_rule:?}").into()
6874 } else {
6875 String::new().into()
6876 },
6877 if let Some(order) = &self.order {
6878 format!("{order:?}").into()
6879 } else {
6880 String::new().into()
6881 },
6882 if let Some(attachment_type) = &self.attachment_type {
6883 format!("{attachment_type:?}").into()
6884 } else {
6885 String::new().into()
6886 },
6887 if let Some(consumption_scope) = &self.consumption_scope {
6888 format!("{consumption_scope:?}").into()
6889 } else {
6890 String::new().into()
6891 },
6892 if let Some(pdf_layout) = &self.pdf_layout {
6893 format!("{pdf_layout:?}").into()
6894 } else {
6895 String::new().into()
6896 },
6897 if let Some(owner) = &self.owner {
6898 format!("{owner:?}").into()
6899 } else {
6900 String::new().into()
6901 },
6902 if let Some(set_permissions) = &self.set_permissions {
6903 format!("{set_permissions:?}").into()
6904 } else {
6905 String::new().into()
6906 },
6907 ]
6908 }
6909
6910 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6911 vec![
6912 "name".into(),
6913 "account".into(),
6914 "enabled".into(),
6915 "folder".into(),
6916 "filter_from".into(),
6917 "filter_to".into(),
6918 "filter_subject".into(),
6919 "filter_body".into(),
6920 "filter_attachment_filename_include".into(),
6921 "filter_attachment_filename_exclude".into(),
6922 "maximum_age".into(),
6923 "action".into(),
6924 "action_parameter".into(),
6925 "assign_title_from".into(),
6926 "assign_tags".into(),
6927 "assign_correspondent_from".into(),
6928 "assign_correspondent".into(),
6929 "assign_document_type".into(),
6930 "assign_owner_from_rule".into(),
6931 "order".into(),
6932 "attachment_type".into(),
6933 "consumption_scope".into(),
6934 "pdf_layout".into(),
6935 "owner".into(),
6936 "set_permissions".into(),
6937 ]
6938 }
6939}
6940
6941#[derive(
6942 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6943)]
6944#[allow(non_snake_case)]
6945pub struct PatchedProfileRequest {
6946 #[serde(default, skip_serializing_if = "Option::is_none")]
6947 pub email: Option<String>,
6948 #[serde(default, skip_serializing_if = "Option::is_none")]
6949 pub password: Option<String>,
6950 #[serde(default, skip_serializing_if = "Option::is_none")]
6951 pub first_name: Option<String>,
6952 #[serde(default, skip_serializing_if = "Option::is_none")]
6953 pub last_name: Option<String>,
6954}
6955
6956impl std::fmt::Display for PatchedProfileRequest {
6957 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6958 write!(
6959 f,
6960 "{}",
6961 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6962 )
6963 }
6964}
6965
6966#[cfg(feature = "tabled")]
6967impl tabled::Tabled for PatchedProfileRequest {
6968 const LENGTH: usize = 4;
6969 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6970 vec![
6971 if let Some(email) = &self.email {
6972 format!("{email:?}").into()
6973 } else {
6974 String::new().into()
6975 },
6976 if let Some(password) = &self.password {
6977 format!("{password:?}").into()
6978 } else {
6979 String::new().into()
6980 },
6981 if let Some(first_name) = &self.first_name {
6982 format!("{first_name:?}").into()
6983 } else {
6984 String::new().into()
6985 },
6986 if let Some(last_name) = &self.last_name {
6987 format!("{last_name:?}").into()
6988 } else {
6989 String::new().into()
6990 },
6991 ]
6992 }
6993
6994 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6995 vec![
6996 "email".into(),
6997 "password".into(),
6998 "first_name".into(),
6999 "last_name".into(),
7000 ]
7001 }
7002}
7003
7004#[derive(
7005 serde :: Serialize,
7006 serde :: Deserialize,
7007 PartialEq,
7008 Hash,
7009 Debug,
7010 Clone,
7011 schemars :: JsonSchema,
7012 parse_display :: FromStr,
7013 parse_display :: Display,
7014)]
7015#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
7016#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7017pub enum DisplayMode {
7018 #[serde(rename = "table")]
7019 #[display("table")]
7020 Table,
7021 #[serde(rename = "smallCards")]
7022 #[display("smallCards")]
7023 SmallCards,
7024 #[serde(rename = "largeCards")]
7025 #[display("largeCards")]
7026 LargeCards,
7027 #[serde(rename = "")]
7028 #[display("")]
7029 Empty,
7030}
7031
7032#[derive(
7033 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7034)]
7035#[allow(non_snake_case)]
7036pub struct PatchedSavedViewRequest {
7037 #[serde(default, skip_serializing_if = "Option::is_none")]
7038 pub name: Option<String>,
7039 #[serde(default, skip_serializing_if = "Option::is_none")]
7040 pub show_on_dashboard: Option<bool>,
7041 #[serde(default, skip_serializing_if = "Option::is_none")]
7042 pub show_in_sidebar: Option<bool>,
7043 #[serde(default, skip_serializing_if = "Option::is_none")]
7044 pub sort_field: Option<String>,
7045 #[serde(default, skip_serializing_if = "Option::is_none")]
7046 pub sort_reverse: Option<bool>,
7047 #[serde(default, skip_serializing_if = "Option::is_none")]
7048 pub filter_rules: Option<Vec<SavedViewFilterRuleRequest>>,
7049 #[serde(default, skip_serializing_if = "Option::is_none")]
7050 pub page_size: Option<i64>,
7051 #[serde(default, skip_serializing_if = "Option::is_none")]
7052 pub display_mode: Option<DisplayMode>,
7053 #[serde(default, skip_serializing_if = "Option::is_none")]
7054 pub display_fields: Option<serde_json::Value>,
7055 #[serde(default, skip_serializing_if = "Option::is_none")]
7056 pub owner: Option<i64>,
7057}
7058
7059impl std::fmt::Display for PatchedSavedViewRequest {
7060 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7061 write!(
7062 f,
7063 "{}",
7064 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7065 )
7066 }
7067}
7068
7069#[cfg(feature = "tabled")]
7070impl tabled::Tabled for PatchedSavedViewRequest {
7071 const LENGTH: usize = 10;
7072 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7073 vec![
7074 if let Some(name) = &self.name {
7075 format!("{name:?}").into()
7076 } else {
7077 String::new().into()
7078 },
7079 if let Some(show_on_dashboard) = &self.show_on_dashboard {
7080 format!("{show_on_dashboard:?}").into()
7081 } else {
7082 String::new().into()
7083 },
7084 if let Some(show_in_sidebar) = &self.show_in_sidebar {
7085 format!("{show_in_sidebar:?}").into()
7086 } else {
7087 String::new().into()
7088 },
7089 if let Some(sort_field) = &self.sort_field {
7090 format!("{sort_field:?}").into()
7091 } else {
7092 String::new().into()
7093 },
7094 if let Some(sort_reverse) = &self.sort_reverse {
7095 format!("{sort_reverse:?}").into()
7096 } else {
7097 String::new().into()
7098 },
7099 if let Some(filter_rules) = &self.filter_rules {
7100 format!("{filter_rules:?}").into()
7101 } else {
7102 String::new().into()
7103 },
7104 if let Some(page_size) = &self.page_size {
7105 format!("{page_size:?}").into()
7106 } else {
7107 String::new().into()
7108 },
7109 if let Some(display_mode) = &self.display_mode {
7110 format!("{display_mode:?}").into()
7111 } else {
7112 String::new().into()
7113 },
7114 if let Some(display_fields) = &self.display_fields {
7115 format!("{display_fields:?}").into()
7116 } else {
7117 String::new().into()
7118 },
7119 if let Some(owner) = &self.owner {
7120 format!("{owner:?}").into()
7121 } else {
7122 String::new().into()
7123 },
7124 ]
7125 }
7126
7127 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7128 vec![
7129 "name".into(),
7130 "show_on_dashboard".into(),
7131 "show_in_sidebar".into(),
7132 "sort_field".into(),
7133 "sort_reverse".into(),
7134 "filter_rules".into(),
7135 "page_size".into(),
7136 "display_mode".into(),
7137 "display_fields".into(),
7138 "owner".into(),
7139 ]
7140 }
7141}
7142
7143#[derive(
7144 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7145)]
7146#[allow(non_snake_case)]
7147pub struct PatchedShareLinkRequest {
7148 #[serde(default, skip_serializing_if = "Option::is_none")]
7149 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
7150 #[serde(default, skip_serializing_if = "Option::is_none")]
7151 pub document: Option<i64>,
7152 #[doc = "* `archive` - Archive\n* `original` - Original"]
7153 #[serde(default, skip_serializing_if = "Option::is_none")]
7154 pub file_version: Option<FileVersionEnum>,
7155}
7156
7157impl std::fmt::Display for PatchedShareLinkRequest {
7158 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7159 write!(
7160 f,
7161 "{}",
7162 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7163 )
7164 }
7165}
7166
7167#[cfg(feature = "tabled")]
7168impl tabled::Tabled for PatchedShareLinkRequest {
7169 const LENGTH: usize = 3;
7170 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7171 vec![
7172 if let Some(expiration) = &self.expiration {
7173 format!("{expiration:?}").into()
7174 } else {
7175 String::new().into()
7176 },
7177 if let Some(document) = &self.document {
7178 format!("{document:?}").into()
7179 } else {
7180 String::new().into()
7181 },
7182 if let Some(file_version) = &self.file_version {
7183 format!("{file_version:?}").into()
7184 } else {
7185 String::new().into()
7186 },
7187 ]
7188 }
7189
7190 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7191 vec![
7192 "expiration".into(),
7193 "document".into(),
7194 "file_version".into(),
7195 ]
7196 }
7197}
7198
7199#[derive(
7200 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7201)]
7202#[allow(non_snake_case)]
7203pub struct PatchedStoragePathRequest {
7204 #[serde(default, skip_serializing_if = "Option::is_none")]
7205 pub name: Option<String>,
7206 #[serde(default, skip_serializing_if = "Option::is_none")]
7207 pub path: Option<String>,
7208 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
7209 pub match_: Option<String>,
7210 #[serde(default, skip_serializing_if = "Option::is_none")]
7211 pub matching_algorithm: Option<i64>,
7212 #[serde(default, skip_serializing_if = "Option::is_none")]
7213 pub is_insensitive: Option<bool>,
7214 #[serde(default, skip_serializing_if = "Option::is_none")]
7215 pub owner: Option<i64>,
7216 #[serde(default, skip_serializing_if = "Option::is_none")]
7217 pub set_permissions: Option<SetPermissions>,
7218}
7219
7220impl std::fmt::Display for PatchedStoragePathRequest {
7221 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7222 write!(
7223 f,
7224 "{}",
7225 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7226 )
7227 }
7228}
7229
7230#[cfg(feature = "tabled")]
7231impl tabled::Tabled for PatchedStoragePathRequest {
7232 const LENGTH: usize = 7;
7233 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7234 vec![
7235 if let Some(name) = &self.name {
7236 format!("{name:?}").into()
7237 } else {
7238 String::new().into()
7239 },
7240 if let Some(path) = &self.path {
7241 format!("{path:?}").into()
7242 } else {
7243 String::new().into()
7244 },
7245 if let Some(match_) = &self.match_ {
7246 format!("{match_:?}").into()
7247 } else {
7248 String::new().into()
7249 },
7250 if let Some(matching_algorithm) = &self.matching_algorithm {
7251 format!("{matching_algorithm:?}").into()
7252 } else {
7253 String::new().into()
7254 },
7255 if let Some(is_insensitive) = &self.is_insensitive {
7256 format!("{is_insensitive:?}").into()
7257 } else {
7258 String::new().into()
7259 },
7260 if let Some(owner) = &self.owner {
7261 format!("{owner:?}").into()
7262 } else {
7263 String::new().into()
7264 },
7265 if let Some(set_permissions) = &self.set_permissions {
7266 format!("{set_permissions:?}").into()
7267 } else {
7268 String::new().into()
7269 },
7270 ]
7271 }
7272
7273 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7274 vec![
7275 "name".into(),
7276 "path".into(),
7277 "match_".into(),
7278 "matching_algorithm".into(),
7279 "is_insensitive".into(),
7280 "owner".into(),
7281 "set_permissions".into(),
7282 ]
7283 }
7284}
7285
7286#[derive(
7287 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7288)]
7289#[allow(non_snake_case)]
7290pub struct PatchedTagRequest {
7291 #[serde(default, skip_serializing_if = "Option::is_none")]
7292 pub name: Option<String>,
7293 #[serde(default, skip_serializing_if = "Option::is_none")]
7294 pub color: Option<String>,
7295 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
7296 pub match_: Option<String>,
7297 #[serde(default, skip_serializing_if = "Option::is_none")]
7298 pub matching_algorithm: Option<i64>,
7299 #[serde(default, skip_serializing_if = "Option::is_none")]
7300 pub is_insensitive: Option<bool>,
7301 #[doc = "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."]
7302 #[serde(default, skip_serializing_if = "Option::is_none")]
7303 pub is_inbox_tag: Option<bool>,
7304 #[serde(default, skip_serializing_if = "Option::is_none")]
7305 pub owner: Option<i64>,
7306 #[serde(default, skip_serializing_if = "Option::is_none")]
7307 pub set_permissions: Option<SetPermissions>,
7308}
7309
7310impl std::fmt::Display for PatchedTagRequest {
7311 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7312 write!(
7313 f,
7314 "{}",
7315 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7316 )
7317 }
7318}
7319
7320#[cfg(feature = "tabled")]
7321impl tabled::Tabled for PatchedTagRequest {
7322 const LENGTH: usize = 8;
7323 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7324 vec![
7325 if let Some(name) = &self.name {
7326 format!("{name:?}").into()
7327 } else {
7328 String::new().into()
7329 },
7330 if let Some(color) = &self.color {
7331 format!("{color:?}").into()
7332 } else {
7333 String::new().into()
7334 },
7335 if let Some(match_) = &self.match_ {
7336 format!("{match_:?}").into()
7337 } else {
7338 String::new().into()
7339 },
7340 if let Some(matching_algorithm) = &self.matching_algorithm {
7341 format!("{matching_algorithm:?}").into()
7342 } else {
7343 String::new().into()
7344 },
7345 if let Some(is_insensitive) = &self.is_insensitive {
7346 format!("{is_insensitive:?}").into()
7347 } else {
7348 String::new().into()
7349 },
7350 if let Some(is_inbox_tag) = &self.is_inbox_tag {
7351 format!("{is_inbox_tag:?}").into()
7352 } else {
7353 String::new().into()
7354 },
7355 if let Some(owner) = &self.owner {
7356 format!("{owner:?}").into()
7357 } else {
7358 String::new().into()
7359 },
7360 if let Some(set_permissions) = &self.set_permissions {
7361 format!("{set_permissions:?}").into()
7362 } else {
7363 String::new().into()
7364 },
7365 ]
7366 }
7367
7368 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7369 vec![
7370 "name".into(),
7371 "color".into(),
7372 "match_".into(),
7373 "matching_algorithm".into(),
7374 "is_insensitive".into(),
7375 "is_inbox_tag".into(),
7376 "owner".into(),
7377 "set_permissions".into(),
7378 ]
7379 }
7380}
7381
7382#[derive(
7383 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7384)]
7385#[allow(non_snake_case)]
7386pub struct PatchedUserRequest {
7387 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
7388 #[serde(default, skip_serializing_if = "Option::is_none")]
7389 pub username: Option<String>,
7390 #[serde(default, skip_serializing_if = "Option::is_none")]
7391 pub email: Option<String>,
7392 #[serde(default, skip_serializing_if = "Option::is_none")]
7393 pub password: Option<String>,
7394 #[serde(default, skip_serializing_if = "Option::is_none")]
7395 pub first_name: Option<String>,
7396 #[serde(default, skip_serializing_if = "Option::is_none")]
7397 pub last_name: Option<String>,
7398 #[serde(default, skip_serializing_if = "Option::is_none")]
7399 pub date_joined: Option<chrono::DateTime<chrono::Utc>>,
7400 #[doc = "Designates whether the user can log into this admin site."]
7401 #[serde(default, skip_serializing_if = "Option::is_none")]
7402 pub is_staff: Option<bool>,
7403 #[doc = "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."]
7404 #[serde(default, skip_serializing_if = "Option::is_none")]
7405 pub is_active: Option<bool>,
7406 #[doc = "Designates that this user has all permissions without explicitly assigning them."]
7407 #[serde(default, skip_serializing_if = "Option::is_none")]
7408 pub is_superuser: Option<bool>,
7409 #[doc = "The groups this user belongs to. A user will get all permissions granted to each of their groups."]
7410 #[serde(default, skip_serializing_if = "Option::is_none")]
7411 pub groups: Option<Vec<i64>>,
7412 #[serde(default, skip_serializing_if = "Option::is_none")]
7413 pub user_permissions: Option<Vec<String>>,
7414}
7415
7416impl std::fmt::Display for PatchedUserRequest {
7417 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7418 write!(
7419 f,
7420 "{}",
7421 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7422 )
7423 }
7424}
7425
7426#[cfg(feature = "tabled")]
7427impl tabled::Tabled for PatchedUserRequest {
7428 const LENGTH: usize = 11;
7429 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7430 vec![
7431 if let Some(username) = &self.username {
7432 format!("{username:?}").into()
7433 } else {
7434 String::new().into()
7435 },
7436 if let Some(email) = &self.email {
7437 format!("{email:?}").into()
7438 } else {
7439 String::new().into()
7440 },
7441 if let Some(password) = &self.password {
7442 format!("{password:?}").into()
7443 } else {
7444 String::new().into()
7445 },
7446 if let Some(first_name) = &self.first_name {
7447 format!("{first_name:?}").into()
7448 } else {
7449 String::new().into()
7450 },
7451 if let Some(last_name) = &self.last_name {
7452 format!("{last_name:?}").into()
7453 } else {
7454 String::new().into()
7455 },
7456 if let Some(date_joined) = &self.date_joined {
7457 format!("{date_joined:?}").into()
7458 } else {
7459 String::new().into()
7460 },
7461 if let Some(is_staff) = &self.is_staff {
7462 format!("{is_staff:?}").into()
7463 } else {
7464 String::new().into()
7465 },
7466 if let Some(is_active) = &self.is_active {
7467 format!("{is_active:?}").into()
7468 } else {
7469 String::new().into()
7470 },
7471 if let Some(is_superuser) = &self.is_superuser {
7472 format!("{is_superuser:?}").into()
7473 } else {
7474 String::new().into()
7475 },
7476 if let Some(groups) = &self.groups {
7477 format!("{groups:?}").into()
7478 } else {
7479 String::new().into()
7480 },
7481 if let Some(user_permissions) = &self.user_permissions {
7482 format!("{user_permissions:?}").into()
7483 } else {
7484 String::new().into()
7485 },
7486 ]
7487 }
7488
7489 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7490 vec![
7491 "username".into(),
7492 "email".into(),
7493 "password".into(),
7494 "first_name".into(),
7495 "last_name".into(),
7496 "date_joined".into(),
7497 "is_staff".into(),
7498 "is_active".into(),
7499 "is_superuser".into(),
7500 "groups".into(),
7501 "user_permissions".into(),
7502 ]
7503 }
7504}
7505
7506#[derive(
7507 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7508)]
7509#[allow(non_snake_case)]
7510pub struct PatchedWorkflowActionRequest {
7511 #[serde(default, skip_serializing_if = "Option::is_none")]
7512 pub id: Option<i64>,
7513 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
7514 pub type_: Option<i64>,
7515 #[doc = "Assign a document title, can include some placeholders, see documentation."]
7516 #[serde(default, skip_serializing_if = "Option::is_none")]
7517 pub assign_title: Option<String>,
7518 #[serde(default, skip_serializing_if = "Option::is_none")]
7519 pub assign_tags: Option<Vec<Option<i64>>>,
7520 #[serde(default, skip_serializing_if = "Option::is_none")]
7521 pub assign_correspondent: Option<i64>,
7522 #[serde(default, skip_serializing_if = "Option::is_none")]
7523 pub assign_document_type: Option<i64>,
7524 #[serde(default, skip_serializing_if = "Option::is_none")]
7525 pub assign_storage_path: Option<i64>,
7526 #[serde(default, skip_serializing_if = "Option::is_none")]
7527 pub assign_owner: Option<i64>,
7528 #[serde(default, skip_serializing_if = "Option::is_none")]
7529 pub assign_view_users: Option<Vec<i64>>,
7530 #[serde(default, skip_serializing_if = "Option::is_none")]
7531 pub assign_view_groups: Option<Vec<i64>>,
7532 #[serde(default, skip_serializing_if = "Option::is_none")]
7533 pub assign_change_users: Option<Vec<i64>>,
7534 #[serde(default, skip_serializing_if = "Option::is_none")]
7535 pub assign_change_groups: Option<Vec<i64>>,
7536 #[serde(default, skip_serializing_if = "Option::is_none")]
7537 pub assign_custom_fields: Option<Vec<i64>>,
7538 #[doc = "Optional values to assign to the custom fields."]
7539 #[serde(default, skip_serializing_if = "Option::is_none")]
7540 pub assign_custom_fields_values: Option<serde_json::Value>,
7541 #[serde(default, skip_serializing_if = "Option::is_none")]
7542 pub remove_all_tags: Option<bool>,
7543 #[serde(default, skip_serializing_if = "Option::is_none")]
7544 pub remove_tags: Option<Vec<i64>>,
7545 #[serde(default, skip_serializing_if = "Option::is_none")]
7546 pub remove_all_correspondents: Option<bool>,
7547 #[serde(default, skip_serializing_if = "Option::is_none")]
7548 pub remove_correspondents: Option<Vec<i64>>,
7549 #[serde(default, skip_serializing_if = "Option::is_none")]
7550 pub remove_all_document_types: Option<bool>,
7551 #[serde(default, skip_serializing_if = "Option::is_none")]
7552 pub remove_document_types: Option<Vec<i64>>,
7553 #[serde(default, skip_serializing_if = "Option::is_none")]
7554 pub remove_all_storage_paths: Option<bool>,
7555 #[serde(default, skip_serializing_if = "Option::is_none")]
7556 pub remove_storage_paths: Option<Vec<i64>>,
7557 #[serde(default, skip_serializing_if = "Option::is_none")]
7558 pub remove_custom_fields: Option<Vec<i64>>,
7559 #[serde(default, skip_serializing_if = "Option::is_none")]
7560 pub remove_all_custom_fields: Option<bool>,
7561 #[serde(default, skip_serializing_if = "Option::is_none")]
7562 pub remove_all_owners: Option<bool>,
7563 #[serde(default, skip_serializing_if = "Option::is_none")]
7564 pub remove_owners: Option<Vec<i64>>,
7565 #[serde(default, skip_serializing_if = "Option::is_none")]
7566 pub remove_all_permissions: Option<bool>,
7567 #[serde(default, skip_serializing_if = "Option::is_none")]
7568 pub remove_view_users: Option<Vec<i64>>,
7569 #[serde(default, skip_serializing_if = "Option::is_none")]
7570 pub remove_view_groups: Option<Vec<i64>>,
7571 #[serde(default, skip_serializing_if = "Option::is_none")]
7572 pub remove_change_users: Option<Vec<i64>>,
7573 #[serde(default, skip_serializing_if = "Option::is_none")]
7574 pub remove_change_groups: Option<Vec<i64>>,
7575 #[serde(default, skip_serializing_if = "Option::is_none")]
7576 pub email: Option<WorkflowActionEmailRequest>,
7577 #[serde(default, skip_serializing_if = "Option::is_none")]
7578 pub webhook: Option<WorkflowActionWebhookRequest>,
7579}
7580
7581impl std::fmt::Display for PatchedWorkflowActionRequest {
7582 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7583 write!(
7584 f,
7585 "{}",
7586 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7587 )
7588 }
7589}
7590
7591#[cfg(feature = "tabled")]
7592impl tabled::Tabled for PatchedWorkflowActionRequest {
7593 const LENGTH: usize = 33;
7594 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7595 vec![
7596 if let Some(id) = &self.id {
7597 format!("{id:?}").into()
7598 } else {
7599 String::new().into()
7600 },
7601 if let Some(type_) = &self.type_ {
7602 format!("{type_:?}").into()
7603 } else {
7604 String::new().into()
7605 },
7606 if let Some(assign_title) = &self.assign_title {
7607 format!("{assign_title:?}").into()
7608 } else {
7609 String::new().into()
7610 },
7611 if let Some(assign_tags) = &self.assign_tags {
7612 format!("{assign_tags:?}").into()
7613 } else {
7614 String::new().into()
7615 },
7616 if let Some(assign_correspondent) = &self.assign_correspondent {
7617 format!("{assign_correspondent:?}").into()
7618 } else {
7619 String::new().into()
7620 },
7621 if let Some(assign_document_type) = &self.assign_document_type {
7622 format!("{assign_document_type:?}").into()
7623 } else {
7624 String::new().into()
7625 },
7626 if let Some(assign_storage_path) = &self.assign_storage_path {
7627 format!("{assign_storage_path:?}").into()
7628 } else {
7629 String::new().into()
7630 },
7631 if let Some(assign_owner) = &self.assign_owner {
7632 format!("{assign_owner:?}").into()
7633 } else {
7634 String::new().into()
7635 },
7636 if let Some(assign_view_users) = &self.assign_view_users {
7637 format!("{assign_view_users:?}").into()
7638 } else {
7639 String::new().into()
7640 },
7641 if let Some(assign_view_groups) = &self.assign_view_groups {
7642 format!("{assign_view_groups:?}").into()
7643 } else {
7644 String::new().into()
7645 },
7646 if let Some(assign_change_users) = &self.assign_change_users {
7647 format!("{assign_change_users:?}").into()
7648 } else {
7649 String::new().into()
7650 },
7651 if let Some(assign_change_groups) = &self.assign_change_groups {
7652 format!("{assign_change_groups:?}").into()
7653 } else {
7654 String::new().into()
7655 },
7656 if let Some(assign_custom_fields) = &self.assign_custom_fields {
7657 format!("{assign_custom_fields:?}").into()
7658 } else {
7659 String::new().into()
7660 },
7661 if let Some(assign_custom_fields_values) = &self.assign_custom_fields_values {
7662 format!("{assign_custom_fields_values:?}").into()
7663 } else {
7664 String::new().into()
7665 },
7666 if let Some(remove_all_tags) = &self.remove_all_tags {
7667 format!("{remove_all_tags:?}").into()
7668 } else {
7669 String::new().into()
7670 },
7671 if let Some(remove_tags) = &self.remove_tags {
7672 format!("{remove_tags:?}").into()
7673 } else {
7674 String::new().into()
7675 },
7676 if let Some(remove_all_correspondents) = &self.remove_all_correspondents {
7677 format!("{remove_all_correspondents:?}").into()
7678 } else {
7679 String::new().into()
7680 },
7681 if let Some(remove_correspondents) = &self.remove_correspondents {
7682 format!("{remove_correspondents:?}").into()
7683 } else {
7684 String::new().into()
7685 },
7686 if let Some(remove_all_document_types) = &self.remove_all_document_types {
7687 format!("{remove_all_document_types:?}").into()
7688 } else {
7689 String::new().into()
7690 },
7691 if let Some(remove_document_types) = &self.remove_document_types {
7692 format!("{remove_document_types:?}").into()
7693 } else {
7694 String::new().into()
7695 },
7696 if let Some(remove_all_storage_paths) = &self.remove_all_storage_paths {
7697 format!("{remove_all_storage_paths:?}").into()
7698 } else {
7699 String::new().into()
7700 },
7701 if let Some(remove_storage_paths) = &self.remove_storage_paths {
7702 format!("{remove_storage_paths:?}").into()
7703 } else {
7704 String::new().into()
7705 },
7706 if let Some(remove_custom_fields) = &self.remove_custom_fields {
7707 format!("{remove_custom_fields:?}").into()
7708 } else {
7709 String::new().into()
7710 },
7711 if let Some(remove_all_custom_fields) = &self.remove_all_custom_fields {
7712 format!("{remove_all_custom_fields:?}").into()
7713 } else {
7714 String::new().into()
7715 },
7716 if let Some(remove_all_owners) = &self.remove_all_owners {
7717 format!("{remove_all_owners:?}").into()
7718 } else {
7719 String::new().into()
7720 },
7721 if let Some(remove_owners) = &self.remove_owners {
7722 format!("{remove_owners:?}").into()
7723 } else {
7724 String::new().into()
7725 },
7726 if let Some(remove_all_permissions) = &self.remove_all_permissions {
7727 format!("{remove_all_permissions:?}").into()
7728 } else {
7729 String::new().into()
7730 },
7731 if let Some(remove_view_users) = &self.remove_view_users {
7732 format!("{remove_view_users:?}").into()
7733 } else {
7734 String::new().into()
7735 },
7736 if let Some(remove_view_groups) = &self.remove_view_groups {
7737 format!("{remove_view_groups:?}").into()
7738 } else {
7739 String::new().into()
7740 },
7741 if let Some(remove_change_users) = &self.remove_change_users {
7742 format!("{remove_change_users:?}").into()
7743 } else {
7744 String::new().into()
7745 },
7746 if let Some(remove_change_groups) = &self.remove_change_groups {
7747 format!("{remove_change_groups:?}").into()
7748 } else {
7749 String::new().into()
7750 },
7751 if let Some(email) = &self.email {
7752 format!("{email:?}").into()
7753 } else {
7754 String::new().into()
7755 },
7756 if let Some(webhook) = &self.webhook {
7757 format!("{webhook:?}").into()
7758 } else {
7759 String::new().into()
7760 },
7761 ]
7762 }
7763
7764 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7765 vec![
7766 "id".into(),
7767 "type_".into(),
7768 "assign_title".into(),
7769 "assign_tags".into(),
7770 "assign_correspondent".into(),
7771 "assign_document_type".into(),
7772 "assign_storage_path".into(),
7773 "assign_owner".into(),
7774 "assign_view_users".into(),
7775 "assign_view_groups".into(),
7776 "assign_change_users".into(),
7777 "assign_change_groups".into(),
7778 "assign_custom_fields".into(),
7779 "assign_custom_fields_values".into(),
7780 "remove_all_tags".into(),
7781 "remove_tags".into(),
7782 "remove_all_correspondents".into(),
7783 "remove_correspondents".into(),
7784 "remove_all_document_types".into(),
7785 "remove_document_types".into(),
7786 "remove_all_storage_paths".into(),
7787 "remove_storage_paths".into(),
7788 "remove_custom_fields".into(),
7789 "remove_all_custom_fields".into(),
7790 "remove_all_owners".into(),
7791 "remove_owners".into(),
7792 "remove_all_permissions".into(),
7793 "remove_view_users".into(),
7794 "remove_view_groups".into(),
7795 "remove_change_users".into(),
7796 "remove_change_groups".into(),
7797 "email".into(),
7798 "webhook".into(),
7799 ]
7800 }
7801}
7802
7803#[derive(
7804 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7805)]
7806#[allow(non_snake_case)]
7807pub struct PatchedWorkflowRequest {
7808 #[serde(default, skip_serializing_if = "Option::is_none")]
7809 pub name: Option<String>,
7810 #[serde(default, skip_serializing_if = "Option::is_none")]
7811 pub order: Option<i64>,
7812 #[serde(default, skip_serializing_if = "Option::is_none")]
7813 pub enabled: Option<bool>,
7814 #[serde(default, skip_serializing_if = "Option::is_none")]
7815 pub triggers: Option<Vec<WorkflowTriggerRequest>>,
7816 #[serde(default, skip_serializing_if = "Option::is_none")]
7817 pub actions: Option<Vec<WorkflowActionRequest>>,
7818}
7819
7820impl std::fmt::Display for PatchedWorkflowRequest {
7821 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7822 write!(
7823 f,
7824 "{}",
7825 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7826 )
7827 }
7828}
7829
7830#[cfg(feature = "tabled")]
7831impl tabled::Tabled for PatchedWorkflowRequest {
7832 const LENGTH: usize = 5;
7833 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7834 vec![
7835 if let Some(name) = &self.name {
7836 format!("{name:?}").into()
7837 } else {
7838 String::new().into()
7839 },
7840 if let Some(order) = &self.order {
7841 format!("{order:?}").into()
7842 } else {
7843 String::new().into()
7844 },
7845 if let Some(enabled) = &self.enabled {
7846 format!("{enabled:?}").into()
7847 } else {
7848 String::new().into()
7849 },
7850 if let Some(triggers) = &self.triggers {
7851 format!("{triggers:?}").into()
7852 } else {
7853 String::new().into()
7854 },
7855 if let Some(actions) = &self.actions {
7856 format!("{actions:?}").into()
7857 } else {
7858 String::new().into()
7859 },
7860 ]
7861 }
7862
7863 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7864 vec![
7865 "name".into(),
7866 "order".into(),
7867 "enabled".into(),
7868 "triggers".into(),
7869 "actions".into(),
7870 ]
7871 }
7872}
7873
7874#[derive(
7875 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7876)]
7877#[allow(non_snake_case)]
7878pub struct PatchedWorkflowTriggerRequest {
7879 #[serde(default, skip_serializing_if = "Option::is_none")]
7880 pub id: Option<i64>,
7881 #[serde(default)]
7882 pub sources: Vec<i64>,
7883 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
7884 pub type_: Option<i64>,
7885 #[doc = "Only consume documents with a path that matches this if specified. Wildcards specified as * are allowed. Case insensitive."]
7886 #[serde(default, skip_serializing_if = "Option::is_none")]
7887 pub filter_path: Option<String>,
7888 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
7889 #[serde(default, skip_serializing_if = "Option::is_none")]
7890 pub filter_filename: Option<String>,
7891 #[serde(default, skip_serializing_if = "Option::is_none")]
7892 pub filter_mailrule: Option<i64>,
7893 #[serde(default, skip_serializing_if = "Option::is_none")]
7894 pub matching_algorithm: Option<i64>,
7895 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
7896 pub match_: Option<String>,
7897 #[serde(default, skip_serializing_if = "Option::is_none")]
7898 pub is_insensitive: Option<bool>,
7899 #[serde(default, skip_serializing_if = "Option::is_none")]
7900 pub filter_has_tags: Option<Vec<i64>>,
7901 #[serde(default, skip_serializing_if = "Option::is_none")]
7902 pub filter_has_correspondent: Option<i64>,
7903 #[serde(default, skip_serializing_if = "Option::is_none")]
7904 pub filter_has_document_type: Option<i64>,
7905 #[doc = "The number of days to offset the schedule trigger by."]
7906 #[serde(default, skip_serializing_if = "Option::is_none")]
7907 pub schedule_offset_days: Option<i64>,
7908 #[doc = "If the schedule should be recurring."]
7909 #[serde(default, skip_serializing_if = "Option::is_none")]
7910 pub schedule_is_recurring: Option<bool>,
7911 #[doc = "The number of days between recurring schedule triggers."]
7912 #[serde(default, skip_serializing_if = "Option::is_none")]
7913 pub schedule_recurring_interval_days: Option<i64>,
7914 #[doc = "The field to check for a schedule trigger.\n\n* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
7915 #[serde(default, skip_serializing_if = "Option::is_none")]
7916 pub schedule_date_field: Option<ScheduleDateFieldEnum>,
7917 #[serde(default, skip_serializing_if = "Option::is_none")]
7918 pub schedule_date_custom_field: Option<i64>,
7919}
7920
7921impl std::fmt::Display for PatchedWorkflowTriggerRequest {
7922 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7923 write!(
7924 f,
7925 "{}",
7926 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7927 )
7928 }
7929}
7930
7931#[cfg(feature = "tabled")]
7932impl tabled::Tabled for PatchedWorkflowTriggerRequest {
7933 const LENGTH: usize = 17;
7934 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7935 vec![
7936 if let Some(id) = &self.id {
7937 format!("{id:?}").into()
7938 } else {
7939 String::new().into()
7940 },
7941 format!("{:?}", self.sources).into(),
7942 if let Some(type_) = &self.type_ {
7943 format!("{type_:?}").into()
7944 } else {
7945 String::new().into()
7946 },
7947 if let Some(filter_path) = &self.filter_path {
7948 format!("{filter_path:?}").into()
7949 } else {
7950 String::new().into()
7951 },
7952 if let Some(filter_filename) = &self.filter_filename {
7953 format!("{filter_filename:?}").into()
7954 } else {
7955 String::new().into()
7956 },
7957 if let Some(filter_mailrule) = &self.filter_mailrule {
7958 format!("{filter_mailrule:?}").into()
7959 } else {
7960 String::new().into()
7961 },
7962 if let Some(matching_algorithm) = &self.matching_algorithm {
7963 format!("{matching_algorithm:?}").into()
7964 } else {
7965 String::new().into()
7966 },
7967 if let Some(match_) = &self.match_ {
7968 format!("{match_:?}").into()
7969 } else {
7970 String::new().into()
7971 },
7972 if let Some(is_insensitive) = &self.is_insensitive {
7973 format!("{is_insensitive:?}").into()
7974 } else {
7975 String::new().into()
7976 },
7977 if let Some(filter_has_tags) = &self.filter_has_tags {
7978 format!("{filter_has_tags:?}").into()
7979 } else {
7980 String::new().into()
7981 },
7982 if let Some(filter_has_correspondent) = &self.filter_has_correspondent {
7983 format!("{filter_has_correspondent:?}").into()
7984 } else {
7985 String::new().into()
7986 },
7987 if let Some(filter_has_document_type) = &self.filter_has_document_type {
7988 format!("{filter_has_document_type:?}").into()
7989 } else {
7990 String::new().into()
7991 },
7992 if let Some(schedule_offset_days) = &self.schedule_offset_days {
7993 format!("{schedule_offset_days:?}").into()
7994 } else {
7995 String::new().into()
7996 },
7997 if let Some(schedule_is_recurring) = &self.schedule_is_recurring {
7998 format!("{schedule_is_recurring:?}").into()
7999 } else {
8000 String::new().into()
8001 },
8002 if let Some(schedule_recurring_interval_days) = &self.schedule_recurring_interval_days {
8003 format!("{schedule_recurring_interval_days:?}").into()
8004 } else {
8005 String::new().into()
8006 },
8007 if let Some(schedule_date_field) = &self.schedule_date_field {
8008 format!("{schedule_date_field:?}").into()
8009 } else {
8010 String::new().into()
8011 },
8012 if let Some(schedule_date_custom_field) = &self.schedule_date_custom_field {
8013 format!("{schedule_date_custom_field:?}").into()
8014 } else {
8015 String::new().into()
8016 },
8017 ]
8018 }
8019
8020 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8021 vec![
8022 "id".into(),
8023 "sources".into(),
8024 "type_".into(),
8025 "filter_path".into(),
8026 "filter_filename".into(),
8027 "filter_mailrule".into(),
8028 "matching_algorithm".into(),
8029 "match_".into(),
8030 "is_insensitive".into(),
8031 "filter_has_tags".into(),
8032 "filter_has_correspondent".into(),
8033 "filter_has_document_type".into(),
8034 "schedule_offset_days".into(),
8035 "schedule_is_recurring".into(),
8036 "schedule_recurring_interval_days".into(),
8037 "schedule_date_field".into(),
8038 "schedule_date_custom_field".into(),
8039 ]
8040 }
8041}
8042
8043#[derive(
8044 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8045)]
8046#[allow(non_snake_case)]
8047pub struct PostDocumentRequest {
8048 #[serde(default, skip_serializing_if = "Option::is_none")]
8049 pub created: Option<chrono::DateTime<chrono::Utc>>,
8050 pub document: bytes::Bytes,
8051 #[serde(default, skip_serializing_if = "Option::is_none")]
8052 pub title: Option<String>,
8053 #[serde(default, skip_serializing_if = "Option::is_none")]
8054 pub correspondent: Option<i64>,
8055 #[serde(default, skip_serializing_if = "Option::is_none")]
8056 pub document_type: Option<i64>,
8057 #[serde(default, skip_serializing_if = "Option::is_none")]
8058 pub storage_path: Option<i64>,
8059 #[serde(default, skip_serializing_if = "Option::is_none")]
8060 pub tags: Option<Vec<i64>>,
8061 #[serde(default, skip_serializing_if = "Option::is_none")]
8062 pub archive_serial_number: Option<i64>,
8063 #[serde(default, skip_serializing_if = "Option::is_none")]
8064 pub custom_fields: Option<Vec<i64>>,
8065 #[serde(default, skip_serializing_if = "Option::is_none")]
8066 pub from_webui: Option<bool>,
8067}
8068
8069impl std::fmt::Display for PostDocumentRequest {
8070 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8071 write!(
8072 f,
8073 "{}",
8074 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8075 )
8076 }
8077}
8078
8079#[cfg(feature = "tabled")]
8080impl tabled::Tabled for PostDocumentRequest {
8081 const LENGTH: usize = 10;
8082 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8083 vec![
8084 if let Some(created) = &self.created {
8085 format!("{created:?}").into()
8086 } else {
8087 String::new().into()
8088 },
8089 format!("{:?}", self.document).into(),
8090 if let Some(title) = &self.title {
8091 format!("{title:?}").into()
8092 } else {
8093 String::new().into()
8094 },
8095 if let Some(correspondent) = &self.correspondent {
8096 format!("{correspondent:?}").into()
8097 } else {
8098 String::new().into()
8099 },
8100 if let Some(document_type) = &self.document_type {
8101 format!("{document_type:?}").into()
8102 } else {
8103 String::new().into()
8104 },
8105 if let Some(storage_path) = &self.storage_path {
8106 format!("{storage_path:?}").into()
8107 } else {
8108 String::new().into()
8109 },
8110 if let Some(tags) = &self.tags {
8111 format!("{tags:?}").into()
8112 } else {
8113 String::new().into()
8114 },
8115 if let Some(archive_serial_number) = &self.archive_serial_number {
8116 format!("{archive_serial_number:?}").into()
8117 } else {
8118 String::new().into()
8119 },
8120 if let Some(custom_fields) = &self.custom_fields {
8121 format!("{custom_fields:?}").into()
8122 } else {
8123 String::new().into()
8124 },
8125 if let Some(from_webui) = &self.from_webui {
8126 format!("{from_webui:?}").into()
8127 } else {
8128 String::new().into()
8129 },
8130 ]
8131 }
8132
8133 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8134 vec![
8135 "created".into(),
8136 "document".into(),
8137 "title".into(),
8138 "correspondent".into(),
8139 "document_type".into(),
8140 "storage_path".into(),
8141 "tags".into(),
8142 "archive_serial_number".into(),
8143 "custom_fields".into(),
8144 "from_webui".into(),
8145 ]
8146 }
8147}
8148
8149#[derive(
8150 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8151)]
8152#[allow(non_snake_case)]
8153pub struct Profile {
8154 #[serde(default, skip_serializing_if = "Option::is_none")]
8155 pub email: Option<String>,
8156 #[serde(default, skip_serializing_if = "Option::is_none")]
8157 pub password: Option<String>,
8158 #[serde(default, skip_serializing_if = "Option::is_none")]
8159 pub first_name: Option<String>,
8160 #[serde(default, skip_serializing_if = "Option::is_none")]
8161 pub last_name: Option<String>,
8162 pub auth_token: String,
8163 pub social_accounts: Vec<SocialAccount>,
8164 pub has_usable_password: bool,
8165 pub is_mfa_enabled: bool,
8166}
8167
8168impl std::fmt::Display for Profile {
8169 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8170 write!(
8171 f,
8172 "{}",
8173 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8174 )
8175 }
8176}
8177
8178#[cfg(feature = "tabled")]
8179impl tabled::Tabled for Profile {
8180 const LENGTH: usize = 8;
8181 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8182 vec![
8183 if let Some(email) = &self.email {
8184 format!("{email:?}").into()
8185 } else {
8186 String::new().into()
8187 },
8188 if let Some(password) = &self.password {
8189 format!("{password:?}").into()
8190 } else {
8191 String::new().into()
8192 },
8193 if let Some(first_name) = &self.first_name {
8194 format!("{first_name:?}").into()
8195 } else {
8196 String::new().into()
8197 },
8198 if let Some(last_name) = &self.last_name {
8199 format!("{last_name:?}").into()
8200 } else {
8201 String::new().into()
8202 },
8203 self.auth_token.clone().into(),
8204 format!("{:?}", self.social_accounts).into(),
8205 format!("{:?}", self.has_usable_password).into(),
8206 format!("{:?}", self.is_mfa_enabled).into(),
8207 ]
8208 }
8209
8210 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8211 vec![
8212 "email".into(),
8213 "password".into(),
8214 "first_name".into(),
8215 "last_name".into(),
8216 "auth_token".into(),
8217 "social_accounts".into(),
8218 "has_usable_password".into(),
8219 "is_mfa_enabled".into(),
8220 ]
8221 }
8222}
8223
8224#[derive(
8225 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8226)]
8227#[allow(non_snake_case)]
8228pub struct SanityCheck {
8229 pub status: String,
8230 pub error: String,
8231 pub last_run: chrono::DateTime<chrono::Utc>,
8232}
8233
8234impl std::fmt::Display for SanityCheck {
8235 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8236 write!(
8237 f,
8238 "{}",
8239 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8240 )
8241 }
8242}
8243
8244#[cfg(feature = "tabled")]
8245impl tabled::Tabled for SanityCheck {
8246 const LENGTH: usize = 3;
8247 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8248 vec![
8249 self.status.clone().into(),
8250 self.error.clone().into(),
8251 format!("{:?}", self.last_run).into(),
8252 ]
8253 }
8254
8255 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8256 vec!["status".into(), "error".into(), "last_run".into()]
8257 }
8258}
8259
8260#[derive(
8261 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8262)]
8263#[allow(non_snake_case)]
8264pub struct SavedView {
8265 pub id: i64,
8266 pub name: String,
8267 pub show_on_dashboard: bool,
8268 pub show_in_sidebar: bool,
8269 #[serde(default, skip_serializing_if = "Option::is_none")]
8270 pub sort_field: Option<String>,
8271 #[serde(default, skip_serializing_if = "Option::is_none")]
8272 pub sort_reverse: Option<bool>,
8273 pub filter_rules: Vec<SavedViewFilterRule>,
8274 #[serde(default, skip_serializing_if = "Option::is_none")]
8275 pub page_size: Option<i64>,
8276 #[serde(default, skip_serializing_if = "Option::is_none")]
8277 pub display_mode: Option<DisplayMode>,
8278 #[serde(default, skip_serializing_if = "Option::is_none")]
8279 pub display_fields: Option<serde_json::Value>,
8280 #[serde(default, skip_serializing_if = "Option::is_none")]
8281 pub owner: Option<i64>,
8282 pub user_can_change: bool,
8283}
8284
8285impl std::fmt::Display for SavedView {
8286 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8287 write!(
8288 f,
8289 "{}",
8290 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8291 )
8292 }
8293}
8294
8295#[cfg(feature = "tabled")]
8296impl tabled::Tabled for SavedView {
8297 const LENGTH: usize = 12;
8298 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8299 vec![
8300 format!("{:?}", self.id).into(),
8301 self.name.clone().into(),
8302 format!("{:?}", self.show_on_dashboard).into(),
8303 format!("{:?}", self.show_in_sidebar).into(),
8304 if let Some(sort_field) = &self.sort_field {
8305 format!("{sort_field:?}").into()
8306 } else {
8307 String::new().into()
8308 },
8309 if let Some(sort_reverse) = &self.sort_reverse {
8310 format!("{sort_reverse:?}").into()
8311 } else {
8312 String::new().into()
8313 },
8314 format!("{:?}", self.filter_rules).into(),
8315 if let Some(page_size) = &self.page_size {
8316 format!("{page_size:?}").into()
8317 } else {
8318 String::new().into()
8319 },
8320 if let Some(display_mode) = &self.display_mode {
8321 format!("{display_mode:?}").into()
8322 } else {
8323 String::new().into()
8324 },
8325 if let Some(display_fields) = &self.display_fields {
8326 format!("{display_fields:?}").into()
8327 } else {
8328 String::new().into()
8329 },
8330 if let Some(owner) = &self.owner {
8331 format!("{owner:?}").into()
8332 } else {
8333 String::new().into()
8334 },
8335 format!("{:?}", self.user_can_change).into(),
8336 ]
8337 }
8338
8339 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8340 vec![
8341 "id".into(),
8342 "name".into(),
8343 "show_on_dashboard".into(),
8344 "show_in_sidebar".into(),
8345 "sort_field".into(),
8346 "sort_reverse".into(),
8347 "filter_rules".into(),
8348 "page_size".into(),
8349 "display_mode".into(),
8350 "display_fields".into(),
8351 "owner".into(),
8352 "user_can_change".into(),
8353 ]
8354 }
8355}
8356
8357#[derive(
8358 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8359)]
8360#[allow(non_snake_case)]
8361pub struct SavedViewFilterRule {
8362 pub rule_type: i64,
8363 #[serde(default, skip_serializing_if = "Option::is_none")]
8364 pub value: Option<String>,
8365}
8366
8367impl std::fmt::Display for SavedViewFilterRule {
8368 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8369 write!(
8370 f,
8371 "{}",
8372 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8373 )
8374 }
8375}
8376
8377#[cfg(feature = "tabled")]
8378impl tabled::Tabled for SavedViewFilterRule {
8379 const LENGTH: usize = 2;
8380 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8381 vec![
8382 format!("{:?}", self.rule_type).into(),
8383 if let Some(value) = &self.value {
8384 format!("{value:?}").into()
8385 } else {
8386 String::new().into()
8387 },
8388 ]
8389 }
8390
8391 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8392 vec!["rule_type".into(), "value".into()]
8393 }
8394}
8395
8396#[derive(
8397 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8398)]
8399#[allow(non_snake_case)]
8400pub struct SavedViewFilterRuleRequest {
8401 pub rule_type: i64,
8402 #[serde(default, skip_serializing_if = "Option::is_none")]
8403 pub value: Option<String>,
8404}
8405
8406impl std::fmt::Display for SavedViewFilterRuleRequest {
8407 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8408 write!(
8409 f,
8410 "{}",
8411 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8412 )
8413 }
8414}
8415
8416#[cfg(feature = "tabled")]
8417impl tabled::Tabled for SavedViewFilterRuleRequest {
8418 const LENGTH: usize = 2;
8419 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8420 vec![
8421 format!("{:?}", self.rule_type).into(),
8422 if let Some(value) = &self.value {
8423 format!("{value:?}").into()
8424 } else {
8425 String::new().into()
8426 },
8427 ]
8428 }
8429
8430 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8431 vec!["rule_type".into(), "value".into()]
8432 }
8433}
8434
8435#[derive(
8436 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8437)]
8438#[allow(non_snake_case)]
8439pub struct SavedViewRequest {
8440 pub name: String,
8441 pub show_on_dashboard: bool,
8442 pub show_in_sidebar: bool,
8443 #[serde(default, skip_serializing_if = "Option::is_none")]
8444 pub sort_field: Option<String>,
8445 #[serde(default, skip_serializing_if = "Option::is_none")]
8446 pub sort_reverse: Option<bool>,
8447 pub filter_rules: Vec<SavedViewFilterRuleRequest>,
8448 #[serde(default, skip_serializing_if = "Option::is_none")]
8449 pub page_size: Option<i64>,
8450 #[serde(default, skip_serializing_if = "Option::is_none")]
8451 pub display_mode: Option<DisplayMode>,
8452 #[serde(default, skip_serializing_if = "Option::is_none")]
8453 pub display_fields: Option<serde_json::Value>,
8454 #[serde(default, skip_serializing_if = "Option::is_none")]
8455 pub owner: Option<i64>,
8456}
8457
8458impl std::fmt::Display for SavedViewRequest {
8459 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8460 write!(
8461 f,
8462 "{}",
8463 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8464 )
8465 }
8466}
8467
8468#[cfg(feature = "tabled")]
8469impl tabled::Tabled for SavedViewRequest {
8470 const LENGTH: usize = 10;
8471 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8472 vec![
8473 self.name.clone().into(),
8474 format!("{:?}", self.show_on_dashboard).into(),
8475 format!("{:?}", self.show_in_sidebar).into(),
8476 if let Some(sort_field) = &self.sort_field {
8477 format!("{sort_field:?}").into()
8478 } else {
8479 String::new().into()
8480 },
8481 if let Some(sort_reverse) = &self.sort_reverse {
8482 format!("{sort_reverse:?}").into()
8483 } else {
8484 String::new().into()
8485 },
8486 format!("{:?}", self.filter_rules).into(),
8487 if let Some(page_size) = &self.page_size {
8488 format!("{page_size:?}").into()
8489 } else {
8490 String::new().into()
8491 },
8492 if let Some(display_mode) = &self.display_mode {
8493 format!("{display_mode:?}").into()
8494 } else {
8495 String::new().into()
8496 },
8497 if let Some(display_fields) = &self.display_fields {
8498 format!("{display_fields:?}").into()
8499 } else {
8500 String::new().into()
8501 },
8502 if let Some(owner) = &self.owner {
8503 format!("{owner:?}").into()
8504 } else {
8505 String::new().into()
8506 },
8507 ]
8508 }
8509
8510 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8511 vec![
8512 "name".into(),
8513 "show_on_dashboard".into(),
8514 "show_in_sidebar".into(),
8515 "sort_field".into(),
8516 "sort_reverse".into(),
8517 "filter_rules".into(),
8518 "page_size".into(),
8519 "display_mode".into(),
8520 "display_fields".into(),
8521 "owner".into(),
8522 ]
8523 }
8524}
8525
8526#[doc = "* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
8527#[derive(
8528 serde :: Serialize,
8529 serde :: Deserialize,
8530 PartialEq,
8531 Hash,
8532 Debug,
8533 Clone,
8534 schemars :: JsonSchema,
8535 parse_display :: FromStr,
8536 parse_display :: Display,
8537)]
8538#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
8539#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8540pub enum ScheduleDateFieldEnum {
8541 #[serde(rename = "added")]
8542 #[display("added")]
8543 Added,
8544 #[serde(rename = "created")]
8545 #[display("created")]
8546 Created,
8547 #[serde(rename = "modified")]
8548 #[display("modified")]
8549 Modified,
8550 #[serde(rename = "custom_field")]
8551 #[display("custom_field")]
8552 CustomField,
8553}
8554
8555#[derive(
8556 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8557)]
8558#[allow(non_snake_case)]
8559pub struct SearchResult {
8560 pub total: i64,
8561 pub documents: Vec<Document>,
8562 pub saved_views: Vec<SavedView>,
8563 pub tags: Vec<Tag>,
8564 pub correspondents: Vec<Correspondent>,
8565 pub document_types: Vec<DocumentType>,
8566 pub storage_paths: Vec<StoragePath>,
8567 pub users: Vec<User>,
8568 pub groups: Vec<Group>,
8569 pub mail_rules: Vec<MailRule>,
8570 pub mail_accounts: Vec<MailAccount>,
8571 pub workflows: Vec<Workflow>,
8572 pub custom_fields: Vec<CustomField>,
8573}
8574
8575impl std::fmt::Display for SearchResult {
8576 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8577 write!(
8578 f,
8579 "{}",
8580 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8581 )
8582 }
8583}
8584
8585#[cfg(feature = "tabled")]
8586impl tabled::Tabled for SearchResult {
8587 const LENGTH: usize = 13;
8588 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8589 vec![
8590 format!("{:?}", self.total).into(),
8591 format!("{:?}", self.documents).into(),
8592 format!("{:?}", self.saved_views).into(),
8593 format!("{:?}", self.tags).into(),
8594 format!("{:?}", self.correspondents).into(),
8595 format!("{:?}", self.document_types).into(),
8596 format!("{:?}", self.storage_paths).into(),
8597 format!("{:?}", self.users).into(),
8598 format!("{:?}", self.groups).into(),
8599 format!("{:?}", self.mail_rules).into(),
8600 format!("{:?}", self.mail_accounts).into(),
8601 format!("{:?}", self.workflows).into(),
8602 format!("{:?}", self.custom_fields).into(),
8603 ]
8604 }
8605
8606 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8607 vec![
8608 "total".into(),
8609 "documents".into(),
8610 "saved_views".into(),
8611 "tags".into(),
8612 "correspondents".into(),
8613 "document_types".into(),
8614 "storage_paths".into(),
8615 "users".into(),
8616 "groups".into(),
8617 "mail_rules".into(),
8618 "mail_accounts".into(),
8619 "workflows".into(),
8620 "custom_fields".into(),
8621 ]
8622 }
8623}
8624
8625#[derive(
8626 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8627)]
8628#[allow(non_snake_case)]
8629pub struct SelectionData {
8630 pub selected_correspondents: Vec<CorrespondentCounts>,
8631 pub selected_tags: Vec<TagCounts>,
8632 pub selected_document_types: Vec<DocumentTypeCounts>,
8633 pub selected_storage_paths: Vec<StoragePathCounts>,
8634 pub selected_custom_fields: Vec<CustomFieldCounts>,
8635}
8636
8637impl std::fmt::Display for SelectionData {
8638 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8639 write!(
8640 f,
8641 "{}",
8642 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8643 )
8644 }
8645}
8646
8647#[cfg(feature = "tabled")]
8648impl tabled::Tabled for SelectionData {
8649 const LENGTH: usize = 5;
8650 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8651 vec![
8652 format!("{:?}", self.selected_correspondents).into(),
8653 format!("{:?}", self.selected_tags).into(),
8654 format!("{:?}", self.selected_document_types).into(),
8655 format!("{:?}", self.selected_storage_paths).into(),
8656 format!("{:?}", self.selected_custom_fields).into(),
8657 ]
8658 }
8659
8660 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8661 vec![
8662 "selected_correspondents".into(),
8663 "selected_tags".into(),
8664 "selected_document_types".into(),
8665 "selected_storage_paths".into(),
8666 "selected_custom_fields".into(),
8667 ]
8668 }
8669}
8670
8671#[derive(
8672 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8673)]
8674#[allow(non_snake_case)]
8675pub struct ShareLink {
8676 pub id: i64,
8677 pub created: chrono::DateTime<chrono::Utc>,
8678 #[serde(default, skip_serializing_if = "Option::is_none")]
8679 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
8680 pub slug: String,
8681 #[serde(default, skip_serializing_if = "Option::is_none")]
8682 pub document: Option<i64>,
8683 #[doc = "* `archive` - Archive\n* `original` - Original"]
8684 #[serde(default, skip_serializing_if = "Option::is_none")]
8685 pub file_version: Option<FileVersionEnum>,
8686}
8687
8688impl std::fmt::Display for ShareLink {
8689 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8690 write!(
8691 f,
8692 "{}",
8693 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8694 )
8695 }
8696}
8697
8698#[cfg(feature = "tabled")]
8699impl tabled::Tabled for ShareLink {
8700 const LENGTH: usize = 6;
8701 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8702 vec![
8703 format!("{:?}", self.id).into(),
8704 format!("{:?}", self.created).into(),
8705 if let Some(expiration) = &self.expiration {
8706 format!("{expiration:?}").into()
8707 } else {
8708 String::new().into()
8709 },
8710 self.slug.clone().into(),
8711 if let Some(document) = &self.document {
8712 format!("{document:?}").into()
8713 } else {
8714 String::new().into()
8715 },
8716 if let Some(file_version) = &self.file_version {
8717 format!("{file_version:?}").into()
8718 } else {
8719 String::new().into()
8720 },
8721 ]
8722 }
8723
8724 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8725 vec![
8726 "id".into(),
8727 "created".into(),
8728 "expiration".into(),
8729 "slug".into(),
8730 "document".into(),
8731 "file_version".into(),
8732 ]
8733 }
8734}
8735
8736#[derive(
8737 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8738)]
8739#[allow(non_snake_case)]
8740pub struct ShareLinkRequest {
8741 #[serde(default, skip_serializing_if = "Option::is_none")]
8742 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
8743 #[serde(default, skip_serializing_if = "Option::is_none")]
8744 pub document: Option<i64>,
8745 #[doc = "* `archive` - Archive\n* `original` - Original"]
8746 #[serde(default, skip_serializing_if = "Option::is_none")]
8747 pub file_version: Option<FileVersionEnum>,
8748}
8749
8750impl std::fmt::Display for ShareLinkRequest {
8751 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8752 write!(
8753 f,
8754 "{}",
8755 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8756 )
8757 }
8758}
8759
8760#[cfg(feature = "tabled")]
8761impl tabled::Tabled for ShareLinkRequest {
8762 const LENGTH: usize = 3;
8763 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8764 vec![
8765 if let Some(expiration) = &self.expiration {
8766 format!("{expiration:?}").into()
8767 } else {
8768 String::new().into()
8769 },
8770 if let Some(document) = &self.document {
8771 format!("{document:?}").into()
8772 } else {
8773 String::new().into()
8774 },
8775 if let Some(file_version) = &self.file_version {
8776 format!("{file_version:?}").into()
8777 } else {
8778 String::new().into()
8779 },
8780 ]
8781 }
8782
8783 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8784 vec![
8785 "expiration".into(),
8786 "document".into(),
8787 "file_version".into(),
8788 ]
8789 }
8790}
8791
8792#[doc = "* `never` - never\n* `with_text` - with_text\n* `always` - always"]
8793#[derive(
8794 serde :: Serialize,
8795 serde :: Deserialize,
8796 PartialEq,
8797 Hash,
8798 Debug,
8799 Clone,
8800 schemars :: JsonSchema,
8801 parse_display :: FromStr,
8802 parse_display :: Display,
8803)]
8804#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
8805#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8806pub enum SkipArchiveFileEnum {
8807 #[serde(rename = "never")]
8808 #[display("never")]
8809 Never,
8810 #[serde(rename = "with_text")]
8811 #[display("with_text")]
8812 WithText,
8813 #[serde(rename = "always")]
8814 #[display("always")]
8815 Always,
8816 #[serde(rename = "")]
8817 #[display("")]
8818 Empty,
8819}
8820
8821#[derive(
8822 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8823)]
8824#[allow(non_snake_case)]
8825pub struct SocialAccount {
8826 pub id: i64,
8827 pub provider: String,
8828 pub name: String,
8829}
8830
8831impl std::fmt::Display for SocialAccount {
8832 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8833 write!(
8834 f,
8835 "{}",
8836 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8837 )
8838 }
8839}
8840
8841#[cfg(feature = "tabled")]
8842impl tabled::Tabled for SocialAccount {
8843 const LENGTH: usize = 3;
8844 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8845 vec![
8846 format!("{:?}", self.id).into(),
8847 self.provider.clone().into(),
8848 self.name.clone().into(),
8849 ]
8850 }
8851
8852 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8853 vec!["id".into(), "provider".into(), "name".into()]
8854 }
8855}
8856
8857#[derive(
8858 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8859)]
8860#[allow(non_snake_case)]
8861pub struct SocialAccountRequest {
8862 pub provider: String,
8863}
8864
8865impl std::fmt::Display for SocialAccountRequest {
8866 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8867 write!(
8868 f,
8869 "{}",
8870 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8871 )
8872 }
8873}
8874
8875#[cfg(feature = "tabled")]
8876impl tabled::Tabled for SocialAccountRequest {
8877 const LENGTH: usize = 1;
8878 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8879 vec![self.provider.clone().into()]
8880 }
8881
8882 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8883 vec!["provider".into()]
8884 }
8885}
8886
8887#[doc = "* `FAILURE` - FAILURE\n* `PENDING` - PENDING\n* `RECEIVED` - RECEIVED\n* `RETRY` - RETRY\n* `REVOKED` - REVOKED\n* `STARTED` - STARTED\n* `SUCCESS` - SUCCESS"]
8888#[derive(
8889 serde :: Serialize,
8890 serde :: Deserialize,
8891 PartialEq,
8892 Hash,
8893 Debug,
8894 Clone,
8895 schemars :: JsonSchema,
8896 parse_display :: FromStr,
8897 parse_display :: Display,
8898)]
8899#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
8900#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8901pub enum StatusEnum {
8902 #[serde(rename = "FAILURE")]
8903 #[display("FAILURE")]
8904 Failure,
8905 #[serde(rename = "PENDING")]
8906 #[display("PENDING")]
8907 Pending,
8908 #[serde(rename = "RECEIVED")]
8909 #[display("RECEIVED")]
8910 Received,
8911 #[serde(rename = "RETRY")]
8912 #[display("RETRY")]
8913 Retry,
8914 #[serde(rename = "REVOKED")]
8915 #[display("REVOKED")]
8916 Revoked,
8917 #[serde(rename = "STARTED")]
8918 #[display("STARTED")]
8919 Started,
8920 #[serde(rename = "SUCCESS")]
8921 #[display("SUCCESS")]
8922 Success,
8923}
8924
8925#[derive(
8926 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8927)]
8928#[allow(non_snake_case)]
8929pub struct Storage {
8930 pub total: i64,
8931 pub available: i64,
8932}
8933
8934impl std::fmt::Display for Storage {
8935 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8936 write!(
8937 f,
8938 "{}",
8939 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8940 )
8941 }
8942}
8943
8944#[cfg(feature = "tabled")]
8945impl tabled::Tabled for Storage {
8946 const LENGTH: usize = 2;
8947 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8948 vec![
8949 format!("{:?}", self.total).into(),
8950 format!("{:?}", self.available).into(),
8951 ]
8952 }
8953
8954 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8955 vec!["total".into(), "available".into()]
8956 }
8957}
8958
8959#[derive(
8960 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8961)]
8962#[allow(non_snake_case)]
8963pub struct StoragePath {
8964 pub id: i64,
8965 pub slug: String,
8966 pub name: String,
8967 pub path: String,
8968 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
8969 pub match_: Option<String>,
8970 #[serde(default, skip_serializing_if = "Option::is_none")]
8971 pub matching_algorithm: Option<i64>,
8972 #[serde(default, skip_serializing_if = "Option::is_none")]
8973 pub is_insensitive: Option<bool>,
8974 pub document_count: i64,
8975 #[serde(default, skip_serializing_if = "Option::is_none")]
8976 pub owner: Option<i64>,
8977 pub user_can_change: bool,
8978}
8979
8980impl std::fmt::Display for StoragePath {
8981 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8982 write!(
8983 f,
8984 "{}",
8985 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8986 )
8987 }
8988}
8989
8990#[cfg(feature = "tabled")]
8991impl tabled::Tabled for StoragePath {
8992 const LENGTH: usize = 10;
8993 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8994 vec![
8995 format!("{:?}", self.id).into(),
8996 self.slug.clone().into(),
8997 self.name.clone().into(),
8998 self.path.clone().into(),
8999 if let Some(match_) = &self.match_ {
9000 format!("{match_:?}").into()
9001 } else {
9002 String::new().into()
9003 },
9004 if let Some(matching_algorithm) = &self.matching_algorithm {
9005 format!("{matching_algorithm:?}").into()
9006 } else {
9007 String::new().into()
9008 },
9009 if let Some(is_insensitive) = &self.is_insensitive {
9010 format!("{is_insensitive:?}").into()
9011 } else {
9012 String::new().into()
9013 },
9014 format!("{:?}", self.document_count).into(),
9015 if let Some(owner) = &self.owner {
9016 format!("{owner:?}").into()
9017 } else {
9018 String::new().into()
9019 },
9020 format!("{:?}", self.user_can_change).into(),
9021 ]
9022 }
9023
9024 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9025 vec![
9026 "id".into(),
9027 "slug".into(),
9028 "name".into(),
9029 "path".into(),
9030 "match_".into(),
9031 "matching_algorithm".into(),
9032 "is_insensitive".into(),
9033 "document_count".into(),
9034 "owner".into(),
9035 "user_can_change".into(),
9036 ]
9037 }
9038}
9039
9040#[derive(
9041 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9042)]
9043#[allow(non_snake_case)]
9044pub struct StoragePathCounts {
9045 pub id: i64,
9046 pub document_count: i64,
9047}
9048
9049impl std::fmt::Display for StoragePathCounts {
9050 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9051 write!(
9052 f,
9053 "{}",
9054 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9055 )
9056 }
9057}
9058
9059#[cfg(feature = "tabled")]
9060impl tabled::Tabled for StoragePathCounts {
9061 const LENGTH: usize = 2;
9062 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9063 vec![
9064 format!("{:?}", self.id).into(),
9065 format!("{:?}", self.document_count).into(),
9066 ]
9067 }
9068
9069 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9070 vec!["id".into(), "document_count".into()]
9071 }
9072}
9073
9074#[derive(
9075 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9076)]
9077#[allow(non_snake_case)]
9078pub struct StoragePathRequest {
9079 pub name: String,
9080 pub path: String,
9081 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9082 pub match_: Option<String>,
9083 #[serde(default, skip_serializing_if = "Option::is_none")]
9084 pub matching_algorithm: Option<i64>,
9085 #[serde(default, skip_serializing_if = "Option::is_none")]
9086 pub is_insensitive: Option<bool>,
9087 #[serde(default, skip_serializing_if = "Option::is_none")]
9088 pub owner: Option<i64>,
9089 #[serde(default, skip_serializing_if = "Option::is_none")]
9090 pub set_permissions: Option<SetPermissions>,
9091}
9092
9093impl std::fmt::Display for StoragePathRequest {
9094 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9095 write!(
9096 f,
9097 "{}",
9098 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9099 )
9100 }
9101}
9102
9103#[cfg(feature = "tabled")]
9104impl tabled::Tabled for StoragePathRequest {
9105 const LENGTH: usize = 7;
9106 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9107 vec![
9108 self.name.clone().into(),
9109 self.path.clone().into(),
9110 if let Some(match_) = &self.match_ {
9111 format!("{match_:?}").into()
9112 } else {
9113 String::new().into()
9114 },
9115 if let Some(matching_algorithm) = &self.matching_algorithm {
9116 format!("{matching_algorithm:?}").into()
9117 } else {
9118 String::new().into()
9119 },
9120 if let Some(is_insensitive) = &self.is_insensitive {
9121 format!("{is_insensitive:?}").into()
9122 } else {
9123 String::new().into()
9124 },
9125 if let Some(owner) = &self.owner {
9126 format!("{owner:?}").into()
9127 } else {
9128 String::new().into()
9129 },
9130 if let Some(set_permissions) = &self.set_permissions {
9131 format!("{set_permissions:?}").into()
9132 } else {
9133 String::new().into()
9134 },
9135 ]
9136 }
9137
9138 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9139 vec![
9140 "name".into(),
9141 "path".into(),
9142 "match_".into(),
9143 "matching_algorithm".into(),
9144 "is_insensitive".into(),
9145 "owner".into(),
9146 "set_permissions".into(),
9147 ]
9148 }
9149}
9150
9151#[derive(
9152 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9153)]
9154#[allow(non_snake_case)]
9155pub struct Suggestions {
9156 pub correspondents: Vec<i64>,
9157 pub tags: Vec<i64>,
9158 pub document_types: Vec<i64>,
9159 pub storage_paths: Vec<i64>,
9160 pub dates: Vec<String>,
9161}
9162
9163impl std::fmt::Display for Suggestions {
9164 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9165 write!(
9166 f,
9167 "{}",
9168 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9169 )
9170 }
9171}
9172
9173#[cfg(feature = "tabled")]
9174impl tabled::Tabled for Suggestions {
9175 const LENGTH: usize = 5;
9176 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9177 vec![
9178 format!("{:?}", self.correspondents).into(),
9179 format!("{:?}", self.tags).into(),
9180 format!("{:?}", self.document_types).into(),
9181 format!("{:?}", self.storage_paths).into(),
9182 format!("{:?}", self.dates).into(),
9183 ]
9184 }
9185
9186 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9187 vec![
9188 "correspondents".into(),
9189 "tags".into(),
9190 "document_types".into(),
9191 "storage_paths".into(),
9192 "dates".into(),
9193 ]
9194 }
9195}
9196
9197#[derive(
9198 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9199)]
9200#[allow(non_snake_case)]
9201pub struct SystemStatus {
9202 pub pngx_version: String,
9203 pub server_os: String,
9204 pub install_type: String,
9205 pub storage: Storage,
9206 pub database: Database,
9207 pub tasks: Tasks,
9208 pub index: Index,
9209 pub classifier: Classifier,
9210 pub sanity_check: SanityCheck,
9211}
9212
9213impl std::fmt::Display for SystemStatus {
9214 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9215 write!(
9216 f,
9217 "{}",
9218 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9219 )
9220 }
9221}
9222
9223#[cfg(feature = "tabled")]
9224impl tabled::Tabled for SystemStatus {
9225 const LENGTH: usize = 9;
9226 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9227 vec![
9228 self.pngx_version.clone().into(),
9229 self.server_os.clone().into(),
9230 self.install_type.clone().into(),
9231 format!("{:?}", self.storage).into(),
9232 format!("{:?}", self.database).into(),
9233 format!("{:?}", self.tasks).into(),
9234 format!("{:?}", self.index).into(),
9235 format!("{:?}", self.classifier).into(),
9236 format!("{:?}", self.sanity_check).into(),
9237 ]
9238 }
9239
9240 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9241 vec![
9242 "pngx_version".into(),
9243 "server_os".into(),
9244 "install_type".into(),
9245 "storage".into(),
9246 "database".into(),
9247 "tasks".into(),
9248 "index".into(),
9249 "classifier".into(),
9250 "sanity_check".into(),
9251 ]
9252 }
9253}
9254
9255#[derive(
9256 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9257)]
9258#[allow(non_snake_case)]
9259pub struct Tag {
9260 pub id: i64,
9261 pub slug: String,
9262 pub name: String,
9263 #[serde(default, skip_serializing_if = "Option::is_none")]
9264 pub color: Option<String>,
9265 pub text_color: String,
9266 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9267 pub match_: Option<String>,
9268 #[serde(default, skip_serializing_if = "Option::is_none")]
9269 pub matching_algorithm: Option<i64>,
9270 #[serde(default, skip_serializing_if = "Option::is_none")]
9271 pub is_insensitive: Option<bool>,
9272 #[doc = "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."]
9273 #[serde(default, skip_serializing_if = "Option::is_none")]
9274 pub is_inbox_tag: Option<bool>,
9275 #[serde(default)]
9276 pub document_count: i64,
9277 #[serde(default, skip_serializing_if = "Option::is_none")]
9278 pub owner: Option<i64>,
9279 pub user_can_change: bool,
9280}
9281
9282impl std::fmt::Display for Tag {
9283 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9284 write!(
9285 f,
9286 "{}",
9287 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9288 )
9289 }
9290}
9291
9292#[cfg(feature = "tabled")]
9293impl tabled::Tabled for Tag {
9294 const LENGTH: usize = 12;
9295 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9296 vec![
9297 format!("{:?}", self.id).into(),
9298 self.slug.clone().into(),
9299 self.name.clone().into(),
9300 if let Some(color) = &self.color {
9301 format!("{color:?}").into()
9302 } else {
9303 String::new().into()
9304 },
9305 self.text_color.clone().into(),
9306 if let Some(match_) = &self.match_ {
9307 format!("{match_:?}").into()
9308 } else {
9309 String::new().into()
9310 },
9311 if let Some(matching_algorithm) = &self.matching_algorithm {
9312 format!("{matching_algorithm:?}").into()
9313 } else {
9314 String::new().into()
9315 },
9316 if let Some(is_insensitive) = &self.is_insensitive {
9317 format!("{is_insensitive:?}").into()
9318 } else {
9319 String::new().into()
9320 },
9321 if let Some(is_inbox_tag) = &self.is_inbox_tag {
9322 format!("{is_inbox_tag:?}").into()
9323 } else {
9324 String::new().into()
9325 },
9326 format!("{:?}", self.document_count).into(),
9327 if let Some(owner) = &self.owner {
9328 format!("{owner:?}").into()
9329 } else {
9330 String::new().into()
9331 },
9332 format!("{:?}", self.user_can_change).into(),
9333 ]
9334 }
9335
9336 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9337 vec![
9338 "id".into(),
9339 "slug".into(),
9340 "name".into(),
9341 "color".into(),
9342 "text_color".into(),
9343 "match_".into(),
9344 "matching_algorithm".into(),
9345 "is_insensitive".into(),
9346 "is_inbox_tag".into(),
9347 "document_count".into(),
9348 "owner".into(),
9349 "user_can_change".into(),
9350 ]
9351 }
9352}
9353
9354#[derive(
9355 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9356)]
9357#[allow(non_snake_case)]
9358pub struct TagCounts {
9359 pub id: i64,
9360 pub document_count: i64,
9361}
9362
9363impl std::fmt::Display for TagCounts {
9364 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9365 write!(
9366 f,
9367 "{}",
9368 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9369 )
9370 }
9371}
9372
9373#[cfg(feature = "tabled")]
9374impl tabled::Tabled for TagCounts {
9375 const LENGTH: usize = 2;
9376 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9377 vec![
9378 format!("{:?}", self.id).into(),
9379 format!("{:?}", self.document_count).into(),
9380 ]
9381 }
9382
9383 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9384 vec!["id".into(), "document_count".into()]
9385 }
9386}
9387
9388#[derive(
9389 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9390)]
9391#[allow(non_snake_case)]
9392pub struct TagRequest {
9393 pub name: String,
9394 #[serde(default, skip_serializing_if = "Option::is_none")]
9395 pub color: Option<String>,
9396 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
9397 pub match_: Option<String>,
9398 #[serde(default, skip_serializing_if = "Option::is_none")]
9399 pub matching_algorithm: Option<i64>,
9400 #[serde(default, skip_serializing_if = "Option::is_none")]
9401 pub is_insensitive: Option<bool>,
9402 #[doc = "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."]
9403 #[serde(default, skip_serializing_if = "Option::is_none")]
9404 pub is_inbox_tag: Option<bool>,
9405 #[serde(default, skip_serializing_if = "Option::is_none")]
9406 pub owner: Option<i64>,
9407 #[serde(default, skip_serializing_if = "Option::is_none")]
9408 pub set_permissions: Option<SetPermissions>,
9409}
9410
9411impl std::fmt::Display for TagRequest {
9412 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9413 write!(
9414 f,
9415 "{}",
9416 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9417 )
9418 }
9419}
9420
9421#[cfg(feature = "tabled")]
9422impl tabled::Tabled for TagRequest {
9423 const LENGTH: usize = 8;
9424 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9425 vec![
9426 self.name.clone().into(),
9427 if let Some(color) = &self.color {
9428 format!("{color:?}").into()
9429 } else {
9430 String::new().into()
9431 },
9432 if let Some(match_) = &self.match_ {
9433 format!("{match_:?}").into()
9434 } else {
9435 String::new().into()
9436 },
9437 if let Some(matching_algorithm) = &self.matching_algorithm {
9438 format!("{matching_algorithm:?}").into()
9439 } else {
9440 String::new().into()
9441 },
9442 if let Some(is_insensitive) = &self.is_insensitive {
9443 format!("{is_insensitive:?}").into()
9444 } else {
9445 String::new().into()
9446 },
9447 if let Some(is_inbox_tag) = &self.is_inbox_tag {
9448 format!("{is_inbox_tag:?}").into()
9449 } else {
9450 String::new().into()
9451 },
9452 if let Some(owner) = &self.owner {
9453 format!("{owner:?}").into()
9454 } else {
9455 String::new().into()
9456 },
9457 if let Some(set_permissions) = &self.set_permissions {
9458 format!("{set_permissions:?}").into()
9459 } else {
9460 String::new().into()
9461 },
9462 ]
9463 }
9464
9465 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9466 vec![
9467 "name".into(),
9468 "color".into(),
9469 "match_".into(),
9470 "matching_algorithm".into(),
9471 "is_insensitive".into(),
9472 "is_inbox_tag".into(),
9473 "owner".into(),
9474 "set_permissions".into(),
9475 ]
9476 }
9477}
9478
9479#[doc = "* `consume_file` - Consume File\n* `train_classifier` - Train Classifier\n* `check_sanity` - Check Sanity\n* `index_optimize` - Index Optimize"]
9480#[derive(
9481 serde :: Serialize,
9482 serde :: Deserialize,
9483 PartialEq,
9484 Hash,
9485 Debug,
9486 Clone,
9487 schemars :: JsonSchema,
9488 parse_display :: FromStr,
9489 parse_display :: Display,
9490)]
9491#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9492#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9493pub enum TaskNameEnum {
9494 #[serde(rename = "consume_file")]
9495 #[display("consume_file")]
9496 ConsumeFile,
9497 #[serde(rename = "train_classifier")]
9498 #[display("train_classifier")]
9499 TrainClassifier,
9500 #[serde(rename = "check_sanity")]
9501 #[display("check_sanity")]
9502 CheckSanity,
9503 #[serde(rename = "index_optimize")]
9504 #[display("index_optimize")]
9505 IndexOptimize,
9506}
9507
9508#[derive(
9509 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9510)]
9511#[allow(non_snake_case)]
9512pub struct Tasks {
9513 pub redis_url: String,
9514 pub redis_status: String,
9515 pub redis_error: String,
9516 pub celery_status: String,
9517}
9518
9519impl std::fmt::Display for Tasks {
9520 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9521 write!(
9522 f,
9523 "{}",
9524 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9525 )
9526 }
9527}
9528
9529#[cfg(feature = "tabled")]
9530impl tabled::Tabled for Tasks {
9531 const LENGTH: usize = 4;
9532 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9533 vec![
9534 self.redis_url.clone().into(),
9535 self.redis_status.clone().into(),
9536 self.redis_error.clone().into(),
9537 self.celery_status.clone().into(),
9538 ]
9539 }
9540
9541 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9542 vec![
9543 "redis_url".into(),
9544 "redis_status".into(),
9545 "redis_error".into(),
9546 "celery_status".into(),
9547 ]
9548 }
9549}
9550
9551#[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"]
9552#[derive(
9553 serde :: Serialize,
9554 serde :: Deserialize,
9555 PartialEq,
9556 Hash,
9557 Debug,
9558 Clone,
9559 schemars :: JsonSchema,
9560 parse_display :: FromStr,
9561 parse_display :: Display,
9562)]
9563#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9564#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9565pub enum TaskName {
9566 #[serde(rename = "consume_file")]
9567 #[display("consume_file")]
9568 ConsumeFile,
9569 #[serde(rename = "train_classifier")]
9570 #[display("train_classifier")]
9571 TrainClassifier,
9572 #[serde(rename = "check_sanity")]
9573 #[display("check_sanity")]
9574 CheckSanity,
9575 #[serde(rename = "index_optimize")]
9576 #[display("index_optimize")]
9577 IndexOptimize,
9578}
9579
9580#[derive(
9581 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9582)]
9583#[allow(non_snake_case)]
9584pub struct TasksView {
9585 pub id: i64,
9586 #[doc = "Celery ID for the Task that was run"]
9587 pub task_id: String,
9588 #[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"]
9589 #[serde(default, skip_serializing_if = "Option::is_none")]
9590 pub task_name: Option<TaskName>,
9591 #[doc = "Name of the file which the Task was run for"]
9592 #[serde(default, skip_serializing_if = "Option::is_none")]
9593 pub task_file_name: Option<String>,
9594 #[doc = "Datetime field when the task result was created in UTC"]
9595 #[serde(default, skip_serializing_if = "Option::is_none")]
9596 pub date_created: Option<chrono::DateTime<chrono::Utc>>,
9597 #[doc = "Datetime field when the task was completed in UTC"]
9598 #[serde(default, skip_serializing_if = "Option::is_none")]
9599 pub date_done: Option<chrono::DateTime<chrono::Utc>>,
9600 #[doc = "The type of task that was run\n\n* `auto_task` - Auto Task\n* `scheduled_task` - Scheduled Task\n* `manual_task` - Manual Task"]
9601 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
9602 pub type_: Option<TasksViewTypeEnum>,
9603 #[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"]
9604 #[serde(default, skip_serializing_if = "Option::is_none")]
9605 pub status: Option<StatusEnum>,
9606 #[doc = "The data returned by the task"]
9607 #[serde(default, skip_serializing_if = "Option::is_none")]
9608 pub result: Option<String>,
9609 #[doc = "If the task is acknowledged via the frontend or API"]
9610 #[serde(default, skip_serializing_if = "Option::is_none")]
9611 pub acknowledged: Option<bool>,
9612 #[serde(default)]
9613 pub related_document: Option<String>,
9614 #[serde(default, skip_serializing_if = "Option::is_none")]
9615 pub owner: Option<i64>,
9616}
9617
9618impl std::fmt::Display for TasksView {
9619 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9620 write!(
9621 f,
9622 "{}",
9623 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9624 )
9625 }
9626}
9627
9628#[cfg(feature = "tabled")]
9629impl tabled::Tabled for TasksView {
9630 const LENGTH: usize = 12;
9631 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9632 vec![
9633 format!("{:?}", self.id).into(),
9634 self.task_id.clone().into(),
9635 if let Some(task_name) = &self.task_name {
9636 format!("{task_name:?}").into()
9637 } else {
9638 String::new().into()
9639 },
9640 if let Some(task_file_name) = &self.task_file_name {
9641 format!("{task_file_name:?}").into()
9642 } else {
9643 String::new().into()
9644 },
9645 if let Some(date_created) = &self.date_created {
9646 format!("{date_created:?}").into()
9647 } else {
9648 String::new().into()
9649 },
9650 if let Some(date_done) = &self.date_done {
9651 format!("{date_done:?}").into()
9652 } else {
9653 String::new().into()
9654 },
9655 if let Some(type_) = &self.type_ {
9656 format!("{type_:?}").into()
9657 } else {
9658 String::new().into()
9659 },
9660 if let Some(status) = &self.status {
9661 format!("{status:?}").into()
9662 } else {
9663 String::new().into()
9664 },
9665 if let Some(result) = &self.result {
9666 format!("{result:?}").into()
9667 } else {
9668 String::new().into()
9669 },
9670 if let Some(acknowledged) = &self.acknowledged {
9671 format!("{acknowledged:?}").into()
9672 } else {
9673 String::new().into()
9674 },
9675 format!("{:?}", self.related_document).into(),
9676 if let Some(owner) = &self.owner {
9677 format!("{owner:?}").into()
9678 } else {
9679 String::new().into()
9680 },
9681 ]
9682 }
9683
9684 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9685 vec![
9686 "id".into(),
9687 "task_id".into(),
9688 "task_name".into(),
9689 "task_file_name".into(),
9690 "date_created".into(),
9691 "date_done".into(),
9692 "type_".into(),
9693 "status".into(),
9694 "result".into(),
9695 "acknowledged".into(),
9696 "related_document".into(),
9697 "owner".into(),
9698 ]
9699 }
9700}
9701
9702#[derive(
9703 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9704)]
9705#[allow(non_snake_case)]
9706pub struct TasksViewRequest {
9707 #[doc = "Celery ID for the Task that was run"]
9708 pub task_id: String,
9709 #[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"]
9710 #[serde(default, skip_serializing_if = "Option::is_none")]
9711 pub task_name: Option<TaskName>,
9712 #[doc = "Name of the file which the Task was run for"]
9713 #[serde(default, skip_serializing_if = "Option::is_none")]
9714 pub task_file_name: Option<String>,
9715 #[doc = "Datetime field when the task result was created in UTC"]
9716 #[serde(default, skip_serializing_if = "Option::is_none")]
9717 pub date_created: Option<chrono::DateTime<chrono::Utc>>,
9718 #[doc = "Datetime field when the task was completed in UTC"]
9719 #[serde(default, skip_serializing_if = "Option::is_none")]
9720 pub date_done: Option<chrono::DateTime<chrono::Utc>>,
9721 #[doc = "The type of task that was run\n\n* `auto_task` - Auto Task\n* `scheduled_task` - Scheduled Task\n* `manual_task` - Manual Task"]
9722 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
9723 pub type_: Option<TasksViewTypeEnum>,
9724 #[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"]
9725 #[serde(default, skip_serializing_if = "Option::is_none")]
9726 pub status: Option<StatusEnum>,
9727 #[doc = "The data returned by the task"]
9728 #[serde(default, skip_serializing_if = "Option::is_none")]
9729 pub result: Option<String>,
9730 #[doc = "If the task is acknowledged via the frontend or API"]
9731 #[serde(default, skip_serializing_if = "Option::is_none")]
9732 pub acknowledged: Option<bool>,
9733 #[serde(default, skip_serializing_if = "Option::is_none")]
9734 pub owner: Option<i64>,
9735}
9736
9737impl std::fmt::Display for TasksViewRequest {
9738 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9739 write!(
9740 f,
9741 "{}",
9742 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9743 )
9744 }
9745}
9746
9747#[cfg(feature = "tabled")]
9748impl tabled::Tabled for TasksViewRequest {
9749 const LENGTH: usize = 10;
9750 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9751 vec![
9752 self.task_id.clone().into(),
9753 if let Some(task_name) = &self.task_name {
9754 format!("{task_name:?}").into()
9755 } else {
9756 String::new().into()
9757 },
9758 if let Some(task_file_name) = &self.task_file_name {
9759 format!("{task_file_name:?}").into()
9760 } else {
9761 String::new().into()
9762 },
9763 if let Some(date_created) = &self.date_created {
9764 format!("{date_created:?}").into()
9765 } else {
9766 String::new().into()
9767 },
9768 if let Some(date_done) = &self.date_done {
9769 format!("{date_done:?}").into()
9770 } else {
9771 String::new().into()
9772 },
9773 if let Some(type_) = &self.type_ {
9774 format!("{type_:?}").into()
9775 } else {
9776 String::new().into()
9777 },
9778 if let Some(status) = &self.status {
9779 format!("{status:?}").into()
9780 } else {
9781 String::new().into()
9782 },
9783 if let Some(result) = &self.result {
9784 format!("{result:?}").into()
9785 } else {
9786 String::new().into()
9787 },
9788 if let Some(acknowledged) = &self.acknowledged {
9789 format!("{acknowledged:?}").into()
9790 } else {
9791 String::new().into()
9792 },
9793 if let Some(owner) = &self.owner {
9794 format!("{owner:?}").into()
9795 } else {
9796 String::new().into()
9797 },
9798 ]
9799 }
9800
9801 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9802 vec![
9803 "task_id".into(),
9804 "task_name".into(),
9805 "task_file_name".into(),
9806 "date_created".into(),
9807 "date_done".into(),
9808 "type_".into(),
9809 "status".into(),
9810 "result".into(),
9811 "acknowledged".into(),
9812 "owner".into(),
9813 ]
9814 }
9815}
9816
9817#[doc = "* `auto_task` - Auto Task\n* `scheduled_task` - Scheduled Task\n* `manual_task` - Manual Task"]
9818#[derive(
9819 serde :: Serialize,
9820 serde :: Deserialize,
9821 PartialEq,
9822 Hash,
9823 Debug,
9824 Clone,
9825 schemars :: JsonSchema,
9826 parse_display :: FromStr,
9827 parse_display :: Display,
9828)]
9829#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9830#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9831pub enum TasksViewTypeEnum {
9832 #[serde(rename = "auto_task")]
9833 #[display("auto_task")]
9834 AutoTask,
9835 #[serde(rename = "scheduled_task")]
9836 #[display("scheduled_task")]
9837 ScheduledTask,
9838 #[serde(rename = "manual_task")]
9839 #[display("manual_task")]
9840 ManualTask,
9841}
9842
9843#[doc = "* `restore` - restore\n* `empty` - empty"]
9844#[derive(
9845 serde :: Serialize,
9846 serde :: Deserialize,
9847 PartialEq,
9848 Hash,
9849 Debug,
9850 Clone,
9851 schemars :: JsonSchema,
9852 parse_display :: FromStr,
9853 parse_display :: Display,
9854)]
9855#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9856#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9857pub enum TrashActionEnum {
9858 #[serde(rename = "restore")]
9859 #[display("restore")]
9860 Restore,
9861 #[serde(rename = "empty")]
9862 #[display("empty")]
9863 Empty,
9864}
9865
9866#[derive(
9867 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9868)]
9869#[allow(non_snake_case)]
9870pub struct TrashRequest {
9871 #[serde(default, skip_serializing_if = "Option::is_none")]
9872 pub documents: Option<Vec<i64>>,
9873 pub action: TrashActionEnum,
9874}
9875
9876impl std::fmt::Display for TrashRequest {
9877 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9878 write!(
9879 f,
9880 "{}",
9881 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9882 )
9883 }
9884}
9885
9886#[cfg(feature = "tabled")]
9887impl tabled::Tabled for TrashRequest {
9888 const LENGTH: usize = 2;
9889 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9890 vec![
9891 if let Some(documents) = &self.documents {
9892 format!("{documents:?}").into()
9893 } else {
9894 String::new().into()
9895 },
9896 format!("{:?}", self.action).into(),
9897 ]
9898 }
9899
9900 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9901 vec!["documents".into(), "action".into()]
9902 }
9903}
9904
9905#[derive(
9906 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9907)]
9908#[allow(non_snake_case)]
9909pub struct UiSettingsView {
9910 pub id: i64,
9911 #[serde(default, skip_serializing_if = "Option::is_none")]
9912 pub settings: Option<std::collections::HashMap<String, serde_json::Value>>,
9913}
9914
9915impl std::fmt::Display for UiSettingsView {
9916 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9917 write!(
9918 f,
9919 "{}",
9920 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9921 )
9922 }
9923}
9924
9925#[cfg(feature = "tabled")]
9926impl tabled::Tabled for UiSettingsView {
9927 const LENGTH: usize = 2;
9928 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9929 vec![
9930 format!("{:?}", self.id).into(),
9931 if let Some(settings) = &self.settings {
9932 format!("{settings:?}").into()
9933 } else {
9934 String::new().into()
9935 },
9936 ]
9937 }
9938
9939 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9940 vec!["id".into(), "settings".into()]
9941 }
9942}
9943
9944#[derive(
9945 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9946)]
9947#[allow(non_snake_case)]
9948pub struct UiSettingsViewRequest {
9949 #[serde(default, skip_serializing_if = "Option::is_none")]
9950 pub settings: Option<std::collections::HashMap<String, serde_json::Value>>,
9951}
9952
9953impl std::fmt::Display for UiSettingsViewRequest {
9954 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9955 write!(
9956 f,
9957 "{}",
9958 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9959 )
9960 }
9961}
9962
9963#[cfg(feature = "tabled")]
9964impl tabled::Tabled for UiSettingsViewRequest {
9965 const LENGTH: usize = 1;
9966 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9967 vec![if let Some(settings) = &self.settings {
9968 format!("{settings:?}").into()
9969 } else {
9970 String::new().into()
9971 }]
9972 }
9973
9974 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9975 vec!["settings".into()]
9976 }
9977}
9978
9979#[doc = "* `clean` - clean\n* `clean-final` - clean-final\n* `none` - none"]
9980#[derive(
9981 serde :: Serialize,
9982 serde :: Deserialize,
9983 PartialEq,
9984 Hash,
9985 Debug,
9986 Clone,
9987 schemars :: JsonSchema,
9988 parse_display :: FromStr,
9989 parse_display :: Display,
9990)]
9991#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9992#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9993pub enum UnpaperCleanEnum {
9994 #[serde(rename = "clean")]
9995 #[display("clean")]
9996 Clean,
9997 #[serde(rename = "clean-final")]
9998 #[display("clean-final")]
9999 CleanFinal,
10000 #[serde(rename = "none")]
10001 #[display("none")]
10002 None,
10003 #[serde(rename = "")]
10004 #[display("")]
10005 Empty,
10006}
10007
10008#[derive(
10009 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10010)]
10011#[allow(non_snake_case)]
10012pub struct User {
10013 pub id: i64,
10014 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
10015 pub username: String,
10016 #[serde(default, skip_serializing_if = "Option::is_none")]
10017 pub email: Option<String>,
10018 #[serde(default, skip_serializing_if = "Option::is_none")]
10019 pub password: Option<String>,
10020 #[serde(default, skip_serializing_if = "Option::is_none")]
10021 pub first_name: Option<String>,
10022 #[serde(default, skip_serializing_if = "Option::is_none")]
10023 pub last_name: Option<String>,
10024 #[serde(default, skip_serializing_if = "Option::is_none")]
10025 pub date_joined: Option<chrono::DateTime<chrono::Utc>>,
10026 #[doc = "Designates whether the user can log into this admin site."]
10027 #[serde(default, skip_serializing_if = "Option::is_none")]
10028 pub is_staff: Option<bool>,
10029 #[doc = "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."]
10030 #[serde(default, skip_serializing_if = "Option::is_none")]
10031 pub is_active: Option<bool>,
10032 #[doc = "Designates that this user has all permissions without explicitly assigning them."]
10033 #[serde(default, skip_serializing_if = "Option::is_none")]
10034 pub is_superuser: Option<bool>,
10035 #[doc = "The groups this user belongs to. A user will get all permissions granted to each of their groups."]
10036 #[serde(default, skip_serializing_if = "Option::is_none")]
10037 pub groups: Option<Vec<i64>>,
10038 #[serde(default, skip_serializing_if = "Option::is_none")]
10039 pub user_permissions: Option<Vec<String>>,
10040 pub inherited_permissions: Vec<String>,
10041 pub is_mfa_enabled: bool,
10042}
10043
10044impl std::fmt::Display for User {
10045 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10046 write!(
10047 f,
10048 "{}",
10049 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10050 )
10051 }
10052}
10053
10054#[cfg(feature = "tabled")]
10055impl tabled::Tabled for User {
10056 const LENGTH: usize = 14;
10057 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10058 vec![
10059 format!("{:?}", self.id).into(),
10060 self.username.clone().into(),
10061 if let Some(email) = &self.email {
10062 format!("{email:?}").into()
10063 } else {
10064 String::new().into()
10065 },
10066 if let Some(password) = &self.password {
10067 format!("{password:?}").into()
10068 } else {
10069 String::new().into()
10070 },
10071 if let Some(first_name) = &self.first_name {
10072 format!("{first_name:?}").into()
10073 } else {
10074 String::new().into()
10075 },
10076 if let Some(last_name) = &self.last_name {
10077 format!("{last_name:?}").into()
10078 } else {
10079 String::new().into()
10080 },
10081 if let Some(date_joined) = &self.date_joined {
10082 format!("{date_joined:?}").into()
10083 } else {
10084 String::new().into()
10085 },
10086 if let Some(is_staff) = &self.is_staff {
10087 format!("{is_staff:?}").into()
10088 } else {
10089 String::new().into()
10090 },
10091 if let Some(is_active) = &self.is_active {
10092 format!("{is_active:?}").into()
10093 } else {
10094 String::new().into()
10095 },
10096 if let Some(is_superuser) = &self.is_superuser {
10097 format!("{is_superuser:?}").into()
10098 } else {
10099 String::new().into()
10100 },
10101 if let Some(groups) = &self.groups {
10102 format!("{groups:?}").into()
10103 } else {
10104 String::new().into()
10105 },
10106 if let Some(user_permissions) = &self.user_permissions {
10107 format!("{user_permissions:?}").into()
10108 } else {
10109 String::new().into()
10110 },
10111 format!("{:?}", self.inherited_permissions).into(),
10112 format!("{:?}", self.is_mfa_enabled).into(),
10113 ]
10114 }
10115
10116 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10117 vec![
10118 "id".into(),
10119 "username".into(),
10120 "email".into(),
10121 "password".into(),
10122 "first_name".into(),
10123 "last_name".into(),
10124 "date_joined".into(),
10125 "is_staff".into(),
10126 "is_active".into(),
10127 "is_superuser".into(),
10128 "groups".into(),
10129 "user_permissions".into(),
10130 "inherited_permissions".into(),
10131 "is_mfa_enabled".into(),
10132 ]
10133 }
10134}
10135
10136#[derive(
10137 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10138)]
10139#[allow(non_snake_case)]
10140pub struct UserRequest {
10141 #[doc = "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."]
10142 pub username: String,
10143 #[serde(default, skip_serializing_if = "Option::is_none")]
10144 pub email: Option<String>,
10145 #[serde(default, skip_serializing_if = "Option::is_none")]
10146 pub password: Option<String>,
10147 #[serde(default, skip_serializing_if = "Option::is_none")]
10148 pub first_name: Option<String>,
10149 #[serde(default, skip_serializing_if = "Option::is_none")]
10150 pub last_name: Option<String>,
10151 #[serde(default, skip_serializing_if = "Option::is_none")]
10152 pub date_joined: Option<chrono::DateTime<chrono::Utc>>,
10153 #[doc = "Designates whether the user can log into this admin site."]
10154 #[serde(default, skip_serializing_if = "Option::is_none")]
10155 pub is_staff: Option<bool>,
10156 #[doc = "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."]
10157 #[serde(default, skip_serializing_if = "Option::is_none")]
10158 pub is_active: Option<bool>,
10159 #[doc = "Designates that this user has all permissions without explicitly assigning them."]
10160 #[serde(default, skip_serializing_if = "Option::is_none")]
10161 pub is_superuser: Option<bool>,
10162 #[doc = "The groups this user belongs to. A user will get all permissions granted to each of their groups."]
10163 #[serde(default, skip_serializing_if = "Option::is_none")]
10164 pub groups: Option<Vec<i64>>,
10165 #[serde(default, skip_serializing_if = "Option::is_none")]
10166 pub user_permissions: Option<Vec<String>>,
10167}
10168
10169impl std::fmt::Display for UserRequest {
10170 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10171 write!(
10172 f,
10173 "{}",
10174 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10175 )
10176 }
10177}
10178
10179#[cfg(feature = "tabled")]
10180impl tabled::Tabled for UserRequest {
10181 const LENGTH: usize = 11;
10182 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10183 vec![
10184 self.username.clone().into(),
10185 if let Some(email) = &self.email {
10186 format!("{email:?}").into()
10187 } else {
10188 String::new().into()
10189 },
10190 if let Some(password) = &self.password {
10191 format!("{password:?}").into()
10192 } else {
10193 String::new().into()
10194 },
10195 if let Some(first_name) = &self.first_name {
10196 format!("{first_name:?}").into()
10197 } else {
10198 String::new().into()
10199 },
10200 if let Some(last_name) = &self.last_name {
10201 format!("{last_name:?}").into()
10202 } else {
10203 String::new().into()
10204 },
10205 if let Some(date_joined) = &self.date_joined {
10206 format!("{date_joined:?}").into()
10207 } else {
10208 String::new().into()
10209 },
10210 if let Some(is_staff) = &self.is_staff {
10211 format!("{is_staff:?}").into()
10212 } else {
10213 String::new().into()
10214 },
10215 if let Some(is_active) = &self.is_active {
10216 format!("{is_active:?}").into()
10217 } else {
10218 String::new().into()
10219 },
10220 if let Some(is_superuser) = &self.is_superuser {
10221 format!("{is_superuser:?}").into()
10222 } else {
10223 String::new().into()
10224 },
10225 if let Some(groups) = &self.groups {
10226 format!("{groups:?}").into()
10227 } else {
10228 String::new().into()
10229 },
10230 if let Some(user_permissions) = &self.user_permissions {
10231 format!("{user_permissions:?}").into()
10232 } else {
10233 String::new().into()
10234 },
10235 ]
10236 }
10237
10238 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10239 vec![
10240 "username".into(),
10241 "email".into(),
10242 "password".into(),
10243 "first_name".into(),
10244 "last_name".into(),
10245 "date_joined".into(),
10246 "is_staff".into(),
10247 "is_active".into(),
10248 "is_superuser".into(),
10249 "groups".into(),
10250 "user_permissions".into(),
10251 ]
10252 }
10253}
10254
10255#[derive(
10256 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10257)]
10258#[allow(non_snake_case)]
10259pub struct Workflow {
10260 pub id: i64,
10261 pub name: String,
10262 #[serde(default, skip_serializing_if = "Option::is_none")]
10263 pub order: Option<i64>,
10264 #[serde(default, skip_serializing_if = "Option::is_none")]
10265 pub enabled: Option<bool>,
10266 pub triggers: Vec<WorkflowTrigger>,
10267 pub actions: Vec<WorkflowAction>,
10268}
10269
10270impl std::fmt::Display for Workflow {
10271 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10272 write!(
10273 f,
10274 "{}",
10275 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10276 )
10277 }
10278}
10279
10280#[cfg(feature = "tabled")]
10281impl tabled::Tabled for Workflow {
10282 const LENGTH: usize = 6;
10283 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10284 vec![
10285 format!("{:?}", self.id).into(),
10286 self.name.clone().into(),
10287 if let Some(order) = &self.order {
10288 format!("{order:?}").into()
10289 } else {
10290 String::new().into()
10291 },
10292 if let Some(enabled) = &self.enabled {
10293 format!("{enabled:?}").into()
10294 } else {
10295 String::new().into()
10296 },
10297 format!("{:?}", self.triggers).into(),
10298 format!("{:?}", self.actions).into(),
10299 ]
10300 }
10301
10302 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10303 vec![
10304 "id".into(),
10305 "name".into(),
10306 "order".into(),
10307 "enabled".into(),
10308 "triggers".into(),
10309 "actions".into(),
10310 ]
10311 }
10312}
10313
10314#[derive(
10315 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10316)]
10317#[allow(non_snake_case)]
10318pub struct WorkflowAction {
10319 #[serde(default, skip_serializing_if = "Option::is_none")]
10320 pub id: Option<i64>,
10321 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
10322 pub type_: Option<i64>,
10323 #[doc = "Assign a document title, can include some placeholders, see documentation."]
10324 #[serde(default, skip_serializing_if = "Option::is_none")]
10325 pub assign_title: Option<String>,
10326 #[serde(default, skip_serializing_if = "Option::is_none")]
10327 pub assign_tags: Option<Vec<Option<i64>>>,
10328 #[serde(default, skip_serializing_if = "Option::is_none")]
10329 pub assign_correspondent: Option<i64>,
10330 #[serde(default, skip_serializing_if = "Option::is_none")]
10331 pub assign_document_type: Option<i64>,
10332 #[serde(default, skip_serializing_if = "Option::is_none")]
10333 pub assign_storage_path: Option<i64>,
10334 #[serde(default, skip_serializing_if = "Option::is_none")]
10335 pub assign_owner: Option<i64>,
10336 #[serde(default, skip_serializing_if = "Option::is_none")]
10337 pub assign_view_users: Option<Vec<i64>>,
10338 #[serde(default, skip_serializing_if = "Option::is_none")]
10339 pub assign_view_groups: Option<Vec<i64>>,
10340 #[serde(default, skip_serializing_if = "Option::is_none")]
10341 pub assign_change_users: Option<Vec<i64>>,
10342 #[serde(default, skip_serializing_if = "Option::is_none")]
10343 pub assign_change_groups: Option<Vec<i64>>,
10344 #[serde(default, skip_serializing_if = "Option::is_none")]
10345 pub assign_custom_fields: Option<Vec<i64>>,
10346 #[doc = "Optional values to assign to the custom fields."]
10347 #[serde(default, skip_serializing_if = "Option::is_none")]
10348 pub assign_custom_fields_values: Option<serde_json::Value>,
10349 #[serde(default, skip_serializing_if = "Option::is_none")]
10350 pub remove_all_tags: Option<bool>,
10351 #[serde(default, skip_serializing_if = "Option::is_none")]
10352 pub remove_tags: Option<Vec<i64>>,
10353 #[serde(default, skip_serializing_if = "Option::is_none")]
10354 pub remove_all_correspondents: Option<bool>,
10355 #[serde(default, skip_serializing_if = "Option::is_none")]
10356 pub remove_correspondents: Option<Vec<i64>>,
10357 #[serde(default, skip_serializing_if = "Option::is_none")]
10358 pub remove_all_document_types: Option<bool>,
10359 #[serde(default, skip_serializing_if = "Option::is_none")]
10360 pub remove_document_types: Option<Vec<i64>>,
10361 #[serde(default, skip_serializing_if = "Option::is_none")]
10362 pub remove_all_storage_paths: Option<bool>,
10363 #[serde(default, skip_serializing_if = "Option::is_none")]
10364 pub remove_storage_paths: Option<Vec<i64>>,
10365 #[serde(default, skip_serializing_if = "Option::is_none")]
10366 pub remove_custom_fields: Option<Vec<i64>>,
10367 #[serde(default, skip_serializing_if = "Option::is_none")]
10368 pub remove_all_custom_fields: Option<bool>,
10369 #[serde(default, skip_serializing_if = "Option::is_none")]
10370 pub remove_all_owners: Option<bool>,
10371 #[serde(default, skip_serializing_if = "Option::is_none")]
10372 pub remove_owners: Option<Vec<i64>>,
10373 #[serde(default, skip_serializing_if = "Option::is_none")]
10374 pub remove_all_permissions: Option<bool>,
10375 #[serde(default, skip_serializing_if = "Option::is_none")]
10376 pub remove_view_users: Option<Vec<i64>>,
10377 #[serde(default, skip_serializing_if = "Option::is_none")]
10378 pub remove_view_groups: Option<Vec<i64>>,
10379 #[serde(default, skip_serializing_if = "Option::is_none")]
10380 pub remove_change_users: Option<Vec<i64>>,
10381 #[serde(default, skip_serializing_if = "Option::is_none")]
10382 pub remove_change_groups: Option<Vec<i64>>,
10383 #[serde(default, skip_serializing_if = "Option::is_none")]
10384 pub email: Option<WorkflowActionEmail>,
10385 #[serde(default, skip_serializing_if = "Option::is_none")]
10386 pub webhook: Option<WorkflowActionWebhook>,
10387}
10388
10389impl std::fmt::Display for WorkflowAction {
10390 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10391 write!(
10392 f,
10393 "{}",
10394 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10395 )
10396 }
10397}
10398
10399#[cfg(feature = "tabled")]
10400impl tabled::Tabled for WorkflowAction {
10401 const LENGTH: usize = 33;
10402 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10403 vec![
10404 if let Some(id) = &self.id {
10405 format!("{id:?}").into()
10406 } else {
10407 String::new().into()
10408 },
10409 if let Some(type_) = &self.type_ {
10410 format!("{type_:?}").into()
10411 } else {
10412 String::new().into()
10413 },
10414 if let Some(assign_title) = &self.assign_title {
10415 format!("{assign_title:?}").into()
10416 } else {
10417 String::new().into()
10418 },
10419 if let Some(assign_tags) = &self.assign_tags {
10420 format!("{assign_tags:?}").into()
10421 } else {
10422 String::new().into()
10423 },
10424 if let Some(assign_correspondent) = &self.assign_correspondent {
10425 format!("{assign_correspondent:?}").into()
10426 } else {
10427 String::new().into()
10428 },
10429 if let Some(assign_document_type) = &self.assign_document_type {
10430 format!("{assign_document_type:?}").into()
10431 } else {
10432 String::new().into()
10433 },
10434 if let Some(assign_storage_path) = &self.assign_storage_path {
10435 format!("{assign_storage_path:?}").into()
10436 } else {
10437 String::new().into()
10438 },
10439 if let Some(assign_owner) = &self.assign_owner {
10440 format!("{assign_owner:?}").into()
10441 } else {
10442 String::new().into()
10443 },
10444 if let Some(assign_view_users) = &self.assign_view_users {
10445 format!("{assign_view_users:?}").into()
10446 } else {
10447 String::new().into()
10448 },
10449 if let Some(assign_view_groups) = &self.assign_view_groups {
10450 format!("{assign_view_groups:?}").into()
10451 } else {
10452 String::new().into()
10453 },
10454 if let Some(assign_change_users) = &self.assign_change_users {
10455 format!("{assign_change_users:?}").into()
10456 } else {
10457 String::new().into()
10458 },
10459 if let Some(assign_change_groups) = &self.assign_change_groups {
10460 format!("{assign_change_groups:?}").into()
10461 } else {
10462 String::new().into()
10463 },
10464 if let Some(assign_custom_fields) = &self.assign_custom_fields {
10465 format!("{assign_custom_fields:?}").into()
10466 } else {
10467 String::new().into()
10468 },
10469 if let Some(assign_custom_fields_values) = &self.assign_custom_fields_values {
10470 format!("{assign_custom_fields_values:?}").into()
10471 } else {
10472 String::new().into()
10473 },
10474 if let Some(remove_all_tags) = &self.remove_all_tags {
10475 format!("{remove_all_tags:?}").into()
10476 } else {
10477 String::new().into()
10478 },
10479 if let Some(remove_tags) = &self.remove_tags {
10480 format!("{remove_tags:?}").into()
10481 } else {
10482 String::new().into()
10483 },
10484 if let Some(remove_all_correspondents) = &self.remove_all_correspondents {
10485 format!("{remove_all_correspondents:?}").into()
10486 } else {
10487 String::new().into()
10488 },
10489 if let Some(remove_correspondents) = &self.remove_correspondents {
10490 format!("{remove_correspondents:?}").into()
10491 } else {
10492 String::new().into()
10493 },
10494 if let Some(remove_all_document_types) = &self.remove_all_document_types {
10495 format!("{remove_all_document_types:?}").into()
10496 } else {
10497 String::new().into()
10498 },
10499 if let Some(remove_document_types) = &self.remove_document_types {
10500 format!("{remove_document_types:?}").into()
10501 } else {
10502 String::new().into()
10503 },
10504 if let Some(remove_all_storage_paths) = &self.remove_all_storage_paths {
10505 format!("{remove_all_storage_paths:?}").into()
10506 } else {
10507 String::new().into()
10508 },
10509 if let Some(remove_storage_paths) = &self.remove_storage_paths {
10510 format!("{remove_storage_paths:?}").into()
10511 } else {
10512 String::new().into()
10513 },
10514 if let Some(remove_custom_fields) = &self.remove_custom_fields {
10515 format!("{remove_custom_fields:?}").into()
10516 } else {
10517 String::new().into()
10518 },
10519 if let Some(remove_all_custom_fields) = &self.remove_all_custom_fields {
10520 format!("{remove_all_custom_fields:?}").into()
10521 } else {
10522 String::new().into()
10523 },
10524 if let Some(remove_all_owners) = &self.remove_all_owners {
10525 format!("{remove_all_owners:?}").into()
10526 } else {
10527 String::new().into()
10528 },
10529 if let Some(remove_owners) = &self.remove_owners {
10530 format!("{remove_owners:?}").into()
10531 } else {
10532 String::new().into()
10533 },
10534 if let Some(remove_all_permissions) = &self.remove_all_permissions {
10535 format!("{remove_all_permissions:?}").into()
10536 } else {
10537 String::new().into()
10538 },
10539 if let Some(remove_view_users) = &self.remove_view_users {
10540 format!("{remove_view_users:?}").into()
10541 } else {
10542 String::new().into()
10543 },
10544 if let Some(remove_view_groups) = &self.remove_view_groups {
10545 format!("{remove_view_groups:?}").into()
10546 } else {
10547 String::new().into()
10548 },
10549 if let Some(remove_change_users) = &self.remove_change_users {
10550 format!("{remove_change_users:?}").into()
10551 } else {
10552 String::new().into()
10553 },
10554 if let Some(remove_change_groups) = &self.remove_change_groups {
10555 format!("{remove_change_groups:?}").into()
10556 } else {
10557 String::new().into()
10558 },
10559 if let Some(email) = &self.email {
10560 format!("{email:?}").into()
10561 } else {
10562 String::new().into()
10563 },
10564 if let Some(webhook) = &self.webhook {
10565 format!("{webhook:?}").into()
10566 } else {
10567 String::new().into()
10568 },
10569 ]
10570 }
10571
10572 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10573 vec![
10574 "id".into(),
10575 "type_".into(),
10576 "assign_title".into(),
10577 "assign_tags".into(),
10578 "assign_correspondent".into(),
10579 "assign_document_type".into(),
10580 "assign_storage_path".into(),
10581 "assign_owner".into(),
10582 "assign_view_users".into(),
10583 "assign_view_groups".into(),
10584 "assign_change_users".into(),
10585 "assign_change_groups".into(),
10586 "assign_custom_fields".into(),
10587 "assign_custom_fields_values".into(),
10588 "remove_all_tags".into(),
10589 "remove_tags".into(),
10590 "remove_all_correspondents".into(),
10591 "remove_correspondents".into(),
10592 "remove_all_document_types".into(),
10593 "remove_document_types".into(),
10594 "remove_all_storage_paths".into(),
10595 "remove_storage_paths".into(),
10596 "remove_custom_fields".into(),
10597 "remove_all_custom_fields".into(),
10598 "remove_all_owners".into(),
10599 "remove_owners".into(),
10600 "remove_all_permissions".into(),
10601 "remove_view_users".into(),
10602 "remove_view_groups".into(),
10603 "remove_change_users".into(),
10604 "remove_change_groups".into(),
10605 "email".into(),
10606 "webhook".into(),
10607 ]
10608 }
10609}
10610
10611#[derive(
10612 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10613)]
10614#[allow(non_snake_case)]
10615pub struct WorkflowActionEmail {
10616 #[serde(default, skip_serializing_if = "Option::is_none")]
10617 pub id: Option<i64>,
10618 #[doc = "The subject of the email, can include some placeholders, see documentation."]
10619 pub subject: String,
10620 #[doc = "The body (message) of the email, can include some placeholders, see documentation."]
10621 pub body: String,
10622 #[doc = "The destination email addresses, comma separated."]
10623 pub to: String,
10624 #[serde(default, skip_serializing_if = "Option::is_none")]
10625 pub include_document: Option<bool>,
10626}
10627
10628impl std::fmt::Display for WorkflowActionEmail {
10629 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10630 write!(
10631 f,
10632 "{}",
10633 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10634 )
10635 }
10636}
10637
10638#[cfg(feature = "tabled")]
10639impl tabled::Tabled for WorkflowActionEmail {
10640 const LENGTH: usize = 5;
10641 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10642 vec![
10643 if let Some(id) = &self.id {
10644 format!("{id:?}").into()
10645 } else {
10646 String::new().into()
10647 },
10648 self.subject.clone().into(),
10649 self.body.clone().into(),
10650 self.to.clone().into(),
10651 if let Some(include_document) = &self.include_document {
10652 format!("{include_document:?}").into()
10653 } else {
10654 String::new().into()
10655 },
10656 ]
10657 }
10658
10659 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10660 vec![
10661 "id".into(),
10662 "subject".into(),
10663 "body".into(),
10664 "to".into(),
10665 "include_document".into(),
10666 ]
10667 }
10668}
10669
10670#[derive(
10671 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10672)]
10673#[allow(non_snake_case)]
10674pub struct WorkflowActionEmailRequest {
10675 #[serde(default, skip_serializing_if = "Option::is_none")]
10676 pub id: Option<i64>,
10677 #[doc = "The subject of the email, can include some placeholders, see documentation."]
10678 pub subject: String,
10679 #[doc = "The body (message) of the email, can include some placeholders, see documentation."]
10680 pub body: String,
10681 #[doc = "The destination email addresses, comma separated."]
10682 pub to: String,
10683 #[serde(default, skip_serializing_if = "Option::is_none")]
10684 pub include_document: Option<bool>,
10685}
10686
10687impl std::fmt::Display for WorkflowActionEmailRequest {
10688 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10689 write!(
10690 f,
10691 "{}",
10692 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10693 )
10694 }
10695}
10696
10697#[cfg(feature = "tabled")]
10698impl tabled::Tabled for WorkflowActionEmailRequest {
10699 const LENGTH: usize = 5;
10700 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10701 vec![
10702 if let Some(id) = &self.id {
10703 format!("{id:?}").into()
10704 } else {
10705 String::new().into()
10706 },
10707 self.subject.clone().into(),
10708 self.body.clone().into(),
10709 self.to.clone().into(),
10710 if let Some(include_document) = &self.include_document {
10711 format!("{include_document:?}").into()
10712 } else {
10713 String::new().into()
10714 },
10715 ]
10716 }
10717
10718 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10719 vec![
10720 "id".into(),
10721 "subject".into(),
10722 "body".into(),
10723 "to".into(),
10724 "include_document".into(),
10725 ]
10726 }
10727}
10728
10729#[derive(
10730 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10731)]
10732#[allow(non_snake_case)]
10733pub struct WorkflowActionRequest {
10734 #[serde(default, skip_serializing_if = "Option::is_none")]
10735 pub id: Option<i64>,
10736 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
10737 pub type_: Option<i64>,
10738 #[doc = "Assign a document title, can include some placeholders, see documentation."]
10739 #[serde(default, skip_serializing_if = "Option::is_none")]
10740 pub assign_title: Option<String>,
10741 #[serde(default, skip_serializing_if = "Option::is_none")]
10742 pub assign_tags: Option<Vec<Option<i64>>>,
10743 #[serde(default, skip_serializing_if = "Option::is_none")]
10744 pub assign_correspondent: Option<i64>,
10745 #[serde(default, skip_serializing_if = "Option::is_none")]
10746 pub assign_document_type: Option<i64>,
10747 #[serde(default, skip_serializing_if = "Option::is_none")]
10748 pub assign_storage_path: Option<i64>,
10749 #[serde(default, skip_serializing_if = "Option::is_none")]
10750 pub assign_owner: Option<i64>,
10751 #[serde(default, skip_serializing_if = "Option::is_none")]
10752 pub assign_view_users: Option<Vec<i64>>,
10753 #[serde(default, skip_serializing_if = "Option::is_none")]
10754 pub assign_view_groups: Option<Vec<i64>>,
10755 #[serde(default, skip_serializing_if = "Option::is_none")]
10756 pub assign_change_users: Option<Vec<i64>>,
10757 #[serde(default, skip_serializing_if = "Option::is_none")]
10758 pub assign_change_groups: Option<Vec<i64>>,
10759 #[serde(default, skip_serializing_if = "Option::is_none")]
10760 pub assign_custom_fields: Option<Vec<i64>>,
10761 #[doc = "Optional values to assign to the custom fields."]
10762 #[serde(default, skip_serializing_if = "Option::is_none")]
10763 pub assign_custom_fields_values: Option<serde_json::Value>,
10764 #[serde(default, skip_serializing_if = "Option::is_none")]
10765 pub remove_all_tags: Option<bool>,
10766 #[serde(default, skip_serializing_if = "Option::is_none")]
10767 pub remove_tags: Option<Vec<i64>>,
10768 #[serde(default, skip_serializing_if = "Option::is_none")]
10769 pub remove_all_correspondents: Option<bool>,
10770 #[serde(default, skip_serializing_if = "Option::is_none")]
10771 pub remove_correspondents: Option<Vec<i64>>,
10772 #[serde(default, skip_serializing_if = "Option::is_none")]
10773 pub remove_all_document_types: Option<bool>,
10774 #[serde(default, skip_serializing_if = "Option::is_none")]
10775 pub remove_document_types: Option<Vec<i64>>,
10776 #[serde(default, skip_serializing_if = "Option::is_none")]
10777 pub remove_all_storage_paths: Option<bool>,
10778 #[serde(default, skip_serializing_if = "Option::is_none")]
10779 pub remove_storage_paths: Option<Vec<i64>>,
10780 #[serde(default, skip_serializing_if = "Option::is_none")]
10781 pub remove_custom_fields: Option<Vec<i64>>,
10782 #[serde(default, skip_serializing_if = "Option::is_none")]
10783 pub remove_all_custom_fields: Option<bool>,
10784 #[serde(default, skip_serializing_if = "Option::is_none")]
10785 pub remove_all_owners: Option<bool>,
10786 #[serde(default, skip_serializing_if = "Option::is_none")]
10787 pub remove_owners: Option<Vec<i64>>,
10788 #[serde(default, skip_serializing_if = "Option::is_none")]
10789 pub remove_all_permissions: Option<bool>,
10790 #[serde(default, skip_serializing_if = "Option::is_none")]
10791 pub remove_view_users: Option<Vec<i64>>,
10792 #[serde(default, skip_serializing_if = "Option::is_none")]
10793 pub remove_view_groups: Option<Vec<i64>>,
10794 #[serde(default, skip_serializing_if = "Option::is_none")]
10795 pub remove_change_users: Option<Vec<i64>>,
10796 #[serde(default, skip_serializing_if = "Option::is_none")]
10797 pub remove_change_groups: Option<Vec<i64>>,
10798 #[serde(default, skip_serializing_if = "Option::is_none")]
10799 pub email: Option<WorkflowActionEmailRequest>,
10800 #[serde(default, skip_serializing_if = "Option::is_none")]
10801 pub webhook: Option<WorkflowActionWebhookRequest>,
10802}
10803
10804impl std::fmt::Display for WorkflowActionRequest {
10805 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10806 write!(
10807 f,
10808 "{}",
10809 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10810 )
10811 }
10812}
10813
10814#[cfg(feature = "tabled")]
10815impl tabled::Tabled for WorkflowActionRequest {
10816 const LENGTH: usize = 33;
10817 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10818 vec![
10819 if let Some(id) = &self.id {
10820 format!("{id:?}").into()
10821 } else {
10822 String::new().into()
10823 },
10824 if let Some(type_) = &self.type_ {
10825 format!("{type_:?}").into()
10826 } else {
10827 String::new().into()
10828 },
10829 if let Some(assign_title) = &self.assign_title {
10830 format!("{assign_title:?}").into()
10831 } else {
10832 String::new().into()
10833 },
10834 if let Some(assign_tags) = &self.assign_tags {
10835 format!("{assign_tags:?}").into()
10836 } else {
10837 String::new().into()
10838 },
10839 if let Some(assign_correspondent) = &self.assign_correspondent {
10840 format!("{assign_correspondent:?}").into()
10841 } else {
10842 String::new().into()
10843 },
10844 if let Some(assign_document_type) = &self.assign_document_type {
10845 format!("{assign_document_type:?}").into()
10846 } else {
10847 String::new().into()
10848 },
10849 if let Some(assign_storage_path) = &self.assign_storage_path {
10850 format!("{assign_storage_path:?}").into()
10851 } else {
10852 String::new().into()
10853 },
10854 if let Some(assign_owner) = &self.assign_owner {
10855 format!("{assign_owner:?}").into()
10856 } else {
10857 String::new().into()
10858 },
10859 if let Some(assign_view_users) = &self.assign_view_users {
10860 format!("{assign_view_users:?}").into()
10861 } else {
10862 String::new().into()
10863 },
10864 if let Some(assign_view_groups) = &self.assign_view_groups {
10865 format!("{assign_view_groups:?}").into()
10866 } else {
10867 String::new().into()
10868 },
10869 if let Some(assign_change_users) = &self.assign_change_users {
10870 format!("{assign_change_users:?}").into()
10871 } else {
10872 String::new().into()
10873 },
10874 if let Some(assign_change_groups) = &self.assign_change_groups {
10875 format!("{assign_change_groups:?}").into()
10876 } else {
10877 String::new().into()
10878 },
10879 if let Some(assign_custom_fields) = &self.assign_custom_fields {
10880 format!("{assign_custom_fields:?}").into()
10881 } else {
10882 String::new().into()
10883 },
10884 if let Some(assign_custom_fields_values) = &self.assign_custom_fields_values {
10885 format!("{assign_custom_fields_values:?}").into()
10886 } else {
10887 String::new().into()
10888 },
10889 if let Some(remove_all_tags) = &self.remove_all_tags {
10890 format!("{remove_all_tags:?}").into()
10891 } else {
10892 String::new().into()
10893 },
10894 if let Some(remove_tags) = &self.remove_tags {
10895 format!("{remove_tags:?}").into()
10896 } else {
10897 String::new().into()
10898 },
10899 if let Some(remove_all_correspondents) = &self.remove_all_correspondents {
10900 format!("{remove_all_correspondents:?}").into()
10901 } else {
10902 String::new().into()
10903 },
10904 if let Some(remove_correspondents) = &self.remove_correspondents {
10905 format!("{remove_correspondents:?}").into()
10906 } else {
10907 String::new().into()
10908 },
10909 if let Some(remove_all_document_types) = &self.remove_all_document_types {
10910 format!("{remove_all_document_types:?}").into()
10911 } else {
10912 String::new().into()
10913 },
10914 if let Some(remove_document_types) = &self.remove_document_types {
10915 format!("{remove_document_types:?}").into()
10916 } else {
10917 String::new().into()
10918 },
10919 if let Some(remove_all_storage_paths) = &self.remove_all_storage_paths {
10920 format!("{remove_all_storage_paths:?}").into()
10921 } else {
10922 String::new().into()
10923 },
10924 if let Some(remove_storage_paths) = &self.remove_storage_paths {
10925 format!("{remove_storage_paths:?}").into()
10926 } else {
10927 String::new().into()
10928 },
10929 if let Some(remove_custom_fields) = &self.remove_custom_fields {
10930 format!("{remove_custom_fields:?}").into()
10931 } else {
10932 String::new().into()
10933 },
10934 if let Some(remove_all_custom_fields) = &self.remove_all_custom_fields {
10935 format!("{remove_all_custom_fields:?}").into()
10936 } else {
10937 String::new().into()
10938 },
10939 if let Some(remove_all_owners) = &self.remove_all_owners {
10940 format!("{remove_all_owners:?}").into()
10941 } else {
10942 String::new().into()
10943 },
10944 if let Some(remove_owners) = &self.remove_owners {
10945 format!("{remove_owners:?}").into()
10946 } else {
10947 String::new().into()
10948 },
10949 if let Some(remove_all_permissions) = &self.remove_all_permissions {
10950 format!("{remove_all_permissions:?}").into()
10951 } else {
10952 String::new().into()
10953 },
10954 if let Some(remove_view_users) = &self.remove_view_users {
10955 format!("{remove_view_users:?}").into()
10956 } else {
10957 String::new().into()
10958 },
10959 if let Some(remove_view_groups) = &self.remove_view_groups {
10960 format!("{remove_view_groups:?}").into()
10961 } else {
10962 String::new().into()
10963 },
10964 if let Some(remove_change_users) = &self.remove_change_users {
10965 format!("{remove_change_users:?}").into()
10966 } else {
10967 String::new().into()
10968 },
10969 if let Some(remove_change_groups) = &self.remove_change_groups {
10970 format!("{remove_change_groups:?}").into()
10971 } else {
10972 String::new().into()
10973 },
10974 if let Some(email) = &self.email {
10975 format!("{email:?}").into()
10976 } else {
10977 String::new().into()
10978 },
10979 if let Some(webhook) = &self.webhook {
10980 format!("{webhook:?}").into()
10981 } else {
10982 String::new().into()
10983 },
10984 ]
10985 }
10986
10987 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10988 vec![
10989 "id".into(),
10990 "type_".into(),
10991 "assign_title".into(),
10992 "assign_tags".into(),
10993 "assign_correspondent".into(),
10994 "assign_document_type".into(),
10995 "assign_storage_path".into(),
10996 "assign_owner".into(),
10997 "assign_view_users".into(),
10998 "assign_view_groups".into(),
10999 "assign_change_users".into(),
11000 "assign_change_groups".into(),
11001 "assign_custom_fields".into(),
11002 "assign_custom_fields_values".into(),
11003 "remove_all_tags".into(),
11004 "remove_tags".into(),
11005 "remove_all_correspondents".into(),
11006 "remove_correspondents".into(),
11007 "remove_all_document_types".into(),
11008 "remove_document_types".into(),
11009 "remove_all_storage_paths".into(),
11010 "remove_storage_paths".into(),
11011 "remove_custom_fields".into(),
11012 "remove_all_custom_fields".into(),
11013 "remove_all_owners".into(),
11014 "remove_owners".into(),
11015 "remove_all_permissions".into(),
11016 "remove_view_users".into(),
11017 "remove_view_groups".into(),
11018 "remove_change_users".into(),
11019 "remove_change_groups".into(),
11020 "email".into(),
11021 "webhook".into(),
11022 ]
11023 }
11024}
11025
11026#[derive(
11027 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11028)]
11029#[allow(non_snake_case)]
11030pub struct WorkflowActionWebhook {
11031 #[serde(default, skip_serializing_if = "Option::is_none")]
11032 pub id: Option<i64>,
11033 #[doc = "The destination URL for the notification."]
11034 pub url: String,
11035 #[serde(default, skip_serializing_if = "Option::is_none")]
11036 pub use_params: Option<bool>,
11037 #[serde(default, skip_serializing_if = "Option::is_none")]
11038 pub as_json: Option<bool>,
11039 #[doc = "The parameters to send with the webhook URL if body not used."]
11040 #[serde(default, skip_serializing_if = "Option::is_none")]
11041 pub params: Option<serde_json::Value>,
11042 #[doc = "The body to send with the webhook URL if parameters not used."]
11043 #[serde(default, skip_serializing_if = "Option::is_none")]
11044 pub body: Option<String>,
11045 #[doc = "The headers to send with the webhook URL."]
11046 #[serde(default, skip_serializing_if = "Option::is_none")]
11047 pub headers: Option<serde_json::Value>,
11048 #[serde(default, skip_serializing_if = "Option::is_none")]
11049 pub include_document: Option<bool>,
11050}
11051
11052impl std::fmt::Display for WorkflowActionWebhook {
11053 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11054 write!(
11055 f,
11056 "{}",
11057 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11058 )
11059 }
11060}
11061
11062#[cfg(feature = "tabled")]
11063impl tabled::Tabled for WorkflowActionWebhook {
11064 const LENGTH: usize = 8;
11065 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11066 vec![
11067 if let Some(id) = &self.id {
11068 format!("{id:?}").into()
11069 } else {
11070 String::new().into()
11071 },
11072 self.url.clone().into(),
11073 if let Some(use_params) = &self.use_params {
11074 format!("{use_params:?}").into()
11075 } else {
11076 String::new().into()
11077 },
11078 if let Some(as_json) = &self.as_json {
11079 format!("{as_json:?}").into()
11080 } else {
11081 String::new().into()
11082 },
11083 if let Some(params) = &self.params {
11084 format!("{params:?}").into()
11085 } else {
11086 String::new().into()
11087 },
11088 if let Some(body) = &self.body {
11089 format!("{body:?}").into()
11090 } else {
11091 String::new().into()
11092 },
11093 if let Some(headers) = &self.headers {
11094 format!("{headers:?}").into()
11095 } else {
11096 String::new().into()
11097 },
11098 if let Some(include_document) = &self.include_document {
11099 format!("{include_document:?}").into()
11100 } else {
11101 String::new().into()
11102 },
11103 ]
11104 }
11105
11106 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11107 vec![
11108 "id".into(),
11109 "url".into(),
11110 "use_params".into(),
11111 "as_json".into(),
11112 "params".into(),
11113 "body".into(),
11114 "headers".into(),
11115 "include_document".into(),
11116 ]
11117 }
11118}
11119
11120#[derive(
11121 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11122)]
11123#[allow(non_snake_case)]
11124pub struct WorkflowActionWebhookRequest {
11125 #[serde(default, skip_serializing_if = "Option::is_none")]
11126 pub id: Option<i64>,
11127 #[doc = "The destination URL for the notification."]
11128 pub url: String,
11129 #[serde(default, skip_serializing_if = "Option::is_none")]
11130 pub use_params: Option<bool>,
11131 #[serde(default, skip_serializing_if = "Option::is_none")]
11132 pub as_json: Option<bool>,
11133 #[doc = "The parameters to send with the webhook URL if body not used."]
11134 #[serde(default, skip_serializing_if = "Option::is_none")]
11135 pub params: Option<serde_json::Value>,
11136 #[doc = "The body to send with the webhook URL if parameters not used."]
11137 #[serde(default, skip_serializing_if = "Option::is_none")]
11138 pub body: Option<String>,
11139 #[doc = "The headers to send with the webhook URL."]
11140 #[serde(default, skip_serializing_if = "Option::is_none")]
11141 pub headers: Option<serde_json::Value>,
11142 #[serde(default, skip_serializing_if = "Option::is_none")]
11143 pub include_document: Option<bool>,
11144}
11145
11146impl std::fmt::Display for WorkflowActionWebhookRequest {
11147 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11148 write!(
11149 f,
11150 "{}",
11151 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11152 )
11153 }
11154}
11155
11156#[cfg(feature = "tabled")]
11157impl tabled::Tabled for WorkflowActionWebhookRequest {
11158 const LENGTH: usize = 8;
11159 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11160 vec![
11161 if let Some(id) = &self.id {
11162 format!("{id:?}").into()
11163 } else {
11164 String::new().into()
11165 },
11166 self.url.clone().into(),
11167 if let Some(use_params) = &self.use_params {
11168 format!("{use_params:?}").into()
11169 } else {
11170 String::new().into()
11171 },
11172 if let Some(as_json) = &self.as_json {
11173 format!("{as_json:?}").into()
11174 } else {
11175 String::new().into()
11176 },
11177 if let Some(params) = &self.params {
11178 format!("{params:?}").into()
11179 } else {
11180 String::new().into()
11181 },
11182 if let Some(body) = &self.body {
11183 format!("{body:?}").into()
11184 } else {
11185 String::new().into()
11186 },
11187 if let Some(headers) = &self.headers {
11188 format!("{headers:?}").into()
11189 } else {
11190 String::new().into()
11191 },
11192 if let Some(include_document) = &self.include_document {
11193 format!("{include_document:?}").into()
11194 } else {
11195 String::new().into()
11196 },
11197 ]
11198 }
11199
11200 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11201 vec![
11202 "id".into(),
11203 "url".into(),
11204 "use_params".into(),
11205 "as_json".into(),
11206 "params".into(),
11207 "body".into(),
11208 "headers".into(),
11209 "include_document".into(),
11210 ]
11211 }
11212}
11213
11214#[derive(
11215 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11216)]
11217#[allow(non_snake_case)]
11218pub struct WorkflowRequest {
11219 pub name: String,
11220 #[serde(default, skip_serializing_if = "Option::is_none")]
11221 pub order: Option<i64>,
11222 #[serde(default, skip_serializing_if = "Option::is_none")]
11223 pub enabled: Option<bool>,
11224 pub triggers: Vec<WorkflowTriggerRequest>,
11225 pub actions: Vec<WorkflowActionRequest>,
11226}
11227
11228impl std::fmt::Display for WorkflowRequest {
11229 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11230 write!(
11231 f,
11232 "{}",
11233 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11234 )
11235 }
11236}
11237
11238#[cfg(feature = "tabled")]
11239impl tabled::Tabled for WorkflowRequest {
11240 const LENGTH: usize = 5;
11241 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11242 vec![
11243 self.name.clone().into(),
11244 if let Some(order) = &self.order {
11245 format!("{order:?}").into()
11246 } else {
11247 String::new().into()
11248 },
11249 if let Some(enabled) = &self.enabled {
11250 format!("{enabled:?}").into()
11251 } else {
11252 String::new().into()
11253 },
11254 format!("{:?}", self.triggers).into(),
11255 format!("{:?}", self.actions).into(),
11256 ]
11257 }
11258
11259 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11260 vec![
11261 "name".into(),
11262 "order".into(),
11263 "enabled".into(),
11264 "triggers".into(),
11265 "actions".into(),
11266 ]
11267 }
11268}
11269
11270#[derive(
11271 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11272)]
11273#[allow(non_snake_case)]
11274pub struct WorkflowTrigger {
11275 #[serde(default, skip_serializing_if = "Option::is_none")]
11276 pub id: Option<i64>,
11277 #[serde(default)]
11278 pub sources: Vec<i64>,
11279 #[serde(rename = "type")]
11280 pub type_: i64,
11281 #[doc = "Only consume documents with a path that matches this if specified. Wildcards specified as * are allowed. Case insensitive."]
11282 #[serde(default, skip_serializing_if = "Option::is_none")]
11283 pub filter_path: Option<String>,
11284 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
11285 #[serde(default, skip_serializing_if = "Option::is_none")]
11286 pub filter_filename: Option<String>,
11287 #[serde(default, skip_serializing_if = "Option::is_none")]
11288 pub filter_mailrule: Option<i64>,
11289 #[serde(default, skip_serializing_if = "Option::is_none")]
11290 pub matching_algorithm: Option<i64>,
11291 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
11292 pub match_: Option<String>,
11293 #[serde(default, skip_serializing_if = "Option::is_none")]
11294 pub is_insensitive: Option<bool>,
11295 #[serde(default, skip_serializing_if = "Option::is_none")]
11296 pub filter_has_tags: Option<Vec<i64>>,
11297 #[serde(default, skip_serializing_if = "Option::is_none")]
11298 pub filter_has_correspondent: Option<i64>,
11299 #[serde(default, skip_serializing_if = "Option::is_none")]
11300 pub filter_has_document_type: Option<i64>,
11301 #[doc = "The number of days to offset the schedule trigger by."]
11302 #[serde(default, skip_serializing_if = "Option::is_none")]
11303 pub schedule_offset_days: Option<i64>,
11304 #[doc = "If the schedule should be recurring."]
11305 #[serde(default, skip_serializing_if = "Option::is_none")]
11306 pub schedule_is_recurring: Option<bool>,
11307 #[doc = "The number of days between recurring schedule triggers."]
11308 #[serde(default, skip_serializing_if = "Option::is_none")]
11309 pub schedule_recurring_interval_days: Option<i64>,
11310 #[doc = "The field to check for a schedule trigger.\n\n* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
11311 #[serde(default, skip_serializing_if = "Option::is_none")]
11312 pub schedule_date_field: Option<ScheduleDateFieldEnum>,
11313 #[serde(default, skip_serializing_if = "Option::is_none")]
11314 pub schedule_date_custom_field: Option<i64>,
11315}
11316
11317impl std::fmt::Display for WorkflowTrigger {
11318 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11319 write!(
11320 f,
11321 "{}",
11322 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11323 )
11324 }
11325}
11326
11327#[cfg(feature = "tabled")]
11328impl tabled::Tabled for WorkflowTrigger {
11329 const LENGTH: usize = 17;
11330 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11331 vec![
11332 if let Some(id) = &self.id {
11333 format!("{id:?}").into()
11334 } else {
11335 String::new().into()
11336 },
11337 format!("{:?}", self.sources).into(),
11338 format!("{:?}", self.type_).into(),
11339 if let Some(filter_path) = &self.filter_path {
11340 format!("{filter_path:?}").into()
11341 } else {
11342 String::new().into()
11343 },
11344 if let Some(filter_filename) = &self.filter_filename {
11345 format!("{filter_filename:?}").into()
11346 } else {
11347 String::new().into()
11348 },
11349 if let Some(filter_mailrule) = &self.filter_mailrule {
11350 format!("{filter_mailrule:?}").into()
11351 } else {
11352 String::new().into()
11353 },
11354 if let Some(matching_algorithm) = &self.matching_algorithm {
11355 format!("{matching_algorithm:?}").into()
11356 } else {
11357 String::new().into()
11358 },
11359 if let Some(match_) = &self.match_ {
11360 format!("{match_:?}").into()
11361 } else {
11362 String::new().into()
11363 },
11364 if let Some(is_insensitive) = &self.is_insensitive {
11365 format!("{is_insensitive:?}").into()
11366 } else {
11367 String::new().into()
11368 },
11369 if let Some(filter_has_tags) = &self.filter_has_tags {
11370 format!("{filter_has_tags:?}").into()
11371 } else {
11372 String::new().into()
11373 },
11374 if let Some(filter_has_correspondent) = &self.filter_has_correspondent {
11375 format!("{filter_has_correspondent:?}").into()
11376 } else {
11377 String::new().into()
11378 },
11379 if let Some(filter_has_document_type) = &self.filter_has_document_type {
11380 format!("{filter_has_document_type:?}").into()
11381 } else {
11382 String::new().into()
11383 },
11384 if let Some(schedule_offset_days) = &self.schedule_offset_days {
11385 format!("{schedule_offset_days:?}").into()
11386 } else {
11387 String::new().into()
11388 },
11389 if let Some(schedule_is_recurring) = &self.schedule_is_recurring {
11390 format!("{schedule_is_recurring:?}").into()
11391 } else {
11392 String::new().into()
11393 },
11394 if let Some(schedule_recurring_interval_days) = &self.schedule_recurring_interval_days {
11395 format!("{schedule_recurring_interval_days:?}").into()
11396 } else {
11397 String::new().into()
11398 },
11399 if let Some(schedule_date_field) = &self.schedule_date_field {
11400 format!("{schedule_date_field:?}").into()
11401 } else {
11402 String::new().into()
11403 },
11404 if let Some(schedule_date_custom_field) = &self.schedule_date_custom_field {
11405 format!("{schedule_date_custom_field:?}").into()
11406 } else {
11407 String::new().into()
11408 },
11409 ]
11410 }
11411
11412 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11413 vec![
11414 "id".into(),
11415 "sources".into(),
11416 "type_".into(),
11417 "filter_path".into(),
11418 "filter_filename".into(),
11419 "filter_mailrule".into(),
11420 "matching_algorithm".into(),
11421 "match_".into(),
11422 "is_insensitive".into(),
11423 "filter_has_tags".into(),
11424 "filter_has_correspondent".into(),
11425 "filter_has_document_type".into(),
11426 "schedule_offset_days".into(),
11427 "schedule_is_recurring".into(),
11428 "schedule_recurring_interval_days".into(),
11429 "schedule_date_field".into(),
11430 "schedule_date_custom_field".into(),
11431 ]
11432 }
11433}
11434
11435#[derive(
11436 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11437)]
11438#[allow(non_snake_case)]
11439pub struct WorkflowTriggerRequest {
11440 #[serde(default, skip_serializing_if = "Option::is_none")]
11441 pub id: Option<i64>,
11442 #[serde(default)]
11443 pub sources: Vec<i64>,
11444 #[serde(rename = "type")]
11445 pub type_: i64,
11446 #[doc = "Only consume documents with a path that matches this if specified. Wildcards specified as * are allowed. Case insensitive."]
11447 #[serde(default, skip_serializing_if = "Option::is_none")]
11448 pub filter_path: Option<String>,
11449 #[doc = "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."]
11450 #[serde(default, skip_serializing_if = "Option::is_none")]
11451 pub filter_filename: Option<String>,
11452 #[serde(default, skip_serializing_if = "Option::is_none")]
11453 pub filter_mailrule: Option<i64>,
11454 #[serde(default, skip_serializing_if = "Option::is_none")]
11455 pub matching_algorithm: Option<i64>,
11456 #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
11457 pub match_: Option<String>,
11458 #[serde(default, skip_serializing_if = "Option::is_none")]
11459 pub is_insensitive: Option<bool>,
11460 #[serde(default, skip_serializing_if = "Option::is_none")]
11461 pub filter_has_tags: Option<Vec<i64>>,
11462 #[serde(default, skip_serializing_if = "Option::is_none")]
11463 pub filter_has_correspondent: Option<i64>,
11464 #[serde(default, skip_serializing_if = "Option::is_none")]
11465 pub filter_has_document_type: Option<i64>,
11466 #[doc = "The number of days to offset the schedule trigger by."]
11467 #[serde(default, skip_serializing_if = "Option::is_none")]
11468 pub schedule_offset_days: Option<i64>,
11469 #[doc = "If the schedule should be recurring."]
11470 #[serde(default, skip_serializing_if = "Option::is_none")]
11471 pub schedule_is_recurring: Option<bool>,
11472 #[doc = "The number of days between recurring schedule triggers."]
11473 #[serde(default, skip_serializing_if = "Option::is_none")]
11474 pub schedule_recurring_interval_days: Option<i64>,
11475 #[doc = "The field to check for a schedule trigger.\n\n* `added` - Added\n* `created` - Created\n* `modified` - Modified\n* `custom_field` - Custom Field"]
11476 #[serde(default, skip_serializing_if = "Option::is_none")]
11477 pub schedule_date_field: Option<ScheduleDateFieldEnum>,
11478 #[serde(default, skip_serializing_if = "Option::is_none")]
11479 pub schedule_date_custom_field: Option<i64>,
11480}
11481
11482impl std::fmt::Display for WorkflowTriggerRequest {
11483 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11484 write!(
11485 f,
11486 "{}",
11487 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11488 )
11489 }
11490}
11491
11492#[cfg(feature = "tabled")]
11493impl tabled::Tabled for WorkflowTriggerRequest {
11494 const LENGTH: usize = 17;
11495 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11496 vec![
11497 if let Some(id) = &self.id {
11498 format!("{id:?}").into()
11499 } else {
11500 String::new().into()
11501 },
11502 format!("{:?}", self.sources).into(),
11503 format!("{:?}", self.type_).into(),
11504 if let Some(filter_path) = &self.filter_path {
11505 format!("{filter_path:?}").into()
11506 } else {
11507 String::new().into()
11508 },
11509 if let Some(filter_filename) = &self.filter_filename {
11510 format!("{filter_filename:?}").into()
11511 } else {
11512 String::new().into()
11513 },
11514 if let Some(filter_mailrule) = &self.filter_mailrule {
11515 format!("{filter_mailrule:?}").into()
11516 } else {
11517 String::new().into()
11518 },
11519 if let Some(matching_algorithm) = &self.matching_algorithm {
11520 format!("{matching_algorithm:?}").into()
11521 } else {
11522 String::new().into()
11523 },
11524 if let Some(match_) = &self.match_ {
11525 format!("{match_:?}").into()
11526 } else {
11527 String::new().into()
11528 },
11529 if let Some(is_insensitive) = &self.is_insensitive {
11530 format!("{is_insensitive:?}").into()
11531 } else {
11532 String::new().into()
11533 },
11534 if let Some(filter_has_tags) = &self.filter_has_tags {
11535 format!("{filter_has_tags:?}").into()
11536 } else {
11537 String::new().into()
11538 },
11539 if let Some(filter_has_correspondent) = &self.filter_has_correspondent {
11540 format!("{filter_has_correspondent:?}").into()
11541 } else {
11542 String::new().into()
11543 },
11544 if let Some(filter_has_document_type) = &self.filter_has_document_type {
11545 format!("{filter_has_document_type:?}").into()
11546 } else {
11547 String::new().into()
11548 },
11549 if let Some(schedule_offset_days) = &self.schedule_offset_days {
11550 format!("{schedule_offset_days:?}").into()
11551 } else {
11552 String::new().into()
11553 },
11554 if let Some(schedule_is_recurring) = &self.schedule_is_recurring {
11555 format!("{schedule_is_recurring:?}").into()
11556 } else {
11557 String::new().into()
11558 },
11559 if let Some(schedule_recurring_interval_days) = &self.schedule_recurring_interval_days {
11560 format!("{schedule_recurring_interval_days:?}").into()
11561 } else {
11562 String::new().into()
11563 },
11564 if let Some(schedule_date_field) = &self.schedule_date_field {
11565 format!("{schedule_date_field:?}").into()
11566 } else {
11567 String::new().into()
11568 },
11569 if let Some(schedule_date_custom_field) = &self.schedule_date_custom_field {
11570 format!("{schedule_date_custom_field:?}").into()
11571 } else {
11572 String::new().into()
11573 },
11574 ]
11575 }
11576
11577 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11578 vec![
11579 "id".into(),
11580 "sources".into(),
11581 "type_".into(),
11582 "filter_path".into(),
11583 "filter_filename".into(),
11584 "filter_mailrule".into(),
11585 "matching_algorithm".into(),
11586 "match_".into(),
11587 "is_insensitive".into(),
11588 "filter_has_tags".into(),
11589 "filter_has_correspondent".into(),
11590 "filter_has_document_type".into(),
11591 "schedule_offset_days".into(),
11592 "schedule_is_recurring".into(),
11593 "schedule_recurring_interval_days".into(),
11594 "schedule_date_field".into(),
11595 "schedule_date_custom_field".into(),
11596 ]
11597 }
11598}
11599
11600#[derive(
11601 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11602)]
11603#[allow(non_snake_case)]
11604pub struct DocumentShareLinksResponse {
11605 #[serde(default, skip_serializing_if = "Option::is_none")]
11606 pub id: Option<i64>,
11607 #[serde(default, skip_serializing_if = "Option::is_none")]
11608 pub created: Option<chrono::DateTime<chrono::Utc>>,
11609 #[serde(default, skip_serializing_if = "Option::is_none")]
11610 pub expiration: Option<chrono::DateTime<chrono::Utc>>,
11611 #[serde(default, skip_serializing_if = "Option::is_none")]
11612 pub slug: Option<String>,
11613}
11614
11615impl std::fmt::Display for DocumentShareLinksResponse {
11616 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11617 write!(
11618 f,
11619 "{}",
11620 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11621 )
11622 }
11623}
11624
11625#[cfg(feature = "tabled")]
11626impl tabled::Tabled for DocumentShareLinksResponse {
11627 const LENGTH: usize = 4;
11628 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11629 vec![
11630 if let Some(id) = &self.id {
11631 format!("{id:?}").into()
11632 } else {
11633 String::new().into()
11634 },
11635 if let Some(created) = &self.created {
11636 format!("{created:?}").into()
11637 } else {
11638 String::new().into()
11639 },
11640 if let Some(expiration) = &self.expiration {
11641 format!("{expiration:?}").into()
11642 } else {
11643 String::new().into()
11644 },
11645 if let Some(slug) = &self.slug {
11646 format!("{slug:?}").into()
11647 } else {
11648 String::new().into()
11649 },
11650 ]
11651 }
11652
11653 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11654 vec![
11655 "id".into(),
11656 "created".into(),
11657 "expiration".into(),
11658 "slug".into(),
11659 ]
11660 }
11661}
11662
11663#[derive(
11664 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11665)]
11666#[allow(non_snake_case)]
11667pub struct ProfileDisconnectSocialAccountCreateRequestBody {
11668 pub id: i64,
11669}
11670
11671impl std::fmt::Display for ProfileDisconnectSocialAccountCreateRequestBody {
11672 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11673 write!(
11674 f,
11675 "{}",
11676 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11677 )
11678 }
11679}
11680
11681#[cfg(feature = "tabled")]
11682impl tabled::Tabled for ProfileDisconnectSocialAccountCreateRequestBody {
11683 const LENGTH: usize = 1;
11684 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11685 vec![format!("{:?}", self.id).into()]
11686 }
11687
11688 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11689 vec!["id".into()]
11690 }
11691}
11692
11693#[derive(
11694 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11695)]
11696#[allow(non_snake_case)]
11697pub struct ProfileTotpCreateRequestBody {
11698 pub secret: String,
11699 pub code: String,
11700}
11701
11702impl std::fmt::Display for ProfileTotpCreateRequestBody {
11703 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11704 write!(
11705 f,
11706 "{}",
11707 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11708 )
11709 }
11710}
11711
11712#[cfg(feature = "tabled")]
11713impl tabled::Tabled for ProfileTotpCreateRequestBody {
11714 const LENGTH: usize = 2;
11715 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11716 vec![self.secret.clone().into(), self.code.clone().into()]
11717 }
11718
11719 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11720 vec!["secret".into(), "code".into()]
11721 }
11722}
11723
11724#[derive(
11725 serde :: Serialize,
11726 serde :: Deserialize,
11727 PartialEq,
11728 Hash,
11729 Debug,
11730 Clone,
11731 schemars :: JsonSchema,
11732 parse_display :: FromStr,
11733 parse_display :: Display,
11734)]
11735#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
11736#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
11737pub enum Status {
11738 #[serde(rename = "FAILURE")]
11739 #[display("FAILURE")]
11740 Failure,
11741 #[serde(rename = "PENDING")]
11742 #[display("PENDING")]
11743 Pending,
11744 #[serde(rename = "RECEIVED")]
11745 #[display("RECEIVED")]
11746 Received,
11747 #[serde(rename = "RETRY")]
11748 #[display("RETRY")]
11749 Retry,
11750 #[serde(rename = "REVOKED")]
11751 #[display("REVOKED")]
11752 Revoked,
11753 #[serde(rename = "STARTED")]
11754 #[display("STARTED")]
11755 Started,
11756 #[serde(rename = "SUCCESS")]
11757 #[display("SUCCESS")]
11758 Success,
11759}
11760
11761#[derive(
11762 serde :: Serialize,
11763 serde :: Deserialize,
11764 PartialEq,
11765 Hash,
11766 Debug,
11767 Clone,
11768 schemars :: JsonSchema,
11769 parse_display :: FromStr,
11770 parse_display :: Display,
11771)]
11772#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
11773#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
11774pub enum ListTaskName {
11775 #[serde(rename = "check_sanity")]
11776 #[display("check_sanity")]
11777 CheckSanity,
11778 #[serde(rename = "consume_file")]
11779 #[display("consume_file")]
11780 ConsumeFile,
11781 #[serde(rename = "index_optimize")]
11782 #[display("index_optimize")]
11783 IndexOptimize,
11784 #[serde(rename = "train_classifier")]
11785 #[display("train_classifier")]
11786 TrainClassifier,
11787}
11788
11789#[derive(
11790 serde :: Serialize,
11791 serde :: Deserialize,
11792 PartialEq,
11793 Hash,
11794 Debug,
11795 Clone,
11796 schemars :: JsonSchema,
11797 parse_display :: FromStr,
11798 parse_display :: Display,
11799)]
11800#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
11801#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
11802pub enum Type {
11803 #[serde(rename = "auto_task")]
11804 #[display("auto_task")]
11805 AutoTask,
11806 #[serde(rename = "manual_task")]
11807 #[display("manual_task")]
11808 ManualTask,
11809 #[serde(rename = "scheduled_task")]
11810 #[display("scheduled_task")]
11811 ScheduledTask,
11812}
11813
11814#[derive(
11815 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11816)]
11817#[allow(non_snake_case)]
11818pub struct AcknowledgeTasksRequestBody {
11819 pub tasks: Vec<i64>,
11820}
11821
11822impl std::fmt::Display for AcknowledgeTasksRequestBody {
11823 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11824 write!(
11825 f,
11826 "{}",
11827 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11828 )
11829 }
11830}
11831
11832#[cfg(feature = "tabled")]
11833impl tabled::Tabled for AcknowledgeTasksRequestBody {
11834 const LENGTH: usize = 1;
11835 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11836 vec![format!("{:?}", self.tasks).into()]
11837 }
11838
11839 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11840 vec!["tasks".into()]
11841 }
11842}