+
    &jE1                        R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIt^ RIH	t	 ^RI
HtHtHtHtHtHtHtHt ^RIHtHt  ! R R]]P.                  4      t ! R	 R
]]P.                  4      tRR0t]]]P8                  ! R^R7      3,          tR R lt]! RR7      t]PA                  R. R<OR7      ]PB                  ]PD                  R^]PF                  R3R R ll4       t$]PA                  RRR.R7      ]PF                  R3R R ll4       t%]PA                  R. R=OR7      RRR]PF                  R3R R ll4       t&]PA                  R R!R".R7      RR]PF                  R3R# R$ ll4       t']PA                  R%R&R'.R7      RR]PF                  R3R( R) ll4       t(]PA                  R*R+R,.R7      RR]PF                  R3R- R. ll4       t)]PA                  R/R0.R7      ]PF                  R3R1 R2 ll4       t*]PA                  R3R4R5.R7      RR]PF                  R3R6 R7 ll4       t+]PA                  R8R9.R7      ]PF                  R3R: R; ll4       t,R# )>zYContains commands to interact with discussions and pull requests on the Hugging Face Hub.N)Path)	Annotated)	constants)	AuthorOptLimitOpt	RepoIdArgRepoTypeRepoTypeOptTokenOpt
get_hf_apityper_factory)_dataclass_to_dictoutc                   *    ] tR t^&tRtRtRtRtRtRt	R# )DiscussionStatusopenclosedmergeddraftall N)
__name__
__module____qualname____firstlineno__r   r   r   r   r   __static_attributes__r       w/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/huggingface_hub/cli/discussions.pyr   r   &   s    DFFE
Cr   r   c                   "    ] tR t^.tRtRtRtRtR# )DiscussionKindr   
discussionpull_requestr   N)r   r   r   r   r   r    r!   r   r   r   r   r   r   .   s    
CJ!Lr   r   r   r   z&The discussion or pull request number.)helpminc                f    V ^8  d   QhR\         R,          R\        R,          R\         R,          /# )   bodyN	body_filereturn)strr   )formats   "r   __annotate__r+   D   s-      S4Z D4K C$J r   c                    V e   Ve   \         P                  ! R4      hVeA   \        V4      R8X  d   \        P                  P                  4       # VP                  RR7      # V # )zFResolve body text from --body or --body-file (supports '-' for stdin).z'Cannot use both --body and --body-file.-zutf-8)encoding)typerBadParameterr)   sysstdinread	read_text)r&   r'   s   &&r   
_read_bodyr5   D   s[    I1  !JKKy>S 99>>##""G"44Kr   z0Manage discussions and pull requests on the Hub.r"   z	list | ls)examplesc                    V ^8  d   QhR\         R\        \        \        P                  ! RRRR7      3,          R\        \
        \        P                  ! RR	R
R7      3,          R\        R\        R\        R\        RR/# )r%   repo_idstatusz-sz--statusz4Filter by status (open, closed, merged, draft, all).r6   kindz-kz--kindz/Filter by kind (discussion, pull_request, all).authorlimit	repo_typetokenr(   N)
r   r   r   r/   Optionr   r   r   r	   r
   )r*   s   "r   r+   r+   [   s     ; ;;G	
	; B	
	;$ %;& ';( );* +;, 
-;r   c                :   \        VR7      pV\        P                  8X  d   RpMV\        P                  8X  d   RpMRpV\        P
                  8X  d   Rp	MVP                  p	. p
VP                  V VV	VVP                  R7       FX  pVP                  \        9   d   VP                  VP                  8w  d   K5  V
P                  V4       \        V
4      V8  g   KX   M	  V
 Uu. uF  p\        V4      NK  	  pp\        P                  ! V. RORR7       R# u upi )	z-List discussions and pull requests on a repo.r?   r   r   N)r9   r<   discussion_typediscussion_statusr>   num)headersid_key)rE   titleis_pull_requestr:   r<   
created_at)r   r   r   r   r   r   valueget_repo_discussions_CLIENT_SIDE_STATUSESr:   appendlenr   r   table)r9   r:   r;   r<   r=   r>   r?   api
api_statusapi_discussion_typediscussionsditemss   &&&&&&&      r   discussion_listrW   R   s   B 5
!C !&&&
	#**	*

 ~!!!""jjK%%+$// &  <<00QXX5M1{u$ -88Kq"KE8IIU 9s   %Dinfoz'hf discussions info username/my-model 5z5hf discussions info username/my-model 5 --format jsonc          
      L    V ^8  d   QhR\         R\        R\        R\        RR/# r%   r9   rE   r>   r?   r(   Nr   DiscussionNumArgr	   r
   )r*   s   "r   r+   r+      s:      	  	
 
