
    Fg1                         S SK r S SKJr  S SKJrJrJrJr  S SKJ	r	   " S S5      r
 " S S5      r " S	 S
5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S\5      r " S S\5      rg)    N)Enum)ListOptionalTupleUnion)utilc                   0    \ rS rSrSrS\S\4S jrS rSrg)	
TextResult   z/Holds the result of a text translation request.textdetected_source_langc                     Xl         X l        g N)r   r   )selfr   r   s      _/Users/admin/workspace/ai/PDFMathTranslate/myenv/lib/python3.13/site-packages/deepl/api_data.py__init__TextResult.__init__   s    	$8!    c                     U R                   $ r   )r   r   s    r   __str__TextResult.__str__       yyr   )r   r   N)	__name__
__module____qualname____firstlineno____doc__strr   r   __static_attributes__ r   r   r
   r
      s    99S 9 9r   r
   c                   `    \ rS rSrSrS\S\4S jrS r\S\4S j5       r	\S\4S	 j5       r
S
rg)DocumentHandle   zHandle to an in-progress document translation.

:param document_id: ID of associated document request.
:param document_key: Key of associated document request.
document_iddocument_keyc                     Xl         X l        g r   _document_id_document_key)r   r%   r&   s      r   r   DocumentHandle.__init__   s    ')r   c                 :    SU R                    SU R                   3$ )NzDocument ID: z, key: )r%   r&   r   s    r   r   DocumentHandle.__str__"   s#    t//08I8I7JKKr   returnc                     U R                   $ r   )r)   r   s    r   r%   DocumentHandle.document_id%          r   c                     U R                   $ r   )r*   r   s    r   r&   DocumentHandle.document_key)   s    !!!r   r(   N)r   r   r   r   r   r   r   r   propertyr%   r&   r    r!   r   r   r#   r#      sV    *C *s *L !S ! ! "c " "r   r#   c                       \ rS rSrSr " S S\5      r   SS\4S jjrS\4S	 jr	\
S\4S
 j5       r\
S\4S j5       r\
S\4S j5       r\
S\\   4S j5       r\
S\\   4S j5       r\
S\\   4S j5       rSrg)DocumentStatus.   a  Status of a document translation request.

:param status: One of the Status enum values below.
:param seconds_remaining: Estimated time until document translation
    completes in seconds, or None if unknown.
:param billed_characters: Number of characters billed for this document, or
    None if unknown or before translation is complete.
:param error_message: A short description of the error, or None if no error
    has occurred.
c                   (    \ rS rSrSrSrSrSrSrSr	g)	DocumentStatus.Status:   queuedtranslatingdone
downloadederrorr!   N)
r   r   r   r   QUEUEDTRANSLATINGDONE
DOWNLOADEDERRORr    r!   r   r   Statusr9   :   s    #!
r   rE   Nstatusc                 T    U R                  U5      U l        X l        X0l        X@l        g r   )rE   _status_seconds_remaining_billed_characters_error_message)r   rF   seconds_remainingbilled_characterserror_messages        r   r   DocumentStatus.__init__A   s&     {{6*"3"3+r   r.   c                 .    U R                   R                  $ r   )rF   valuer   s    r   r   DocumentStatus.__str__M   s    {{   r   c                 H    U R                   U R                  R                  :g  $ r   )rH   rE   rD   r   s    r   okDocumentStatus.okP   s    ||t{{0000r   c                 H    U R                   U R                  R                  :H  $ r   )rH   rE   rB   r   s    r   r=   DocumentStatus.doneT   s    ||t{{////r   c                     U R                   $ r   )rH   r   s    r   rF   DocumentStatus.statusX   s    ||r   c                     U R                   $ r   )rI   r   s    r   rL    DocumentStatus.seconds_remaining\       &&&r   c                     U R                   $ r   )rJ   r   s    r   rM    DocumentStatus.billed_characters`   r\   r   c                     U R                   $ r   )rK   r   s    r   rN   DocumentStatus.error_messaged       """r   )rJ   rK   rI   rH   )NNN)r   r   r   r   r   r   rE   r   r   r   r4   boolrT   r=   rF   r   intrL   rM   rN   r    r!   r   r   r6   r6   .   s    	  
,
,! ! 1D 1 1 0d 0 0    '8C= ' ' '8C= ' ' #x} # #r   r6   c                   0   \ rS rSrSrS\S\S\S\S\S\R                  S	\4S
 jr	S\4S jr
\SS j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\R                  4S j5       r\S\4S j5       rSrg)GlossaryInfoi   a  Information about a glossary, excluding the entry list.

:param glossary_id: Unique ID assigned to the glossary.
:param name: User-defined name assigned to the glossary.
:param ready: True iff the glossary may be used for translations.
:param source_lang: Source language code of the glossary.
:param target_lang: Target language code of the glossary.
:param creation_time: Timestamp when the glossary was created.
:param entry_count: The number of entries contained in the glossary.
glossary_idnamereadysource_langtarget_langcreation_timeentry_countc                 X    Xl         X l        X0l        X@l        XPl        X`l        Xpl        g r   )_glossary_id_name_ready_source_lang_target_lang_creation_time_entry_count)r   rg   rh   ri   rj   rk   rl   rm   s           r   r   GlossaryInfo.__init__u   s,     (
''+'r   r.   c                 <    SU R                    SU R                   S3$ )Nz
Glossary "z" ())rh   rg   r   s    r   r   GlossaryInfo.__str__   s"    DII;c$*:*:);1==r   c                 X   U S   nSUSS :X  a  USS USS -   nSUSS :X  a  USS S-   n[        U S	   U S
   [        U S   5      [        U S   5      R                  5       [        U S   5      R                  5       [        R                  R                  US5      [        U S   5      5      $ )z3Create GlossaryInfo from the given API JSON object.rl   :NZz+0000rg   rh   ri   rj   rk   z%Y-%m-%dT%H:%M:%S.%f%zrm   )re   rb   r   upperdatetimestrptimerc   )jsonrl   s     r   	from_jsonGlossaryInfo.from_json   s     _--2&&)#2.rs1CCM-$$)#2.8MLg]#$**,]#$**,&&7 ]#$

 
	
r   c                     U R                   $ r   )ro   r   s    r   rg   GlossaryInfo.glossary_id   r1   r   c                     U R                   $ r   )rp   r   s    r   rh   GlossaryInfo.name   s    zzr   c                     U R                   $ r   )rq   r   s    r   ri   GlossaryInfo.ready   s    {{r   c                     U R                   $ r   rr   r   s    r   rj   GlossaryInfo.source_lang   r1   r   c                     U R                   $ r   rs   r   s    r   rk   GlossaryInfo.target_lang   r1   r   c                     U R                   $ r   )rt   r   s    r   rl   GlossaryInfo.creation_time   ra   r   c                     U R                   $ r   )ru   r   s    r   rm   GlossaryInfo.entry_count   r1   r   )rt   ru   ro   rp   rq   rr   rs   N)r.   re   )r   r   r   r   r   r   rb   r   rc   r   r   staticmethodr   r4   rg   rh   ri   rj   rk   rl   rm   r    r!   r   r   re   re   i   s9   	(( ( 	(
 ( (  ((( ($> > 
 
* !S ! ! c   t   !S ! ! !S ! ! #x00 # # !S ! !r   re   c                       \ rS rSrSr " S S5      rS\\   4S jr\	S\
4S j5       r\	S\
4S	 j5       r\	S\4S
 j5       r\	S\4S j5       r\	S\4S j5       rS\4S jrSrg)Usage   a?  Holds the result of a usage request.

The character, document and team_document properties provide details about
each corresponding usage type. These properties allow each usage type to be
checked individually.
The any_limit_reached property checks if for any usage type the amount used
has reached the allowed amount.
c                       \ rS rSrS\\   S\4S jr\S\\	   4S j5       r
\S\\	   4S j5       r\S\4S j5       r\S\4S	 j5       r\S\4S
 j5       rS\4S jrSrg)Usage.Detail   r   prefixc                 |    [         R                  " X S35      U l        [         R                  " X S35      U l        g )N_count_limit)r   get_int_safer   r   )r   r   r   s      r   r   Usage.Detail.__init__   s4    ++DHF2CDDK++DHF2CDDKr   r.   c                     U R                   $ )z9Returns the amount used for this usage type, may be None.)r   r   s    r   countUsage.Detail.count        ;;r   c                     U R                   $ )z<Returns the maximum amount for this usage type, may be None.)r   r   s    r   limitUsage.Detail.limit   r   r   c                 H    U R                   SL=(       a    U R                  SL$ )z>True iff both the count and limit are set for this usage
type.Nr   r   r   s    r   validUsage.Detail.valid   s!     ;;d*Ft{{$/FFr   c                 Z    U R                   =(       a    U R                  U R                  :  $ )zpTrue if this limit is valid and the amount used is greater than
or equal to the amount allowed, otherwise False.r   r   r   r   s    r   limit_reachedUsage.Detail.limit_reached   s      :::$**

"::r   c                 L    SSK nUR                  S[        SS9  U R                  $ )z&Deprecated, use limit_reached instead.r   Nzlimit_reached is deprecated   
stacklevel)warningswarnDeprecationWarningr   r   r   s     r   limit_exceededUsage.Detail.limit_exceeded   s.     MM-/Aa   %%%r   c                 ^    U R                   (       a  U R                   SU R                   3$ S$ )Nz of Unknownr   r   s    r   r   Usage.Detail.__str__   s&    6:jjdjj\djj\2OiOr   r   N)r   r   r   r   r   dictr   r   r4   rc   r   r   rb   r   r   r   r   r    r!   r   r   Detailr      s    	E$ 	E 	E 
	8C= 	 
	 
	8C= 	 
	 
	G4 	G 
	G
 
	;4 	; 
	;
 
	&D 	& 
	&	PS 	Pr   r   r   c                     U R                  US5      U l        U R                  US5      U l        U R                  US5      U l        g )N	characterdocumentteam_document)r   
_character	_document_team_document)r   r   s     r   r   Usage.__init__   s9    ++dK8T:6"kk$@r   r.   c                     U R                   R                  =(       d3    U R                  R                  =(       d    U R                  R                  $ )zpTrue if for any API usage type, the amount used is greater than or
equal to the amount allowed, otherwise False.)r   r   r   r   r   s    r   any_limit_reachedUsage.any_limit_reached   s<    
 NN(( 0}}**0!!//	
r   c                 L    SSK nUR                  S[        SS9  U R                  $ )z*Deprecated, use any_limit_reached instead.r   Nzany_limit_reached is deprecatedr   r   )r   r   r   r   r   s     r   any_limit_exceededUsage.any_limit_exceeded   s.     	-/Aa 	 	
 %%%r   c                     U R                   $ )ziReturns usage details for characters, primarily associated with the
translate_text (/translate) function.)r   r   s    r   r   Usage.character  s     r   c                     U R                   $ )z$Returns usage details for documents.)r   r   s    r   r   Usage.document  s     ~~r   c                     U R                   $ )z;Returns usage details for documents shared among your team.)r   r   s    r   r   Usage.team_document  s     """r   c           
          SU R                   4SU R                  4SU R                  4/nSSR                  U VVs/ s H  u  p#UR                  (       d  M  U SU 3PM!     snn5      -   $ s  snnf )N
