
    ,Of1                        d dl mZ d dlmZ d dlmZ d dlZd dlZd dlZd dlm	Z	 d dlm
Z
mZmZ d dlmZ  G d d	e      Zy)
    )annotations)datetime)AnyN)Consts)	AttributeCompletableGithubObjectNotSet)PaginatedListc                  p   e Zd ZdZddZddZedd       Zedd       Zedd       Z	edd       Z
edd       Zedd	       Zedd
       Zedd       Zedd       Zedd       Zedd       Zedd       Zedd       Zedd       Zedd       Zedd       ZddZd dZd!dZd"dZd#dZd$dZy)%PullRequestCommentz
    This class represents PullRequestComments.

    The reference can be found here
    https://docs.github.com/en/rest/reference/pulls#review-comments

    c                d   t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _	        t         | _
        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        y N)r	   _body
_commit_id_created_at
_diff_hunk_id_in_reply_to_id_original_commit_id_original_position_path	_position_pull_request_url_pull_request_review_id_updated_at_url	_html_url_userselfs    9lib/python3.12/site-packages/github/PullRequestComment.py_initAttributesz"PullRequestComment._initAttributesF   sy    %+
*006*0#)/539 28%+
)/177=$06$*	)/<B
    c                z    | j                  | j                  j                  | j                  j                  d      S )N)iduser)get__repr__r   valuer   r   s    r!   __repr__zPullRequestComment.__repr__X   s*    txx~~tzz?O?O PQQr#   c                d    | j                  | j                         | j                  j                  S r   )_completeIfNotSetr   r(   r   s    r!   bodyzPullRequestComment.body[   $    tzz*zzr#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   	commit_idzPullRequestComment.commit_id`   $    t/$$$r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   
created_atzPullRequestComment.created_ate   (    t//0%%%r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   	diff_hunkzPullRequestComment.diff_hunkj   r0   r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   r%   zPullRequestComment.ido   s"    txx(xx~~r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   in_reply_to_idz!PullRequestComment.in_reply_to_idt   s(    t334##)))r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   original_commit_idz%PullRequestComment.original_commit_idy   s(    t778''---r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   original_positionz$PullRequestComment.original_position~   s(    t667&&,,,r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   pathzPullRequestComment.path   r-   r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   positionzPullRequestComment.position   $    t~~.~~###r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   pull_request_review_idz)PullRequestComment.pull_request_review_id   s(    t;;<++111r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   pull_request_urlz#PullRequestComment.pull_request_url   s(    t556%%+++r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   
updated_atzPullRequestComment.updated_at   r3   r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   urlzPullRequestComment.url   s"    tyy)yyr#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   html_urlzPullRequestComment.html_url   rA   r#   c                d    | j                  | j                         | j                  j                  S r   )r+   r   r(   r   s    r!   r&   zPullRequestComment.user   r-   r#   c                V    | j                   j                  d| j                        \  }}y)z
        :calls: `DELETE /repos/{owner}/{repo}/pulls/comments/{number} <https://docs.github.com/en/rest/reference/pulls#review-comments>`_
        :rtype: None
        DELETEN)
_requesterrequestJsonAndCheckrI   )r    headersdatas      r!   deletezPullRequestComment.delete   s"    
 ;;HdhhOr#   c                    t        |t              sJ |       d|i}| j                  j                  d| j                  |      \  }}| j                  |       y)z
        :calls: `PATCH /repos/{owner}/{repo}/pulls/comments/{number} <https://docs.github.com/en/rest/reference/pulls#review-comments>`_
        :param body: string
        :rtype: None
        r,   PATCH)inputN)
isinstancestrrO   rP   rI   _useAttributes)r    r,   post_parametersrQ   rR   s        r!   editzPullRequestComment.edit   sY     $$*d*$D
 ;;GTXXUd;eD!r#   c                    t        t        j                  j                  | j                  | j                   dddt
        j                  i      S )a9  
        :calls: `GET /repos/{owner}/{repo}/pulls/comments/{number}/reactions
                <https://docs.github.com/en/rest/reference/reactions#list-reactions-for-a-pull-request-review-comment>`_
        :return: :class: :class:`github.PaginatedList.PaginatedList` of :class:`github.Reaction.Reaction`
        