r   c                    \        VR7      pVP                  V VVP                  R7      p\        P                  ! V4       R# )z,Get info about a discussion or pull request.rB   r9   discussion_numr>   N)r   get_discussion_detailsrK   r   dictr9   rE   r>   r?   rQ   detailss   &&&&  r   discussion_inford      s>     5
!C((// ) G
 HHWr   createFc                   V ^8  d   QhR\         R\        \        \        P                  ! RRR7      3,          R\        \        R,          \        P                  ! RR	R7      3,          R
\        \
        R,          \        P                  ! RRR7      3,          R\        \        \        P                  ! RRRR7      3,          R\        R\        RR/# )r%   r9   rH   z--titlez,The title of the discussion or pull request.r6   r&   N--bodyz$The description (supports Markdown).r'   --body-filez4Read the description from a file. Use '-' for stdin.r!   z--pull-requestz--prz.Create a pull request instead of a discussion.r>   r?   r(   )	r   r   r)   r/   r@   r   boolr	   r
   )r*   s   "r   r+   r+      s     .r .r.r?	
	.r d
7	
	.r  tG	
	!.r. A	
	/.r> ?.r@ A.rB 
C.rr   c                @   \        W#4      p\        VR7      pVP                  V VVVP                  VR7      p	V'       d   RMRp
V'       d   RV	P                   2MRp\
        P                  ! RV
 RV	P                   R	V  2V	P                  V	P                  VR
7       R# )z2Create a new discussion or pull request on a repo.rB   )r9   rH   descriptionr>   r!   zpull requestr    zrefs/pr/NzCreated z #z on )rE   urlref)r5   r   create_discussionrK   rE   r   resultrl   )r9   rH   r&   r'   r!   r>   r?   rk   rQ   r    r;   rm   s   &&&&&&&     r   discussion_createrp      s    X T-K
5
!C&&//! ' J *>|D)5HZ^^$
%4CJJ$r*..!1gY?Z^^YcYgYgmpqr   commentzIhf discussions comment username/my-model 5 --body "Thanks for reporting!"z9hf discussions comment username/my-model 5 --body "LGTM!"c                   V ^8  d   QhR\         R\        R\        \        R,          \        P
                  ! RRR7      3,          R\        \        R,          \        P
                  ! R	R
R7      3,          R\        R\        RR/# )r%   r9   rE   r&   Nrg   z%The comment text (supports Markdown).r6   r'   rh   z0Read the comment from a file. Use '-' for stdin.r>   r?   r(   )	r   r\   r   r)   r/   r@   r   r	   r
   )r*   s   "r   r+   r+      s     K KK	K d
8	
	K tC	
	K" #K$ %K& 
'Kr   c                    \        W#4      pVf   \        P                  ! R4      h\        VR7      pVP	                  V VVVP
                  R7       \        P                  ! RV RV  2WR7       R# )z(Comment on a discussion or pull request.Nz)Either --body or --body-file is required.rB   r9   r_   rq   r>   zCommented on # in rE   repo)r5   r/   r0   r   comment_discussionrK   r   ro   )r9   rE   r&   r'   r>   r?   rq   rQ   s   &&&&&&  r   discussion_commentry      so    8 )G  !LMM
5
!C//	   JJuD	2Jr   closez(hf discussions close username/my-model 5zIhf discussions close username/my-model 5 --comment "Closing as resolved."c                    V ^8  d   QhR\         R\        R\        \        R,          \        P
                  ! RRR7      3,          R\        \        \        P
                  ! R	R
RR7      3,          R\        R\        RR/# )r%   r9   rE   rq   N	--commentz)An optional comment to post when closing.r6   yes--yes-ySkip confirmation prompt.r>   r?   r(   	r   r\   r   r)   r/   r@   ri   r	   r
   )r*   s   "r   r+   r+     s     E EE	E d
<	
	E 
,	
	
E$ %E& 'E( 
)Er   c                    \         P                  ! RV RV  R2VR7       \        VR7      pVP                  V VRVVP                  R7       \         P
                  ! RV R	V  2WR
7       R# )z#Close a discussion or pull request.zClose # on ''?r}   rB   r   r9   r_   
new_statusrq   r>   zClosed #ru   rv   Nr   confirmr   change_discussion_statusrK   ro   r9   rE   rq   r}   r>   r?   rQ   s   &&&&&& r   discussion_closer     sn    : KK'#eG9B/S9
5
!C  // !  JJ#d7),#Dr   reopenz)hf discussions reopen username/my-model 5zZhf discussions reopen username/my-model 5 --comment "Reopening for further investigation."c                    V ^8  d   QhR\         R\        R\        \        R,          \        P
                  ! RRR7      3,          R\        \        \        P
                  ! R	R