Characters	DocumentszTeam documentszUsage this billing period:

z: )r   r   r   joinr   )r   detailslabeldetails       r   r   Usage.__str__  st    4>>*$--(t1123

 .		7>Owme&,,!wb!wO1
 
 	
Os   A+A+)r   r   r   N)r   r   r   r   r   r   r   r   r   r4   rb   r   r   r   r   r   r   r   r    r!   r   r   r   r      s    &P &PPAXd^ A
 
4 
 
 &D & & 6  
 &   #v # #
 
r   r   c                       \ rS rSrSr S/S\S\S\\   4S jjrS r	\
S	\\S 4   S
\4S j5       rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr S r!S!r"S"r#S#r$S$r%S%r&S&r'S'r(S(r)S)r*S*r+S+r,S,r-S-r.S.r/g)0Languagei#  a  Information about a language supported by DeepL translator.

:param code: Language code according to ISO 639-1, for example "EN".
    Some target languages also include the regional variant according to
    ISO 3166-1, for example "EN-US".
:param name: Name of the language in English.
:param supports_formality: (Optional) Specifies whether the formality
    option is available for this language; target languages only.
Ncoderh   supports_formalityc                 (    Xl         X l        X0l        g r   r   rh   r   )r   r   rh   r   s       r   r   Language.__init__.  s     		"4r   c                     U R                   $ r   )r   r   s    r   r   Language.__str__5  r   r   languager.   c                 :    [        U 5      R                  5       SS $ )zARemoves the regional variant from a language, e.g. EN-US gives ENr   r   )r   r   )r   s    r   remove_regional_variant Language.remove_regional_variant8  s     8}""$Qq))r   arbgcsdadeelenzen-GBzen-USesetfifrhuiditjakoltlvnbnlplptzpt-BRzpt-PTroruskslsvtrukzhr   r   )0r   r   r   r   r   r   r   rb   r   r   r   r   r   ARABIC	BULGARIANCZECHDANISHGERMANGREEKENGLISHENGLISH_BRITISHENGLISH_AMERICANSPANISHESTONIANFINNISHFRENCH	HUNGARIAN
INDONESIANITALIANJAPANESEKOREAN
LITHUANIANLATVIAN	NORWEGIANDUTCHPOLISH
PORTUGUESEPORTUGUESE_BRAZILIANPORTUGUESE_EUROPEANROMANIANRUSSIANSLOVAK	SLOVENIANSWEDISHTURKISH	UKRAINIANCHINESEr    r!   r   r   r   r   #  s    JN55"58@5 *%Z*@ *S * * FIEFFEGOGHGFIJGHFJGIEFJ"!HGFIGGIGr   r   c                   Z    \ rS rSrSrS\S\4S jr\S\4S j5       r\S\4S j5       r	S	r
g
)GlossaryLanguagePairia  zInformation about a pair of languages supported for DeepL glossaries.

