
    ,Of'                        d dl mZ d dlmZ d dlmZm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 erd dlmZ  G d	 d
e      Zy)    )annotations)datetime)TYPE_CHECKINGAnyN)Consts)	AttributeCompletableGithubObjectNotSet)PaginatedList)Reactionc                     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ddZddZddZddZddZddZy) CommitCommentz
    This class represents CommitComments.

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

    c                    t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _	        t         | _
        t         | _        y N)r
   _body
_commit_id_created_at	_html_url_id_line_path	_position_updated_at_url_userselfs    4lib/python3.12/site-packages/github/CommitComment.py_initAttributeszCommitComment._initAttributesD   sQ    %+
*006)/#)%+
%+
)/06$*	<B
    c                f    | j                  | j                  j                  | j                  d      S )N)iduser)get__repr__r   valuer#   r   s    r   __repr__zCommitComment.__repr__Q   s$    txx~~tyy IJJr    c                d    | j                  | j                         | j                  j                  S r   )_completeIfNotSetr   r%   r   s    r   bodyzCommitComment.bodyT   $    tzz*zzr    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   	commit_idzCommitComment.commit_idY   s$    t/$$$r    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   
created_atzCommitComment.created_at^   (    t//0%%%r    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   html_urlzCommitComment.html_urlc   $    t~~.~~###r    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   r"   zCommitComment.idh   s"    txx(xx~~r    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   linezCommitComment.linem   r*   r    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   pathzCommitComment.pathr   r*   r    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   positionzCommitComment.positionw   r2   r    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   
updated_atzCommitComment.updated_at|   r/   r    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   urlzCommitComment.url   s"    tyy)yyr    c                d    | j                  | j                         | j                  j                  S r   )r(   r   r%   r   s    r   r#   zCommitComment.user   r*   r    c                V    | j                   j                  d| j                        \  }}y)z
        :calls: `DELETE /repos/{owner}/{repo}/comments/{id} <https://docs.github.com/en/rest/reference/repos#comments>`_
        :rtype: None
        DELETEN)
_requesterrequestJsonAndCheckr=   )r   headersdatas      r   deletezCommitComment.delete   s"    
 ;;HdhhOr    c                    t        |t              sJ |       d|i}| j                  j                  d| j                  |      \  }}| j                  |       y)z
        :calls: `PATCH /repos/{owner}/{repo}/comments/{id} <https://docs.github.com/en/rest/reference/repos#comments>`_
        r)   PATCH)inputN)
isinstancestrrA   rB   r=   _useAttributes)r   r)   post_parametersrC   rD   s        r   editzCommitComment.edit   sY     $$*d*$D
 ;;GTXXUd;eD!r    c                    t        t        j                  j                  | j                  | j                   dddt
        j                  i      S )a"  
        :calls: `GET /repos/{owner}/{repo}/comments/{id}/reactions
                <https://docs.github.com/en/rest/reference/reactions#list-reactions-for-a-commit-comment>`_
        :return: :class: :class:`github.PaginatedList.PaginatedList` of :class:`github.Reaction.Reaction`
        
/reactionsNAcceptrC   )r   githubr   rA   r=   r   mediaTypeReactionsPreviewr   s    r   get_reactionszCommitComment.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 )z
        :calls: `POST /repos/{owner}/{repo}/comments/{id}/reactions
                <https://docs.github.com/en/rest/reference/reactions#create-reaction-for-a-commit-comment>`_
        contentPOSTrO   rP   )rH   rC   T)	completed)	rI   rJ   rA   rB   r=   r   rS   rR   r   )r   reaction_typerL   rC   rD   s        r   create_reactionzCommitComment.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}/comments/{comment_id}/reactions/{reaction_id}
                <https://docs.github.com/en/rest/reference/reactions#delete-a-commit-comment-reaction>`_
        :param reaction_id: integer
        :rtype: bool
        r@   z/reactions/rP   rQ      )rI   intrA   requestJsonr=   r   rS   )r   reaction_idstatus_s       r   delete_reactionzCommitComment.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 r3| j                  t        j                  j                  |d         | _        y y )Nr)   r,   r.   r1   r"   r5   r7   r9   r;   r=   r#   )_makeStringAttributer   r   _makeDatetimeAttributer   r   _makeIntAttributer   r   r   r   r   r   _makeClassAttributerR   	NamedUserr   )r   
attributess     r   rK   zCommitComment._useAttributes   sm   Z22:f3EFDJ*$"77
;8OPDO:%#:::l;STD#!66z*7MNDN:--j.>?DHZ//
60BCDJZ22:f3EFDJ#!33Jz4JKDN:%#:::l;STDJ11*U2CDDIZ11&2B2B2L2LjY_N`aDJ  r    N)returnNone)rj   rJ   )rj   r   )rj   r]   )rj   zgithub.NamedUser.NamedUser)r)   rJ   rj   rk   )rj   zPaginatedList[Reaction])rY   rJ   rj   r   )r_   r]   rj   bool)ri   zdict[str, Any]rj   rk   )__name__
__module____qualname____doc__r   r&   propertyr)   r,   r.   r1   r"   r5   r7   r9   r;   r=   r#   rE   rM   rT   rZ   rb   rK    r    r   r   r   ;   s   CK     % % & & $ $           $ $ & &      P	"
X"br    r   )
__future__r   r   typingr   r   github.GithubObjectrR   github.NamedUserr   r   r	   r
   github.PaginatedListr   github.Reactionr   r   rr   r    r   <module>ry      s:   X #  %    J J .(fb+ fbr    