Skip to main content

wellfriend/generated/
tools.rs

1// Generated by scripts/sdk/generate-rust.mjs. Do not edit.
2//! Tools: the tool id list, typed parameters per tool, and one method per tool.
3
4#![allow(clippy::too_many_lines)]
5
6use serde::{Deserialize, Serialize};
7
8use crate::error::Result;
9use crate::file_input::{FileInput, ToolInput};
10use crate::pipeline::Step;
11use crate::tools::{ToolParameters, ToolResult, Tools};
12use crate::Object;
13
14string_enum! {
15    /// A tool id. Tools this SDK version does not know are kept in `Unknown`.
16    ToolId {
17        /// Add Page Numbers: Insert numbered headers or footers.
18        AddPageNumbers => "add-page-numbers",
19        /// Add Watermark: Stamp text or image onto pages.
20        AddWatermark => "add-watermark",
21        /// Check PDF: One report on PDF/A conformance, PDF/UA accessibility and digital signatures.
22        CheckPdf => "check-pdf",
23        /// Compress: Make PDFs and images smaller without changing how they look.
24        CompressPdf => "compress-pdf",
25        /// Convert from JPG: Export JPG files to another image format.
26        ConvertFromJpg => "convert-from-jpg",
27        /// Convert to JPG: Convert supported images to JPG.
28        ConvertToJpg => "convert-to-jpg",
29        /// Crop Image: Crop an image to exact dimensions.
30        CropImage => "crop-image",
31        /// Crop PDF: Trim the margins of every page or the pages you pick.
32        CropPdf => "crop-pdf",
33        /// CSV to PDF: Convert CSV tables into a readable PDF.
34        CsvToPdf => "csv-to-pdf",
35        /// Check & Edit Metadata: Review and update document information.
36        EditMetadata => "edit-metadata",
37        /// Excel to PDF: Convert spreadsheet files to PDF.
38        ExcelToPdf => "excel-to-pdf",
39        /// Flatten PDF: Merge form fields into static pages.
40        FlattenPdf => "flatten-pdf",
41        /// Image Metadata: Read an image's format, size, colour mode, frames and EXIF facts.
42        ImageMetadata => "image-metadata",
43        /// Image to PDF: Combine supported image files into a single PDF.
44        ImageToPdf => "image-to-pdf",
45        /// JSON to PDF: Render structured JSON into a readable PDF.
46        JsonToPdf => "json-to-pdf",
47        /// Markdown to PDF: Convert Markdown content into a PDF document.
48        MarkdownToPdf => "markdown-to-pdf",
49        /// Merge PDF: Combine multiple PDFs into one file.
50        MergePdf => "merge-pdf",
51        /// N-up PDF: Put several pages on each sheet.
52        NUpPdf => "n-up-pdf",
53        /// OCR PDF: Recognise the text of a scanned PDF or an image (PNG, JPEG, TIFF or WebP).
54        OcrPdf => "ocr-pdf",
55        /// Organize PDF: Reorder pages and remove the ones you leave out.
56        OrganizePdf => "organize-pdf",
57        PdfEdit => "pdf-edit",
58        /// PDF Table Extraction: Extract table-like content from PDF text.
59        PdfTableExtraction => "pdf-table-extraction",
60        /// PDF to Chunks: Split the text of a PDF into chunks for search and AI retrieval.
61        PdfToChunks => "pdf-to-chunks",
62        /// PDF to EPUB: Create a text-based EPUB from PDF content.
63        PdfToEpub => "pdf-to-epub",
64        /// PDF to Excel: Export detected PDF tables into XLSX.
65        PdfToExcel => "pdf-to-excel",
66        /// PDF to HTML: Convert the text of a PDF into a clean web page.
67        PdfToHtml => "pdf-to-html",
68        /// PDF to Images: Export pages or embedded images from a PDF.
69        PdfToImages => "pdf-to-images",
70        /// PDF to JSON: Export PDF text as structured JSON.
71        PdfToJson => "pdf-to-json",
72        /// PDF to Markdown: Convert extracted PDF text into Markdown.
73        PdfToMarkdown => "pdf-to-markdown",
74        /// PDF to PowerPoint: Turn every page into a slide of a PowerPoint deck.
75        PdfToPowerpoint => "pdf-to-powerpoint",
76        /// PDF to Text: Extract selectable or OCR text from a PDF.
77        PdfToText => "pdf-to-text",
78        /// PDF to Word: Convert extracted PDF text into editable DOCX.
79        PdfToWord => "pdf-to-word",
80        /// PDF/A Conversion: Convert a PDF to PDF/A for long-term archiving.
81        PdfaConversion => "pdfa-conversion",
82        /// PowerPoint to PDF: Convert presentation files to PDF.
83        PowerpointToPdf => "powerpoint-to-pdf",
84        /// Protect PDF: Lock a file with a password.
85        ProtectPdf => "protect-pdf",
86        RenderPage => "render-page",
87        /// Repair PDF: Fix corrupted or broken PDF files.
88        RepairPdf => "repair-pdf",
89        /// Resize Image: Change image dimensions precisely.
90        ResizeImage => "resize-image",
91        /// Rotate Image: Correct image orientation.
92        RotateImage => "rotate-image",
93        /// Rotate PDF: Rotate all or specific pages.
94        RotatePdf => "rotate-pdf",
95        /// Sanitize PDF.
96        SanitizePdf => "sanitize-pdf",
97        /// Redact PDF: Permanently remove text, images and areas you choose.
98        RedactPdf => "redact-pdf",
99        /// Scale PDF: Resize pages and their content by a percentage.
100        ScalePdf => "scale-pdf",
101        /// Sign PDF: Add a visible signature to a PDF.
102        SignPdf => "sign-pdf",
103        /// Split PDF: Separate pages into individual files.
104        SplitPdf => "split-pdf",
105        /// SVG to PDF: Convert safe SVG artwork into PDF format.
106        SvgToPdf => "svg-to-pdf",
107        /// Text to PDF: Convert plain text into a PDF document.
108        TextToPdf => "text-to-pdf",
109        /// Unlock PDF: Remove password from a file you own.
110        UnlockPdf => "unlock-pdf",
111        /// Watermark Image: Apply text or logo marks to an image.
112        WatermarkImage => "watermark-image",
113        /// Web page to PDF or image: Capture a web address or pasted HTML as a PDF or a PNG, JPEG or WebP
114        /// image.
115        WebCapture => "web-capture",
116        /// Word to PDF: Convert document files to PDF.
117        WordToPdf => "word-to-pdf",
118    }
119}
120
121/// What a tool accepts and produces.
122#[derive(Debug, Clone, Copy, PartialEq, Eq)]
123#[non_exhaustive]
124pub struct ToolSpec {
125    /// The tool id.
126    pub id: &'static str,
127    /// The display name.
128    pub name: &'static str,
129    /// The fewest input files.
130    pub min_files: usize,
131    /// The most input files.
132    pub max_files: usize,
133    /// Accepted file extensions.
134    pub accepts: &'static [&'static str],
135    /// The output content type.
136    pub output_content_type: &'static str,
137    /// The output file extension.
138    pub output_extension: &'static str,
139}
140
141/// Every tool in the catalog.
142pub const TOOLS: &[ToolSpec] = &[
143    ToolSpec {
144        id: "add-page-numbers",
145        name: "Add Page Numbers",
146        min_files: 1,
147        max_files: 1,
148        accepts: &[".pdf"],
149        output_content_type: "application/pdf",
150        output_extension: "pdf",
151    },
152    ToolSpec {
153        id: "add-watermark",
154        name: "Add Watermark",
155        min_files: 1,
156        max_files: 1,
157        accepts: &[".pdf"],
158        output_content_type: "application/pdf",
159        output_extension: "pdf",
160    },
161    ToolSpec {
162        id: "edit-metadata",
163        name: "Check & Edit Metadata",
164        min_files: 1,
165        max_files: 1,
166        accepts: &[".pdf"],
167        output_content_type: "application/pdf",
168        output_extension: "pdf",
169    },
170    ToolSpec {
171        id: "check-pdf",
172        name: "Check PDF",
173        min_files: 1,
174        max_files: 1,
175        accepts: &[".pdf"],
176        output_content_type: "application/json",
177        output_extension: "json",
178    },
179    ToolSpec {
180        id: "compress-pdf",
181        name: "Compress",
182        min_files: 1,
183        max_files: 1,
184        accepts: &[
185            ".avif", ".bmp", ".gif", ".jpeg", ".jpg", ".pdf", ".png", ".tif", ".tiff", ".webp",
186        ],
187        output_content_type: "application/pdf",
188        output_extension: "pdf",
189    },
190    ToolSpec {
191        id: "crop-pdf",
192        name: "Crop PDF",
193        min_files: 1,
194        max_files: 1,
195        accepts: &[".pdf"],
196        output_content_type: "application/pdf",
197        output_extension: "pdf",
198    },
199    ToolSpec {
200        id: "flatten-pdf",
201        name: "Flatten PDF",
202        min_files: 1,
203        max_files: 1,
204        accepts: &[".pdf"],
205        output_content_type: "application/pdf",
206        output_extension: "pdf",
207    },
208    ToolSpec {
209        id: "merge-pdf",
210        name: "Merge PDF",
211        min_files: 2,
212        max_files: 30,
213        accepts: &[".pdf"],
214        output_content_type: "application/pdf",
215        output_extension: "pdf",
216    },
217    ToolSpec {
218        id: "n-up-pdf",
219        name: "N-up PDF",
220        min_files: 1,
221        max_files: 1,
222        accepts: &[".pdf"],
223        output_content_type: "application/pdf",
224        output_extension: "pdf",
225    },
226    ToolSpec {
227        id: "ocr-pdf",
228        name: "OCR PDF",
229        min_files: 1,
230        max_files: 1,
231        accepts: &[
232            ".avif", ".bmp", ".csv", ".docx", ".eml", ".gif", ".jpeg", ".jpg", ".msg", ".pdf",
233            ".png", ".pptx", ".tif", ".tiff", ".tsv", ".webp", ".xlsx", ".zip",
234        ],
235        output_content_type: "application/pdf",
236        output_extension: "pdf",
237    },
238    ToolSpec {
239        id: "organize-pdf",
240        name: "Organize PDF",
241        min_files: 1,
242        max_files: 1,
243        accepts: &[".pdf"],
244        output_content_type: "application/pdf",
245        output_extension: "pdf",
246    },
247    ToolSpec {
248        id: "pdf-table-extraction",
249        name: "PDF Table Extraction",
250        min_files: 1,
251        max_files: 1,
252        accepts: &[".pdf"],
253        output_content_type: "application/zip",
254        output_extension: "zip",
255    },
256    ToolSpec {
257        id: "protect-pdf",
258        name: "Protect PDF",
259        min_files: 1,
260        max_files: 1,
261        accepts: &[".pdf"],
262        output_content_type: "application/pdf",
263        output_extension: "pdf",
264    },
265    ToolSpec {
266        id: "redact-pdf",
267        name: "Redact PDF",
268        min_files: 1,
269        max_files: 1,
270        accepts: &[".pdf"],
271        output_content_type: "application/pdf",
272        output_extension: "pdf",
273    },
274    ToolSpec {
275        id: "repair-pdf",
276        name: "Repair PDF",
277        min_files: 1,
278        max_files: 1,
279        accepts: &[".pdf"],
280        output_content_type: "application/pdf",
281        output_extension: "pdf",
282    },
283    ToolSpec {
284        id: "rotate-pdf",
285        name: "Rotate PDF",
286        min_files: 1,
287        max_files: 1,
288        accepts: &[".pdf"],
289        output_content_type: "application/pdf",
290        output_extension: "pdf",
291    },
292    ToolSpec {
293        id: "sanitize-pdf",
294        name: "Sanitize PDF",
295        min_files: 1,
296        max_files: 1,
297        accepts: &[".pdf"],
298        output_content_type: "application/pdf",
299        output_extension: "pdf",
300    },
301    ToolSpec {
302        id: "scale-pdf",
303        name: "Scale PDF",
304        min_files: 1,
305        max_files: 1,
306        accepts: &[".pdf"],
307        output_content_type: "application/pdf",
308        output_extension: "pdf",
309    },
310    ToolSpec {
311        id: "sign-pdf",
312        name: "Sign PDF",
313        min_files: 1,
314        max_files: 1,
315        accepts: &[".pdf"],
316        output_content_type: "application/pdf",
317        output_extension: "pdf",
318    },
319    ToolSpec {
320        id: "split-pdf",
321        name: "Split PDF",
322        min_files: 1,
323        max_files: 1,
324        accepts: &[".pdf"],
325        output_content_type: "application/zip",
326        output_extension: "zip",
327    },
328    ToolSpec {
329        id: "unlock-pdf",
330        name: "Unlock PDF",
331        min_files: 1,
332        max_files: 1,
333        accepts: &[".pdf"],
334        output_content_type: "application/pdf",
335        output_extension: "pdf",
336    },
337    ToolSpec {
338        id: "csv-to-pdf",
339        name: "CSV to PDF",
340        min_files: 1,
341        max_files: 1,
342        accepts: &[".csv", ".txt"],
343        output_content_type: "application/pdf",
344        output_extension: "pdf",
345    },
346    ToolSpec {
347        id: "excel-to-pdf",
348        name: "Excel to PDF",
349        min_files: 1,
350        max_files: 1,
351        accepts: &[".ods", ".xlsx"],
352        output_content_type: "application/pdf",
353        output_extension: "pdf",
354    },
355    ToolSpec {
356        id: "image-to-pdf",
357        name: "Image to PDF",
358        min_files: 1,
359        max_files: 50,
360        accepts: &[".jpeg", ".jpg", ".png", ".webp"],
361        output_content_type: "application/pdf",
362        output_extension: "pdf",
363    },
364    ToolSpec {
365        id: "json-to-pdf",
366        name: "JSON to PDF",
367        min_files: 1,
368        max_files: 1,
369        accepts: &[".json", ".txt"],
370        output_content_type: "application/pdf",
371        output_extension: "pdf",
372    },
373    ToolSpec {
374        id: "markdown-to-pdf",
375        name: "Markdown to PDF",
376        min_files: 1,
377        max_files: 1,
378        accepts: &[".markdown", ".md", ".txt"],
379        output_content_type: "application/pdf",
380        output_extension: "pdf",
381    },
382    ToolSpec {
383        id: "pdf-to-chunks",
384        name: "PDF to Chunks",
385        min_files: 1,
386        max_files: 1,
387        accepts: &[".pdf"],
388        output_content_type: "application/json",
389        output_extension: "json",
390    },
391    ToolSpec {
392        id: "pdf-to-epub",
393        name: "PDF to EPUB",
394        min_files: 1,
395        max_files: 1,
396        accepts: &[".pdf"],
397        output_content_type: "application/epub+zip",
398        output_extension: "epub",
399    },
400    ToolSpec {
401        id: "pdf-to-excel",
402        name: "PDF to Excel",
403        min_files: 1,
404        max_files: 1,
405        accepts: &[".pdf"],
406        output_content_type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
407        output_extension: "xlsx",
408    },
409    ToolSpec {
410        id: "pdf-to-html",
411        name: "PDF to HTML",
412        min_files: 1,
413        max_files: 1,
414        accepts: &[".pdf"],
415        output_content_type: "text/html",
416        output_extension: "html",
417    },
418    ToolSpec {
419        id: "pdf-to-images",
420        name: "PDF to Images",
421        min_files: 1,
422        max_files: 1,
423        accepts: &[".pdf"],
424        output_content_type: "application/zip",
425        output_extension: "zip",
426    },
427    ToolSpec {
428        id: "pdf-to-json",
429        name: "PDF to JSON",
430        min_files: 1,
431        max_files: 1,
432        accepts: &[".pdf"],
433        output_content_type: "application/json",
434        output_extension: "json",
435    },
436    ToolSpec {
437        id: "pdf-to-markdown",
438        name: "PDF to Markdown",
439        min_files: 1,
440        max_files: 1,
441        accepts: &[".pdf"],
442        output_content_type: "text/markdown",
443        output_extension: "md",
444    },
445    ToolSpec {
446        id: "pdf-to-powerpoint",
447        name: "PDF to PowerPoint",
448        min_files: 1,
449        max_files: 1,
450        accepts: &[".pdf"],
451        output_content_type:
452            "application/vnd.openxmlformats-officedocument.presentationml.presentation",
453        output_extension: "pptx",
454    },
455    ToolSpec {
456        id: "pdf-to-text",
457        name: "PDF to Text",
458        min_files: 1,
459        max_files: 1,
460        accepts: &[".pdf"],
461        output_content_type: "text/plain",
462        output_extension: "txt",
463    },
464    ToolSpec {
465        id: "pdf-to-word",
466        name: "PDF to Word",
467        min_files: 1,
468        max_files: 1,
469        accepts: &[".pdf"],
470        output_content_type:
471            "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
472        output_extension: "docx",
473    },
474    ToolSpec {
475        id: "pdfa-conversion",
476        name: "PDF/A Conversion",
477        min_files: 1,
478        max_files: 1,
479        accepts: &[".pdf"],
480        output_content_type: "application/pdf",
481        output_extension: "pdf",
482    },
483    ToolSpec {
484        id: "powerpoint-to-pdf",
485        name: "PowerPoint to PDF",
486        min_files: 1,
487        max_files: 1,
488        accepts: &[".odp", ".pptx"],
489        output_content_type: "application/pdf",
490        output_extension: "pdf",
491    },
492    ToolSpec {
493        id: "svg-to-pdf",
494        name: "SVG to PDF",
495        min_files: 1,
496        max_files: 1,
497        accepts: &[".svg"],
498        output_content_type: "application/pdf",
499        output_extension: "pdf",
500    },
501    ToolSpec {
502        id: "text-to-pdf",
503        name: "Text to PDF",
504        min_files: 1,
505        max_files: 1,
506        accepts: &[".txt"],
507        output_content_type: "application/pdf",
508        output_extension: "pdf",
509    },
510    ToolSpec {
511        id: "web-capture",
512        name: "Web page to PDF or image",
513        min_files: 1,
514        max_files: 1,
515        accepts: &[".htm", ".html", ".txt", ".url"],
516        output_content_type: "application/pdf",
517        output_extension: "pdf",
518    },
519    ToolSpec {
520        id: "word-to-pdf",
521        name: "Word to PDF",
522        min_files: 1,
523        max_files: 1,
524        accepts: &[".docx", ".odt"],
525        output_content_type: "application/pdf",
526        output_extension: "pdf",
527    },
528    ToolSpec {
529        id: "convert-from-jpg",
530        name: "Convert from JPG",
531        min_files: 1,
532        max_files: 1,
533        accepts: &[".jpeg", ".jpg"],
534        output_content_type: "image/png",
535        output_extension: "png",
536    },
537    ToolSpec {
538        id: "convert-to-jpg",
539        name: "Convert to JPG",
540        min_files: 1,
541        max_files: 1,
542        accepts: &[".avif", ".jpeg", ".jpg", ".png", ".tiff", ".webp"],
543        output_content_type: "image/jpeg",
544        output_extension: "jpg",
545    },
546    ToolSpec {
547        id: "crop-image",
548        name: "Crop Image",
549        min_files: 1,
550        max_files: 1,
551        accepts: &[".avif", ".jpeg", ".jpg", ".png", ".tiff", ".webp"],
552        output_content_type: "application/octet-stream",
553        output_extension: "bin",
554    },
555    ToolSpec {
556        id: "image-metadata",
557        name: "Image Metadata",
558        min_files: 1,
559        max_files: 1,
560        accepts: &[".gif", ".jpeg", ".jpg", ".png", ".webp"],
561        output_content_type: "application/json",
562        output_extension: "json",
563    },
564    ToolSpec {
565        id: "resize-image",
566        name: "Resize Image",
567        min_files: 1,
568        max_files: 1,
569        accepts: &[".avif", ".jpeg", ".jpg", ".png", ".tiff", ".webp"],
570        output_content_type: "application/octet-stream",
571        output_extension: "bin",
572    },
573    ToolSpec {
574        id: "rotate-image",
575        name: "Rotate Image",
576        min_files: 1,
577        max_files: 1,
578        accepts: &[".avif", ".jpeg", ".jpg", ".png", ".tiff", ".webp"],
579        output_content_type: "application/octet-stream",
580        output_extension: "bin",
581    },
582    ToolSpec {
583        id: "watermark-image",
584        name: "Watermark Image",
585        min_files: 1,
586        max_files: 1,
587        accepts: &[".avif", ".jpeg", ".jpg", ".png", ".tiff", ".webp"],
588        output_content_type: "application/octet-stream",
589        output_extension: "bin",
590    },
591];
592
593/// The catalog entry of a tool.
594pub fn tool_spec(id: &str) -> Option<&'static ToolSpec> {
595    TOOLS.iter().find(|spec| spec.id == id)
596}
597
598string_enum! {
599    /// Choices for `position`.
600    AddPageNumbersPosition {
601        TopLeft => "top-left",
602        TopCenter => "top-center",
603        TopRight => "top-right",
604        MiddleLeft => "middle-left",
605        MiddleCenter => "middle-center",
606        MiddleRight => "middle-right",
607        BottomLeft => "bottom-left",
608        BottomCenter => "bottom-center",
609        BottomRight => "bottom-right",
610        Diagonal => "diagonal",
611    }
612}
613
614string_enum! {
615    /// Choices for `positionMode`.
616    AddPageNumbersPositionMode {
617        Preset => "preset",
618        Custom => "custom",
619    }
620}
621
622string_enum! {
623    /// Choices for `format`.
624    AddPageNumbersFormat {
625        Number => "number",
626        PageNumber => "page-number",
627        NumberOfTotal => "number-of-total",
628        Dashes => "dashes",
629        Custom => "custom",
630    }
631}
632
633string_enum! {
634    /// Choices for `pageMode`.
635    AddPageNumbersPageMode {
636        Single => "single",
637        Facing => "facing",
638    }
639}
640
641string_enum! {
642    /// Choices for `facingPlacement`.
643    AddPageNumbersFacingPlacement {
644        Outside => "outside",
645        Inside => "inside",
646    }
647}
648
649string_enum! {
650    /// Choices for `fontStyle`.
651    AddPageNumbersFontStyle {
652        Regular => "regular",
653        Bold => "bold",
654        Italic => "italic",
655        BoldItalic => "bold-italic",
656    }
657}
658
659/// Parameters of Add Page Numbers (`add-page-numbers`).
660#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
661pub struct AddPageNumbersParams {
662    /// Number placement. Default: `"middle-center"`.
663    #[serde(default, skip_serializing_if = "Option::is_none")]
664    pub position: Option<AddPageNumbersPosition>,
665    /// Use a placement preset or percentage coordinates. Default: `"preset"`.
666    #[serde(
667        rename = "positionMode",
668        default,
669        skip_serializing_if = "Option::is_none"
670    )]
671    pub position_mode: Option<AddPageNumbersPositionMode>,
672    /// Horizontal center for custom placement. Default: `50`. Range: 0 to 100. Used when
673    /// `position_mode` is `custom`.
674    #[serde(
675        rename = "xPercent",
676        default,
677        skip_serializing_if = "Option::is_none",
678        serialize_with = "crate::util::number"
679    )]
680    pub x_percent: Option<f64>,
681    /// Vertical center for custom placement. Default: `50`. Range: 0 to 100. Used when `position_mode`
682    /// is `custom`.
683    #[serde(
684        rename = "yPercent",
685        default,
686        skip_serializing_if = "Option::is_none",
687        serialize_with = "crate::util::number"
688    )]
689    pub y_percent: Option<f64>,
690    /// Size multiplier applied to fontSize. Default: `1`. Range: 0.1 to 4.
691    #[serde(
692        default,
693        skip_serializing_if = "Option::is_none",
694        serialize_with = "crate::util::number"
695    )]
696    pub scale: Option<f64>,
697    /// Page-number text format. Default: `"number"`.
698    #[serde(default, skip_serializing_if = "Option::is_none")]
699    pub format: Option<AddPageNumbersFormat>,
700    /// Custom template using {n} and {total}. Required in custom format. Used when `format` is
701    /// `custom`.
702    #[serde(default, skip_serializing_if = "Option::is_none")]
703    pub template: Option<String>,
704    /// Text before the generated page number, up to 40 characters.
705    #[serde(default, skip_serializing_if = "Option::is_none")]
706    pub prefix: Option<String>,
707    /// Text after the generated page number, up to 40 characters.
708    #[serde(default, skip_serializing_if = "Option::is_none")]
709    pub suffix: Option<String>,
710    /// Single placement or mirrored facing-page placement. Default: `"single"`.
711    #[serde(rename = "pageMode", default, skip_serializing_if = "Option::is_none")]
712    pub page_mode: Option<AddPageNumbersPageMode>,
713    /// Place facing-page numbers inside or outside. Default: `"outside"`. Used when `page_mode` is
714    /// `facing`.
715    #[serde(
716        rename = "facingPlacement",
717        default,
718        skip_serializing_if = "Option::is_none"
719    )]
720    pub facing_placement: Option<AddPageNumbersFacingPlacement>,
721    /// Number assigned to the first selected PDF page. Default: `1`. Range: 1 to 1000000.
722    #[serde(
723        rename = "startNumber",
724        default,
725        skip_serializing_if = "Option::is_none",
726        serialize_with = "crate::util::number"
727    )]
728    pub start_number: Option<f64>,
729    /// Number font size in points, before scale is applied. Default: `60`. Range: 8 to 180.
730    #[serde(
731        rename = "fontSize",
732        default,
733        skip_serializing_if = "Option::is_none",
734        serialize_with = "crate::util::number"
735    )]
736    pub font_size: Option<f64>,
737    /// Number font: helvetica, times or courier (standard PDF fonts); gf:&lt;id&gt; embeds a family of
738    /// the font catalog (/docs/fonts: every Google Fonts family, all scripts, shaped for Devanagari,
739    /// Bengali, Tamil, Telugu and Arabic); u:&lt;id&gt; one of your uploaded fonts (the id from your
740    /// fonts in the PDF editor; another person's or a deleted font is refused). Default: `"helvetica"`.
741    #[serde(
742        rename = "fontFamily",
743        default,
744        skip_serializing_if = "Option::is_none"
745    )]
746    pub font_family: Option<String>,
747    /// Font style. Default: `"regular"`.
748    #[serde(rename = "fontStyle", default, skip_serializing_if = "Option::is_none")]
749    pub font_style: Option<AddPageNumbersFontStyle>,
750    /// Fine horizontal offset in PDF points. Positive moves right. Default: `0`.
751    #[serde(
752        rename = "xOffset",
753        default,
754        skip_serializing_if = "Option::is_none",
755        serialize_with = "crate::util::number"
756    )]
757    pub x_offset: Option<f64>,
758    /// Fine vertical offset in PDF points. Positive moves down. Default: `0`.
759    #[serde(
760        rename = "yOffset",
761        default,
762        skip_serializing_if = "Option::is_none",
763        serialize_with = "crate::util::number"
764    )]
765    pub y_offset: Option<f64>,
766    /// Page-edge margin in PDF points for preset placement. Default: `36`. Range: 0 to 240.
767    #[serde(
768        default,
769        skip_serializing_if = "Option::is_none",
770        serialize_with = "crate::util::number"
771    )]
772    pub margin: Option<f64>,
773    /// Turn of the number in degrees, counter-clockwise, from -360 to 360 (decimals allowed; 0 and 360
774    /// are upright). The number sits at its spot, and stays whole on the page, by the box it covers
775    /// once turned. When omitted it is 45 for the diagonal position, otherwise 0. Range: -360 to 360
776    /// degrees.
777    #[serde(
778        default,
779        skip_serializing_if = "Option::is_none",
780        serialize_with = "crate::util::number"
781    )]
782    pub rotation: Option<f64>,
783    /// Number color as a six-digit hex value. Default: `"#2e2e2e"`.
784    #[serde(default, skip_serializing_if = "Option::is_none")]
785    pub color: Option<String>,
786    /// Pages to number; blank numbers every page. Page numbers and ranges separated by commas, plus
787    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
788    #[serde(default, skip_serializing_if = "Option::is_none")]
789    pub pages: Option<String>,
790    /// Output file name without a path; the extension is added for you.
791    #[serde(
792        rename = "outputName",
793        default,
794        skip_serializing_if = "Option::is_none"
795    )]
796    pub output_name: Option<String>,
797    /// Further parameters this SDK version does not model.
798    #[serde(flatten)]
799    pub extra: Object,
800}
801
802impl From<AddPageNumbersParams> for ToolParameters {
803    fn from(params: AddPageNumbersParams) -> Self {
804        ToolParameters::from_serialize(&params).unwrap_or_default()
805    }
806}
807
808string_enum! {
809    /// Choices for `type`.
810    AddWatermarkType {
811        Text => "text",
812        Image => "image",
813    }
814}
815
816string_enum! {
817    /// Choices for `layer`.
818    AddWatermarkLayer {
819        Over => "over",
820        Below => "below",
821    }
822}
823
824string_enum! {
825    /// Choices for `pattern`.
826    AddWatermarkPattern {
827        Single => "single",
828        Tile => "tile",
829    }
830}
831
832string_enum! {
833    /// Choices for `position`.
834    AddWatermarkPosition {
835        TopLeft => "top-left",
836        TopCenter => "top-center",
837        TopRight => "top-right",
838        MiddleLeft => "middle-left",
839        MiddleCenter => "middle-center",
840        MiddleRight => "middle-right",
841        BottomLeft => "bottom-left",
842        BottomCenter => "bottom-center",
843        BottomRight => "bottom-right",
844    }
845}
846
847string_enum! {
848    /// Choices for `positionMode`.
849    AddWatermarkPositionMode {
850        Preset => "preset",
851        Custom => "custom",
852    }
853}
854
855string_enum! {
856    /// Choices for `fontStyle`.
857    AddWatermarkFontStyle {
858        Regular => "regular",
859        Bold => "bold",
860        Italic => "italic",
861        BoldItalic => "bold-italic",
862    }
863}
864
865/// Parameters of Add Watermark (`add-watermark`).
866#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
867pub struct AddWatermarkParams {
868    /// Text or image watermark. Default: `"text"`.
869    #[serde(default, skip_serializing_if = "Option::is_none")]
870    pub r#type: Option<AddWatermarkType>,
871    /// Watermark text, up to 120 characters. Required in text mode. Used when `r#type` is `text`.
872    #[serde(default, skip_serializing_if = "Option::is_none")]
873    pub text: Option<String>,
874    /// Opacity from 1 to 100 percent. Default: `35`. Range: 1 to 100 %.
875    #[serde(
876        default,
877        skip_serializing_if = "Option::is_none",
878        serialize_with = "crate::util::number"
879    )]
880    pub opacity: Option<f64>,
881    /// Draw over or below page content. Default: `"over"`.
882    #[serde(default, skip_serializing_if = "Option::is_none")]
883    pub layer: Option<AddWatermarkLayer>,
884    /// Single or tiled watermark. Default: `"single"`.
885    #[serde(default, skip_serializing_if = "Option::is_none")]
886    pub pattern: Option<AddWatermarkPattern>,
887    /// Tile spacing in PDF points. Default: `180`. Range: 60 to 600. Used when `pattern` is `tile`.
888    #[serde(
889        rename = "tileSpacing",
890        default,
891        skip_serializing_if = "Option::is_none",
892        serialize_with = "crate::util::number"
893    )]
894    pub tile_spacing: Option<f64>,
895    /// Rotation in degrees, counter-clockwise. Default: `45`. Range: -360 to 360 degrees.
896    #[serde(
897        default,
898        skip_serializing_if = "Option::is_none",
899        serialize_with = "crate::util::number"
900    )]
901    pub rotation: Option<f64>,
902    /// Preset placement, one of nine spots. A custom spot uses positionMode=custom with xPercent and
903    /// yPercent. Default: `"middle-center"`.
904    #[serde(default, skip_serializing_if = "Option::is_none")]
905    pub position: Option<AddWatermarkPosition>,
906    /// Use a placement preset or percentage coordinates. Default: `"preset"`.
907    #[serde(
908        rename = "positionMode",
909        default,
910        skip_serializing_if = "Option::is_none"
911    )]
912    pub position_mode: Option<AddWatermarkPositionMode>,
913    /// Horizontal centre of the watermark as a percentage of the page width; the watermark is kept
914    /// inside the page. Default: `50`. Range: 0 to 100. Used when `position_mode` is `custom`.
915    #[serde(
916        rename = "xPercent",
917        default,
918        skip_serializing_if = "Option::is_none",
919        serialize_with = "crate::util::number"
920    )]
921    pub x_percent: Option<f64>,
922    /// Vertical centre of the watermark as a percentage of the page height, from the top; the watermark
923    /// is kept inside the page. Default: `50`. Range: 0 to 100. Used when `position_mode` is `custom`.
924    #[serde(
925        rename = "yPercent",
926        default,
927        skip_serializing_if = "Option::is_none",
928        serialize_with = "crate::util::number"
929    )]
930    pub y_percent: Option<f64>,
931    /// Width of an image watermark as a percentage of the page width. Default: `34`. Range: 5 to 100 %.
932    /// Used when `r#type` is `image`.
933    #[serde(
934        default,
935        skip_serializing_if = "Option::is_none",
936        serialize_with = "crate::util::number"
937    )]
938    pub scale: Option<f64>,
939    /// Text watermark font size in points. Default: `60`. Range: 8 to 180. Used when `r#type` is
940    /// `text`.
941    #[serde(
942        rename = "fontSize",
943        default,
944        skip_serializing_if = "Option::is_none",
945        serialize_with = "crate::util::number"
946    )]
947    pub font_size: Option<f64>,
948    /// Text-watermark font: helvetica, times or courier (standard PDF fonts); gf:&lt;id&gt; embeds a
949    /// family of the font catalog (/docs/fonts: every Google Fonts family, all scripts, shaped for
950    /// Devanagari, Bengali, Tamil, Telugu and Arabic); u:&lt;id&gt; one of your uploaded fonts (the id
951    /// from your fonts in the PDF editor; another person's or a deleted font is refused). Default:
952    /// `"helvetica"`. Used when `r#type` is `text`.
953    #[serde(
954        rename = "fontFamily",
955        default,
956        skip_serializing_if = "Option::is_none"
957    )]
958    pub font_family: Option<String>,
959    /// Text-watermark font style. Default: `"regular"`. Used when `r#type` is `text`.
960    #[serde(rename = "fontStyle", default, skip_serializing_if = "Option::is_none")]
961    pub font_style: Option<AddWatermarkFontStyle>,
962    /// Fine horizontal offset in PDF points. Positive moves right. Default: `0`. Range: -240 to 240.
963    #[serde(
964        rename = "xOffset",
965        default,
966        skip_serializing_if = "Option::is_none",
967        serialize_with = "crate::util::number"
968    )]
969    pub x_offset: Option<f64>,
970    /// Fine vertical offset in PDF points. Positive moves down. Default: `0`. Range: -240 to 240.
971    #[serde(
972        rename = "yOffset",
973        default,
974        skip_serializing_if = "Option::is_none",
975        serialize_with = "crate::util::number"
976    )]
977    pub y_offset: Option<f64>,
978    /// Text color as a six-digit hex value. Default: `"#2e2e2e"`. Used when `r#type` is `text`.
979    #[serde(default, skip_serializing_if = "Option::is_none")]
980    pub color: Option<String>,
981    /// Pages to watermark; blank applies to every page. Page numbers and ranges separated by commas,
982    /// plus odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
983    #[serde(default, skip_serializing_if = "Option::is_none")]
984    pub pages: Option<String>,
985    /// Output file name without a path; the extension is added for you.
986    #[serde(
987        rename = "outputName",
988        default,
989        skip_serializing_if = "Option::is_none"
990    )]
991    pub output_name: Option<String>,
992    /// Further parameters this SDK version does not model.
993    #[serde(flatten)]
994    pub extra: Object,
995}
996
997impl From<AddWatermarkParams> for ToolParameters {
998    fn from(params: AddWatermarkParams) -> Self {
999        ToolParameters::from_serialize(&params).unwrap_or_default()
1000    }
1001}
1002
1003string_enum! {
1004    /// Choices for `preset`.
1005    EditMetadataPreset {
1006        PrivacyCleanup => "privacy-cleanup",
1007        KeepTitleOnly => "keep-title-only",
1008        RemoveAuthorCreatorProducer => "remove-author-creator-producer",
1009        ClearAll => "clear-all",
1010        Custom => "custom",
1011    }
1012}
1013
1014/// Parameters of Check & Edit Metadata (`edit-metadata`).
1015#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1016pub struct EditMetadataParams {
1017    /// Metadata cleanup preset. When omitted, only the fields you send are written. `ai-suggest` fills
1018    /// title, subject and keywords from the first pages in AI mode; values you send win.
1019    #[serde(default, skip_serializing_if = "Option::is_none")]
1020    pub preset: Option<EditMetadataPreset>,
1021    /// PDF title metadata. An empty value clears it.
1022    #[serde(default, skip_serializing_if = "Option::is_none")]
1023    pub title: Option<String>,
1024    /// PDF author metadata. An empty value clears it.
1025    #[serde(default, skip_serializing_if = "Option::is_none")]
1026    pub author: Option<String>,
1027    /// PDF subject metadata. An empty value clears it.
1028    #[serde(default, skip_serializing_if = "Option::is_none")]
1029    pub subject: Option<String>,
1030    /// PDF keyword metadata. An empty value clears it.
1031    #[serde(default, skip_serializing_if = "Option::is_none")]
1032    pub keywords: Option<String>,
1033    /// PDF creator metadata. An empty value clears it.
1034    #[serde(default, skip_serializing_if = "Option::is_none")]
1035    pub creator: Option<String>,
1036    /// PDF producer metadata. An empty value clears it.
1037    #[serde(default, skip_serializing_if = "Option::is_none")]
1038    pub producer: Option<String>,
1039    /// Output file name without a path; the extension is added for you.
1040    #[serde(
1041        rename = "outputName",
1042        default,
1043        skip_serializing_if = "Option::is_none"
1044    )]
1045    pub output_name: Option<String>,
1046    /// Further parameters this SDK version does not model.
1047    #[serde(flatten)]
1048    pub extra: Object,
1049}
1050
1051impl From<EditMetadataParams> for ToolParameters {
1052    fn from(params: EditMetadataParams) -> Self {
1053        ToolParameters::from_serialize(&params).unwrap_or_default()
1054    }
1055}
1056
1057string_enum! {
1058    /// Choices for `targetProfile`.
1059    CheckPdfTargetProfile {
1060        Pdfa1b => "pdfa-1b",
1061        Pdfa2b => "pdfa-2b",
1062        Pdfa2u => "pdfa-2u",
1063        Pdfa3b => "pdfa-3b",
1064        Pdfa3u => "pdfa-3u",
1065    }
1066}
1067
1068/// Parameters of Check PDF (`check-pdf`).
1069#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1070pub struct CheckPdfParams {
1071    /// Check PDF/A archival conformance. Default: `true`.
1072    #[serde(rename = "checkPdfa", default, skip_serializing_if = "Option::is_none")]
1073    pub check_pdfa: Option<bool>,
1074    /// PDF/A profile to check against. Default: `"pdfa-2b"`. Used when `check_pdfa` is `true`.
1075    #[serde(
1076        rename = "targetProfile",
1077        default,
1078        skip_serializing_if = "Option::is_none"
1079    )]
1080    pub target_profile: Option<CheckPdfTargetProfile>,
1081    /// Check the PDF/UA accessibility rules a machine can test. Default: `true`.
1082    #[serde(
1083        rename = "checkPdfua",
1084        default,
1085        skip_serializing_if = "Option::is_none"
1086    )]
1087    pub check_pdfua: Option<bool>,
1088    /// Validate every digital signature: integrity, certificate and trust. Default: `true`.
1089    #[serde(
1090        rename = "checkSignatures",
1091        default,
1092        skip_serializing_if = "Option::is_none"
1093    )]
1094    pub check_signatures: Option<bool>,
1095    /// Output file name without a path; the extension is added for you.
1096    #[serde(
1097        rename = "outputName",
1098        default,
1099        skip_serializing_if = "Option::is_none"
1100    )]
1101    pub output_name: Option<String>,
1102    /// Further parameters this SDK version does not model.
1103    #[serde(flatten)]
1104    pub extra: Object,
1105}
1106
1107impl From<CheckPdfParams> for ToolParameters {
1108    fn from(params: CheckPdfParams) -> Self {
1109        ToolParameters::from_serialize(&params).unwrap_or_default()
1110    }
1111}
1112
1113string_enum! {
1114    /// Choices for `profile`.
1115    CompressPdfProfile {
1116        Best => "best",
1117        Medium => "medium",
1118        AggressiveLossless => "aggressive_lossless",
1119        AggressiveMax => "aggressive_max",
1120    }
1121}
1122
1123string_enum! {
1124    /// Choices for `targetUnit`.
1125    CompressPdfTargetUnit {
1126        Kb => "kb",
1127        Mb => "mb",
1128    }
1129}
1130
1131string_enum! {
1132    /// Choices for `metadata`.
1133    CompressPdfMetadata {
1134        Keep => "keep",
1135        Strip => "strip",
1136    }
1137}
1138
1139/// Parameters of Compress (`compress-pdf`).
1140#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1141pub struct CompressPdfParams {
1142    /// Compression profile, for PDFs and images alike. best keeps the highest quality, medium balances
1143    /// size and quality, aggressive_lossless is the strongest compression that never changes how pages
1144    /// look (an image keeps every pixel), aggressive_max makes the smallest files. The output is never
1145    /// larger than the input: when nothing smaller is valid the original is returned. Default:
1146    /// `"best"`.
1147    #[serde(default, skip_serializing_if = "Option::is_none")]
1148    pub profile: Option<CompressPdfProfile>,
1149    /// Optimise for fast web view (linearize): a browser shows the first page while the rest downloads.
1150    /// Runs after compression and never compresses again. Default: `false`.
1151    #[serde(
1152        rename = "fastWebView",
1153        default,
1154        skip_serializing_if = "Option::is_none"
1155    )]
1156    pub fast_web_view: Option<bool>,
1157    /// Target output size in targetUnit (1 KB = 1024 bytes). Wellfriend tries the chosen profile first
1158    /// and, only if needed, stronger profiles (a lossless profile stays lossless). The result reports
1159    /// whether the target was reached or the closest valid output was returned. Range: 0.01 to 2097152.
1160    #[serde(
1161        rename = "targetSize",
1162        default,
1163        skip_serializing_if = "Option::is_none",
1164        serialize_with = "crate::util::number"
1165    )]
1166    pub target_size: Option<f64>,
1167    /// The unit of the target size. Default: `"mb"`.
1168    #[serde(
1169        rename = "targetUnit",
1170        default,
1171        skip_serializing_if = "Option::is_none"
1172    )]
1173    pub target_unit: Option<CompressPdfTargetUnit>,
1174    /// How far above the target the output may land and still count as reaching it. Default: `7.5`.
1175    /// Range: 5 to 10 %.
1176    #[serde(
1177        rename = "targetSizeTolerancePercent",
1178        default,
1179        skip_serializing_if = "Option::is_none",
1180        serialize_with = "crate::util::number"
1181    )]
1182    pub target_size_tolerance_percent: Option<f64>,
1183    /// Images only: keep copies the image's details (EXIF, XMP, text, colour profile); strip removes
1184    /// them but keeps the orientation and the colour profile, so the image still looks the same. A PDF
1185    /// ignores it. Default: `"keep"`.
1186    #[serde(default, skip_serializing_if = "Option::is_none")]
1187    pub metadata: Option<CompressPdfMetadata>,
1188    /// Output file name without a path; the extension is added for you.
1189    #[serde(
1190        rename = "outputName",
1191        default,
1192        skip_serializing_if = "Option::is_none"
1193    )]
1194    pub output_name: Option<String>,
1195    /// Further parameters this SDK version does not model.
1196    #[serde(flatten)]
1197    pub extra: Object,
1198}
1199
1200impl From<CompressPdfParams> for ToolParameters {
1201    fn from(params: CompressPdfParams) -> Self {
1202        ToolParameters::from_serialize(&params).unwrap_or_default()
1203    }
1204}
1205
1206/// Parameters of Crop PDF (`crop-pdf`).
1207#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1208pub struct CropPdfParams {
1209    /// Points to trim from the top of each page. Default: `0`. Range: 0 to 2000.
1210    #[serde(
1211        default,
1212        skip_serializing_if = "Option::is_none",
1213        serialize_with = "crate::util::number"
1214    )]
1215    pub top: Option<f64>,
1216    /// Points to trim from the right of each page. Default: `0`. Range: 0 to 2000.
1217    #[serde(
1218        default,
1219        skip_serializing_if = "Option::is_none",
1220        serialize_with = "crate::util::number"
1221    )]
1222    pub right: Option<f64>,
1223    /// Points to trim from the bottom of each page. Default: `0`. Range: 0 to 2000.
1224    #[serde(
1225        default,
1226        skip_serializing_if = "Option::is_none",
1227        serialize_with = "crate::util::number"
1228    )]
1229    pub bottom: Option<f64>,
1230    /// Points to trim from the left of each page. Default: `0`. Range: 0 to 2000.
1231    #[serde(
1232        default,
1233        skip_serializing_if = "Option::is_none",
1234        serialize_with = "crate::util::number"
1235    )]
1236    pub left: Option<f64>,
1237    /// Pages to crop; blank crops every page. Page numbers and ranges separated by commas, plus odd,
1238    /// even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
1239    #[serde(default, skip_serializing_if = "Option::is_none")]
1240    pub pages: Option<String>,
1241    /// Output file name without a path; the extension is added for you.
1242    #[serde(
1243        rename = "outputName",
1244        default,
1245        skip_serializing_if = "Option::is_none"
1246    )]
1247    pub output_name: Option<String>,
1248    /// Further parameters this SDK version does not model.
1249    #[serde(flatten)]
1250    pub extra: Object,
1251}
1252
1253impl From<CropPdfParams> for ToolParameters {
1254    fn from(params: CropPdfParams) -> Self {
1255        ToolParameters::from_serialize(&params).unwrap_or_default()
1256    }
1257}
1258
1259/// Parameters of Flatten PDF (`flatten-pdf`).
1260#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1261pub struct FlattenPdfParams {
1262    /// Bake form-field values into the page. Default: `true`.
1263    #[serde(
1264        rename = "flattenForms",
1265        default,
1266        skip_serializing_if = "Option::is_none"
1267    )]
1268    pub flatten_forms: Option<bool>,
1269    /// Flatten supported annotation appearances. Default: `false`.
1270    #[serde(
1271        rename = "flattenAnnotations",
1272        default,
1273        skip_serializing_if = "Option::is_none"
1274    )]
1275    pub flatten_annotations: Option<bool>,
1276    /// Flatten optional-content layers. Default: `false`.
1277    #[serde(
1278        rename = "flattenLayers",
1279        default,
1280        skip_serializing_if = "Option::is_none"
1281    )]
1282    pub flatten_layers: Option<bool>,
1283    /// Render pages to images and rebuild a static PDF. When true, the three flatten options are
1284    /// skipped. Default: `false`.
1285    #[serde(default, skip_serializing_if = "Option::is_none")]
1286    pub rasterize: Option<bool>,
1287    /// Raster resolution. Default: `150`. Range: 72 to 300 dpi. Used when `rasterize` is `true`.
1288    #[serde(
1289        default,
1290        skip_serializing_if = "Option::is_none",
1291        serialize_with = "crate::util::number"
1292    )]
1293    pub dpi: Option<f64>,
1294    /// Output file name without a path; the extension is added for you.
1295    #[serde(
1296        rename = "outputName",
1297        default,
1298        skip_serializing_if = "Option::is_none"
1299    )]
1300    pub output_name: Option<String>,
1301    /// Further parameters this SDK version does not model.
1302    #[serde(flatten)]
1303    pub extra: Object,
1304}
1305
1306impl From<FlattenPdfParams> for ToolParameters {
1307    fn from(params: FlattenPdfParams) -> Self {
1308        ToolParameters::from_serialize(&params).unwrap_or_default()
1309    }
1310}
1311
1312/// Parameters of Merge PDF (`merge-pdf`).
1313#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1314pub struct MergePdfParams {
1315    /// The pages taken from each file, in merge order, separated by semicolons; blank (or nothing
1316    /// between two semicolons) takes every page of that file. Each entry uses page numbers and ranges,
1317    /// e.g. 1-3;;2,5 takes pages 1-3 of the first file, all of the second and pages 2 and 5 of the
1318    /// third.
1319    #[serde(rename = "filePages", default, skip_serializing_if = "Option::is_none")]
1320    pub file_pages: Option<String>,
1321    /// A clockwise turn for each file, in merge order, comma-separated: 0, 90, 180 or 270, e.g. 0,90
1322    /// turns every page of the second file a quarter turn.
1323    #[serde(
1324        rename = "fileRotations",
1325        default,
1326        skip_serializing_if = "Option::is_none"
1327    )]
1328    pub file_rotations: Option<String>,
1329    /// Output file name without a path; the extension is added for you.
1330    #[serde(
1331        rename = "outputName",
1332        default,
1333        skip_serializing_if = "Option::is_none"
1334    )]
1335    pub output_name: Option<String>,
1336    /// Further parameters this SDK version does not model.
1337    #[serde(flatten)]
1338    pub extra: Object,
1339}
1340
1341impl From<MergePdfParams> for ToolParameters {
1342    fn from(params: MergePdfParams) -> Self {
1343        ToolParameters::from_serialize(&params).unwrap_or_default()
1344    }
1345}
1346
1347string_enum! {
1348    /// Choices for `pagesPerSheet`.
1349    NUpPdfPagesPerSheet {
1350        V2 => "2",
1351        V4 => "4",
1352        V6 => "6",
1353        V8 => "8",
1354        V9 => "9",
1355        V16 => "16",
1356    }
1357}
1358
1359/// Parameters of N-up PDF (`n-up-pdf`).
1360#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1361pub struct NUpPdfParams {
1362    /// How many pages go on each sheet, in reading order. Default: `"2"`.
1363    #[serde(
1364        rename = "pagesPerSheet",
1365        default,
1366        skip_serializing_if = "Option::is_none"
1367    )]
1368    pub pages_per_sheet: Option<NUpPdfPagesPerSheet>,
1369    /// Space between the pages and around the sheet, in points. Default: `0`. Range: 0 to 72.
1370    #[serde(
1371        default,
1372        skip_serializing_if = "Option::is_none",
1373        serialize_with = "crate::util::number"
1374    )]
1375    pub gap: Option<f64>,
1376    /// Output file name without a path; the extension is added for you.
1377    #[serde(
1378        rename = "outputName",
1379        default,
1380        skip_serializing_if = "Option::is_none"
1381    )]
1382    pub output_name: Option<String>,
1383    /// Further parameters this SDK version does not model.
1384    #[serde(flatten)]
1385    pub extra: Object,
1386}
1387
1388impl From<NUpPdfParams> for ToolParameters {
1389    fn from(params: NUpPdfParams) -> Self {
1390        ToolParameters::from_serialize(&params).unwrap_or_default()
1391    }
1392}
1393
1394string_enum! {
1395    /// Choices for `mode`.
1396    OcrPdfMode {
1397        Read => "read",
1398        Extract => "extract",
1399    }
1400}
1401
1402string_enum! {
1403    /// Choices for `outputMode`.
1404    OcrPdfOutputMode {
1405        SearchablePdf => "searchable-pdf",
1406        Text => "text",
1407        Markdown => "markdown",
1408        Json => "json",
1409        Docx => "docx",
1410        Html => "html",
1411        Xlsx => "xlsx",
1412        Csv => "csv",
1413        Hocr => "hocr",
1414        Alto => "alto",
1415        BlockJson => "block-json",
1416        AnnotationJson => "annotation-json",
1417    }
1418}
1419
1420string_enum! {
1421    /// Choices for `quality`.
1422    OcrPdfQuality {
1423        Fast => "fast",
1424        Standard => "standard",
1425        High => "high",
1426    }
1427}
1428
1429string_enum! {
1430    /// Choices for `priority`.
1431    OcrPdfPriority {
1432        Standard => "standard",
1433        Batch => "batch",
1434    }
1435}
1436
1437/// Parameters of OCR PDF (`ocr-pdf`).
1438#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1439pub struct OcrPdfParams {
1440    /// read gives the full text of every page in reading order with the layout kept; extract gives
1441    /// fields, tables and line items as checked data (use templateId, queries or schema to say which).
1442    /// Default: `"read"`.
1443    #[serde(default, skip_serializing_if = "Option::is_none")]
1444    pub mode: Option<OcrPdfMode>,
1445    /// Languages on the page, as comma-separated codes from the OCR language list, at most 10, such as
1446    /// "en,hi"; auto detects them. Default: `"en"`.
1447    #[serde(default, skip_serializing_if = "Option::is_none")]
1448    pub languages: Option<String>,
1449    /// The result document: a searchable PDF with an invisible text layer, or the recognised text as
1450    /// plain text, Markdown, JSON, Word, HTML, Excel, CSV, hOCR, ALTO XML, block JSON or annotation
1451    /// JSON (every format the dashboard OCR offers). Default: `"searchable-pdf"`.
1452    #[serde(
1453        rename = "outputMode",
1454        default,
1455        skip_serializing_if = "Option::is_none"
1456    )]
1457    pub output_mode: Option<OcrPdfOutputMode>,
1458    /// Further formats from the same result, comma-separated output formats, such as "text,xlsx". Each
1459    /// becomes its own derived document, listed in the operation's result metadata (outputs).
1460    #[serde(default, skip_serializing_if = "Option::is_none")]
1461    pub outputs: Option<String>,
1462    /// What to read, comma-separated: text, layout, tables, forms (labels and their filled values),
1463    /// signatures. Questions (queries) add the queries feature by themselves. Default: `"text,layout"`.
1464    #[serde(default, skip_serializing_if = "Option::is_none")]
1465    pub features: Option<String>,
1466    /// Recognition quality: fast for clean prints, standard for most scans, high for difficult scans,
1467    /// handwriting and small print. Default: `"standard"`.
1468    #[serde(default, skip_serializing_if = "Option::is_none")]
1469    pub quality: Option<OcrPdfQuality>,
1470    /// Optional pages to read; blank means all pages. Page numbers and ranges separated by commas, plus
1471    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
1472    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
1473    pub page_range: Option<String>,
1474    /// Extract with one of your saved OCR templates (an ocrtpl_ id from Dashboard, OCR, Templates; it
1475    /// must be ready). Use a template, queries or a schema, not more than one. Used when `mode` is
1476    /// `extract`.
1477    #[serde(
1478        rename = "templateId",
1479        default,
1480        skip_serializing_if = "Option::is_none"
1481    )]
1482    pub template_id: Option<String>,
1483    /// Questions to answer from the document, one per line, up to 30 of up to 200 characters, such as
1484    /// "What is the policy number?".
1485    #[serde(default, skip_serializing_if = "Option::is_none")]
1486    pub queries: Option<String>,
1487    /// Extract only: the fields to extract, as a JSON schema object (up to 64 KB). Used when `mode` is
1488    /// `extract`.
1489    #[serde(default, skip_serializing_if = "Option::is_none")]
1490    pub schema: Option<String>,
1491    /// Extract only: the columns and number style of the Excel and CSV outputs, as a JSON object; the
1492    /// template's layout or the default when empty. Used when `mode` is `extract`.
1493    #[serde(default, skip_serializing_if = "Option::is_none")]
1494    pub shaping: Option<String>,
1495    /// The PDF's open password, for a locked PDF. Used for this job only; never stored or shown again.
1496    #[serde(default, skip_serializing_if = "Option::is_none")]
1497    pub password: Option<String>,
1498    /// Keep the OCR results for 30 days and list the job in your OCR history (otherwise they are
1499    /// deleted after 1 hour). Default: `false`.
1500    #[serde(
1501        rename = "saveHistory",
1502        default,
1503        skip_serializing_if = "Option::is_none"
1504    )]
1505    pub save_history: Option<bool>,
1506    /// An OCR webhook endpoint registered on your account (Dashboard, OCR, Webhooks), told when the OCR
1507    /// job ends.
1508    #[serde(
1509        rename = "webhookUrl",
1510        default,
1511        skip_serializing_if = "Option::is_none"
1512    )]
1513    pub webhook_url: Option<String>,
1514    /// `batch` costs half the credits and can take up to 45 minutes; jobs over 200 pages always run as
1515    /// batch. Default: `"standard"`.
1516    #[serde(default, skip_serializing_if = "Option::is_none")]
1517    pub priority: Option<OcrPdfPriority>,
1518    /// Output file name without a path; the extension is added for you.
1519    #[serde(
1520        rename = "outputName",
1521        default,
1522        skip_serializing_if = "Option::is_none"
1523    )]
1524    pub output_name: Option<String>,
1525    /// Further parameters this SDK version does not model.
1526    #[serde(flatten)]
1527    pub extra: Object,
1528}
1529
1530impl From<OcrPdfParams> for ToolParameters {
1531    fn from(params: OcrPdfParams) -> Self {
1532        ToolParameters::from_serialize(&params).unwrap_or_default()
1533    }
1534}
1535
1536/// Parameters of Organize PDF (`organize-pdf`).
1537#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1538pub struct OrganizePdfParams {
1539    /// Final one-based page sequence to keep; omitted pages are removed. Page numbers and ranges
1540    /// separated by commas, up to 20000 characters; a descending range reverses its pages, so 532-1
1541    /// reverses a 532-page document and 1-10,20,15-12 keeps pages 1 to 10, then 20, then 15 down to 12.
1542    /// Each page may appear once.
1543    #[serde(default)]
1544    pub order: String,
1545    /// Optional clockwise rotations applied after reordering, as page:angle pairs on the reordered
1546    /// pages (1 is the first page of the result), e.g. 1:90,3:180. Angles are 90, 180, 270 or -90.
1547    #[serde(default, skip_serializing_if = "Option::is_none")]
1548    pub rotations: Option<String>,
1549    /// Output file name without a path; the extension is added for you.
1550    #[serde(
1551        rename = "outputName",
1552        default,
1553        skip_serializing_if = "Option::is_none"
1554    )]
1555    pub output_name: Option<String>,
1556    /// Further parameters this SDK version does not model.
1557    #[serde(flatten)]
1558    pub extra: Object,
1559}
1560
1561impl From<OrganizePdfParams> for ToolParameters {
1562    fn from(params: OrganizePdfParams) -> Self {
1563        ToolParameters::from_serialize(&params).unwrap_or_default()
1564    }
1565}
1566
1567/// Parameters of PDF Table Extraction (`pdf-table-extraction`).
1568#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1569pub struct PdfTableExtractionParams {
1570    /// Optional pages to read; blank means all pages. Page numbers and ranges separated by commas, plus
1571    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
1572    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
1573    pub page_range: Option<String>,
1574    /// Output file name without a path; the extension is added for you.
1575    #[serde(
1576        rename = "outputName",
1577        default,
1578        skip_serializing_if = "Option::is_none"
1579    )]
1580    pub output_name: Option<String>,
1581    /// Further parameters this SDK version does not model.
1582    #[serde(flatten)]
1583    pub extra: Object,
1584}
1585
1586impl From<PdfTableExtractionParams> for ToolParameters {
1587    fn from(params: PdfTableExtractionParams) -> Self {
1588        ToolParameters::from_serialize(&params).unwrap_or_default()
1589    }
1590}
1591
1592string_enum! {
1593    /// Choices for `encryption`.
1594    ProtectPdfEncryption {
1595        Aes256 => "aes-256",
1596        Aes128 => "aes-128",
1597    }
1598}
1599
1600/// Parameters of Protect PDF (`protect-pdf`).
1601#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1602pub struct ProtectPdfParams {
1603    /// Password to set, up to 256 characters.
1604    #[serde(default)]
1605    pub password: String,
1606    /// Allow printing. Default: `true`.
1607    #[serde(
1608        rename = "allowPrint",
1609        default,
1610        skip_serializing_if = "Option::is_none"
1611    )]
1612    pub allow_print: Option<bool>,
1613    /// Allow text and image extraction. Default: `true`.
1614    #[serde(rename = "allowCopy", default, skip_serializing_if = "Option::is_none")]
1615    pub allow_copy: Option<bool>,
1616    /// Allow document editing. Default: `false`.
1617    #[serde(rename = "allowEdit", default, skip_serializing_if = "Option::is_none")]
1618    pub allow_edit: Option<bool>,
1619    /// Allow comments and annotations. Default: `false`.
1620    #[serde(
1621        rename = "allowAnnotate",
1622        default,
1623        skip_serializing_if = "Option::is_none"
1624    )]
1625    pub allow_annotate: Option<bool>,
1626    /// Separate owner (permissions) password, up to 256 characters. When omitted the owner password is
1627    /// the open password.
1628    #[serde(
1629        rename = "ownerPassword",
1630        default,
1631        skip_serializing_if = "Option::is_none"
1632    )]
1633    pub owner_password: Option<String>,
1634    /// Default: `"aes-256"`.
1635    #[serde(default, skip_serializing_if = "Option::is_none")]
1636    pub encryption: Option<ProtectPdfEncryption>,
1637    /// Output file name without a path; the extension is added for you.
1638    #[serde(
1639        rename = "outputName",
1640        default,
1641        skip_serializing_if = "Option::is_none"
1642    )]
1643    pub output_name: Option<String>,
1644    /// Further parameters this SDK version does not model.
1645    #[serde(flatten)]
1646    pub extra: Object,
1647}
1648
1649impl From<ProtectPdfParams> for ToolParameters {
1650    fn from(params: ProtectPdfParams) -> Self {
1651        ToolParameters::from_serialize(&params).unwrap_or_default()
1652    }
1653}
1654
1655string_enum! {
1656    /// Choices for `imagePolicy`.
1657    RedactPdfImagePolicy {
1658        Partial => "partial",
1659        Remove => "remove",
1660    }
1661}
1662
1663/// Parameters of Redact PDF (`redact-pdf`).
1664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1665pub struct RedactPdfParams {
1666    /// Areas to remove, as page:x,y,width,height in PDF points from the page's bottom-left corner (the
1667    /// PDF's own user space), separated by semicolons, e.g. 1:72,640,200,40;3:50,100,120,30. A turned
1668    /// area adds its angle as a fifth value, degrees counter-clockwise about the area's centre from
1669    /// -360 to 360, e.g. 1:72,640,200,40,30 (a multiple of 90 is an upright area). Everything under an
1670    /// area is removed: text, vector art and the covered part of images; a turned area is painted in
1671    /// its own shape.
1672    #[serde(default, skip_serializing_if = "Option::is_none")]
1673    pub regions: Option<String>,
1674    /// Words or phrases to remove wherever they appear, one per line. Matching is exact and
1675    /// case-sensitive, as written.
1676    #[serde(
1677        rename = "searchTerms",
1678        default,
1679        skip_serializing_if = "Option::is_none"
1680    )]
1681    pub search_terms: Option<String>,
1682    /// Kinds of data to find and remove, comma-separated: email, phone, number (sequences of 4 or more
1683    /// digits, such as account or card numbers), date. Matches are found in the PDF's text and removed
1684    /// like search terms.
1685    #[serde(default, skip_serializing_if = "Option::is_none")]
1686    pub patterns: Option<String>,
1687    /// Pages searched for terms and patterns; blank searches every page. Areas carry their own page.
1688    /// Page numbers and ranges separated by commas, plus odd, even, last and last-N (the Nth page
1689    /// before the last), e.g. 1-3,5, odd or 5-last.
1690    #[serde(default, skip_serializing_if = "Option::is_none")]
1691    pub pages: Option<String>,
1692    /// What happens to an image under an area: partial removes only the covered pixels; remove deletes
1693    /// every image an area touches. Default: `"partial"`.
1694    #[serde(
1695        rename = "imagePolicy",
1696        default,
1697        skip_serializing_if = "Option::is_none"
1698    )]
1699    pub image_policy: Option<RedactPdfImagePolicy>,
1700    /// Keep the document information, XMP and attachment names even when they contain a removed term.
1701    /// By default they are scrubbed too. Default: `false`.
1702    #[serde(
1703        rename = "keepMetadata",
1704        default,
1705        skip_serializing_if = "Option::is_none"
1706    )]
1707    pub keep_metadata: Option<bool>,
1708    /// Output file name without a path; the extension is added for you.
1709    #[serde(
1710        rename = "outputName",
1711        default,
1712        skip_serializing_if = "Option::is_none"
1713    )]
1714    pub output_name: Option<String>,
1715    /// Further parameters this SDK version does not model.
1716    #[serde(flatten)]
1717    pub extra: Object,
1718}
1719
1720impl From<RedactPdfParams> for ToolParameters {
1721    fn from(params: RedactPdfParams) -> Self {
1722        ToolParameters::from_serialize(&params).unwrap_or_default()
1723    }
1724}
1725
1726string_enum! {
1727    /// Choices for `level`.
1728    RepairPdfLevel {
1729        Standard => "standard",
1730        Deep => "deep",
1731    }
1732}
1733
1734/// Parameters of Repair PDF (`repair-pdf`).
1735#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1736pub struct RepairPdfParams {
1737    /// Repair depth. deep rebuilds the whole object structure. Default: `"standard"`.
1738    #[serde(default, skip_serializing_if = "Option::is_none")]
1739    pub level: Option<RepairPdfLevel>,
1740    /// Output file name without a path; the extension is added for you.
1741    #[serde(
1742        rename = "outputName",
1743        default,
1744        skip_serializing_if = "Option::is_none"
1745    )]
1746    pub output_name: Option<String>,
1747    /// Further parameters this SDK version does not model.
1748    #[serde(flatten)]
1749    pub extra: Object,
1750}
1751
1752impl From<RepairPdfParams> for ToolParameters {
1753    fn from(params: RepairPdfParams) -> Self {
1754        ToolParameters::from_serialize(&params).unwrap_or_default()
1755    }
1756}
1757
1758string_enum! {
1759    /// Choices for `angle`.
1760    RotatePdfAngle {
1761        V90 => "90",
1762        V180 => "180",
1763        V270 => "270",
1764    }
1765}
1766
1767string_enum! {
1768    /// Choices for `pageMode`.
1769    RotatePdfPageMode {
1770        All => "all",
1771        Specific => "specific",
1772    }
1773}
1774
1775/// Parameters of Rotate PDF (`rotate-pdf`).
1776#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1777pub struct RotatePdfParams {
1778    /// Clockwise rotation in degrees. Default: `"90"`.
1779    #[serde(default, skip_serializing_if = "Option::is_none")]
1780    pub angle: Option<RotatePdfAngle>,
1781    /// Rotate all pages or a specific page set. Default: `"all"`.
1782    #[serde(rename = "pageMode", default, skip_serializing_if = "Option::is_none")]
1783    pub page_mode: Option<RotatePdfPageMode>,
1784    /// Pages to rotate. Page numbers and ranges separated by commas, plus odd, even, last and last-N
1785    /// (the Nth page before the last), e.g. 1-3,5, odd or 5-last. Required in specific mode. Used when
1786    /// `page_mode` is `specific`.
1787    #[serde(default, skip_serializing_if = "Option::is_none")]
1788    pub pages: Option<String>,
1789    /// Mixed per-page rotations as comma-separated page:angle pairs, e.g. 1:90,3:180. When set, it
1790    /// replaces angle, pageMode, and pages.
1791    #[serde(default, skip_serializing_if = "Option::is_none")]
1792    pub rotations: Option<String>,
1793    /// Output file name without a path; the extension is added for you.
1794    #[serde(
1795        rename = "outputName",
1796        default,
1797        skip_serializing_if = "Option::is_none"
1798    )]
1799    pub output_name: Option<String>,
1800    /// Further parameters this SDK version does not model.
1801    #[serde(flatten)]
1802    pub extra: Object,
1803}
1804
1805impl From<RotatePdfParams> for ToolParameters {
1806    fn from(params: RotatePdfParams) -> Self {
1807        ToolParameters::from_serialize(&params).unwrap_or_default()
1808    }
1809}
1810
1811/// Parameters of Sanitize PDF (`sanitize-pdf`).
1812#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1813pub struct SanitizePdfParams {
1814    /// Also clear the document information and XMP metadata. Default: `false`.
1815    #[serde(
1816        rename = "removeMetadata",
1817        default,
1818        skip_serializing_if = "Option::is_none"
1819    )]
1820    pub remove_metadata: Option<bool>,
1821    /// Output file name without a path; the extension is added for you.
1822    #[serde(
1823        rename = "outputName",
1824        default,
1825        skip_serializing_if = "Option::is_none"
1826    )]
1827    pub output_name: Option<String>,
1828    /// Further parameters this SDK version does not model.
1829    #[serde(flatten)]
1830    pub extra: Object,
1831}
1832
1833impl From<SanitizePdfParams> for ToolParameters {
1834    fn from(params: SanitizePdfParams) -> Self {
1835        ToolParameters::from_serialize(&params).unwrap_or_default()
1836    }
1837}
1838
1839/// Parameters of Scale PDF (`scale-pdf`).
1840#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1841pub struct ScalePdfParams {
1842    /// New size as a percentage of the current size. Default: `100`. Range: 10 to 400.
1843    #[serde(
1844        default,
1845        skip_serializing_if = "Option::is_none",
1846        serialize_with = "crate::util::number"
1847    )]
1848    pub percent: Option<f64>,
1849    /// Pages to scale; blank scales every page. Page numbers and ranges separated by commas, plus odd,
1850    /// even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
1851    #[serde(default, skip_serializing_if = "Option::is_none")]
1852    pub pages: Option<String>,
1853    /// Output file name without a path; the extension is added for you.
1854    #[serde(
1855        rename = "outputName",
1856        default,
1857        skip_serializing_if = "Option::is_none"
1858    )]
1859    pub output_name: Option<String>,
1860    /// Further parameters this SDK version does not model.
1861    #[serde(flatten)]
1862    pub extra: Object,
1863}
1864
1865impl From<ScalePdfParams> for ToolParameters {
1866    fn from(params: ScalePdfParams) -> Self {
1867        ToolParameters::from_serialize(&params).unwrap_or_default()
1868    }
1869}
1870
1871string_enum! {
1872    /// Choices for `signatureType`.
1873    SignPdfSignatureType {
1874        Type => "type",
1875        Image => "image",
1876        Digital => "digital",
1877    }
1878}
1879
1880string_enum! {
1881    /// Choices for `position`.
1882    SignPdfPosition {
1883        TopLeft => "top-left",
1884        TopCenter => "top-center",
1885        TopRight => "top-right",
1886        MiddleLeft => "middle-left",
1887        MiddleCenter => "middle-center",
1888        MiddleRight => "middle-right",
1889        BottomLeft => "bottom-left",
1890        BottomCenter => "bottom-center",
1891        BottomRight => "bottom-right",
1892        Diagonal => "diagonal",
1893    }
1894}
1895
1896string_enum! {
1897    /// Choices for `positionMode`.
1898    SignPdfPositionMode {
1899        Preset => "preset",
1900        Custom => "custom",
1901    }
1902}
1903
1904string_enum! {
1905    /// Choices for `type`.
1906    SignPdfFieldsItemType {
1907        Date => "date",
1908        Name => "name",
1909        Initials => "initials",
1910        CustomText => "custom-text",
1911        Stamp => "stamp",
1912        CompanyStamp => "company-stamp",
1913    }
1914}
1915
1916/// One entry of `fields`.
1917#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1918pub struct SignPdfFieldsItem {
1919    /// Field kind. date, name and initials print their text (a date field without text prints the
1920    /// signing date in dateFormat); custom-text prints text; stamp and company-stamp draw stampImage.
1921    #[serde(default)]
1922    pub r#type: SignPdfFieldsItemType,
1923    /// One-based page. Range: 1 to 100000.
1924    #[serde(default, serialize_with = "crate::util::required_number")]
1925    pub page: f64,
1926    /// Horizontal centre as a percentage of the page width. Range: 0 to 100.
1927    #[serde(
1928        rename = "xPercent",
1929        default,
1930        serialize_with = "crate::util::required_number"
1931    )]
1932    pub x_percent: f64,
1933    /// Vertical centre as a percentage of the page height, from the top. Range: 0 to 100.
1934    #[serde(
1935        rename = "yPercent",
1936        default,
1937        serialize_with = "crate::util::required_number"
1938    )]
1939    pub y_percent: f64,
1940    /// Field width as a percentage of the page width. Default: `22`. Range: 4 to 90.
1941    #[serde(
1942        rename = "widthPercent",
1943        default,
1944        skip_serializing_if = "Option::is_none",
1945        serialize_with = "crate::util::number"
1946    )]
1947    pub width_percent: Option<f64>,
1948    /// Field height as a percentage of the page height. Default: `8`. Range: 2 to 80.
1949    #[serde(
1950        rename = "heightPercent",
1951        default,
1952        skip_serializing_if = "Option::is_none",
1953        serialize_with = "crate::util::number"
1954    )]
1955    pub height_percent: Option<f64>,
1956    /// Text to print, up to 240 characters.
1957    #[serde(default, skip_serializing_if = "Option::is_none")]
1958    pub text: Option<String>,
1959    /// Text size in points. Default: `12`. Range: 6 to 72.
1960    #[serde(
1961        rename = "fontSize",
1962        default,
1963        skip_serializing_if = "Option::is_none",
1964        serialize_with = "crate::util::number"
1965    )]
1966    pub font_size: Option<f64>,
1967    /// Text colour as a six-digit hex value.
1968    #[serde(default, skip_serializing_if = "Option::is_none")]
1969    pub color: Option<String>,
1970    /// Stamp opacity from 0 to 1. Default: `1`. Range: 0 to 1.
1971    #[serde(
1972        default,
1973        skip_serializing_if = "Option::is_none",
1974        serialize_with = "crate::util::number"
1975    )]
1976    pub opacity: Option<f64>,
1977    /// Further parameters this SDK version does not model.
1978    #[serde(flatten)]
1979    pub extra: Object,
1980}
1981
1982impl From<SignPdfFieldsItem> for ToolParameters {
1983    fn from(params: SignPdfFieldsItem) -> Self {
1984        ToolParameters::from_serialize(&params).unwrap_or_default()
1985    }
1986}
1987
1988string_enum! {
1989    /// Choices for `dateFormat`.
1990    SignPdfDateFormat {
1991        DdMmYyyy => "DD/MM/YYYY",
1992        MmDdYyyy => "MM/DD/YYYY",
1993        YyyyMmDd => "YYYY-MM-DD",
1994        DMmmYyyy => "D MMM YYYY",
1995    }
1996}
1997
1998/// Parameters of Sign PDF (`sign-pdf`).
1999#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2000pub struct SignPdfParams {
2001    /// Typed name, signature image, or certificate-backed digital signature. Default: `"image"`.
2002    #[serde(
2003        rename = "signatureType",
2004        default,
2005        skip_serializing_if = "Option::is_none"
2006    )]
2007    pub signature_type: Option<SignPdfSignatureType>,
2008    /// Typed signer name (required for type, up to 120 characters) or the digital appearance label.
2009    /// Used when `signature_type` is `type` or `digital`.
2010    #[serde(default, skip_serializing_if = "Option::is_none")]
2011    pub name: Option<String>,
2012    /// Font of the typed signature and text fields: blank keeps Helvetica Oblique; gf:&lt;id&gt; embeds
2013    /// a family of the font catalog (/docs/fonts: every Google Fonts family, all scripts, shaped for
2014    /// Devanagari, Bengali, Tamil, Telugu and Arabic); u:&lt;id&gt; one of your uploaded fonts (the id
2015    /// from your fonts in the PDF editor; another person's or a deleted font is refused). Used when
2016    /// `signature_type` is `type` or `digital`.
2017    #[serde(
2018        rename = "fontFamily",
2019        default,
2020        skip_serializing_if = "Option::is_none"
2021    )]
2022    pub font_family: Option<String>,
2023    /// One-based page number for the visible signature. Default: `1`. Range: 1 to 100000.
2024    #[serde(
2025        default,
2026        skip_serializing_if = "Option::is_none",
2027        serialize_with = "crate::util::number"
2028    )]
2029    pub page: Option<f64>,
2030    /// Visible signature placement. Default: `"bottom-right"`.
2031    #[serde(default, skip_serializing_if = "Option::is_none")]
2032    pub position: Option<SignPdfPosition>,
2033    /// Use a placement preset or percentage coordinates. Default: `"preset"`.
2034    #[serde(
2035        rename = "positionMode",
2036        default,
2037        skip_serializing_if = "Option::is_none"
2038    )]
2039    pub position_mode: Option<SignPdfPositionMode>,
2040    /// Horizontal center for custom placement. Default: `50`. Range: 0 to 100. Used when
2041    /// `position_mode` is `custom`.
2042    #[serde(
2043        rename = "xPercent",
2044        default,
2045        skip_serializing_if = "Option::is_none",
2046        serialize_with = "crate::util::number"
2047    )]
2048    pub x_percent: Option<f64>,
2049    /// Vertical center for custom placement. Default: `50`. Range: 0 to 100. Used when `position_mode`
2050    /// is `custom`.
2051    #[serde(
2052        rename = "yPercent",
2053        default,
2054        skip_serializing_if = "Option::is_none",
2055        serialize_with = "crate::util::number"
2056    )]
2057    pub y_percent: Option<f64>,
2058    /// Turn of the visible signature in degrees, counter-clockwise, from -360 to 360 (decimals
2059    /// allowed). It sits at its spot, and stays whole on the page, by the box it covers once turned.
2060    /// Default: `0`. Range: -360 to 360 degrees.
2061    #[serde(
2062        default,
2063        skip_serializing_if = "Option::is_none",
2064        serialize_with = "crate::util::number"
2065    )]
2066    pub rotation: Option<f64>,
2067    /// Visible signature scale multiplier. Default: `1`. Range: 0.1 to 4.
2068    #[serde(
2069        default,
2070        skip_serializing_if = "Option::is_none",
2071        serialize_with = "crate::util::number"
2072    )]
2073    pub scale: Option<f64>,
2074    /// Optional visible fields, up to 80: each a date, name, initials, custom-text, stamp or
2075    /// company-stamp box placed by its centre and size in percentages of the page. At most 80 entries.
2076    #[serde(default, skip_serializing_if = "Option::is_none")]
2077    pub fields: Option<Vec<SignPdfFieldsItem>>,
2078    /// How a date field without text prints the signing date (UTC). Default: `"D MMM YYYY"`.
2079    #[serde(
2080        rename = "dateFormat",
2081        default,
2082        skip_serializing_if = "Option::is_none"
2083    )]
2084    pub date_format: Option<SignPdfDateFormat>,
2085    /// Add a visible appearance to the digital signature. Default: `true`. Used when `signature_type`
2086    /// is `digital`.
2087    #[serde(
2088        rename = "digitalVisible",
2089        default,
2090        skip_serializing_if = "Option::is_none"
2091    )]
2092    pub digital_visible: Option<bool>,
2093    /// Passphrase for the PKCS#12 certificate. You can instead send it as a file part named
2094    /// certificatePassphraseFile (up to 512 bytes). Used when `signature_type` is `digital`.
2095    #[serde(
2096        rename = "certificatePassphrase",
2097        default,
2098        skip_serializing_if = "Option::is_none"
2099    )]
2100    pub certificate_passphrase: Option<String>,
2101    /// Output file name without a path; the extension is added for you.
2102    #[serde(
2103        rename = "outputName",
2104        default,
2105        skip_serializing_if = "Option::is_none"
2106    )]
2107    pub output_name: Option<String>,
2108    /// Further parameters this SDK version does not model.
2109    #[serde(flatten)]
2110    pub extra: Object,
2111}
2112
2113impl From<SignPdfParams> for ToolParameters {
2114    fn from(params: SignPdfParams) -> Self {
2115        ToolParameters::from_serialize(&params).unwrap_or_default()
2116    }
2117}
2118
2119string_enum! {
2120    /// Choices for `mode`.
2121    SplitPdfMode {
2122        Ranges => "ranges",
2123        Interval => "interval",
2124        Each => "each",
2125        Smart => "smart",
2126        Size => "size",
2127        Content => "content",
2128        Large => "large",
2129    }
2130}
2131
2132string_enum! {
2133    /// Choices for `targetUnit`.
2134    SplitPdfTargetUnit {
2135        Kb => "kb",
2136        Mb => "mb",
2137    }
2138}
2139
2140/// Parameters of Split PDF (`split-pdf`).
2141#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2142pub struct SplitPdfParams {
2143    /// Split strategy. ranges: the page groups in ranges. interval: every N pages. each: one PDF per
2144    /// page. smart: at bookmarks, falling back to content breaks. size: parts near targetSize. content:
2145    /// at detected content breaks. large: fixed-size parts for very long documents. ai (and its alias
2146    /// ocr) finds where each document starts and names each part by its document label; it runs in AI
2147    /// mode and needs the AI processing agreement. Default: `"ranges"`.
2148    #[serde(default, skip_serializing_if = "Option::is_none")]
2149    pub mode: Option<SplitPdfMode>,
2150    /// Page groups, one output per comma-separated group unless mergeRanges. Page numbers and ranges
2151    /// separated by commas, plus odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5,
2152    /// odd or 5-last. Required in ranges mode. Used when `mode` is `ranges`.
2153    #[serde(default, skip_serializing_if = "Option::is_none")]
2154    pub ranges: Option<String>,
2155    /// Merge the range groups into one PDF instead of one PDF per group. When omitted it is true for a
2156    /// single range and false otherwise. Used when `mode` is `ranges`.
2157    #[serde(
2158        rename = "mergeRanges",
2159        default,
2160        skip_serializing_if = "Option::is_none"
2161    )]
2162    pub merge_ranges: Option<bool>,
2163    /// Pages per output. Default: `1`. Range: 1 to 5000. Used when `mode` is `interval`.
2164    #[serde(
2165        default,
2166        skip_serializing_if = "Option::is_none",
2167        serialize_with = "crate::util::number"
2168    )]
2169    pub interval: Option<f64>,
2170    /// Target size of each output. Required in size mode; the smallest target is 8 KB. Range: 1 to
2171    /// 10240. Used when `mode` is `size`.
2172    #[serde(
2173        rename = "targetSize",
2174        default,
2175        skip_serializing_if = "Option::is_none",
2176        serialize_with = "crate::util::number"
2177    )]
2178    pub target_size: Option<f64>,
2179    /// The unit of the target size. Default: `"mb"`. Used when `mode` is `size`.
2180    #[serde(
2181        rename = "targetUnit",
2182        default,
2183        skip_serializing_if = "Option::is_none"
2184    )]
2185    pub target_unit: Option<SplitPdfTargetUnit>,
2186    /// Pages per output. Default: `50`. Range: 1 to 250. Used when `mode` is `large`.
2187    #[serde(
2188        rename = "pagesPerFile",
2189        default,
2190        skip_serializing_if = "Option::is_none",
2191        serialize_with = "crate::util::number"
2192    )]
2193    pub pages_per_file: Option<f64>,
2194    /// Safety cap on pages processed. Default: `1500`. Range: 1 to 5000. Used when `mode` is `large`.
2195    #[serde(
2196        rename = "maxPages",
2197        default,
2198        skip_serializing_if = "Option::is_none",
2199        serialize_with = "crate::util::number"
2200    )]
2201    pub max_pages: Option<f64>,
2202    /// Fall back to content breaks when the PDF has no usable bookmarks. Default: `true`. Used when
2203    /// `mode` is `smart`.
2204    #[serde(
2205        rename = "allowFallback",
2206        default,
2207        skip_serializing_if = "Option::is_none"
2208    )]
2209    pub allow_fallback: Option<bool>,
2210    /// Output file name without a path; the extension is added for you.
2211    #[serde(
2212        rename = "outputName",
2213        default,
2214        skip_serializing_if = "Option::is_none"
2215    )]
2216    pub output_name: Option<String>,
2217    /// Further parameters this SDK version does not model.
2218    #[serde(flatten)]
2219    pub extra: Object,
2220}
2221
2222impl From<SplitPdfParams> for ToolParameters {
2223    fn from(params: SplitPdfParams) -> Self {
2224        ToolParameters::from_serialize(&params).unwrap_or_default()
2225    }
2226}
2227
2228/// Parameters of Unlock PDF (`unlock-pdf`).
2229#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2230pub struct UnlockPdfParams {
2231    /// Current password; leave blank only for permission-restricted files.
2232    #[serde(default, skip_serializing_if = "Option::is_none")]
2233    pub password: Option<String>,
2234    /// Output file name without a path; the extension is added for you.
2235    #[serde(
2236        rename = "outputName",
2237        default,
2238        skip_serializing_if = "Option::is_none"
2239    )]
2240    pub output_name: Option<String>,
2241    /// Further parameters this SDK version does not model.
2242    #[serde(flatten)]
2243    pub extra: Object,
2244}
2245
2246impl From<UnlockPdfParams> for ToolParameters {
2247    fn from(params: UnlockPdfParams) -> Self {
2248        ToolParameters::from_serialize(&params).unwrap_or_default()
2249    }
2250}
2251
2252string_enum! {
2253    /// Choices for `pageSize`.
2254    CsvToPdfPageSize {
2255        A4 => "a4",
2256        Letter => "letter",
2257        A3 => "a3",
2258    }
2259}
2260
2261string_enum! {
2262    /// Choices for `orientation`.
2263    CsvToPdfOrientation {
2264        Portrait => "portrait",
2265        Landscape => "landscape",
2266    }
2267}
2268
2269string_enum! {
2270    /// Choices for `delimiter`.
2271    CsvToPdfDelimiter {
2272        Comma => "comma",
2273        Semicolon => "semicolon",
2274        Tab => "tab",
2275        Pipe => "pipe",
2276    }
2277}
2278
2279/// Parameters of CSV to PDF (`csv-to-pdf`).
2280#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2281pub struct CsvToPdfParams {
2282    /// Output page size. Default: `"a4"`.
2283    #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")]
2284    pub page_size: Option<CsvToPdfPageSize>,
2285    /// Output page orientation. Default: `"portrait"`.
2286    #[serde(default, skip_serializing_if = "Option::is_none")]
2287    pub orientation: Option<CsvToPdfOrientation>,
2288    /// Body font size in points. Default: `9`. Range: 6 to 14.
2289    #[serde(
2290        rename = "fontSize",
2291        default,
2292        skip_serializing_if = "Option::is_none",
2293        serialize_with = "crate::util::number"
2294    )]
2295    pub font_size: Option<f64>,
2296    /// Page margin in PDF points. Default: `54`. Range: 18 to 108.
2297    #[serde(
2298        default,
2299        skip_serializing_if = "Option::is_none",
2300        serialize_with = "crate::util::number"
2301    )]
2302    pub margin: Option<f64>,
2303    /// Body font: blank keeps DejaVu Sans; helvetica, times or courier uses that standard PDF font;
2304    /// gf:&lt;id&gt; uses a family of the font catalog (/docs/fonts: every Google Fonts family, all
2305    /// scripts); u:&lt;id&gt; one of your uploaded fonts; embedded in the PDF.
2306    #[serde(
2307        rename = "fontFamily",
2308        default,
2309        skip_serializing_if = "Option::is_none"
2310    )]
2311    pub font_family: Option<String>,
2312    /// Column delimiter of the CSV. Default: `"comma"`.
2313    #[serde(default, skip_serializing_if = "Option::is_none")]
2314    pub delimiter: Option<CsvToPdfDelimiter>,
2315    /// Treat the first row as a header. Default: `true`.
2316    #[serde(rename = "headerRow", default, skip_serializing_if = "Option::is_none")]
2317    pub header_row: Option<bool>,
2318    /// Output file name without a path; the extension is added for you.
2319    #[serde(
2320        rename = "outputName",
2321        default,
2322        skip_serializing_if = "Option::is_none"
2323    )]
2324    pub output_name: Option<String>,
2325    /// Further parameters this SDK version does not model.
2326    #[serde(flatten)]
2327    pub extra: Object,
2328}
2329
2330impl From<CsvToPdfParams> for ToolParameters {
2331    fn from(params: CsvToPdfParams) -> Self {
2332        ToolParameters::from_serialize(&params).unwrap_or_default()
2333    }
2334}
2335
2336/// Parameters of Excel to PDF (`excel-to-pdf`).
2337#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2338pub struct ExcelToPdfParams {
2339    /// Output file name without a path; the extension is added for you.
2340    #[serde(
2341        rename = "outputName",
2342        default,
2343        skip_serializing_if = "Option::is_none"
2344    )]
2345    pub output_name: Option<String>,
2346    /// Further parameters this SDK version does not model.
2347    #[serde(flatten)]
2348    pub extra: Object,
2349}
2350
2351impl From<ExcelToPdfParams> for ToolParameters {
2352    fn from(params: ExcelToPdfParams) -> Self {
2353        ToolParameters::from_serialize(&params).unwrap_or_default()
2354    }
2355}
2356
2357string_enum! {
2358    /// Choices for `pageSize`.
2359    ImageToPdfPageSize {
2360        A4 => "a4",
2361        Letter => "letter",
2362        Match => "match",
2363    }
2364}
2365
2366string_enum! {
2367    /// Choices for `orientation`.
2368    ImageToPdfOrientation {
2369        Auto => "auto",
2370        Portrait => "portrait",
2371        Landscape => "landscape",
2372    }
2373}
2374
2375/// Parameters of Image to PDF (`image-to-pdf`).
2376#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2377pub struct ImageToPdfParams {
2378    /// Output page size. match sizes each page to its image. Default: `"a4"`.
2379    #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")]
2380    pub page_size: Option<ImageToPdfPageSize>,
2381    /// Output page orientation. Default: `"auto"`. Used when `page_size` is `a4` or `letter`.
2382    #[serde(default, skip_serializing_if = "Option::is_none")]
2383    pub orientation: Option<ImageToPdfOrientation>,
2384    /// Image margin in PDF points. Default: `10`. Range: 0 to 72.
2385    #[serde(
2386        default,
2387        skip_serializing_if = "Option::is_none",
2388        serialize_with = "crate::util::number"
2389    )]
2390    pub margin: Option<f64>,
2391    /// Output file name without a path; the extension is added for you.
2392    #[serde(
2393        rename = "outputName",
2394        default,
2395        skip_serializing_if = "Option::is_none"
2396    )]
2397    pub output_name: Option<String>,
2398    /// Further parameters this SDK version does not model.
2399    #[serde(flatten)]
2400    pub extra: Object,
2401}
2402
2403impl From<ImageToPdfParams> for ToolParameters {
2404    fn from(params: ImageToPdfParams) -> Self {
2405        ToolParameters::from_serialize(&params).unwrap_or_default()
2406    }
2407}
2408
2409string_enum! {
2410    /// Choices for `pageSize`.
2411    JsonToPdfPageSize {
2412        A4 => "a4",
2413        Letter => "letter",
2414        A3 => "a3",
2415    }
2416}
2417
2418string_enum! {
2419    /// Choices for `orientation`.
2420    JsonToPdfOrientation {
2421        Portrait => "portrait",
2422        Landscape => "landscape",
2423    }
2424}
2425
2426/// Parameters of JSON to PDF (`json-to-pdf`).
2427#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2428pub struct JsonToPdfParams {
2429    /// Output page size. Default: `"a4"`.
2430    #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")]
2431    pub page_size: Option<JsonToPdfPageSize>,
2432    /// Output page orientation. Default: `"portrait"`.
2433    #[serde(default, skip_serializing_if = "Option::is_none")]
2434    pub orientation: Option<JsonToPdfOrientation>,
2435    /// Body font size in points. Default: `9`. Range: 6 to 14.
2436    #[serde(
2437        rename = "fontSize",
2438        default,
2439        skip_serializing_if = "Option::is_none",
2440        serialize_with = "crate::util::number"
2441    )]
2442    pub font_size: Option<f64>,
2443    /// Page margin in PDF points. Default: `54`. Range: 18 to 108.
2444    #[serde(
2445        default,
2446        skip_serializing_if = "Option::is_none",
2447        serialize_with = "crate::util::number"
2448    )]
2449    pub margin: Option<f64>,
2450    /// Body font: blank keeps DejaVu Sans; helvetica, times or courier uses that standard PDF font;
2451    /// gf:&lt;id&gt; uses a family of the font catalog (/docs/fonts: every Google Fonts family, all
2452    /// scripts); u:&lt;id&gt; one of your uploaded fonts; embedded in the PDF.
2453    #[serde(
2454        rename = "fontFamily",
2455        default,
2456        skip_serializing_if = "Option::is_none"
2457    )]
2458    pub font_family: Option<String>,
2459    /// Output file name without a path; the extension is added for you.
2460    #[serde(
2461        rename = "outputName",
2462        default,
2463        skip_serializing_if = "Option::is_none"
2464    )]
2465    pub output_name: Option<String>,
2466    /// Further parameters this SDK version does not model.
2467    #[serde(flatten)]
2468    pub extra: Object,
2469}
2470
2471impl From<JsonToPdfParams> for ToolParameters {
2472    fn from(params: JsonToPdfParams) -> Self {
2473        ToolParameters::from_serialize(&params).unwrap_or_default()
2474    }
2475}
2476
2477string_enum! {
2478    /// Choices for `pageSize`.
2479    MarkdownToPdfPageSize {
2480        A4 => "a4",
2481        Letter => "letter",
2482        A3 => "a3",
2483    }
2484}
2485
2486string_enum! {
2487    /// Choices for `orientation`.
2488    MarkdownToPdfOrientation {
2489        Portrait => "portrait",
2490        Landscape => "landscape",
2491    }
2492}
2493
2494/// Parameters of Markdown to PDF (`markdown-to-pdf`).
2495#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2496pub struct MarkdownToPdfParams {
2497    /// Output page size. Default: `"a4"`.
2498    #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")]
2499    pub page_size: Option<MarkdownToPdfPageSize>,
2500    /// Output page orientation. Default: `"portrait"`.
2501    #[serde(default, skip_serializing_if = "Option::is_none")]
2502    pub orientation: Option<MarkdownToPdfOrientation>,
2503    /// Body font size in points. Default: `11`. Range: 7 to 22.
2504    #[serde(
2505        rename = "fontSize",
2506        default,
2507        skip_serializing_if = "Option::is_none",
2508        serialize_with = "crate::util::number"
2509    )]
2510    pub font_size: Option<f64>,
2511    /// Page margin in PDF points. Default: `54`. Range: 18 to 108.
2512    #[serde(
2513        default,
2514        skip_serializing_if = "Option::is_none",
2515        serialize_with = "crate::util::number"
2516    )]
2517    pub margin: Option<f64>,
2518    /// Body font: blank keeps DejaVu Sans; helvetica, times or courier uses that standard PDF font;
2519    /// gf:&lt;id&gt; uses a family of the font catalog (/docs/fonts: every Google Fonts family, all
2520    /// scripts); u:&lt;id&gt; one of your uploaded fonts; embedded in the PDF.
2521    #[serde(
2522        rename = "fontFamily",
2523        default,
2524        skip_serializing_if = "Option::is_none"
2525    )]
2526    pub font_family: Option<String>,
2527    /// Output file name without a path; the extension is added for you.
2528    #[serde(
2529        rename = "outputName",
2530        default,
2531        skip_serializing_if = "Option::is_none"
2532    )]
2533    pub output_name: Option<String>,
2534    /// Further parameters this SDK version does not model.
2535    #[serde(flatten)]
2536    pub extra: Object,
2537}
2538
2539impl From<MarkdownToPdfParams> for ToolParameters {
2540    fn from(params: MarkdownToPdfParams) -> Self {
2541        ToolParameters::from_serialize(&params).unwrap_or_default()
2542    }
2543}
2544
2545/// Parameters of PDF to Chunks (`pdf-to-chunks`).
2546#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2547pub struct PdfToChunksParams {
2548    /// Pages to convert; blank converts every page. Page numbers and ranges separated by commas, plus
2549    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
2550    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2551    pub page_range: Option<String>,
2552    /// Target characters per chunk. Default: `1500`. Range: 200 to 8000.
2553    #[serde(
2554        rename = "chunkSize",
2555        default,
2556        skip_serializing_if = "Option::is_none",
2557        serialize_with = "crate::util::number"
2558    )]
2559    pub chunk_size: Option<f64>,
2560    /// Characters repeated from the previous chunk (at most half the chunk size). Default: `150`.
2561    /// Range: 0 to 4000.
2562    #[serde(
2563        default,
2564        skip_serializing_if = "Option::is_none",
2565        serialize_with = "crate::util::number"
2566    )]
2567    pub overlap: Option<f64>,
2568    /// Output file name without a path; the extension is added for you.
2569    #[serde(
2570        rename = "outputName",
2571        default,
2572        skip_serializing_if = "Option::is_none"
2573    )]
2574    pub output_name: Option<String>,
2575    /// Further parameters this SDK version does not model.
2576    #[serde(flatten)]
2577    pub extra: Object,
2578}
2579
2580impl From<PdfToChunksParams> for ToolParameters {
2581    fn from(params: PdfToChunksParams) -> Self {
2582        ToolParameters::from_serialize(&params).unwrap_or_default()
2583    }
2584}
2585
2586string_enum! {
2587    /// Choices for `chapterSplit`.
2588    PdfToEpubChapterSplit {
2589        Headings => "headings",
2590        Pages => "pages",
2591    }
2592}
2593
2594/// Parameters of PDF to EPUB (`pdf-to-epub`).
2595#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2596pub struct PdfToEpubParams {
2597    /// Optional pages to read; blank means all pages. Page numbers and ranges separated by commas, plus
2598    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
2599    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2600    pub page_range: Option<String>,
2601    /// EPUB title. When omitted, the input file name is used.
2602    #[serde(default, skip_serializing_if = "Option::is_none")]
2603    pub title: Option<String>,
2604    /// EPUB author. Default: `"Wellfriend"`.
2605    #[serde(default, skip_serializing_if = "Option::is_none")]
2606    pub author: Option<String>,
2607    /// Start chapters at detected headings, or every pagesPerChapter pages. Default: `"headings"`.
2608    #[serde(
2609        rename = "chapterSplit",
2610        default,
2611        skip_serializing_if = "Option::is_none"
2612    )]
2613    pub chapter_split: Option<PdfToEpubChapterSplit>,
2614    /// Pages per chapter in pages split. Default: `10`. Range: 1 to 500. Used when `chapter_split` is
2615    /// `pages`.
2616    #[serde(
2617        rename = "pagesPerChapter",
2618        default,
2619        skip_serializing_if = "Option::is_none",
2620        serialize_with = "crate::util::number"
2621    )]
2622    pub pages_per_chapter: Option<f64>,
2623    /// Include the PDF's images in the book. Default: `true`.
2624    #[serde(
2625        rename = "includeImages",
2626        default,
2627        skip_serializing_if = "Option::is_none"
2628    )]
2629    pub include_images: Option<bool>,
2630    /// Output file name without a path; the extension is added for you.
2631    #[serde(
2632        rename = "outputName",
2633        default,
2634        skip_serializing_if = "Option::is_none"
2635    )]
2636    pub output_name: Option<String>,
2637    /// Further parameters this SDK version does not model.
2638    #[serde(flatten)]
2639    pub extra: Object,
2640}
2641
2642impl From<PdfToEpubParams> for ToolParameters {
2643    fn from(params: PdfToEpubParams) -> Self {
2644        ToolParameters::from_serialize(&params).unwrap_or_default()
2645    }
2646}
2647
2648string_enum! {
2649    /// Choices for `sheetLayout`.
2650    PdfToExcelSheetLayout {
2651        One => "one",
2652        Multiple => "multiple",
2653    }
2654}
2655
2656/// Parameters of PDF to Excel (`pdf-to-excel`).
2657#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2658pub struct PdfToExcelParams {
2659    /// Optional pages to read; blank means all pages. Page numbers and ranges separated by commas, plus
2660    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
2661    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2662    pub page_range: Option<String>,
2663    /// Combine tables or create separate sheets. Default: `"multiple"`.
2664    #[serde(
2665        rename = "sheetLayout",
2666        default,
2667        skip_serializing_if = "Option::is_none"
2668    )]
2669    pub sheet_layout: Option<PdfToExcelSheetLayout>,
2670    /// Output file name without a path; the extension is added for you.
2671    #[serde(
2672        rename = "outputName",
2673        default,
2674        skip_serializing_if = "Option::is_none"
2675    )]
2676    pub output_name: Option<String>,
2677    /// Further parameters this SDK version does not model.
2678    #[serde(flatten)]
2679    pub extra: Object,
2680}
2681
2682impl From<PdfToExcelParams> for ToolParameters {
2683    fn from(params: PdfToExcelParams) -> Self {
2684        ToolParameters::from_serialize(&params).unwrap_or_default()
2685    }
2686}
2687
2688/// Parameters of PDF to HTML (`pdf-to-html`).
2689#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2690pub struct PdfToHtmlParams {
2691    /// Pages to convert; blank converts every page. Page numbers and ranges separated by commas, plus
2692    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
2693    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2694    pub page_range: Option<String>,
2695    /// Output file name without a path; the extension is added for you.
2696    #[serde(
2697        rename = "outputName",
2698        default,
2699        skip_serializing_if = "Option::is_none"
2700    )]
2701    pub output_name: Option<String>,
2702    /// Further parameters this SDK version does not model.
2703    #[serde(flatten)]
2704    pub extra: Object,
2705}
2706
2707impl From<PdfToHtmlParams> for ToolParameters {
2708    fn from(params: PdfToHtmlParams) -> Self {
2709        ToolParameters::from_serialize(&params).unwrap_or_default()
2710    }
2711}
2712
2713string_enum! {
2714    /// Choices for `exportMode`.
2715    PdfToImagesExportMode {
2716        Pages => "pages",
2717        ExtractImages => "extract-images",
2718    }
2719}
2720
2721string_enum! {
2722    /// Choices for `quality`.
2723    PdfToImagesQuality {
2724        Normal => "normal",
2725        Recommended => "recommended",
2726        High => "high",
2727    }
2728}
2729
2730string_enum! {
2731    /// Choices for `imageFormat`.
2732    PdfToImagesImageFormat {
2733        Jpg => "jpg",
2734        Png => "png",
2735    }
2736}
2737
2738/// Parameters of PDF to Images (`pdf-to-images`).
2739#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2740pub struct PdfToImagesParams {
2741    /// Render pages or extract embedded raster images. Default: `"pages"`.
2742    #[serde(
2743        rename = "exportMode",
2744        default,
2745        skip_serializing_if = "Option::is_none"
2746    )]
2747    pub export_mode: Option<PdfToImagesExportMode>,
2748    /// JPG preset: normal 120 dpi, recommended 170 dpi, high 220 dpi. In extract-images mode only the
2749    /// JPG quality applies. Default: `"recommended"`.
2750    #[serde(default, skip_serializing_if = "Option::is_none")]
2751    pub quality: Option<PdfToImagesQuality>,
2752    /// Optional pages to render; blank means all pages. Page numbers and ranges separated by commas,
2753    /// plus odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last. Used
2754    /// when `export_mode` is `pages`.
2755    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2756    pub page_range: Option<String>,
2757    /// Image format of rendered pages: JPG (smaller) or lossless PNG. Default: `"jpg"`. Used when
2758    /// `export_mode` is `pages`.
2759    #[serde(
2760        rename = "imageFormat",
2761        default,
2762        skip_serializing_if = "Option::is_none"
2763    )]
2764    pub image_format: Option<PdfToImagesImageFormat>,
2765    /// Render resolution. When set it replaces the quality preset's resolution. Range: 72 to 600 dpi.
2766    /// Used when `export_mode` is `pages`.
2767    #[serde(
2768        default,
2769        skip_serializing_if = "Option::is_none",
2770        serialize_with = "crate::util::number"
2771    )]
2772    pub dpi: Option<f64>,
2773    /// Output file name without a path; the extension is added for you.
2774    #[serde(
2775        rename = "outputName",
2776        default,
2777        skip_serializing_if = "Option::is_none"
2778    )]
2779    pub output_name: Option<String>,
2780    /// Further parameters this SDK version does not model.
2781    #[serde(flatten)]
2782    pub extra: Object,
2783}
2784
2785impl From<PdfToImagesParams> for ToolParameters {
2786    fn from(params: PdfToImagesParams) -> Self {
2787        ToolParameters::from_serialize(&params).unwrap_or_default()
2788    }
2789}
2790
2791string_enum! {
2792    /// Choices for `breakMode`.
2793    PdfToJsonBreakMode {
2794        Line => "line",
2795        Word => "word",
2796        Space => "space",
2797    }
2798}
2799
2800/// Parameters of PDF to JSON (`pdf-to-json`).
2801#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2802pub struct PdfToJsonParams {
2803    /// Optional pages to read; blank means all pages. Page numbers and ranges separated by commas, plus
2804    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
2805    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2806    pub page_range: Option<String>,
2807    /// JSON token grouping. Default: `"line"`.
2808    #[serde(rename = "breakMode", default, skip_serializing_if = "Option::is_none")]
2809    pub break_mode: Option<PdfToJsonBreakMode>,
2810    /// Output file name without a path; the extension is added for you.
2811    #[serde(
2812        rename = "outputName",
2813        default,
2814        skip_serializing_if = "Option::is_none"
2815    )]
2816    pub output_name: Option<String>,
2817    /// Further parameters this SDK version does not model.
2818    #[serde(flatten)]
2819    pub extra: Object,
2820}
2821
2822impl From<PdfToJsonParams> for ToolParameters {
2823    fn from(params: PdfToJsonParams) -> Self {
2824        ToolParameters::from_serialize(&params).unwrap_or_default()
2825    }
2826}
2827
2828/// Parameters of PDF to Markdown (`pdf-to-markdown`).
2829#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2830pub struct PdfToMarkdownParams {
2831    /// Optional pages to read; blank means all pages. Page numbers and ranges separated by commas, plus
2832    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
2833    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2834    pub page_range: Option<String>,
2835    /// Output file name without a path; the extension is added for you.
2836    #[serde(
2837        rename = "outputName",
2838        default,
2839        skip_serializing_if = "Option::is_none"
2840    )]
2841    pub output_name: Option<String>,
2842    /// Further parameters this SDK version does not model.
2843    #[serde(flatten)]
2844    pub extra: Object,
2845}
2846
2847impl From<PdfToMarkdownParams> for ToolParameters {
2848    fn from(params: PdfToMarkdownParams) -> Self {
2849        ToolParameters::from_serialize(&params).unwrap_or_default()
2850    }
2851}
2852
2853/// Parameters of PDF to PowerPoint (`pdf-to-powerpoint`).
2854#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2855pub struct PdfToPowerpointParams {
2856    /// Pages to convert; blank converts every page. Page numbers and ranges separated by commas, plus
2857    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
2858    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2859    pub page_range: Option<String>,
2860    /// Resolution of each slide picture. Default: `150`. Range: 72 to 200.
2861    #[serde(
2862        default,
2863        skip_serializing_if = "Option::is_none",
2864        serialize_with = "crate::util::number"
2865    )]
2866    pub dpi: Option<f64>,
2867    /// Output file name without a path; the extension is added for you.
2868    #[serde(
2869        rename = "outputName",
2870        default,
2871        skip_serializing_if = "Option::is_none"
2872    )]
2873    pub output_name: Option<String>,
2874    /// Further parameters this SDK version does not model.
2875    #[serde(flatten)]
2876    pub extra: Object,
2877}
2878
2879impl From<PdfToPowerpointParams> for ToolParameters {
2880    fn from(params: PdfToPowerpointParams) -> Self {
2881        ToolParameters::from_serialize(&params).unwrap_or_default()
2882    }
2883}
2884
2885string_enum! {
2886    /// Choices for `readingOrder`.
2887    PdfToTextReadingOrder {
2888        Layout => "layout",
2889        Raw => "raw",
2890    }
2891}
2892
2893/// Parameters of PDF to Text (`pdf-to-text`).
2894#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2895pub struct PdfToTextParams {
2896    /// Optional pages to read; blank means all pages. Page numbers and ranges separated by commas, plus
2897    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
2898    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2899    pub page_range: Option<String>,
2900    /// Mark where each page starts in the text. Default: `false`.
2901    #[serde(
2902        rename = "includePageNumbers",
2903        default,
2904        skip_serializing_if = "Option::is_none"
2905    )]
2906    pub include_page_numbers: Option<bool>,
2907    /// layout recovers the reading order across columns and blocks; raw keeps the content-stream order,
2908    /// which is faster on simple single-column pages. Default: `"layout"`.
2909    #[serde(
2910        rename = "readingOrder",
2911        default,
2912        skip_serializing_if = "Option::is_none"
2913    )]
2914    pub reading_order: Option<PdfToTextReadingOrder>,
2915    /// Output file name without a path; the extension is added for you.
2916    #[serde(
2917        rename = "outputName",
2918        default,
2919        skip_serializing_if = "Option::is_none"
2920    )]
2921    pub output_name: Option<String>,
2922    /// Further parameters this SDK version does not model.
2923    #[serde(flatten)]
2924    pub extra: Object,
2925}
2926
2927impl From<PdfToTextParams> for ToolParameters {
2928    fn from(params: PdfToTextParams) -> Self {
2929        ToolParameters::from_serialize(&params).unwrap_or_default()
2930    }
2931}
2932
2933string_enum! {
2934    /// Choices for `layout`.
2935    PdfToWordLayout {
2936        Flowing => "flowing",
2937        PageFaithful => "page-faithful",
2938        Hybrid => "hybrid",
2939    }
2940}
2941
2942/// Parameters of PDF to Word (`pdf-to-word`).
2943#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2944pub struct PdfToWordParams {
2945    /// Optional pages to read; blank means all pages. Page numbers and ranges separated by commas, plus
2946    /// odd, even, last and last-N (the Nth page before the last), e.g. 1-3,5, odd or 5-last.
2947    #[serde(rename = "pageRange", default, skip_serializing_if = "Option::is_none")]
2948    pub page_range: Option<String>,
2949    /// flowing writes editable flowing text; page-faithful keeps each page's layout; hybrid keeps page
2950    /// breaks with flowing text. Default: `"flowing"`.
2951    #[serde(default, skip_serializing_if = "Option::is_none")]
2952    pub layout: Option<PdfToWordLayout>,
2953    /// Export the PDF's images as pictures in the document. Default: `true`.
2954    #[serde(
2955        rename = "includeImages",
2956        default,
2957        skip_serializing_if = "Option::is_none"
2958    )]
2959    pub include_images: Option<bool>,
2960    /// Output file name without a path; the extension is added for you.
2961    #[serde(
2962        rename = "outputName",
2963        default,
2964        skip_serializing_if = "Option::is_none"
2965    )]
2966    pub output_name: Option<String>,
2967    /// Further parameters this SDK version does not model.
2968    #[serde(flatten)]
2969    pub extra: Object,
2970}
2971
2972impl From<PdfToWordParams> for ToolParameters {
2973    fn from(params: PdfToWordParams) -> Self {
2974        ToolParameters::from_serialize(&params).unwrap_or_default()
2975    }
2976}
2977
2978string_enum! {
2979    /// Choices for `targetProfile`.
2980    PdfaConversionTargetProfile {
2981        Pdfa1b => "pdfa-1b",
2982        Pdfa2b => "pdfa-2b",
2983        Pdfa2u => "pdfa-2u",
2984        Pdfa3b => "pdfa-3b",
2985        Pdfa3u => "pdfa-3u",
2986    }
2987}
2988
2989/// Parameters of PDF/A Conversion (`pdfa-conversion`).
2990#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2991pub struct PdfaConversionParams {
2992    /// PDF/A conformance level to convert to. The u levels also require Unicode text mapping. Default:
2993    /// `"pdfa-2b"`.
2994    #[serde(
2995        rename = "targetProfile",
2996        default,
2997        skip_serializing_if = "Option::is_none"
2998    )]
2999    pub target_profile: Option<PdfaConversionTargetProfile>,
3000    /// Output file name without a path; the extension is added for you.
3001    #[serde(
3002        rename = "outputName",
3003        default,
3004        skip_serializing_if = "Option::is_none"
3005    )]
3006    pub output_name: Option<String>,
3007    /// Further parameters this SDK version does not model.
3008    #[serde(flatten)]
3009    pub extra: Object,
3010}
3011
3012impl From<PdfaConversionParams> for ToolParameters {
3013    fn from(params: PdfaConversionParams) -> Self {
3014        ToolParameters::from_serialize(&params).unwrap_or_default()
3015    }
3016}
3017
3018/// Parameters of PowerPoint to PDF (`powerpoint-to-pdf`).
3019#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3020pub struct PowerpointToPdfParams {
3021    /// Output file name without a path; the extension is added for you.
3022    #[serde(
3023        rename = "outputName",
3024        default,
3025        skip_serializing_if = "Option::is_none"
3026    )]
3027    pub output_name: Option<String>,
3028    /// Further parameters this SDK version does not model.
3029    #[serde(flatten)]
3030    pub extra: Object,
3031}
3032
3033impl From<PowerpointToPdfParams> for ToolParameters {
3034    fn from(params: PowerpointToPdfParams) -> Self {
3035        ToolParameters::from_serialize(&params).unwrap_or_default()
3036    }
3037}
3038
3039/// Parameters of SVG to PDF (`svg-to-pdf`).
3040#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3041pub struct SvgToPdfParams {
3042    /// Output file name without a path; the extension is added for you.
3043    #[serde(
3044        rename = "outputName",
3045        default,
3046        skip_serializing_if = "Option::is_none"
3047    )]
3048    pub output_name: Option<String>,
3049    /// Further parameters this SDK version does not model.
3050    #[serde(flatten)]
3051    pub extra: Object,
3052}
3053
3054impl From<SvgToPdfParams> for ToolParameters {
3055    fn from(params: SvgToPdfParams) -> Self {
3056        ToolParameters::from_serialize(&params).unwrap_or_default()
3057    }
3058}
3059
3060string_enum! {
3061    /// Choices for `pageSize`.
3062    TextToPdfPageSize {
3063        A4 => "a4",
3064        Letter => "letter",
3065        A3 => "a3",
3066    }
3067}
3068
3069string_enum! {
3070    /// Choices for `orientation`.
3071    TextToPdfOrientation {
3072        Portrait => "portrait",
3073        Landscape => "landscape",
3074    }
3075}
3076
3077/// Parameters of Text to PDF (`text-to-pdf`).
3078#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3079pub struct TextToPdfParams {
3080    /// Output page size. Default: `"a4"`.
3081    #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")]
3082    pub page_size: Option<TextToPdfPageSize>,
3083    /// Output page orientation. Default: `"portrait"`.
3084    #[serde(default, skip_serializing_if = "Option::is_none")]
3085    pub orientation: Option<TextToPdfOrientation>,
3086    /// Body font size in points. Default: `11`. Range: 7 to 22.
3087    #[serde(
3088        rename = "fontSize",
3089        default,
3090        skip_serializing_if = "Option::is_none",
3091        serialize_with = "crate::util::number"
3092    )]
3093    pub font_size: Option<f64>,
3094    /// Page margin in PDF points. Default: `54`. Range: 18 to 108.
3095    #[serde(
3096        default,
3097        skip_serializing_if = "Option::is_none",
3098        serialize_with = "crate::util::number"
3099    )]
3100    pub margin: Option<f64>,
3101    /// Body font: blank keeps DejaVu Sans; helvetica, times or courier uses that standard PDF font;
3102    /// gf:&lt;id&gt; uses a family of the font catalog (/docs/fonts: every Google Fonts family, all
3103    /// scripts); u:&lt;id&gt; one of your uploaded fonts; embedded in the PDF.
3104    #[serde(
3105        rename = "fontFamily",
3106        default,
3107        skip_serializing_if = "Option::is_none"
3108    )]
3109    pub font_family: Option<String>,
3110    /// Output file name without a path; the extension is added for you.
3111    #[serde(
3112        rename = "outputName",
3113        default,
3114        skip_serializing_if = "Option::is_none"
3115    )]
3116    pub output_name: Option<String>,
3117    /// Further parameters this SDK version does not model.
3118    #[serde(flatten)]
3119    pub extra: Object,
3120}
3121
3122impl From<TextToPdfParams> for ToolParameters {
3123    fn from(params: TextToPdfParams) -> Self {
3124        ToolParameters::from_serialize(&params).unwrap_or_default()
3125    }
3126}
3127
3128string_enum! {
3129    /// Choices for `source`.
3130    WebCaptureSource {
3131        Html => "html",
3132        Url => "url",
3133    }
3134}
3135
3136string_enum! {
3137    /// Choices for `output`.
3138    WebCaptureOutput {
3139        Pdf => "pdf",
3140        Png => "png",
3141        Jpeg => "jpeg",
3142        Webp => "webp",
3143    }
3144}
3145
3146string_enum! {
3147    /// Choices for `pageSize`.
3148    WebCapturePageSize {
3149        A4 => "A4",
3150        Letter => "Letter",
3151        Legal => "Legal",
3152        A3 => "A3",
3153    }
3154}
3155
3156string_enum! {
3157    /// Choices for `orientation`.
3158    WebCaptureOrientation {
3159        Portrait => "portrait",
3160        Landscape => "landscape",
3161    }
3162}
3163
3164string_enum! {
3165    /// Choices for `margin`.
3166    WebCaptureMargin {
3167        NoMargin => "no-margin",
3168        Small => "small",
3169        Big => "big",
3170    }
3171}
3172
3173string_enum! {
3174    /// Choices for `screenSize`.
3175    WebCaptureScreenSize {
3176        Desktop => "desktop",
3177        Laptop => "laptop",
3178        Tablet => "tablet",
3179        Mobile => "mobile",
3180    }
3181}
3182
3183/// Parameters of Web page to PDF or image (`web-capture`).
3184#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3185pub struct WebCaptureParams {
3186    /// html renders the uploaded HTML with scripts off; url captures a public web address. Default:
3187    /// `"html"`.
3188    #[serde(default, skip_serializing_if = "Option::is_none")]
3189    pub source: Option<WebCaptureSource>,
3190    /// Public address to capture. When empty, the input file's text is the address. Used when `source`
3191    /// is `url`.
3192    #[serde(default, skip_serializing_if = "Option::is_none")]
3193    pub url: Option<String>,
3194    /// What to make: a PDF, or a PNG, JPEG or WebP image. Default: `"pdf"`.
3195    #[serde(default, skip_serializing_if = "Option::is_none")]
3196    pub output: Option<WebCaptureOutput>,
3197    /// PDF page size. Default: `"A4"`. Used when `output` is `pdf`.
3198    #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")]
3199    pub page_size: Option<WebCapturePageSize>,
3200    /// PDF orientation. Default: `"portrait"`. Used when `output` is `pdf`.
3201    #[serde(default, skip_serializing_if = "Option::is_none")]
3202    pub orientation: Option<WebCaptureOrientation>,
3203    /// PDF margin: no-margin 0, small 0.5 in, big 0.75 in. Default: `"small"`. Used when `output` is
3204    /// `pdf`.
3205    #[serde(default, skip_serializing_if = "Option::is_none")]
3206    pub margin: Option<WebCaptureMargin>,
3207    /// Capture the whole page (one long PDF page, or a full-length image) instead of the first screen.
3208    /// Default: `false`.
3209    #[serde(rename = "fullPage", default, skip_serializing_if = "Option::is_none")]
3210    pub full_page: Option<bool>,
3211    /// Browser window: desktop 1365x768, laptop 1440x900, tablet 834x1112, mobile 390x844. Default:
3212    /// `"desktop"`.
3213    #[serde(
3214        rename = "screenSize",
3215        default,
3216        skip_serializing_if = "Option::is_none"
3217    )]
3218    pub screen_size: Option<WebCaptureScreenSize>,
3219    /// Exact window width; overrides screenSize. Range: 320 to 2400 px.
3220    #[serde(
3221        rename = "viewportWidth",
3222        default,
3223        skip_serializing_if = "Option::is_none",
3224        serialize_with = "crate::util::number"
3225    )]
3226    pub viewport_width: Option<f64>,
3227    /// Exact window height; overrides screenSize. Range: 240 to 2400 px.
3228    #[serde(
3229        rename = "viewportHeight",
3230        default,
3231        skip_serializing_if = "Option::is_none",
3232        serialize_with = "crate::util::number"
3233    )]
3234    pub viewport_height: Option<f64>,
3235    /// Wait after the page loads before capturing (an image waits 250 ms when this is omitted). Range:
3236    /// 0 to 3000 ms.
3237    #[serde(
3238        rename = "delayMs",
3239        default,
3240        skip_serializing_if = "Option::is_none",
3241        serialize_with = "crate::util::number"
3242    )]
3243    pub delay_ms: Option<f64>,
3244    /// JPEG or WebP quality. Default: `86`. Range: 1 to 100 %. Used when `output` is `jpeg` or `webp`.
3245    #[serde(
3246        default,
3247        skip_serializing_if = "Option::is_none",
3248        serialize_with = "crate::util::number"
3249    )]
3250    pub quality: Option<f64>,
3251    /// Keep a transparent background. Default: `false`. Used when `output` is `png`.
3252    #[serde(
3253        rename = "transparentBackground",
3254        default,
3255        skip_serializing_if = "Option::is_none"
3256    )]
3257    pub transparent_background: Option<bool>,
3258    /// Try to block advertising requests. Default: `false`. Used when `output` is `pdf`.
3259    #[serde(rename = "blockAds", default, skip_serializing_if = "Option::is_none")]
3260    pub block_ads: Option<bool>,
3261    /// Try to remove pop-up overlays from a captured web address. Default: `false`. Used when `output`
3262    /// is `pdf`.
3263    #[serde(
3264        rename = "removeOverlays",
3265        default,
3266        skip_serializing_if = "Option::is_none"
3267    )]
3268    pub remove_overlays: Option<bool>,
3269    /// Output file name without a path; the extension is added for you.
3270    #[serde(
3271        rename = "outputName",
3272        default,
3273        skip_serializing_if = "Option::is_none"
3274    )]
3275    pub output_name: Option<String>,
3276    /// Further parameters this SDK version does not model.
3277    #[serde(flatten)]
3278    pub extra: Object,
3279}
3280
3281impl From<WebCaptureParams> for ToolParameters {
3282    fn from(params: WebCaptureParams) -> Self {
3283        ToolParameters::from_serialize(&params).unwrap_or_default()
3284    }
3285}
3286
3287/// Parameters of Word to PDF (`word-to-pdf`).
3288#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3289pub struct WordToPdfParams {
3290    /// Output file name without a path; the extension is added for you.
3291    #[serde(
3292        rename = "outputName",
3293        default,
3294        skip_serializing_if = "Option::is_none"
3295    )]
3296    pub output_name: Option<String>,
3297    /// Further parameters this SDK version does not model.
3298    #[serde(flatten)]
3299    pub extra: Object,
3300}
3301
3302impl From<WordToPdfParams> for ToolParameters {
3303    fn from(params: WordToPdfParams) -> Self {
3304        ToolParameters::from_serialize(&params).unwrap_or_default()
3305    }
3306}
3307
3308string_enum! {
3309    /// Choices for `targetFormat`.
3310    ConvertFromJpgTargetFormat {
3311        Png => "png",
3312        Webp => "webp",
3313        Avif => "avif",
3314        Tiff => "tiff",
3315    }
3316}
3317
3318string_enum! {
3319    /// Choices for `preset`.
3320    ConvertFromJpgPreset {
3321        Recommended => "recommended",
3322        Smaller => "smaller",
3323        HighQuality => "high-quality",
3324    }
3325}
3326
3327/// Parameters of Convert from JPG (`convert-from-jpg`).
3328#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3329pub struct ConvertFromJpgParams {
3330    /// Target image format. Default: `"png"`.
3331    #[serde(
3332        rename = "targetFormat",
3333        default,
3334        skip_serializing_if = "Option::is_none"
3335    )]
3336    pub target_format: Option<ConvertFromJpgTargetFormat>,
3337    /// Output quality preset for lossy target formats. Default: `"recommended"`. Used when
3338    /// `target_format` is `webp` or `avif`.
3339    #[serde(default, skip_serializing_if = "Option::is_none")]
3340    pub preset: Option<ConvertFromJpgPreset>,
3341    /// Exact encoder quality. When supplied, this overrides the preset. Range: 1 to 100 %. Used when
3342    /// `target_format` is `webp` or `avif`.
3343    #[serde(
3344        default,
3345        skip_serializing_if = "Option::is_none",
3346        serialize_with = "crate::util::number"
3347    )]
3348    pub quality: Option<f64>,
3349    /// Output file name without a path; the extension is added for you.
3350    #[serde(
3351        rename = "outputName",
3352        default,
3353        skip_serializing_if = "Option::is_none"
3354    )]
3355    pub output_name: Option<String>,
3356    /// Further parameters this SDK version does not model.
3357    #[serde(flatten)]
3358    pub extra: Object,
3359}
3360
3361impl From<ConvertFromJpgParams> for ToolParameters {
3362    fn from(params: ConvertFromJpgParams) -> Self {
3363        ToolParameters::from_serialize(&params).unwrap_or_default()
3364    }
3365}
3366
3367string_enum! {
3368    /// Choices for `preset`.
3369    ConvertToJpgPreset {
3370        Recommended => "recommended",
3371        Smaller => "smaller",
3372        HighQuality => "high-quality",
3373    }
3374}
3375
3376/// Parameters of Convert to JPG (`convert-to-jpg`).
3377#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3378pub struct ConvertToJpgParams {
3379    /// JPG quality preset. Default: `"recommended"`.
3380    #[serde(default, skip_serializing_if = "Option::is_none")]
3381    pub preset: Option<ConvertToJpgPreset>,
3382    /// Exact JPG encoder quality. When supplied, this overrides the preset. Range: 1 to 100 %.
3383    #[serde(
3384        default,
3385        skip_serializing_if = "Option::is_none",
3386        serialize_with = "crate::util::number"
3387    )]
3388    pub quality: Option<f64>,
3389    /// Background used to flatten transparent pixels, as a six-digit hex color. Default: `"#ffffff"`.
3390    #[serde(default, skip_serializing_if = "Option::is_none")]
3391    pub background: Option<String>,
3392    /// Output file name without a path; the extension is added for you.
3393    #[serde(
3394        rename = "outputName",
3395        default,
3396        skip_serializing_if = "Option::is_none"
3397    )]
3398    pub output_name: Option<String>,
3399    /// Further parameters this SDK version does not model.
3400    #[serde(flatten)]
3401    pub extra: Object,
3402}
3403
3404impl From<ConvertToJpgParams> for ToolParameters {
3405    fn from(params: ConvertToJpgParams) -> Self {
3406        ToolParameters::from_serialize(&params).unwrap_or_default()
3407    }
3408}
3409
3410string_enum! {
3411    /// Choices for `outputFormat`.
3412    CropImageOutputFormat {
3413        Same => "same",
3414        Jpg => "jpg",
3415        Png => "png",
3416        Webp => "webp",
3417        Avif => "avif",
3418        Tiff => "tiff",
3419    }
3420}
3421
3422/// Parameters of Crop Image (`crop-image`).
3423#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3424pub struct CropImageParams {
3425    /// Left offset. Range: 0 to 19999 px.
3426    #[serde(default, serialize_with = "crate::util::required_number")]
3427    pub x: f64,
3428    /// Top offset. Range: 0 to 19999 px.
3429    #[serde(default, serialize_with = "crate::util::required_number")]
3430    pub y: f64,
3431    /// Crop width. Range: 1 to 20000 px.
3432    #[serde(default, serialize_with = "crate::util::required_number")]
3433    pub width: f64,
3434    /// Crop height. Range: 1 to 20000 px.
3435    #[serde(default, serialize_with = "crate::util::required_number")]
3436    pub height: f64,
3437    /// Keep the input format or encode a specific output format. Default: `"same"`.
3438    #[serde(
3439        rename = "outputFormat",
3440        default,
3441        skip_serializing_if = "Option::is_none"
3442    )]
3443    pub output_format: Option<CropImageOutputFormat>,
3444    /// Lossy encoder quality for JPG, WebP, or AVIF output (AVIF defaults to 55). Default: `82`. Range:
3445    /// 1 to 100 %.
3446    #[serde(
3447        default,
3448        skip_serializing_if = "Option::is_none",
3449        serialize_with = "crate::util::number"
3450    )]
3451    pub quality: Option<f64>,
3452    /// Six-digit hex background used when transparent pixels are encoded as JPG. Default: `"#ffffff"`.
3453    #[serde(default, skip_serializing_if = "Option::is_none")]
3454    pub background: Option<String>,
3455    /// Output file name without a path; the extension is added for you.
3456    #[serde(
3457        rename = "outputName",
3458        default,
3459        skip_serializing_if = "Option::is_none"
3460    )]
3461    pub output_name: Option<String>,
3462    /// Further parameters this SDK version does not model.
3463    #[serde(flatten)]
3464    pub extra: Object,
3465}
3466
3467impl From<CropImageParams> for ToolParameters {
3468    fn from(params: CropImageParams) -> Self {
3469        ToolParameters::from_serialize(&params).unwrap_or_default()
3470    }
3471}
3472
3473/// Parameters of Image Metadata (`image-metadata`).
3474#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3475pub struct ImageMetadataParams {
3476    /// Output file name without a path; the extension is added for you.
3477    #[serde(
3478        rename = "outputName",
3479        default,
3480        skip_serializing_if = "Option::is_none"
3481    )]
3482    pub output_name: Option<String>,
3483    /// Further parameters this SDK version does not model.
3484    #[serde(flatten)]
3485    pub extra: Object,
3486}
3487
3488impl From<ImageMetadataParams> for ToolParameters {
3489    fn from(params: ImageMetadataParams) -> Self {
3490        ToolParameters::from_serialize(&params).unwrap_or_default()
3491    }
3492}
3493
3494string_enum! {
3495    /// Choices for `mode`.
3496    ResizeImageMode {
3497        Pixels => "pixels",
3498        Percentage => "percentage",
3499    }
3500}
3501
3502string_enum! {
3503    /// Choices for `fit`.
3504    ResizeImageFit {
3505        Inside => "inside",
3506        Cover => "cover",
3507        Fill => "fill",
3508    }
3509}
3510
3511string_enum! {
3512    /// Choices for `kernel`.
3513    ResizeImageKernel {
3514        Nearest => "nearest",
3515        Cubic => "cubic",
3516        Mitchell => "mitchell",
3517        Lanczos2 => "lanczos2",
3518        Lanczos3 => "lanczos3",
3519    }
3520}
3521
3522string_enum! {
3523    /// Choices for `outputFormat`.
3524    ResizeImageOutputFormat {
3525        Same => "same",
3526        Jpg => "jpg",
3527        Png => "png",
3528        Webp => "webp",
3529        Avif => "avif",
3530        Tiff => "tiff",
3531    }
3532}
3533
3534/// Parameters of Resize Image (`resize-image`).
3535#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3536pub struct ResizeImageParams {
3537    /// Resize by pixels or percentage. Default: `"pixels"`.
3538    #[serde(default, skip_serializing_if = "Option::is_none")]
3539    pub mode: Option<ResizeImageMode>,
3540    /// Target width. Send width, height, or both. Range: 1 to 20000 px. Used when `mode` is `pixels`.
3541    #[serde(
3542        default,
3543        skip_serializing_if = "Option::is_none",
3544        serialize_with = "crate::util::number"
3545    )]
3546    pub width: Option<f64>,
3547    /// Target height. Send width, height, or both. Range: 1 to 20000 px. Used when `mode` is `pixels`.
3548    #[serde(
3549        default,
3550        skip_serializing_if = "Option::is_none",
3551        serialize_with = "crate::util::number"
3552    )]
3553    pub height: Option<f64>,
3554    /// Scale percentage. Default: `100`. Range: 1 to 400 %. Used when `mode` is `percentage`.
3555    #[serde(
3556        default,
3557        skip_serializing_if = "Option::is_none",
3558        serialize_with = "crate::util::number"
3559    )]
3560    pub percentage: Option<f64>,
3561    /// Preserve the source aspect ratio when only one of width or height is sent. Default: `true`. Used
3562    /// when `mode` is `pixels`.
3563    #[serde(
3564        rename = "maintainAspect",
3565        default,
3566        skip_serializing_if = "Option::is_none"
3567    )]
3568    pub maintain_aspect: Option<bool>,
3569    /// Do not upscale images smaller than the requested size. Default: `true`.
3570    #[serde(rename = "noEnlarge", default, skip_serializing_if = "Option::is_none")]
3571    pub no_enlarge: Option<bool>,
3572    /// How to fit the box. Default: `"inside"`.
3573    #[serde(default, skip_serializing_if = "Option::is_none")]
3574    pub fit: Option<ResizeImageFit>,
3575    /// Pixel resampling kernel used by the image encoder. Default: `"lanczos3"`.
3576    #[serde(default, skip_serializing_if = "Option::is_none")]
3577    pub kernel: Option<ResizeImageKernel>,
3578    /// Keep the input format or encode a specific output format. Default: `"same"`.
3579    #[serde(
3580        rename = "outputFormat",
3581        default,
3582        skip_serializing_if = "Option::is_none"
3583    )]
3584    pub output_format: Option<ResizeImageOutputFormat>,
3585    /// Lossy encoder quality for JPG, WebP, or AVIF output (AVIF defaults to 55). Default: `82`. Range:
3586    /// 1 to 100 %.
3587    #[serde(
3588        default,
3589        skip_serializing_if = "Option::is_none",
3590        serialize_with = "crate::util::number"
3591    )]
3592    pub quality: Option<f64>,
3593    /// Six-digit hex background used when transparent pixels are encoded as JPG. Default: `"#ffffff"`.
3594    #[serde(default, skip_serializing_if = "Option::is_none")]
3595    pub background: Option<String>,
3596    /// Output file name without a path; the extension is added for you.
3597    #[serde(
3598        rename = "outputName",
3599        default,
3600        skip_serializing_if = "Option::is_none"
3601    )]
3602    pub output_name: Option<String>,
3603    /// Further parameters this SDK version does not model.
3604    #[serde(flatten)]
3605    pub extra: Object,
3606}
3607
3608impl From<ResizeImageParams> for ToolParameters {
3609    fn from(params: ResizeImageParams) -> Self {
3610        ToolParameters::from_serialize(&params).unwrap_or_default()
3611    }
3612}
3613
3614string_enum! {
3615    /// Choices for `action`.
3616    RotateImageAction {
3617        Auto => "auto",
3618        Left => "left",
3619        Right => "right",
3620        V180 => "180",
3621        FlipHorizontal => "flip-horizontal",
3622        FlipVertical => "flip-vertical",
3623    }
3624}
3625
3626string_enum! {
3627    /// Choices for `outputFormat`.
3628    RotateImageOutputFormat {
3629        Same => "same",
3630        Jpg => "jpg",
3631        Png => "png",
3632        Webp => "webp",
3633        Avif => "avif",
3634        Tiff => "tiff",
3635    }
3636}
3637
3638/// Parameters of Rotate Image (`rotate-image`).
3639#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3640pub struct RotateImageParams {
3641    /// Rotation or flip preset. auto applies the EXIF orientation only; left, right and 180 rotate;
3642    /// flip-horizontal and flip-vertical mirror. Default: `"right"`.
3643    #[serde(default, skip_serializing_if = "Option::is_none")]
3644    pub action: Option<RotateImageAction>,
3645    /// Exact clockwise rotation. When supplied, it overrides left, right, and 180 actions. Range: -360
3646    /// to 360 degrees.
3647    #[serde(
3648        default,
3649        skip_serializing_if = "Option::is_none",
3650        serialize_with = "crate::util::number"
3651    )]
3652    pub angle: Option<f64>,
3653    /// Mirror left to right, before the turn, in the same run. Default: `false`.
3654    #[serde(
3655        rename = "flipHorizontal",
3656        default,
3657        skip_serializing_if = "Option::is_none"
3658    )]
3659    pub flip_horizontal: Option<bool>,
3660    /// Mirror top to bottom, before the turn, in the same run. Default: `false`.
3661    #[serde(
3662        rename = "flipVertical",
3663        default,
3664        skip_serializing_if = "Option::is_none"
3665    )]
3666    pub flip_vertical: Option<bool>,
3667    /// Six-digit hex fill for corners created by a non-right-angle rotation or JPG transparency
3668    /// flattening. Default: `"#ffffff"`.
3669    #[serde(default, skip_serializing_if = "Option::is_none")]
3670    pub background: Option<String>,
3671    /// Keep the input format or encode a specific output format. Default: `"same"`.
3672    #[serde(
3673        rename = "outputFormat",
3674        default,
3675        skip_serializing_if = "Option::is_none"
3676    )]
3677    pub output_format: Option<RotateImageOutputFormat>,
3678    /// Lossy encoder quality for JPG, WebP, or AVIF output (AVIF defaults to 55). Default: `82`. Range:
3679    /// 1 to 100 %.
3680    #[serde(
3681        default,
3682        skip_serializing_if = "Option::is_none",
3683        serialize_with = "crate::util::number"
3684    )]
3685    pub quality: Option<f64>,
3686    /// Output file name without a path; the extension is added for you.
3687    #[serde(
3688        rename = "outputName",
3689        default,
3690        skip_serializing_if = "Option::is_none"
3691    )]
3692    pub output_name: Option<String>,
3693    /// Further parameters this SDK version does not model.
3694    #[serde(flatten)]
3695    pub extra: Object,
3696}
3697
3698impl From<RotateImageParams> for ToolParameters {
3699    fn from(params: RotateImageParams) -> Self {
3700        ToolParameters::from_serialize(&params).unwrap_or_default()
3701    }
3702}
3703
3704string_enum! {
3705    /// Choices for `mode`.
3706    WatermarkImageMode {
3707        Text => "text",
3708        Image => "image",
3709    }
3710}
3711
3712string_enum! {
3713    /// Choices for `position`.
3714    WatermarkImagePosition {
3715        TopLeft => "top-left",
3716        TopCenter => "top-center",
3717        TopRight => "top-right",
3718        MiddleLeft => "middle-left",
3719        MiddleCenter => "middle-center",
3720        MiddleRight => "middle-right",
3721        BottomLeft => "bottom-left",
3722        BottomCenter => "bottom-center",
3723        BottomRight => "bottom-right",
3724    }
3725}
3726
3727string_enum! {
3728    /// Choices for `positionMode`.
3729    WatermarkImagePositionMode {
3730        Preset => "preset",
3731        Custom => "custom",
3732    }
3733}
3734
3735string_enum! {
3736    /// Choices for `pattern`.
3737    WatermarkImagePattern {
3738        Single => "single",
3739        Tile => "tile",
3740    }
3741}
3742
3743string_enum! {
3744    /// Choices for `outputFormat`.
3745    WatermarkImageOutputFormat {
3746        Same => "same",
3747        Jpg => "jpg",
3748        Png => "png",
3749        Webp => "webp",
3750        Avif => "avif",
3751        Tiff => "tiff",
3752    }
3753}
3754
3755/// Parameters of Watermark Image (`watermark-image`).
3756#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3757pub struct WatermarkImageParams {
3758    /// Text or image watermark. Default: `"text"`.
3759    #[serde(default, skip_serializing_if = "Option::is_none")]
3760    pub mode: Option<WatermarkImageMode>,
3761    /// Watermark text, up to 160 characters. Required in text mode. Used when `mode` is `text`.
3762    #[serde(default, skip_serializing_if = "Option::is_none")]
3763    pub text: Option<String>,
3764    /// Text font: blank keeps the bold sans; gf:&lt;id&gt; embeds a family of the font catalog
3765    /// (/docs/fonts: every Google Fonts family, all scripts, shaped for Devanagari, Bengali, Tamil,
3766    /// Telugu and Arabic); u:&lt;id&gt; one of your uploaded fonts (the id from your fonts in the PDF
3767    /// editor; another person's or a deleted font is refused) (its bold face when it has one). Used
3768    /// when `mode` is `text`.
3769    #[serde(
3770        rename = "fontFamily",
3771        default,
3772        skip_serializing_if = "Option::is_none"
3773    )]
3774    pub font_family: Option<String>,
3775    /// Opacity from 1 to 100 percent. Default: `35`. Range: 1 to 100 %.
3776    #[serde(
3777        default,
3778        skip_serializing_if = "Option::is_none",
3779        serialize_with = "crate::util::number"
3780    )]
3781    pub opacity: Option<f64>,
3782    /// Preset placement, one of nine spots. A custom spot uses positionMode=custom with xPercent and
3783    /// yPercent. Default: `"bottom-right"`.
3784    #[serde(default, skip_serializing_if = "Option::is_none")]
3785    pub position: Option<WatermarkImagePosition>,
3786    /// Use a preset or explicit percentage coordinates. Default: `"preset"`.
3787    #[serde(
3788        rename = "positionMode",
3789        default,
3790        skip_serializing_if = "Option::is_none"
3791    )]
3792    pub position_mode: Option<WatermarkImagePositionMode>,
3793    /// Horizontal centre of the watermark as a percentage of the image width; the watermark is kept
3794    /// inside the image. Default: `50`. Range: 0 to 100. Used when `position_mode` is `custom`.
3795    #[serde(
3796        rename = "xPercent",
3797        default,
3798        skip_serializing_if = "Option::is_none",
3799        serialize_with = "crate::util::number"
3800    )]
3801    pub x_percent: Option<f64>,
3802    /// Vertical centre of the watermark as a percentage of the image height, from the top; the
3803    /// watermark is kept inside the image. Default: `50`. Range: 0 to 100. Used when `position_mode` is
3804    /// `custom`.
3805    #[serde(
3806        rename = "yPercent",
3807        default,
3808        skip_serializing_if = "Option::is_none",
3809        serialize_with = "crate::util::number"
3810    )]
3811    pub y_percent: Option<f64>,
3812    /// Edge margin in pixels for preset placement. Default: `20`. Range: 0 to 2000 px.
3813    #[serde(
3814        default,
3815        skip_serializing_if = "Option::is_none",
3816        serialize_with = "crate::util::number"
3817    )]
3818    pub margin: Option<f64>,
3819    /// Width of an image watermark as a percentage of the image width. Default: `30`. Range: 5 to 100
3820    /// %. Used when `mode` is `image`.
3821    #[serde(
3822        default,
3823        skip_serializing_if = "Option::is_none",
3824        serialize_with = "crate::util::number"
3825    )]
3826    pub scale: Option<f64>,
3827    /// Single or tiled watermark. Default: `"single"`.
3828    #[serde(default, skip_serializing_if = "Option::is_none")]
3829    pub pattern: Option<WatermarkImagePattern>,
3830    /// Spacing between repeated watermarks in pixels. Default: `180`. Range: 40 to 1000 px. Used when
3831    /// `pattern` is `tile`.
3832    #[serde(
3833        rename = "tileSpacing",
3834        default,
3835        skip_serializing_if = "Option::is_none",
3836        serialize_with = "crate::util::number"
3837    )]
3838    pub tile_spacing: Option<f64>,
3839    /// Rotation in degrees, counter-clockwise. Default: `0`. Range: -180 to 180 degrees.
3840    #[serde(
3841        default,
3842        skip_serializing_if = "Option::is_none",
3843        serialize_with = "crate::util::number"
3844    )]
3845    pub rotation: Option<f64>,
3846    /// Text size in pixels. When omitted it is a fourteenth of the image width, at least 18. Range: 10
3847    /// to 240 px. Used when `mode` is `text`.
3848    #[serde(
3849        rename = "fontSize",
3850        default,
3851        skip_serializing_if = "Option::is_none",
3852        serialize_with = "crate::util::number"
3853    )]
3854    pub font_size: Option<f64>,
3855    /// Text color as a six-digit hex color. Default: `"#101511"`. Used when `mode` is `text`.
3856    #[serde(default, skip_serializing_if = "Option::is_none")]
3857    pub color: Option<String>,
3858    /// Keep the input format or encode a specific output format. Default: `"same"`.
3859    #[serde(
3860        rename = "outputFormat",
3861        default,
3862        skip_serializing_if = "Option::is_none"
3863    )]
3864    pub output_format: Option<WatermarkImageOutputFormat>,
3865    /// Lossy encoder quality for JPG, WebP, or AVIF output (AVIF defaults to 55). Default: `85`. Range:
3866    /// 1 to 100 %.
3867    #[serde(
3868        default,
3869        skip_serializing_if = "Option::is_none",
3870        serialize_with = "crate::util::number"
3871    )]
3872    pub quality: Option<f64>,
3873    /// Six-digit hex background used when transparent pixels are encoded as JPG. Default: `"#ffffff"`.
3874    #[serde(default, skip_serializing_if = "Option::is_none")]
3875    pub background: Option<String>,
3876    /// Output file name without a path; the extension is added for you.
3877    #[serde(
3878        rename = "outputName",
3879        default,
3880        skip_serializing_if = "Option::is_none"
3881    )]
3882    pub output_name: Option<String>,
3883    /// Further parameters this SDK version does not model.
3884    #[serde(flatten)]
3885    pub extra: Object,
3886}
3887
3888impl From<WatermarkImageParams> for ToolParameters {
3889    fn from(params: WatermarkImageParams) -> Self {
3890        ToolParameters::from_serialize(&params).unwrap_or_default()
3891    }
3892}
3893
3894impl Tools {
3895    /// Add Page Numbers: Insert numbered headers or footers.
3896    ///
3897    /// Accepts .pdf. Returns PDF document (application/pdf).
3898    pub async fn add_page_numbers(
3899        &self,
3900        input: impl Into<FileInput>,
3901        params: Option<AddPageNumbersParams>,
3902    ) -> Result<ToolResult> {
3903        self.run_typed(
3904            ToolId::AddPageNumbers,
3905            ToolInput::from(Into::<FileInput>::into(input)),
3906            params.as_ref(),
3907        )
3908        .await
3909    }
3910
3911    /// Add Watermark: Stamp text or image onto pages.
3912    ///
3913    /// Accepts .pdf. Returns PDF document (application/pdf).
3914    pub async fn add_watermark(
3915        &self,
3916        input: impl Into<FileInput>,
3917        params: Option<AddWatermarkParams>,
3918    ) -> Result<ToolResult> {
3919        self.run_typed(
3920            ToolId::AddWatermark,
3921            ToolInput::from(Into::<FileInput>::into(input)),
3922            params.as_ref(),
3923        )
3924        .await
3925    }
3926
3927    /// Check & Edit Metadata: Review and update document information.
3928    ///
3929    /// Accepts .pdf. Returns PDF document (application/pdf), or a ZIP of PDFs in batch mode
3930    /// (application/zip).
3931    pub async fn edit_metadata(
3932        &self,
3933        input: impl Into<FileInput>,
3934        params: Option<EditMetadataParams>,
3935    ) -> Result<ToolResult> {
3936        self.run_typed(
3937            ToolId::EditMetadata,
3938            ToolInput::from(Into::<FileInput>::into(input)),
3939            params.as_ref(),
3940        )
3941        .await
3942    }
3943
3944    /// Check PDF: One report on PDF/A conformance, PDF/UA accessibility and digital signatures.
3945    ///
3946    /// Accepts .pdf. Returns JSON report (application/json): PDF/A conformance, PDF/UA accessibility
3947    /// and digital signatures, each with a pass, warn or fail summary and its details.
3948    pub async fn check_pdf(
3949        &self,
3950        input: impl Into<FileInput>,
3951        params: Option<CheckPdfParams>,
3952    ) -> Result<ToolResult> {
3953        self.run_typed(
3954            ToolId::CheckPdf,
3955            ToolInput::from(Into::<FileInput>::into(input)),
3956            params.as_ref(),
3957        )
3958        .await
3959    }
3960
3961    /// Compress: Make PDFs and images smaller without changing how they look.
3962    ///
3963    /// Accepts .avif, .bmp, .gif, .jpeg, .jpg, .pdf, .png, .tif, .tiff, .webp. Returns The PDF,
3964    /// compressed (application/pdf); an image comes back in its own format (JPEG, PNG, WebP, GIF, TIFF,
3965    /// BMP or AVIF) at the same pixel size, never larger than the input.
3966    pub async fn compress_pdf(
3967        &self,
3968        input: impl Into<FileInput>,
3969        params: Option<CompressPdfParams>,
3970    ) -> Result<ToolResult> {
3971        self.run_typed(
3972            ToolId::CompressPdf,
3973            ToolInput::from(Into::<FileInput>::into(input)),
3974            params.as_ref(),
3975        )
3976        .await
3977    }
3978
3979    /// Crop PDF: Trim the margins of every page or the pages you pick.
3980    ///
3981    /// Accepts .pdf. Returns PDF document (application/pdf).
3982    pub async fn crop_pdf(
3983        &self,
3984        input: impl Into<FileInput>,
3985        params: Option<CropPdfParams>,
3986    ) -> Result<ToolResult> {
3987        self.run_typed(
3988            ToolId::CropPdf,
3989            ToolInput::from(Into::<FileInput>::into(input)),
3990            params.as_ref(),
3991        )
3992        .await
3993    }
3994
3995    /// Flatten PDF: Merge form fields into static pages.
3996    ///
3997    /// Accepts .pdf. Returns PDF document (application/pdf).
3998    pub async fn flatten_pdf(
3999        &self,
4000        input: impl Into<FileInput>,
4001        params: Option<FlattenPdfParams>,
4002    ) -> Result<ToolResult> {
4003        self.run_typed(
4004            ToolId::FlattenPdf,
4005            ToolInput::from(Into::<FileInput>::into(input)),
4006            params.as_ref(),
4007        )
4008        .await
4009    }
4010
4011    /// Merge PDF: Combine multiple PDFs into one file.
4012    ///
4013    /// Accepts .pdf (2 to 30 files, in order). Returns PDF document (application/pdf).
4014    pub async fn merge_pdf(
4015        &self,
4016        input: impl IntoIterator<Item = impl Into<FileInput>>,
4017        params: Option<MergePdfParams>,
4018    ) -> Result<ToolResult> {
4019        self.run_typed(ToolId::MergePdf, ToolInput::many(input), params.as_ref())
4020            .await
4021    }
4022
4023    /// N-up PDF: Put several pages on each sheet.
4024    ///
4025    /// Accepts .pdf. Returns PDF document (application/pdf).
4026    pub async fn n_up_pdf(
4027        &self,
4028        input: impl Into<FileInput>,
4029        params: Option<NUpPdfParams>,
4030    ) -> Result<ToolResult> {
4031        self.run_typed(
4032            ToolId::NUpPdf,
4033            ToolInput::from(Into::<FileInput>::into(input)),
4034            params.as_ref(),
4035        )
4036        .await
4037    }
4038
4039    /// OCR PDF: Recognise the text of a scanned PDF or an image (PNG, JPEG, TIFF or WebP).
4040    ///
4041    /// Accepts .avif, .bmp, .csv, .docx, .eml, .gif, .jpeg, .jpg, .msg, .pdf, .png, .pptx, .tif, .tiff,
4042    /// .tsv, .webp, .xlsx, .zip. Returns Searchable PDF (application/pdf), or the recognised text as
4043    /// plain text, Markdown, JSON, DOCX, HTML, XLSX, CSV, hOCR, ALTO XML, block JSON or annotation
4044    /// JSON, as chosen by outputMode; further formats (outputs) are listed in the result metadata.
4045    pub async fn ocr_pdf(
4046        &self,
4047        input: impl Into<FileInput>,
4048        params: Option<OcrPdfParams>,
4049    ) -> Result<ToolResult> {
4050        self.run_typed(
4051            ToolId::OcrPdf,
4052            ToolInput::from(Into::<FileInput>::into(input)),
4053            params.as_ref(),
4054        )
4055        .await
4056    }
4057
4058    /// Organize PDF: Reorder pages and remove the ones you leave out.
4059    ///
4060    /// Accepts .pdf. Returns PDF document (application/pdf).
4061    /// Required: `order`.
4062    pub async fn organize_pdf(
4063        &self,
4064        input: impl Into<FileInput>,
4065        params: OrganizePdfParams,
4066    ) -> Result<ToolResult> {
4067        self.run_typed(
4068            ToolId::OrganizePdf,
4069            ToolInput::from(Into::<FileInput>::into(input)),
4070            Some(&params),
4071        )
4072        .await
4073    }
4074
4075    /// PDF Table Extraction: Extract table-like content from PDF text.
4076    ///
4077    /// Accepts .pdf. Returns ZIP of CSV files, one per detected table (application/zip).
4078    pub async fn pdf_table_extraction(
4079        &self,
4080        input: impl Into<FileInput>,
4081        params: Option<PdfTableExtractionParams>,
4082    ) -> Result<ToolResult> {
4083        self.run_typed(
4084            ToolId::PdfTableExtraction,
4085            ToolInput::from(Into::<FileInput>::into(input)),
4086            params.as_ref(),
4087        )
4088        .await
4089    }
4090
4091    /// Protect PDF: Lock a file with a password.
4092    ///
4093    /// Accepts .pdf. Returns PDF document (application/pdf).
4094    /// Required: `password`.
4095    pub async fn protect_pdf(
4096        &self,
4097        input: impl Into<FileInput>,
4098        params: ProtectPdfParams,
4099    ) -> Result<ToolResult> {
4100        self.run_typed(
4101            ToolId::ProtectPdf,
4102            ToolInput::from(Into::<FileInput>::into(input)),
4103            Some(&params),
4104        )
4105        .await
4106    }
4107
4108    /// Redact PDF: Permanently remove text, images and areas you choose.
4109    ///
4110    /// Accepts .pdf. Returns PDF document (application/pdf).
4111    pub async fn redact_pdf(
4112        &self,
4113        input: impl Into<FileInput>,
4114        params: Option<RedactPdfParams>,
4115    ) -> Result<ToolResult> {
4116        self.run_typed(
4117            ToolId::RedactPdf,
4118            ToolInput::from(Into::<FileInput>::into(input)),
4119            params.as_ref(),
4120        )
4121        .await
4122    }
4123
4124    /// Repair PDF: Fix corrupted or broken PDF files.
4125    ///
4126    /// Accepts .pdf. Returns PDF document (application/pdf).
4127    pub async fn repair_pdf(
4128        &self,
4129        input: impl Into<FileInput>,
4130        params: Option<RepairPdfParams>,
4131    ) -> Result<ToolResult> {
4132        self.run_typed(
4133            ToolId::RepairPdf,
4134            ToolInput::from(Into::<FileInput>::into(input)),
4135            params.as_ref(),
4136        )
4137        .await
4138    }
4139
4140    /// Rotate PDF: Rotate all or specific pages.
4141    ///
4142    /// Accepts .pdf. Returns PDF document (application/pdf).
4143    pub async fn rotate_pdf(
4144        &self,
4145        input: impl Into<FileInput>,
4146        params: Option<RotatePdfParams>,
4147    ) -> Result<ToolResult> {
4148        self.run_typed(
4149            ToolId::RotatePdf,
4150            ToolInput::from(Into::<FileInput>::into(input)),
4151            params.as_ref(),
4152        )
4153        .await
4154    }
4155
4156    /// Sanitize PDF.
4157    ///
4158    /// Accepts .pdf. Returns PDF document (application/pdf).
4159    pub async fn sanitize_pdf(
4160        &self,
4161        input: impl Into<FileInput>,
4162        params: Option<SanitizePdfParams>,
4163    ) -> Result<ToolResult> {
4164        self.run_typed(
4165            ToolId::SanitizePdf,
4166            ToolInput::from(Into::<FileInput>::into(input)),
4167            params.as_ref(),
4168        )
4169        .await
4170    }
4171
4172    /// Scale PDF: Resize pages and their content by a percentage.
4173    ///
4174    /// Accepts .pdf. Returns PDF document (application/pdf).
4175    pub async fn scale_pdf(
4176        &self,
4177        input: impl Into<FileInput>,
4178        params: Option<ScalePdfParams>,
4179    ) -> Result<ToolResult> {
4180        self.run_typed(
4181            ToolId::ScalePdf,
4182            ToolInput::from(Into::<FileInput>::into(input)),
4183            params.as_ref(),
4184        )
4185        .await
4186    }
4187
4188    /// Sign PDF: Add a visible signature to a PDF.
4189    ///
4190    /// Accepts .pdf. Returns PDF document (application/pdf).
4191    pub async fn sign_pdf(
4192        &self,
4193        input: impl Into<FileInput>,
4194        params: Option<SignPdfParams>,
4195    ) -> Result<ToolResult> {
4196        self.run_typed(
4197            ToolId::SignPdf,
4198            ToolInput::from(Into::<FileInput>::into(input)),
4199            params.as_ref(),
4200        )
4201        .await
4202    }
4203
4204    /// Split PDF: Separate pages into individual files.
4205    ///
4206    /// Accepts .pdf. Returns One PDF (application/pdf), or a ZIP of PDFs when the split produces
4207    /// several parts (application/zip).
4208    pub async fn split_pdf(
4209        &self,
4210        input: impl Into<FileInput>,
4211        params: Option<SplitPdfParams>,
4212    ) -> Result<ToolResult> {
4213        self.run_typed(
4214            ToolId::SplitPdf,
4215            ToolInput::from(Into::<FileInput>::into(input)),
4216            params.as_ref(),
4217        )
4218        .await
4219    }
4220
4221    /// Unlock PDF: Remove password from a file you own.
4222    ///
4223    /// Accepts .pdf. Returns PDF document (application/pdf).
4224    pub async fn unlock_pdf(
4225        &self,
4226        input: impl Into<FileInput>,
4227        params: Option<UnlockPdfParams>,
4228    ) -> Result<ToolResult> {
4229        self.run_typed(
4230            ToolId::UnlockPdf,
4231            ToolInput::from(Into::<FileInput>::into(input)),
4232            params.as_ref(),
4233        )
4234        .await
4235    }
4236
4237    /// CSV to PDF: Convert CSV tables into a readable PDF.
4238    ///
4239    /// Accepts .csv, .txt. Returns PDF document (application/pdf).
4240    pub async fn csv_to_pdf(
4241        &self,
4242        input: impl Into<FileInput>,
4243        params: Option<CsvToPdfParams>,
4244    ) -> Result<ToolResult> {
4245        self.run_typed(
4246            ToolId::CsvToPdf,
4247            ToolInput::from(Into::<FileInput>::into(input)),
4248            params.as_ref(),
4249        )
4250        .await
4251    }
4252
4253    /// Excel to PDF: Convert spreadsheet files to PDF.
4254    ///
4255    /// Accepts .ods, .xlsx. Returns PDF document (application/pdf).
4256    pub async fn excel_to_pdf(
4257        &self,
4258        input: impl Into<FileInput>,
4259        params: Option<ExcelToPdfParams>,
4260    ) -> Result<ToolResult> {
4261        self.run_typed(
4262            ToolId::ExcelToPdf,
4263            ToolInput::from(Into::<FileInput>::into(input)),
4264            params.as_ref(),
4265        )
4266        .await
4267    }
4268
4269    /// Image to PDF: Combine supported image files into a single PDF.
4270    ///
4271    /// Accepts .jpeg, .jpg, .png, .webp (1 to 50 files, in order). Returns PDF document
4272    /// (application/pdf).
4273    pub async fn image_to_pdf(
4274        &self,
4275        input: impl IntoIterator<Item = impl Into<FileInput>>,
4276        params: Option<ImageToPdfParams>,
4277    ) -> Result<ToolResult> {
4278        self.run_typed(ToolId::ImageToPdf, ToolInput::many(input), params.as_ref())
4279            .await
4280    }
4281
4282    /// JSON to PDF: Render structured JSON into a readable PDF.
4283    ///
4284    /// Accepts .json, .txt. Returns PDF document (application/pdf).
4285    pub async fn json_to_pdf(
4286        &self,
4287        input: impl Into<FileInput>,
4288        params: Option<JsonToPdfParams>,
4289    ) -> Result<ToolResult> {
4290        self.run_typed(
4291            ToolId::JsonToPdf,
4292            ToolInput::from(Into::<FileInput>::into(input)),
4293            params.as_ref(),
4294        )
4295        .await
4296    }
4297
4298    /// Markdown to PDF: Convert Markdown content into a PDF document.
4299    ///
4300    /// Accepts .markdown, .md, .txt. Returns PDF document (application/pdf).
4301    pub async fn markdown_to_pdf(
4302        &self,
4303        input: impl Into<FileInput>,
4304        params: Option<MarkdownToPdfParams>,
4305    ) -> Result<ToolResult> {
4306        self.run_typed(
4307            ToolId::MarkdownToPdf,
4308            ToolInput::from(Into::<FileInput>::into(input)),
4309            params.as_ref(),
4310        )
4311        .await
4312    }
4313
4314    /// PDF to Chunks: Split the text of a PDF into chunks for search and AI retrieval.
4315    ///
4316    /// Accepts .pdf. Returns JSON chunks (application/json): text chunks with their page ranges, for
4317    /// retrieval.
4318    pub async fn pdf_to_chunks(
4319        &self,
4320        input: impl Into<FileInput>,
4321        params: Option<PdfToChunksParams>,
4322    ) -> Result<ToolResult> {
4323        self.run_typed(
4324            ToolId::PdfToChunks,
4325            ToolInput::from(Into::<FileInput>::into(input)),
4326            params.as_ref(),
4327        )
4328        .await
4329    }
4330
4331    /// PDF to EPUB: Create a text-based EPUB from PDF content.
4332    ///
4333    /// Accepts .pdf. Returns EPUB e-book (application/epub+zip).
4334    pub async fn pdf_to_epub(
4335        &self,
4336        input: impl Into<FileInput>,
4337        params: Option<PdfToEpubParams>,
4338    ) -> Result<ToolResult> {
4339        self.run_typed(
4340            ToolId::PdfToEpub,
4341            ToolInput::from(Into::<FileInput>::into(input)),
4342            params.as_ref(),
4343        )
4344        .await
4345    }
4346
4347    /// PDF to Excel: Export detected PDF tables into XLSX.
4348    ///
4349    /// Accepts .pdf. Returns XLSX spreadsheet
4350    /// (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet).
4351    pub async fn pdf_to_excel(
4352        &self,
4353        input: impl Into<FileInput>,
4354        params: Option<PdfToExcelParams>,
4355    ) -> Result<ToolResult> {
4356        self.run_typed(
4357            ToolId::PdfToExcel,
4358            ToolInput::from(Into::<FileInput>::into(input)),
4359            params.as_ref(),
4360        )
4361        .await
4362    }
4363
4364    /// PDF to HTML: Convert the text of a PDF into a clean web page.
4365    ///
4366    /// Accepts .pdf. Returns HTML document (text/html), one section per page, no scripts.
4367    pub async fn pdf_to_html(
4368        &self,
4369        input: impl Into<FileInput>,
4370        params: Option<PdfToHtmlParams>,
4371    ) -> Result<ToolResult> {
4372        self.run_typed(
4373            ToolId::PdfToHtml,
4374            ToolInput::from(Into::<FileInput>::into(input)),
4375            params.as_ref(),
4376        )
4377        .await
4378    }
4379
4380    /// PDF to Images: Export pages or embedded images from a PDF.
4381    ///
4382    /// Accepts .pdf. Returns ZIP of JPG images, one per page or extracted image (application/zip).
4383    pub async fn pdf_to_images(
4384        &self,
4385        input: impl Into<FileInput>,
4386        params: Option<PdfToImagesParams>,
4387    ) -> Result<ToolResult> {
4388        self.run_typed(
4389            ToolId::PdfToImages,
4390            ToolInput::from(Into::<FileInput>::into(input)),
4391            params.as_ref(),
4392        )
4393        .await
4394    }
4395
4396    /// PDF to JSON: Export PDF text as structured JSON.
4397    ///
4398    /// Accepts .pdf. Returns Structured JSON (application/json).
4399    pub async fn pdf_to_json(
4400        &self,
4401        input: impl Into<FileInput>,
4402        params: Option<PdfToJsonParams>,
4403    ) -> Result<ToolResult> {
4404        self.run_typed(
4405            ToolId::PdfToJson,
4406            ToolInput::from(Into::<FileInput>::into(input)),
4407            params.as_ref(),
4408        )
4409        .await
4410    }
4411
4412    /// PDF to Markdown: Convert extracted PDF text into Markdown.
4413    ///
4414    /// Accepts .pdf. Returns Markdown (text/markdown).
4415    pub async fn pdf_to_markdown(
4416        &self,
4417        input: impl Into<FileInput>,
4418        params: Option<PdfToMarkdownParams>,
4419    ) -> Result<ToolResult> {
4420        self.run_typed(
4421            ToolId::PdfToMarkdown,
4422            ToolInput::from(Into::<FileInput>::into(input)),
4423            params.as_ref(),
4424        )
4425        .await
4426    }
4427
4428    /// PDF to PowerPoint: Turn every page into a slide of a PowerPoint deck.
4429    ///
4430    /// Accepts .pdf. Returns PowerPoint deck
4431    /// (application/vnd.openxmlformats-officedocument.presentationml.presentation), one slide per page
4432    /// with its text as the picture description.
4433    pub async fn pdf_to_powerpoint(
4434        &self,
4435        input: impl Into<FileInput>,
4436        params: Option<PdfToPowerpointParams>,
4437    ) -> Result<ToolResult> {
4438        self.run_typed(
4439            ToolId::PdfToPowerpoint,
4440            ToolInput::from(Into::<FileInput>::into(input)),
4441            params.as_ref(),
4442        )
4443        .await
4444    }
4445
4446    /// PDF to Text: Extract selectable or OCR text from a PDF.
4447    ///
4448    /// Accepts .pdf. Returns Plain text (text/plain).
4449    pub async fn pdf_to_text(
4450        &self,
4451        input: impl Into<FileInput>,
4452        params: Option<PdfToTextParams>,
4453    ) -> Result<ToolResult> {
4454        self.run_typed(
4455            ToolId::PdfToText,
4456            ToolInput::from(Into::<FileInput>::into(input)),
4457            params.as_ref(),
4458        )
4459        .await
4460    }
4461
4462    /// PDF to Word: Convert extracted PDF text into editable DOCX.
4463    ///
4464    /// Accepts .pdf. Returns DOCX document
4465    /// (application/vnd.openxmlformats-officedocument.wordprocessingml.document).
4466    pub async fn pdf_to_word(
4467        &self,
4468        input: impl Into<FileInput>,
4469        params: Option<PdfToWordParams>,
4470    ) -> Result<ToolResult> {
4471        self.run_typed(
4472            ToolId::PdfToWord,
4473            ToolInput::from(Into::<FileInput>::into(input)),
4474            params.as_ref(),
4475        )
4476        .await
4477    }
4478
4479    /// PDF/A Conversion: Convert a PDF to PDF/A for long-term archiving.
4480    ///
4481    /// Accepts .pdf. Returns PDF document (application/pdf).
4482    pub async fn pdfa_conversion(
4483        &self,
4484        input: impl Into<FileInput>,
4485        params: Option<PdfaConversionParams>,
4486    ) -> Result<ToolResult> {
4487        self.run_typed(
4488            ToolId::PdfaConversion,
4489            ToolInput::from(Into::<FileInput>::into(input)),
4490            params.as_ref(),
4491        )
4492        .await
4493    }
4494
4495    /// PowerPoint to PDF: Convert presentation files to PDF.
4496    ///
4497    /// Accepts .odp, .pptx. Returns PDF document (application/pdf).
4498    pub async fn powerpoint_to_pdf(
4499        &self,
4500        input: impl Into<FileInput>,
4501        params: Option<PowerpointToPdfParams>,
4502    ) -> Result<ToolResult> {
4503        self.run_typed(
4504            ToolId::PowerpointToPdf,
4505            ToolInput::from(Into::<FileInput>::into(input)),
4506            params.as_ref(),
4507        )
4508        .await
4509    }
4510
4511    /// SVG to PDF: Convert safe SVG artwork into PDF format.
4512    ///
4513    /// Accepts .svg. Returns PDF document (application/pdf).
4514    pub async fn svg_to_pdf(
4515        &self,
4516        input: impl Into<FileInput>,
4517        params: Option<SvgToPdfParams>,
4518    ) -> Result<ToolResult> {
4519        self.run_typed(
4520            ToolId::SvgToPdf,
4521            ToolInput::from(Into::<FileInput>::into(input)),
4522            params.as_ref(),
4523        )
4524        .await
4525    }
4526
4527    /// Text to PDF: Convert plain text into a PDF document.
4528    ///
4529    /// Accepts .txt. Returns PDF document (application/pdf).
4530    pub async fn text_to_pdf(
4531        &self,
4532        input: impl Into<FileInput>,
4533        params: Option<TextToPdfParams>,
4534    ) -> Result<ToolResult> {
4535        self.run_typed(
4536            ToolId::TextToPdf,
4537            ToolInput::from(Into::<FileInput>::into(input)),
4538            params.as_ref(),
4539        )
4540        .await
4541    }
4542
4543    /// Web page to PDF or image: Capture a web address or pasted HTML as a PDF or a PNG, JPEG or WebP
4544    /// image.
4545    ///
4546    /// Accepts .htm, .html, .txt, .url. Returns PDF document (application/pdf), or a PNG, JPEG or WebP
4547    /// image, as chosen by output.
4548    pub async fn web_capture(
4549        &self,
4550        input: impl Into<FileInput>,
4551        params: Option<WebCaptureParams>,
4552    ) -> Result<ToolResult> {
4553        self.run_typed(
4554            ToolId::WebCapture,
4555            ToolInput::from(Into::<FileInput>::into(input)),
4556            params.as_ref(),
4557        )
4558        .await
4559    }
4560
4561    /// Word to PDF: Convert document files to PDF.
4562    ///
4563    /// Accepts .docx, .odt. Returns PDF document (application/pdf).
4564    pub async fn word_to_pdf(
4565        &self,
4566        input: impl Into<FileInput>,
4567        params: Option<WordToPdfParams>,
4568    ) -> Result<ToolResult> {
4569        self.run_typed(
4570            ToolId::WordToPdf,
4571            ToolInput::from(Into::<FileInput>::into(input)),
4572            params.as_ref(),
4573        )
4574        .await
4575    }
4576
4577    /// Convert from JPG: Export JPG files to another image format.
4578    ///
4579    /// Accepts .jpeg, .jpg. Returns Image in targetFormat: PNG, WebP, AVIF, or TIFF.
4580    pub async fn convert_from_jpg(
4581        &self,
4582        input: impl Into<FileInput>,
4583        params: Option<ConvertFromJpgParams>,
4584    ) -> Result<ToolResult> {
4585        self.run_typed(
4586            ToolId::ConvertFromJpg,
4587            ToolInput::from(Into::<FileInput>::into(input)),
4588            params.as_ref(),
4589        )
4590        .await
4591    }
4592
4593    /// Convert to JPG: Convert supported images to JPG.
4594    ///
4595    /// Accepts .avif, .jpeg, .jpg, .png, .tiff, .webp. Returns JPG image (image/jpeg).
4596    pub async fn convert_to_jpg(
4597        &self,
4598        input: impl Into<FileInput>,
4599        params: Option<ConvertToJpgParams>,
4600    ) -> Result<ToolResult> {
4601        self.run_typed(
4602            ToolId::ConvertToJpg,
4603            ToolInput::from(Into::<FileInput>::into(input)),
4604            params.as_ref(),
4605        )
4606        .await
4607    }
4608
4609    /// Crop Image: Crop an image to exact dimensions.
4610    ///
4611    /// Accepts .avif, .jpeg, .jpg, .png, .tiff, .webp. Returns Processed image (same family as input).
4612    /// Required: `x`, `y`, `width`, `height`.
4613    pub async fn crop_image(
4614        &self,
4615        input: impl Into<FileInput>,
4616        params: CropImageParams,
4617    ) -> Result<ToolResult> {
4618        self.run_typed(
4619            ToolId::CropImage,
4620            ToolInput::from(Into::<FileInput>::into(input)),
4621            Some(&params),
4622        )
4623        .await
4624    }
4625
4626    /// Image Metadata: Read an image's format, size, colour mode, frames and EXIF facts.
4627    ///
4628    /// Accepts .gif, .jpeg, .jpg, .png, .webp. Returns JSON metadata report: format, width, height,
4629    /// colour mode, frames and EXIF summary (application/json).
4630    pub async fn image_metadata(
4631        &self,
4632        input: impl Into<FileInput>,
4633        params: Option<ImageMetadataParams>,
4634    ) -> Result<ToolResult> {
4635        self.run_typed(
4636            ToolId::ImageMetadata,
4637            ToolInput::from(Into::<FileInput>::into(input)),
4638            params.as_ref(),
4639        )
4640        .await
4641    }
4642
4643    /// Resize Image: Change image dimensions precisely.
4644    ///
4645    /// Accepts .avif, .jpeg, .jpg, .png, .tiff, .webp. Returns Processed image (same family as input).
4646    pub async fn resize_image(
4647        &self,
4648        input: impl Into<FileInput>,
4649        params: Option<ResizeImageParams>,
4650    ) -> Result<ToolResult> {
4651        self.run_typed(
4652            ToolId::ResizeImage,
4653            ToolInput::from(Into::<FileInput>::into(input)),
4654            params.as_ref(),
4655        )
4656        .await
4657    }
4658
4659    /// Rotate Image: Correct image orientation.
4660    ///
4661    /// Accepts .avif, .jpeg, .jpg, .png, .tiff, .webp. Returns Processed image (same family as input).
4662    pub async fn rotate_image(
4663        &self,
4664        input: impl Into<FileInput>,
4665        params: Option<RotateImageParams>,
4666    ) -> Result<ToolResult> {
4667        self.run_typed(
4668            ToolId::RotateImage,
4669            ToolInput::from(Into::<FileInput>::into(input)),
4670            params.as_ref(),
4671        )
4672        .await
4673    }
4674
4675    /// Watermark Image: Apply text or logo marks to an image.
4676    ///
4677    /// Accepts .avif, .jpeg, .jpg, .png, .tiff, .webp. Returns Processed image (same family as input).
4678    pub async fn watermark_image(
4679        &self,
4680        input: impl Into<FileInput>,
4681        params: Option<WatermarkImageParams>,
4682    ) -> Result<ToolResult> {
4683        self.run_typed(
4684            ToolId::WatermarkImage,
4685            ToolInput::from(Into::<FileInput>::into(input)),
4686            params.as_ref(),
4687        )
4688        .await
4689    }
4690}
4691
4692impl Step {
4693    /// A pipeline step running Add Page Numbers (`add-page-numbers`).
4694    pub fn add_page_numbers(params: Option<AddPageNumbersParams>) -> Self {
4695        Step::typed(ToolId::AddPageNumbers, params.as_ref())
4696    }
4697
4698    /// A pipeline step running Add Watermark (`add-watermark`).
4699    pub fn add_watermark(params: Option<AddWatermarkParams>) -> Self {
4700        Step::typed(ToolId::AddWatermark, params.as_ref())
4701    }
4702
4703    /// A pipeline step running Check & Edit Metadata (`edit-metadata`).
4704    pub fn edit_metadata(params: Option<EditMetadataParams>) -> Self {
4705        Step::typed(ToolId::EditMetadata, params.as_ref())
4706    }
4707
4708    /// A pipeline step running Check PDF (`check-pdf`).
4709    pub fn check_pdf(params: Option<CheckPdfParams>) -> Self {
4710        Step::typed(ToolId::CheckPdf, params.as_ref())
4711    }
4712
4713    /// A pipeline step running Compress (`compress-pdf`).
4714    pub fn compress_pdf(params: Option<CompressPdfParams>) -> Self {
4715        Step::typed(ToolId::CompressPdf, params.as_ref())
4716    }
4717
4718    /// A pipeline step running Crop PDF (`crop-pdf`).
4719    pub fn crop_pdf(params: Option<CropPdfParams>) -> Self {
4720        Step::typed(ToolId::CropPdf, params.as_ref())
4721    }
4722
4723    /// A pipeline step running Flatten PDF (`flatten-pdf`).
4724    pub fn flatten_pdf(params: Option<FlattenPdfParams>) -> Self {
4725        Step::typed(ToolId::FlattenPdf, params.as_ref())
4726    }
4727
4728    /// A pipeline step running Merge PDF (`merge-pdf`).
4729    pub fn merge_pdf(params: Option<MergePdfParams>) -> Self {
4730        Step::typed(ToolId::MergePdf, params.as_ref())
4731    }
4732
4733    /// A pipeline step running N-up PDF (`n-up-pdf`).
4734    pub fn n_up_pdf(params: Option<NUpPdfParams>) -> Self {
4735        Step::typed(ToolId::NUpPdf, params.as_ref())
4736    }
4737
4738    /// A pipeline step running OCR PDF (`ocr-pdf`).
4739    pub fn ocr_pdf(params: Option<OcrPdfParams>) -> Self {
4740        Step::typed(ToolId::OcrPdf, params.as_ref())
4741    }
4742
4743    /// A pipeline step running Organize PDF (`organize-pdf`).
4744    pub fn organize_pdf(params: OrganizePdfParams) -> Self {
4745        Step::typed(ToolId::OrganizePdf, Some(&params))
4746    }
4747
4748    /// A pipeline step running PDF Table Extraction (`pdf-table-extraction`).
4749    pub fn pdf_table_extraction(params: Option<PdfTableExtractionParams>) -> Self {
4750        Step::typed(ToolId::PdfTableExtraction, params.as_ref())
4751    }
4752
4753    /// A pipeline step running Protect PDF (`protect-pdf`).
4754    pub fn protect_pdf(params: ProtectPdfParams) -> Self {
4755        Step::typed(ToolId::ProtectPdf, Some(&params))
4756    }
4757
4758    /// A pipeline step running Redact PDF (`redact-pdf`).
4759    pub fn redact_pdf(params: Option<RedactPdfParams>) -> Self {
4760        Step::typed(ToolId::RedactPdf, params.as_ref())
4761    }
4762
4763    /// A pipeline step running Repair PDF (`repair-pdf`).
4764    pub fn repair_pdf(params: Option<RepairPdfParams>) -> Self {
4765        Step::typed(ToolId::RepairPdf, params.as_ref())
4766    }
4767
4768    /// A pipeline step running Rotate PDF (`rotate-pdf`).
4769    pub fn rotate_pdf(params: Option<RotatePdfParams>) -> Self {
4770        Step::typed(ToolId::RotatePdf, params.as_ref())
4771    }
4772
4773    /// A pipeline step running Sanitize PDF (`sanitize-pdf`).
4774    pub fn sanitize_pdf(params: Option<SanitizePdfParams>) -> Self {
4775        Step::typed(ToolId::SanitizePdf, params.as_ref())
4776    }
4777
4778    /// A pipeline step running Scale PDF (`scale-pdf`).
4779    pub fn scale_pdf(params: Option<ScalePdfParams>) -> Self {
4780        Step::typed(ToolId::ScalePdf, params.as_ref())
4781    }
4782
4783    /// A pipeline step running Sign PDF (`sign-pdf`).
4784    pub fn sign_pdf(params: Option<SignPdfParams>) -> Self {
4785        Step::typed(ToolId::SignPdf, params.as_ref())
4786    }
4787
4788    /// A pipeline step running Split PDF (`split-pdf`).
4789    pub fn split_pdf(params: Option<SplitPdfParams>) -> Self {
4790        Step::typed(ToolId::SplitPdf, params.as_ref())
4791    }
4792
4793    /// A pipeline step running Unlock PDF (`unlock-pdf`).
4794    pub fn unlock_pdf(params: Option<UnlockPdfParams>) -> Self {
4795        Step::typed(ToolId::UnlockPdf, params.as_ref())
4796    }
4797
4798    /// A pipeline step running CSV to PDF (`csv-to-pdf`).
4799    pub fn csv_to_pdf(params: Option<CsvToPdfParams>) -> Self {
4800        Step::typed(ToolId::CsvToPdf, params.as_ref())
4801    }
4802
4803    /// A pipeline step running Excel to PDF (`excel-to-pdf`).
4804    pub fn excel_to_pdf(params: Option<ExcelToPdfParams>) -> Self {
4805        Step::typed(ToolId::ExcelToPdf, params.as_ref())
4806    }
4807
4808    /// A pipeline step running Image to PDF (`image-to-pdf`).
4809    pub fn image_to_pdf(params: Option<ImageToPdfParams>) -> Self {
4810        Step::typed(ToolId::ImageToPdf, params.as_ref())
4811    }
4812
4813    /// A pipeline step running JSON to PDF (`json-to-pdf`).
4814    pub fn json_to_pdf(params: Option<JsonToPdfParams>) -> Self {
4815        Step::typed(ToolId::JsonToPdf, params.as_ref())
4816    }
4817
4818    /// A pipeline step running Markdown to PDF (`markdown-to-pdf`).
4819    pub fn markdown_to_pdf(params: Option<MarkdownToPdfParams>) -> Self {
4820        Step::typed(ToolId::MarkdownToPdf, params.as_ref())
4821    }
4822
4823    /// A pipeline step running PDF to Chunks (`pdf-to-chunks`).
4824    pub fn pdf_to_chunks(params: Option<PdfToChunksParams>) -> Self {
4825        Step::typed(ToolId::PdfToChunks, params.as_ref())
4826    }
4827
4828    /// A pipeline step running PDF to EPUB (`pdf-to-epub`).
4829    pub fn pdf_to_epub(params: Option<PdfToEpubParams>) -> Self {
4830        Step::typed(ToolId::PdfToEpub, params.as_ref())
4831    }
4832
4833    /// A pipeline step running PDF to Excel (`pdf-to-excel`).
4834    pub fn pdf_to_excel(params: Option<PdfToExcelParams>) -> Self {
4835        Step::typed(ToolId::PdfToExcel, params.as_ref())
4836    }
4837
4838    /// A pipeline step running PDF to HTML (`pdf-to-html`).
4839    pub fn pdf_to_html(params: Option<PdfToHtmlParams>) -> Self {
4840        Step::typed(ToolId::PdfToHtml, params.as_ref())
4841    }
4842
4843    /// A pipeline step running PDF to Images (`pdf-to-images`).
4844    pub fn pdf_to_images(params: Option<PdfToImagesParams>) -> Self {
4845        Step::typed(ToolId::PdfToImages, params.as_ref())
4846    }
4847
4848    /// A pipeline step running PDF to JSON (`pdf-to-json`).
4849    pub fn pdf_to_json(params: Option<PdfToJsonParams>) -> Self {
4850        Step::typed(ToolId::PdfToJson, params.as_ref())
4851    }
4852
4853    /// A pipeline step running PDF to Markdown (`pdf-to-markdown`).
4854    pub fn pdf_to_markdown(params: Option<PdfToMarkdownParams>) -> Self {
4855        Step::typed(ToolId::PdfToMarkdown, params.as_ref())
4856    }
4857
4858    /// A pipeline step running PDF to PowerPoint (`pdf-to-powerpoint`).
4859    pub fn pdf_to_powerpoint(params: Option<PdfToPowerpointParams>) -> Self {
4860        Step::typed(ToolId::PdfToPowerpoint, params.as_ref())
4861    }
4862
4863    /// A pipeline step running PDF to Text (`pdf-to-text`).
4864    pub fn pdf_to_text(params: Option<PdfToTextParams>) -> Self {
4865        Step::typed(ToolId::PdfToText, params.as_ref())
4866    }
4867
4868    /// A pipeline step running PDF to Word (`pdf-to-word`).
4869    pub fn pdf_to_word(params: Option<PdfToWordParams>) -> Self {
4870        Step::typed(ToolId::PdfToWord, params.as_ref())
4871    }
4872
4873    /// A pipeline step running PDF/A Conversion (`pdfa-conversion`).
4874    pub fn pdfa_conversion(params: Option<PdfaConversionParams>) -> Self {
4875        Step::typed(ToolId::PdfaConversion, params.as_ref())
4876    }
4877
4878    /// A pipeline step running PowerPoint to PDF (`powerpoint-to-pdf`).
4879    pub fn powerpoint_to_pdf(params: Option<PowerpointToPdfParams>) -> Self {
4880        Step::typed(ToolId::PowerpointToPdf, params.as_ref())
4881    }
4882
4883    /// A pipeline step running SVG to PDF (`svg-to-pdf`).
4884    pub fn svg_to_pdf(params: Option<SvgToPdfParams>) -> Self {
4885        Step::typed(ToolId::SvgToPdf, params.as_ref())
4886    }
4887
4888    /// A pipeline step running Text to PDF (`text-to-pdf`).
4889    pub fn text_to_pdf(params: Option<TextToPdfParams>) -> Self {
4890        Step::typed(ToolId::TextToPdf, params.as_ref())
4891    }
4892
4893    /// A pipeline step running Web page to PDF or image (`web-capture`).
4894    pub fn web_capture(params: Option<WebCaptureParams>) -> Self {
4895        Step::typed(ToolId::WebCapture, params.as_ref())
4896    }
4897
4898    /// A pipeline step running Word to PDF (`word-to-pdf`).
4899    pub fn word_to_pdf(params: Option<WordToPdfParams>) -> Self {
4900        Step::typed(ToolId::WordToPdf, params.as_ref())
4901    }
4902
4903    /// A pipeline step running Convert from JPG (`convert-from-jpg`).
4904    pub fn convert_from_jpg(params: Option<ConvertFromJpgParams>) -> Self {
4905        Step::typed(ToolId::ConvertFromJpg, params.as_ref())
4906    }
4907
4908    /// A pipeline step running Convert to JPG (`convert-to-jpg`).
4909    pub fn convert_to_jpg(params: Option<ConvertToJpgParams>) -> Self {
4910        Step::typed(ToolId::ConvertToJpg, params.as_ref())
4911    }
4912
4913    /// A pipeline step running Crop Image (`crop-image`).
4914    pub fn crop_image(params: CropImageParams) -> Self {
4915        Step::typed(ToolId::CropImage, Some(&params))
4916    }
4917
4918    /// A pipeline step running Image Metadata (`image-metadata`).
4919    pub fn image_metadata(params: Option<ImageMetadataParams>) -> Self {
4920        Step::typed(ToolId::ImageMetadata, params.as_ref())
4921    }
4922
4923    /// A pipeline step running Resize Image (`resize-image`).
4924    pub fn resize_image(params: Option<ResizeImageParams>) -> Self {
4925        Step::typed(ToolId::ResizeImage, params.as_ref())
4926    }
4927
4928    /// A pipeline step running Rotate Image (`rotate-image`).
4929    pub fn rotate_image(params: Option<RotateImageParams>) -> Self {
4930        Step::typed(ToolId::RotateImage, params.as_ref())
4931    }
4932
4933    /// A pipeline step running Watermark Image (`watermark-image`).
4934    pub fn watermark_image(params: Option<WatermarkImageParams>) -> Self {
4935        Step::typed(ToolId::WatermarkImage, params.as_ref())
4936    }
4937}