1111 AliasChoices ,
1212 AwareDatetime ,
1313 BaseModel ,
14+ BeforeValidator ,
1415 ConfigDict ,
1516 Field ,
1617 HttpUrl ,
2021from pydantic_core import CoreSchema
2122from typing_extensions import override
2223
24+ from ._demo_value_sanitizers import (
25+ demo_bool_false_or_passthrough ,
26+ demo_bool_true_or_passthrough ,
27+ demo_int_or_passthrough ,
28+ )
29+
2330__all__ = (
2431 "ExtractTextResponse" ,
2532 "ExtractedTextDocument" ,
@@ -730,13 +737,15 @@ class PdfRestInfoResponse(BaseModel):
730737 ]
731738 tagged : Annotated [
732739 bool | None ,
740+ BeforeValidator (demo_bool_false_or_passthrough ),
733741 Field (
734742 description = "Indicates whether structure tags are present in the PDF "
735743 "document. The result is true or false."
736744 ),
737745 ] = None
738746 image_only : Annotated [
739747 bool | None ,
748+ BeforeValidator (demo_bool_false_or_passthrough ),
740749 Field (
741750 description = (
742751 "Indicates whether the document is 'image only,' meaning it consists "
@@ -848,6 +857,7 @@ class PdfRestInfoResponse(BaseModel):
848857 ] = None
849858 contains_annotations : Annotated [
850859 bool | None ,
860+ BeforeValidator (demo_bool_false_or_passthrough ),
851861 Field (
852862 description = (
853863 "Indicates whether the PDF document contains annotations such as "
@@ -858,6 +868,7 @@ class PdfRestInfoResponse(BaseModel):
858868 ] = None
859869 contains_signature : Annotated [
860870 bool | None ,
871+ BeforeValidator (demo_bool_false_or_passthrough ),
861872 Field (
862873 description = "Indicates whether the PDF contains any digital signatures. "
863874 "The result is true or false."
@@ -875,6 +886,7 @@ class PdfRestInfoResponse(BaseModel):
875886 ] = None
876887 file_size : Annotated [
877888 int | None ,
889+ BeforeValidator (demo_int_or_passthrough ),
878890 Field (
879891 description = "The size of the PDF file in bytes. The result is an integer."
880892 ),
@@ -885,6 +897,7 @@ class PdfRestInfoResponse(BaseModel):
885897 ] = None
886898 restrict_permissions_set : Annotated [
887899 bool | None ,
900+ BeforeValidator (demo_bool_false_or_passthrough ),
888901 Field (
889902 description = (
890903 "Indicates whether the PDF file has restricted permissions, such as "
@@ -895,83 +908,95 @@ class PdfRestInfoResponse(BaseModel):
895908 ] = None
896909 contains_xfa : Annotated [
897910 bool | None ,
911+ BeforeValidator (demo_bool_false_or_passthrough ),
898912 Field (
899913 description = "Indicates whether the PDF contains XFA forms. The result is "
900914 "true or false."
901915 ),
902916 ] = None
903917 contains_acroforms : Annotated [
904918 bool | None ,
919+ BeforeValidator (demo_bool_false_or_passthrough ),
905920 Field (
906921 description = "Indicates whether the PDF contains Acroforms. The result is "
907922 "true or false."
908923 ),
909924 ] = None
910925 contains_javascript : Annotated [
911926 bool | None ,
927+ BeforeValidator (demo_bool_false_or_passthrough ),
912928 Field (
913929 description = "Indicates whether the PDF contains JavaScript. The result is "
914930 "true or false."
915931 ),
916932 ] = None
917933 contains_transparency : Annotated [
918934 bool | None ,
935+ BeforeValidator (demo_bool_false_or_passthrough ),
919936 Field (
920937 description = "Indicates whether the PDF contains transparent objects. The "
921938 "result is true or false."
922939 ),
923940 ] = None
924941 contains_embedded_file : Annotated [
925942 bool | None ,
943+ BeforeValidator (demo_bool_false_or_passthrough ),
926944 Field (
927945 description = "Indicates whether the PDF contains one or more embedded "
928946 "files. The result is true or false."
929947 ),
930948 ] = None
931949 uses_embedded_fonts : Annotated [
932950 bool | None ,
951+ BeforeValidator (demo_bool_false_or_passthrough ),
933952 Field (
934953 description = "Indicates whether the PDF contains fully embedded fonts. "
935954 "The result is true or false."
936955 ),
937956 ] = None
938957 uses_nonembedded_fonts : Annotated [
939958 bool | None ,
959+ BeforeValidator (demo_bool_false_or_passthrough ),
940960 Field (
941961 description = "Indicates whether the PDF contains non-embedded fonts. The "
942962 "result is true or false."
943963 ),
944964 ] = None
945965 pdfa : Annotated [
946966 bool | None ,
967+ BeforeValidator (demo_bool_false_or_passthrough ),
947968 Field (
948969 description = "Indicates whether the document conforms to the PDF/A "
949970 "standard. The result is true or false."
950971 ),
951972 ] = None
952973 pdfua_claim : Annotated [
953974 bool | None ,
975+ BeforeValidator (demo_bool_false_or_passthrough ),
954976 Field (
955977 description = "Indicates whether the document claims to conform to the "
956978 "PDF/UA standard. The result is true or false."
957979 ),
958980 ] = None
959981 pdfe_claim : Annotated [
960982 bool | None ,
983+ BeforeValidator (demo_bool_false_or_passthrough ),
961984 Field (
962985 description = "Indicates whether the document claims to conform to the "
963986 "PDF/E standard. The result is true or false."
964987 ),
965988 ] = None
966989 pdfx_claim : Annotated [
967990 bool | None ,
991+ BeforeValidator (demo_bool_false_or_passthrough ),
968992 Field (
969993 description = "Indicates whether the document claims to conform to the "
970994 "PDF/X standard. The result is true or false."
971995 ),
972996 ] = None
973997 requires_password_to_open : Annotated [
974998 bool | None ,
999+ BeforeValidator (demo_bool_false_or_passthrough ),
9751000 Field (
9761001 description = (
9771002 "Indicates whether the PDF requires a password to open. The result "
@@ -982,6 +1007,7 @@ class PdfRestInfoResponse(BaseModel):
9821007 ] = None
9831008 all_queries_processed : Annotated [
9841009 bool ,
1010+ BeforeValidator (demo_bool_true_or_passthrough ),
9851011 Field (
9861012 validation_alias = AliasChoices (
9871013 "all_queries_processed" , "allQueriesProcessed"
0 commit comments