RR7      3,          R\        R\        RR/# )r%   r9   rE   rq   Nr|   z+An optional comment to post when reopening.r6   r}   r~   r   r   r>   r?   r(   r   )r*   s   "r   r+   r+   C  s     G GG	G d
>	
	G 
,	
	
G$ %G& 'G( 
)Gr   c                    \         P                  ! RV RV  R2VR7       \        VR7      pVP                  V VRVVP                  R7       \         P
                  ! RV R	V  2WR
7       R# )z+Reopen a closed discussion or pull request.zReopen #r   r   r   rB   r   r   z
Reopened #ru   rv   Nr   r   s   &&&&&& r   discussion_reopenr   <  sn    : KK(3%uWIR0c:
5
!C  // !  JJC5WI.CFr   renamez9hf discussions rename username/my-model 5 "Updated title"c                    V ^8  d   QhR\         R\        R\        \        \        P
                  ! RR7      3,          R\        R\        RR	/# )
r%   r9   rE   	new_titlezThe new title.r6   r>   r?   r(   N)r   r\   r   r)   r/   Argumentr	   r
   )r*   s   "r   r+   r+   k  sh     W WW	W !	
	W W W 
Wr   c                    \        VR7      pVP                  V VVVP                  R7       \        P                  ! RV RV  2WVR7       R# )z$Rename a discussion or pull request.rB   )r9   r_   r   r>   z	Renamed #ru   )rE   rw   rH   N)r   rename_discussionrK   r   ro   )r9   rE   r   r>   r?   rQ   s   &&&&& r   discussion_renamer   e  sP    & 5
!C//	   JJ3%tG9-3IVr   mergez(hf discussions merge username/my-model 5zEhf discussions merge username/my-model 5 --comment "Merging, thanks!"c                    V ^8  d   QhR\         R\        R\        \        R,          \        P
                  ! RRR7      3,          R\        \        \        P
                  ! R	R
RR7      3,          R\        R\        RR/# )r%   r9   rE   rq   Nr|   z)An optional comment to post when merging.r6   r}   r~   r   r   r>   r?   r(   r   )r*   s   "r   r+   r+     s     E EE	E d
<	
	E 
,	
	
E$ %E& 'E( 
)Er   c                    \         P                  ! RV RV  R2VR7       \        VR7      pVP                  V VVVP                  R7       \         P
                  ! RV RV  2WR	7       R
# )zMerge a pull request.zMerge #r   r   r   rB   rt   zMerged #ru   rv   N)r   r   r   merge_pull_requestrK   ro   r   s   &&&&&& r   discussion_merger     sk    : KK'#eG9B/S9
5
!C//	   JJ#d7),#Dr   diffz'hf discussions diff username/my-model 5c          
      L    V ^8  d   QhR\         R\        R\        R\        RR/# rZ   r[   )r*   s   "r   r+   r+     s:     ' ''	' ' 	'
 
'r   c                    \        VR7      pVP                  V VVP                  R7      pVP                  '       d#   \        P
                  ! VP                  4       R# \        P
                  ! R4       R# )z Show the diff of a pull request.rB   r^   zNo diff available.N)r   r`   rK   r   r   textrb   s   &&&&  r   discussion_diffr     sX     5
!C((// ) G
 |||%&r   )z%hf discussions list username/my-modelzIhf discussions list username/my-model --kind pull_request --status mergedzFhf discussions list username/my-dataset --type dataset --status closedzBhf discussions list username/my-model --author alice --format json)z<hf discussions create username/my-model --title "Bug report"zWhf discussions create username/my-model --title "Feature request" --body "Please add X"zIhf discussions create username/my-model --title "Fix typo" --pull-requestzUhf discussions create username/my-dataset --type dataset --title "Data quality issue")-__doc__enumr1   pathlibr   typingr   r/   huggingface_hubr   
_cli_utilsr   r   r   r   r	   r
   r   r   _outputr   r   r)   Enumr   r   rM   intr   r\   r5   discussions_clicommandr   r   modelrW   rd   rp   ry   r   r   r   r   r   r   r   r   <module>r      s   `  
    %	 	 	 -sDII "S$)) " "7+  	NN5   %WX   $ 	 	%^^+;;| 
1?   &^^	    0 	 	 	%^^A.r.rb SC    	 	%^^%KKD 2S    	 	%^^'EED 3d    	 	%^^'GGD C   &^^WW. 2O    	 	%^^'EEB 
1   &^^	''r   