+
    9i6                    D  a  0 t $ R t^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^RIHtHtHt ^RIHt ^RIHt ]'       d   ^ RIHt ^ RIHt ^ RI H!t! Rt"R]#R&   R R lt$R]%! R4      /R R llt&R R lt'RR/R R llt(R# )zPLow-level remote (the "raw" endpoint JSON) Terms of Service metadata management.)annotations)datetime)JSONDecodeError)TYPE_CHECKING)context)join_url)get_session)Channel)ValidationError)RequestException)CondaToSInvalidErrorCondaToSMissingErrorCondaToSPermissionError)RemoteToSMetadata)get_cache_path)Path)Final)Responsez
terms.jsonr   ENDPOINTc                    V ^8  d   QhRRRR/# )   channelstr | Channelreturnr    )formats   "9lib/python3.14/site-packages/conda_anaconda_tos/remote.py__annotate__r   #   s     ! !- !H !    c                   \        V 4      p V P                  '       g   \        R4      h\        V P                  4      p\	        V P                  \
        4      p\        P                  p R\        n        VP                  VRR/\        P                  \        P                  3R7      pVP                  4         T\        n        T#   \         d   p\        T 4      ThRp?ii ; i  T\        n        i ; i)z0Get the metadata endpoint for the given channel.zd`channel` must have a base URL. (hint: `conda.models.channel.MultiChannel` doesn't have an endpoint)FzContent-Typezapplication/json)headerstimeoutN)r	   base_url
ValueErrorr   r   r   r   add_anaconda_tokengetremote_connect_timeout_secsremote_read_timeout_secsraise_for_statusr   r   )r   sessionurlsaved_token_settingresponseexcs   &     r   get_endpointr.   #   s    gGS
 	

 '**+G
7##X
.C!449
 &+";;#%783300  
 	!!#
 &9"O  5"7+45 &9"s%   )AC C"CC""C% %C2cache_timeoutinfc               $    V ^8  d   QhRRRRRR/# )r   r   r   r/   int | float | Noner   zPath | Noner   )r   s   "r   r   r   G   s(       & 	r   c               <   V'       g   R# \        V 4      p\        V\        \        34      '       g   \	        R4      h VP                  4       P                  p\        P                  ! 4       P                  4       pYC,
          T8  d   R# T#   \         d     R# i ; i)z5Get the path to cached payload for the given channel.Nz4`cache_timeout` must be an integer, float, or falsy.)r   
isinstanceintfloat	TypeErrorstatst_mtimeFileNotFoundErrorr   now	timestamp)r   r/   pathmtimer;   s   &$   r   get_cached_endpointr?   G   s      '"Dmc5\22NOO		$$ ,,.
"
"
$C%K  s   B BBc               $    V ^8  d   QhRRRRRR/# )r   r   r   metadatazRemoteToSMetadata | Noner   r   r   )r   s   "r   r   r   d   s&      & 
r   c                \   \        V 4      pV'       d"   \        V\        4      '       g   \        R4      h VP                  P                  RRR7       V'       d"   VP                  VP                  4       4       V# VP                  4         V#   \         d   p\        Y 4      ThRp?ii ; i)z/Write the metadata cache for the given channel.z'`metadata` must be a RemoteToSMetadata.T)parentsexist_okN)r   r4   r   r7   parentmkdir
write_textmodel_dump_jsontouchPermissionErrorr   )r   rA   r=   r-   s   &&  r   write_cached_endpointrK   d   s     '"D
8->??ABB>$6OOH4467 K JJL
 K	  >%d4#=>s#   $B B <B B+B&&B+Nc               $    V ^8  d   QhRRRRRR/# )r   r   r   r/   r2   r   r   r   )r   s   "r   r   r   |   s(     7 77 &7 	7r   c               4   \        T \        P                  '       d   \        R4      MTR7      pV'       dK    VP	                  4       P                  4       pV'       g   \        V 4      h  \        P                  ! T4      #  \        R/ \        V 4      P                  4       B p\!        W4       V#   \         d   p\        T 4      ThRp?i\         d   p\        Y 4      ThRp?ii ; i  \         d   p\        T 4      ThRp?ii ; i  \         d    \!        T R4       h \"         d7   pRTP$                  ^ ,          9   d   \!        T R4       \        T 4      Thh Rp?i\&        \(        \*        \        3 d   p\!        T R4       \        T 4      ThRp?ii ; i)z0Get the metadata metadata for the given channel.r0   )r/   Nzoffline moder   )r?   r   offliner6   	read_textstripr   r:   rJ   r   r   model_validate_jsonr
   r   r.   jsonrK   RuntimeErrorargsAttributeErrorr7   r   )r   r/   cachetextr-   rA   s   &$    r   get_remote_metadatarX   |   sm     &-oooeEl=E 		C??$**,D*733 	9$88>>$D|G'<'A'A'CD( 	g0I ! 	9&w/S8 	C)%9sB	C  	9&w/S8	9    	gt, SXXa[(!'40&w/S8IH 5
 	gt,"7+45sw   %B1 B1 +C* "D	 1C'<CC'C'C""C'*D5DD	 F*F+1EF9F:FF))__conditional_annotations____doc__
__future__r   r   rR   r   typingr   conda.base.contextr   conda.common.urlr   !conda.gateways.connection.sessionr   conda.models.channelr	   pydanticr
   requests.exceptionsr   
exceptionsr   r   r   modelsr   r=   r   pathlibr   r   requestsr   r   __annotations__r.   r6   r?   rK   rX   )rY   s   @r   <module>rh      s    W "      & % 9 ( $ 0 
 &  !% !H ).e:07 )-7 7r   