+
    Q\iM0                     f   R t ^ RIHt ^ RIHt ^ RIHtHtHtHtH	t	 ^RI
Ht ^RIHt ]R,          t] ! R R4      4       t] ! R R	]4      4       t ! R
 R]4      t] ! R R4      4       t] ! R R]4      4       t] ! R R]4      4       t] ! R R]4      4       t] ! R R]4      4       tR R ltR# )a  
Data structures to interact with Discussions and Pull Requests on the Hub.

See [the Discussions and Pull Requests guide](https://huggingface.co/docs/hub/repositories-pull-requests-discussions)
for more information on Pull Requests, Discussions, and the community tab.
)	dataclassdatetime)ListLiteralOptional	TypedDictUnion)	constants)parse_datetimec                   h   a  ] tR t^t o Rt]V 3R lR l4       t]V 3R lR l4       tV 3R ltRt	V t
R# )	
Discussiona  
A Discussion or Pull Request on the Hub.

This dataclass is not intended to be instantiated directly.

Attributes:
    title (`str`):
        The title of the Discussion / Pull Request
    status (`str`):
        The status of the Discussion / Pull Request.
        It must be one of:
            * `"open"`
            * `"closed"`
            * `"merged"` (only for Pull Requests )
            * `"draft"` (only for Pull Requests )
    num (`int`):
        The number of the Discussion / Pull Request.
    repo_id (`str`):
        The id (`"{namespace}/{repo_name}"`) of the repo on which
        the Discussion / Pull Request was open.
    repo_type (`str`):
        The type of the repo on which the Discussion / Pull Request was open.
        Possible values are: `"model"`, `"dataset"`, `"space"`.
    author (`str`):
        The username of the Discussion / Pull Request author.
        Can be `"deleted"` if the user has been deleted since.
    is_pull_request (`bool`):
        Whether or not this is a Pull Request.
    created_at (`datetime`):
        The `datetime` of creation of the Discussion / Pull Request.
    endpoint (`str`):
        Endpoint of the Hub. Default is https://huggingface.co.
    git_reference (`str`, *optional*):
        (property) Git reference to which changes can be pushed if this is a Pull Request, `None` otherwise.
    url (`str`):
        (property) URL of the discussion on the Hub.