:param source_lang: The code of the source language.
:param target_lang: The code of the target language.
rj   rk   c                     Xl         X l        g r   rr   rs   )r   rj   rk   s      r   r   GlossaryLanguagePair.__init__h  s    ''r   r.   c                     U R                   $ )z(Returns the code of the source language.r   r   s    r   rj    GlossaryLanguagePair.source_langl          r   c                     U R                   $ )z(Returns the code of the target language.r   r   s    r   rk    GlossaryLanguagePair.target_langq  r2  r   r.  N)r   r   r   r   r   r   r   r4   rj   rk   r    r!   r   r   r,  r,  a  sP    (C (c ( !S ! ! !S ! !r   r,  c                   <    \ rS rSrSrSr Sr Sr Sr Sr	 S r
S	rg
)	Formalityiw  z Options for formality parameter.lessdefaultmoreprefer_moreprefer_lessc                     U R                   $ r   rQ   r   s    r   r   Formality.__str__      zzr   r!   N)r   r   r   r   r   LESSDEFAULTMOREPREFER_MOREPREFER_LESSr   r    r!   r   r   r6  r6  w  s8    *D,G0D*K3  K3r   r6  c                   .    \ rS rSrSrSrSrSr\rS r	Sr
g)	SplitSentencesi  a  Options for split_sentences parameter.

Sets whether the translation engine should first split the input into
sentences. This is enabled by default. Possible values are:
- OFF: no splitting at all, whole input is treated as one sentence. Use
    this option if the input text is already split into sentences, to
    prevent the engine from splitting the sentence unintentionally.
- ALL: (default) splits on punctuation and on newlines.
- NO_NEWLINES: splits on punctuation only, ignoring newlines.
01
nonewlinesc                     U R                   $ r   r=  r   s    r   r   SplitSentences.__str__  r?  r   r!   N)r   r   r   r   r   OFFALLNO_NEWLINESrA  r   r    r!   r   r   rF  rF    s"    	 C
CKGr   rF  )r   enumr   typingr   r   r   r   deeplr   r
   r#   r6   re   r   r   r,  r6  rF  r!   r   r   <module>rR     s|   
   / /  " ".8# 8#vQ! Q!hc
 c
L; ;|! !, 0T r   