/reactionsNAcceptrQ   )r
   githubReactionrO   rI   r   mediaTypeReactionsPreviewr   s    r!   get_reactionsz PullRequestComment.get_reactions   sD     OO$$OOxxj
#v??@
 	
r#   c                   t        |t              sJ |       d|i}| j                  j                  d| j                   d|dt
        j                  i      \  }}t        j                  j                  | j                  ||d      S )a(  
        :calls: `POST /repos/{owner}/{repo}/pulls/comments/{number}/reactions
                <https://docs.github.com/en/rest/reference/reactions#create-reaction-for-a-pull-request-review-comment>`_
        :param reaction_type: string
        :rtype: :class:`github.Reaction.Reaction`
        contentPOSTr]   r^   )rV   rQ   T)	completed)	rW   rX   rO   rP   rI   r   rb   r`   ra   )r    reaction_typerZ   rQ   rR   s        r!   create_reactionz"PullRequestComment.create_reaction   s     --<}<-}
 ;;xxj
#!v??@	 < 
 ''$RV'WWr#   c                    t        |t              sJ |       | j                  j                  d| j                   d| dt
        j                  i      \  }}}|dk(  S )a  
        :calls: `DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}
                <https://docs.github.com/en/rest/reference/reactions#delete-a-pull-request-comment-reaction>`_
        :param reaction_id: integer
        :rtype: bool
        rN   z/reactions/r^   r_      )rW   intrO   requestJsonrI   r   rb   )r    reaction_idstatus_s       r!   delete_reactionz"PullRequestComment.delete_reaction   sg     +s+8[8+22xxjK=1v??@ 3 
1
 }r#   c                   d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _	        d|v r| j                  |d         | _
        d	|v r| j                  |d	         | _        d
|v r| j                  |d
         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r3| j%                  t&        j(                  j(                  |d         | _        y y )Nr,   r/   r2   r5   r%   r8   r:   r<   r>   r@   rC   rE   rG   rI   rK   r&   )_makeStringAttributer   r   _makeDatetimeAttributer   r   _makeIntAttributer   r   r   r   r   r   r   r   r   r   r   _makeClassAttributer`   	NamedUserr   )r    
attributess     r!   rY   z!PullRequestComment._useAttributes   s   Z22:f3EFDJ*$"77
;8OPDO:%#:::l;STD*$"77
;8OPDO:--j.>?DHz)#'#9#9*EU:V#WD :-'+'@'@L`Aa'bD$*,&*&<&<ZH[=\&]D#Z22:f3EFDJ#!33Jz4JKDN#z1+/+A+A*MeBf+gD(+%)%>%>zJ\?]%^D":%#:::l;STDJ11*U2CDDI#!66z*7MNDNZ11&2B2B2L2LjY_N`aDJ  r#   N)returnNone)ry   rX   )ry   r   )ry   rl   )ry   zgithub.NamedUser.NamedUser)r,   rX   ry   rz   )ry   z'PaginatedList[github.Reaction.Reaction])rh   rX   ry   zgithub.Reaction.Reaction)rn   rl   ry   bool)rx   zdict[str, Any]ry   rz   )__name__
__module____qualname____doc__r"   r)   propertyr,   r/   r2   r5   r%   r8   r:   r<   r>   r@   rC   rE   rG   rI   rK   r&   rS   r[   rc   ri   rq   rY    r#   r!   r   r   =   st   C$R     % % & & % %   * * . . - -     $ $ 2 2 , , & &   $ $    P"
X& br#   r   )
__future__r   r   typingr   github.GithubObjectr`   github.NamedUsergithub.Reactionr   r   r   r	   github.PaginatedListr
   r   r   r#   r!   <module>r      s7   ` #       J J .Rb0 Rbr#   