c                0   < V ^8  d   QhRS[ S[,          /#    return)r   str)format__classdict__s   "q/Users/agent/.cache/uv/archive-v0/6ZL4-8mCcRNgGE9wi6M6J/lib/python3.14/site-packages/huggingface_hub/community.py__annotate__Discussion.__annotate__F   s      x}     c                H    V P                   '       d   RV P                   2# R# )zq
If this is a Pull Request , returns the git reference to which changes can be pushed.
Returns `None` otherwise.
zrefs/pr/N)is_pull_requestnumselfs   &r   git_referenceDiscussion.git_referenceE   s$     dhhZ((r   c                    < V ^8  d   QhRS[ /# r   r   )r   r   s   "r   r   r   P   s     Z ZS Zr   c                   V P                   e    V P                   \        P                  8X  d)   V P                   RV P                   RV P
                   2# V P                   RV P                    RV P                   RV P
                   2# )z-Returns the URL of the discussion on the Hub./z/discussions/zs/)	repo_typer
   REPO_TYPE_MODELendpointrepo_idr   r   s   &r   urlDiscussion.urlO   sp     >>!T^^y7P7P%Pmm_Adll^=
KK--$..!1DLL>txxjYYr   c                   < V ^8  d   Qh/ S[ ;R&   S[;R&   S[;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[;R&   S[;R&   S[ ;R	&   # )
r   titlestatusr   r'   r$   authorr   
created_atr&   )r   DiscussionStatusintboolr   )r   r   s   "r   r   r      s     P JQ R S T 
HU V LW X NY Z K[ \ ] ^ _ ` Ma r    N)__name__
__module____qualname____firstlineno____doc__propertyr   r(   __annotate_func____static_attributes____classdictcell__r   s   @r   r   r      s=     $`   Z Z{  r   r   c                   0   a  ] tR t^Wt o RtV 3R ltRtV tR# )DiscussionWithDetailsa{  
Subclass of [`Discussion`].

Attributes:
    title (`str`):
        The title of the Discussion / Pull Request
    status (`str`):
        The status of the Discussion / Pull Request.
        It can be one of:
            * `"open"`
            * `"closed"`
            * `"merged"` (only for Pull Requests )
            * `"draft"` (only for Pull Requests )
    num (`int`):
        The number of the Discussion / Pull Request.
    repo_id (`str`):
        The id (`"{namespace}/{repo_name}"`) of the repo on which
        the Discussion / Pull Request was open.
    repo_type (`str`):
        The type of the repo on which the Discussion / Pull Request was open.
        Possible values are: `"model"`, `"dataset"`, `"space"`.
    author (`str`):
        The username of the Discussion / Pull Request author.
        Can be `"deleted"` if the user has been deleted since.
    is_pull_request (`bool`):
        Whether or not this is a Pull Request.
    created_at (`datetime`):
        The `datetime` of creation of the Discussion / Pull Request.
    events (`list` of [`DiscussionEvent`])
        The list of [`DiscussionEvents`] in this Discussion or Pull Request.
    conflicting_files (`Union[List[str], bool, None]`, *optional*):
        A list of conflicting files if this is a Pull Request.
        `None` if `self.is_pull_request` is `False`.
        `True` if there are conflicting files but the list can't be retrieved.
    target_branch (`str`, *optional*):
        The branch into which changes are to be merged if this is a
        Pull Request . `None`  if `self.is_pull_request` is `False`.
    merge_commit_oid (`str`, *optional*):
        If this is a merged Pull Request , this is set to the OID / SHA of
        the merge commit, `None` otherwise.
    diff (`str`, *optional*):
        The git diff if this is a Pull Request , `None` otherwise.
    endpoint (`str`):
        Endpoint of the Hub. Default is https://huggingface.co.
    git_reference (`str`, *optional*):
        (property) Git reference to which changes can be pushed if this is a Pull Request, `None` otherwise.
    url (`str`):
        (property) URL of the discussion on the Hub.
c                   < V ^8  d   Qh/ S[ R,          ;R&   S[S[ S[,          S[R3,          ;R&   S[S[,          ;R&   S[S[,          ;R&   S[S[,          ;R&   # )r   DiscussionEventeventsNconflicting_filestarget_branchmerge_commit_oiddiff)r   r	   r   r1   r   )r   r   s   "r   r   "DiscussionWithDetails.__annotate__W   sr     h "##i j T#Yd233k l C= m n sm#o p 3-q r   r2   Nr3   r4   r5   r6   r7   r9   r:   r;   r<   s   @r   r>   r>   W   s     0  r   r>   c                   ,   a  ] tR t^t o V 3R ltRtV tR# )DiscussionEventArgsc                V   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[;R&   S[ ;R&   S[;R&   # r   idtyper.   r-   _eventr   r   dict)r   r   s   "r   r    DiscussionEventArgs.__annotate__   s>     G 
I    K	 
 L r   r2   N)r3   r4   r5   r6   r9   r:   r;   r<   s   @r   rI   rI      s      r   rI   c                   2   a  ] tR t^t o Rt V 3R ltRtV tR# )r@   a  
An event in a Discussion or Pull Request.

Use concrete classes:
    * [`DiscussionComment`]
    * [`DiscussionStatusChange`]
    * [`DiscussionCommit`]
    * [`DiscussionTitleChange`]

Attributes:
    id (`str`):
        The ID of the event. An hexadecimal string.
    type (`str`):
        The type of the event.
    created_at (`datetime`):
        A [`datetime`](https://docs.python.org/3/library/datetime.html?highlight=datetime#datetime.datetime)
        object holding the creation timestamp for the event.
    author (`str`):
        The username of the Discussion / Pull Request author.
        Can be `"deleted"` if the user has been deleted since.
c                V   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[;R&   S[ ;R&   S[;R&   # rK   rO   )r   r   s   "r   r   DiscussionEvent.__annotate__   sB     0 	G1 2 I3 4 5 6 K7 : L; r   r2   NrG   r<   s   @r   r@   r@      s     8 N=  r   r@   c                      a  ] tR t^t o Rt]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR	 l4       t	]V 3R
 lR l4       t
V 3R ltRtV tR# )DiscussionCommenta.  A comment in a Discussion / Pull Request.

Subclass of [`DiscussionEvent`].


Attributes:
    id (`str`):
        The ID of the event. An hexadecimal string.
    type (`str`):
        The type of the event.
    created_at (`datetime`):
        A [`datetime`](https://docs.python.org/3/library/datetime.html?highlight=datetime#datetime.datetime)
        object holding the creation timestamp for the event.
    author (`str`):
        The username of the Discussion / Pull Request author.
        Can be `"deleted"` if the user has been deleted since.
    content (`str`):
        The raw markdown content of the comment. Mentions, links and images are not rendered.
    edited (`bool`):
        Whether or not this comment has been edited.
    hidden (`bool`):
        Whether or not this comment has been hidden.
c                    < V ^8  d   QhRS[ /# r   r!   )r   r   s   "r   r   DiscussionComment.__annotate__   s     5 5# 5r   c                D    V P                   R,          R,          R,          # )z&The rendered comment, as a HTML stringdatalatesthtmlrN   r   s   &r   renderedDiscussionComment.rendered   s     {{6"8,V44r   c                    < V ^8  d   QhRS[ /# r   r   )r   r   s   "r   r   rX      s     J J Jr   c                V    \        V P                  R,          R,          R,          4      # )+The last edit time, as a `datetime` object.rZ   r[   	updatedAt)r   rN   r   s   &r   last_edited_at DiscussionComment.last_edited_at   s"     dkk&1(;KHIIr   c                    < V ^8  d   QhRS[ /# r   r!   )r   r   s   "r   r   rX      s     V V Vr   c                v    V P                   R,          R,          P                  R/ 4      P                  RR4      # )rb   rZ   r[   r-   namedeleted)rN   getr   s   &r   last_edited_by DiscussionComment.last_edited_by   s2     {{6"8,002>BB69UUr   c                0   < V ^8  d   QhRS[ S[,          /# r   )r   rP   )r   r   s   "r   r   rX      s     . .d4j .r   c                6    V P                   R,          R,          # )zThe edit history of the commentrZ   historyr]   r   s   &r   edit_historyDiscussionComment.edit_history   s     {{6"9--r   c                    < V ^8  d   QhRS[ /# r   )r0   )r   r   s   "r   r   rX      s     & & &r   c                ,    \        V P                  4      # )N)lenrp   r   s   &r   number_of_edits!DiscussionComment.number_of_edits   s    4$$%%r   c                >   < V ^8  d   Qh/ S[ ;R&   S[;R&   S[;R&   # )r   contenteditedhidden)r   r1   )r   r   s   "r   r   rX      s)     4 L5 6 L7 8 L9 r   r2   N)r3   r4   r5   r6   r7   r8   r^   rd   rk   rp   ru   r9   r:   r;   r<   s   @r   rV   rV      sz     8 5 5 J J V V . . & &g  r   rV   c                   0   a  ] tR t^t o RtV 3R ltRtV tR# )DiscussionStatusChangea
  A change of status in a Discussion / Pull Request.

Subclass of [`DiscussionEvent`].

Attributes:
    id (`str`):
        The ID of the event. An hexadecimal string.
    type (`str`):
        The type of the event.
    created_at (`datetime`):
        A [`datetime`](https://docs.python.org/3/library/datetime.html?highlight=datetime#datetime.datetime)
        object holding the creation timestamp for the event.
    author (`str`):
        The username of the Discussion / Pull Request author.
        Can be `"deleted"` if the user has been deleted since.
    new_status (`str`):
        The status of the Discussion / Pull Request after the change.
        It can be one of:
            * `"open"`
            * `"closed"`
            * `"merged"` (only for Pull Requests )
c                &   < V ^8  d   Qh/ S[ ;R&   # )r   
new_statusr!   )r   r   s   "r   r   #DiscussionStatusChange.__annotate__   s     2 O3 r   r2   NrG   r<   s   @r   r|   r|      s       r   r|   c                   0   a  ] tR tRt o RtV 3R ltRtV tR# )DiscussionCommiti  a  A commit in a Pull Request.

Subclass of [`DiscussionEvent`].

Attributes:
    id (`str`):
        The ID of the event. An hexadecimal string.
    type (`str`):
        The type of the event.
    created_at (`datetime`):
        A [`datetime`](https://docs.python.org/3/library/datetime.html?highlight=datetime#datetime.datetime)
        object holding the creation timestamp for the event.
    author (`str`):
        The username of the Discussion / Pull Request author.
        Can be `"deleted"` if the user has been deleted since.
    summary (`str`):
        The summary of the commit.
    oid (`str`):
        The OID / SHA of the commit, as a hexadecimal string.
c                2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )r   summaryoidr!   )r   r   s   "r   r   DiscussionCommit.__annotate__  s     . L/ 0 
H1 r   r2   NrG   r<   s   @r   r   r            r   r   c                   0   a  ] tR tRt o RtV 3R ltRtV tR# )DiscussionTitleChangei)  a  A rename event in a Discussion / Pull Request.

Subclass of [`DiscussionEvent`].

Attributes:
    id (`str`):
        The ID of the event. An hexadecimal string.
    type (`str`):
        The type of the event.
    created_at (`datetime`):
        A [`datetime`](https://docs.python.org/3/library/datetime.html?highlight=datetime#datetime.datetime)
        object holding the creation timestamp for the event.
    author (`str`):
        The username of the Discussion / Pull Request author.
        Can be `"deleted"` if the user has been deleted since.
    old_title (`str`):
        The previous title for the Discussion / Pull Request.
    new_title (`str`):
        The new title.
c                2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )r   	old_title	new_titler!   )r   r   s   "r   r   "DiscussionTitleChange.__annotate__)  s     . N/ 0 N1 r   r2   NrG   r<   s   @r   r   r   )  r   r   r   c                0    V ^8  d   QhR\         R\        /# )r   eventr   )rP   r@   )r   s   "r   r   r   D  s     '* '*T '*o '*r   c                f   V R,          pV R,          p\        V R,          4      pRVRVRVRV P                  R/ 4      P                  RR4      RV /pVR	8X  dE   \        R/ VBR
V R,          R
,          RV R,          R,          RV R,          R,          R,          /B # VR8X  d   \        R/ VBRV R,          R,          /B # VR8X  d.   \	        R/ VBRV R,          R,          RV R,          R,          /B # VR8X  d.   \        R/ VBRV R,          R,          RV R,          R,          /B # \        R/ VB # )z.Instantiates a [`DiscussionEvent`] from a dictrL   rM   	createdAtr.   r-   rh   ri   rN   commentry   rZ   rz   rx   r[   rawzstatus-changer~   r,   commitr   subjectr   ztitle-changer   fromr   tor2   )r   rj   rV   r|   r   r   r@   )r   event_id
event_typer.   common_argss   &    r   deserialize_eventr   D  s~   $KHFmJk 23J 	h
j%))Hb)--fi@%(K Y  

=*
 =*
 &M(+E2	
 	
 _$% 

V}X.
 	
 X 

&M),
 fe$
 	

 ^#$ 

FmF+
 FmD)
 	
 )[))r   N)openclosedmergeddraft)r7   dataclassesr   r   typingr   r   r   r   r	    r
   utilsr   r/   r   r>   rI   r@   rV   r|   r   r   r   r2   r   r   <module>r      s   "  < <  ! >?  @Z @Z @ZF 7J 7 7t)  N N N@ 3& 3& 3&l _  6   4 O  4'*r   