
    _Ogn                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SS	KJr  SS
KJr  SSKJr   " S S\R$                  5      r " S S\5      r " S S\5      r " S S\R$                  5      r " S S\R$                  5      r " S S\5      r " S S\5      r " S S\R$                  5      r " S S\R$                  5      r " S S\R$                  5      rg )!z?This module contains all the classes relating to pull requests.    )dumps)URITemplate   )models)users)requires_auth)Issue)IssueComment)commit)contentsc                   (    \ rS rSrSrSrS rS rSrg)PullDestination   a>  The object that represents a pull request destination.

This is the base class for the :class:`~github3.pulls.Head` and
:class:`~github3.pulls.Base` objects. Each has identical attributes to
this object.

Please see GitHub's `Pull Request Documentation`_ for more information.

.. _Pull Request Documentation:
    http://developer.github.com/v3/pulls/#get-a-single-pull-request

.. attribute:: ref

    The full reference string for the git object

.. attribute:: label

    The label for the destination (e.g., 'master', 'mybranch')

.. attribute:: user

    If provided, a :class:`~github3.users.ShortUser` instance representing
    the owner of the destination

.. attribute:: sha

    The SHA of the commit at the head of the destination

.. attribute:: repository

    A :class:`~github3.repos.repo.ShortRepository` representing the
    repository containing this destination

.. attribute:: repo

    A tuple containing the login and repository name, e.g.,
    ('sigmavirus24', 'github3.py')

    This attribute is generated by github3.py and may be deprecated in the
    future.
Nc                    SSK Jn  US   U l        US   U l        UR	                  S5      U l        U R
                  (       a&  [        R                  " U R
                  U 5      U l        US   U l        SU l	        SU l
        UR	                  S5      nU(       a0  UR	                  S	5      U l	        US
   S   U l
        U" X05      U l        U R                  U R                  4U l        g )Nr   )ShortRepositoryreflabelusersha reponameownerlogin)
repos.repor   r   r   getr   r   	ShortUserr   
_repo_name_repo_owner
repositoryr   )selfdestr   r   s       R/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/github3/pulls.py_update_attributes"PullDestination._update_attributes<   s    /;']
HHV$	99		48DI;xx"hhv.DO#G}W5D-d9DO%%t7	    c                 <    SU R                    SU R                   S3$ )N<z []>)	directionr   r!   s    r#   _reprPullDestination._reprN   s     4>>""TZZL33r&   )r   r   r   r   r   r    r   r   )	__name__
__module____qualname____firstlineno____doc__r*   r$   r,   __static_attributes__ r&   r#   r   r      s    (T I8$4r&   r   c                       \ rS rSrSrS rSrg)HeadR   z~An object representing the Head destination of a pull request.

See :class:`~github3.pulls.PullDestination` for more details.
r4   Nr.   r/   r0   r1   r2   destinationr3   r4   r&   r#   r6   r6   R       
 Kr&   r6   c                       \ rS rSrSrS rSrg)Base[   z~An object representing the Base destination of a pull request.

See :class:`~github3.pulls.PullDestination` for more details.
r4   Nr8   r4   r&   r#   r<   r<   [   r:   r&   r<   c                   *    \ rS rSrSrS rS rS rSrg)PullFiled   a  The object that represents a file in a pull request.

Please see GitHub's `Pull Request Files Documentation`_ for more
information.

.. _Pull Request Files Documentation:
    http://developer.github.com/v3/pulls/#list-pull-requests-files

.. attribute:: additions_count

    The number of additions made to this file

.. attribute:: blob_url

    The API resource used to retrieve the blob for this file

.. attribute:: changes_count

    The number of changes made to this file

.. attribute:: contents_url

    The API resource to view the raw contents of this file

.. attribute:: deletions_count

    The number of deletions made to this file

.. attribute:: filename

    The name of this file

.. attribute:: patch

    The patch generated by this

    .. note::

        If the patch is larger than a specific size it may be missing
        from GitHub's response. The attribute will be set to ``None``
        in this case.

.. attribute:: raw_url

    The API resource to view the raw diff of this file

.. attribute:: sha

    The SHA of the commit that this file belongs to

.. attribute:: status

    The string with the status of the file, e.g., 'added'
c                     US   U l         US   U l        US   U l        US   U l        US   U l        US   U l        US   U l        US   U l        UR                  S	5      U l	        US
   U l
        g )Nr   filenamestatus	additions	deletionschangesblob_urlraw_urlpatchcontents_url)r   rB   rC   additions_countdeletions_countchanges_countrG   rH   r   rI   rJ   )r!   pfiles     r#   r$   PullFile._update_attributes   s    <j)Ho$[1$[1"9-j)Y'YYw'
!.1r&   c                 "    SU R                    S3$ )Nz<Pull Request File [r)   )rB   r+   s    r#   r,   PullFile._repr   s    %dmm_B77r&   c                     U R                  U R                  U R                  5      S5      nU R                  [        R
                  U5      $ )zReturn the contents of the file.

:returns:
    An object representing the contents of this file
:rtype:
    :class:`~github3.repos.contents.Contents`
   )_json_getrJ   _instance_or_nullr   Contentsr!   jsons     r#   r   PullFile.contents   s<     zz$))D$5$56<%%h&7&7>>r&   )
rK   rG   rM   rJ   rL   rB   rI   rH   r   rC   N)	r.   r/   r0   r1   r2   r$   r,   r   r3   r4   r&   r#   r?   r?   d   s    5n
28	?r&   r?   c                   .   \ rS rSrSrS rS rS r\S 5       r	\S 5       r
\S 5       r\SS	 j5       r\SS
 j5       r\SS j5       rS rS rS rSS jrSS jrSS jr\    SS j5       rS r\S 5       rSS jrS rSS jr\     SS j5       rSrg)_PullRequest   zThe :class:`PullRequest <PullRequest>` object.

Please see GitHub's `PullRequests Documentation`_ for more information.

.. _PullRequests Documentation:
    http://developer.github.com/v3/pulls/
c                    SSK Jn  US   U l        US   U l        US   U l        U R                  b&  [
        R                  " U R                  U 5      U l        US    Vs/ s H  n[
        R                  " X05      PM     snU l        [        US   U 5      U l	        US   U l
        US	   U l        US
   U l        U R                  US   5      U l        US   U l        US   U l        U R                  US   5      U l        US   U l        ['        US   U 5      U l        US   U l        US   U l        US   U l        US   U l        US   U l        US   U l        U R                  US   5      U l        US   U l        US   U l        UR=                  S5      U l        UR=                  S/ 5      nU Vs/ s H  n[
        R                  " XP5      PM     snU l         UR=                  S/ 5      nU Vs/ s H  orRC                  Xp5      PM     snU l"        [G        US   5      U l$        US   U l%        S U l&        U R                  (       a  U R                  RL                  U l&        US   U l'        US    U l(        US!   U l)        U R                  US"   5      U l*        [
        R                  " US#   U 5      U l+        g s  snf s  snf s  snf )$Nr   orgsurlactive_lock_reasonassignee	assigneesbasebody	body_html	body_text	closed_atcomments_urlcommits_url
created_atdiff_urlheadhtml_urlid	issue_url_linkslockedmerge_commit_sha	merged_atnumber	patch_url
rebaseablerequested_reviewersrequested_teamsreview_comment_urlreview_comments_urlstatestatuses_urltitle
updated_atr   ),r   r`   _apirb   rc   r   r   rd   r<   re   rf   rg   rh   	_strptimeri   rj   rk   rl   rm   r6   rn   ro   rp   rq   linksrs   rt   ru   rv   rw   r   rx   ry   	ShortTeamrz   r   review_comment_urltr|   r    r}   r~   r   r   r   )r!   pullr`   ary   rrz   ts           r#   r$   _PullRequest._update_attributes   s   K	"&';"<Z(==$!OODMM4@DM<@<MN<Mq%//!2<MNft,	L	k*k*[(9: 0...l);<Z(ft,	Z(t*k*(^
8n $%7 8[(9:8nk*((<0"hh'<bA.A$
.AEOOA$.A$
  ((#4b9-< 
-<NN1#_ 
 $/t4H/I#J #'(=#> 99"ii22DO']
 0']
..l);<OODL$7	M O,$
 
s    J92 J>0Kc                 <    SU R                    SU R                   S3$ )Nr(   z [#r)   )
class_namerv   r+   s    r#   r,   _PullRequest._repr   s     4??#3t{{m266r&   c                 P    U R                  U R                  U R                  S5      $ )zmClose this Pull Request without merging.

:returns:
    True if successful, False otherwise
:rtype:
    bool
closedupdater   rf   r+   s    r#   close_PullRequest.close   s     {{4::tyy(;;r&   c                     U R                   nSnU(       a"  U R                  U R                  USU0S9S5      nU R                  [        U5      $ )zCreate a comment on this pull request's issue.

:param str body:
    (required), comment body
:returns:
    the comment that was created on the pull request
:rtype:
    :class:`~github3.issues.comment.IssueComment`
Nrf   data   )rj   rT   _postrV   r
   )r!   rf   ra   rY   s       r#   create_comment_PullRequest.create_comment   sK     ::djjFD>jBCHD%%lD99r&   c                     U R                  SU R                  S9nUUU[        U5      S.nU R                  U R	                  XVS9S5      nU R                  [        U5      $ )a  Create a review comment on this pull request.

.. note::

    All parameters are required by the GitHub API.

:param str body:
    The comment text itself
:param str commit_id:
    The SHA of the commit to comment on
:param str path:
    The relative path of the file to comment on
:param int position:
    The line index in the diff to comment on.
:returns:
    The created review comment.
:rtype:
    :class:`~github3.pulls.ReviewComment`
commentsbase_url)rf   	commit_idpathpositionr   r   )
_build_urlr   intrT   r   rV   ReviewComment)r!   rf   r   r   r   ra   r   rY   s           r#   create_review_comment"_PullRequest.create_review_comment  sa    * ooj499o="H	
 zz$**S*4c:%%mT::r&   Nc                 H   U R                  SU R                  S9n0 nUb!  U Vs/ s H  n[        USU5      PM     snUS'   Ub!  U Vs/ s H  n[        USU5      PM     snUS'   U R                  U R	                  X4S9S5      nU R                  [        U5      $ s  snf s  snf )	a"  Ask for reviews on this pull request.

:param list reviewers:
    The users to which request a review
:param list team_reviewers:
    The teams to which request a review
:returns:
    The pull request on which the reviews were requested
:rtype:
    :class:`~github3.pulls.ShortPullRequest`
ry   r   r   	reviewersslugteam_reviewersr   r   )r   r   getattrrT   r   rV   ShortPullRequest)r!   r   r   ra   r   r   r   rY   s           r#   create_review_requests#_PullRequest.create_review_requests0  s     oo3diioH AJ KAGQ!7 KD%/=&/=!61%~&D!" zz$**S*4c:%%&6== !L&s   BBc                     Uc  / nU R                  SU R                  S9nXS.nUb  X&S'   Ub  X6S'   U R                  U R                  XVS9S5      nU R	                  [
        U5      $ )a  Create a review comment on this pull request.

.. warning::

    If you do not specify ``event``, GitHub will default it
    to ``PENDING`` which means that your review will need to
    be submitted after creation. (See also
    :meth:`~github3.pulls.PullReview.submit`.)

:param str body:
    The comment text itself, required when using COMMENT or
    REQUEST_CHANGES.
:param str commit_id:
    The SHA of the commit to comment on
:param str event:
    The review action you want to perform. Actions include
    APPROVE, REQUEST_CHANGES or COMMENT. By leaving this blank
    you set the action to PENDING and will need to submit the
    review. Leaving blank may result in a 422 error response
    which will need to be handled.
:param list comments:
    Array of draft review comment objects. Please see Github's
    `Create a pull request review documentation`_ for details
    on review comment objects. At the time of writing these
    were a dictionary with 3 keys: `path`, `position` and
    `body`.

    .. _Create a pull request review documentation:
        https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review

:returns:
    The created review.
:rtype:
    :class:`~github3.pulls.PullReview`
reviewsr   )rf   r   r   eventr   rS   )r   r   rT   r   rV   
PullReview)r!   rf   r   r   r   ra   r   rY   s           r#   create_review_PullRequest.create_reviewH  sw    J Hooi$))o<3  )!Mzz$**S*4c:%%j$77r&   c                 2   U R                  SU R                  S9n0 nUb!  U Vs/ s H  n[        USU5      PM     snUS'   Ub!  U Vs/ s H  n[        USU5      PM     snUS'   U R                  U R	                  U[        U5      S9SS	5      $ s  snf s  snf )
a  Cancel review requests on this pull request.

:param list reviewers:
    The users whose review is no longer requested
:param list team_reviewers:
    The teams whose review is no longer requested
:returns:
    True if successful, False otherwise
:rtype:
    bool
ry   r   r   r   r   r   r   rS     )r   r   r   _boolean_deleter   )r!   r   r   ra   r   r   r   s          r#   delete_review_requests#_PullRequest.delete_review_requestsx  s     oo3diioH AJ KAGQ!7 KD%/=&/=!61%~&D!" }}T\\#E$K\@#sKK !L&s   BBc                     U R                  U R                  SS0S9nU R                  USS5      (       a  UR                  $ S$ )zMReturn the diff.

:returns:
    representation of the diff
:rtype:
    bytes
Acceptzapplication/vnd.github.diffheadersrS   r   r&   rU   r   r   contentr!   resps     r#   diff_PullRequest.diff  sI     yyII*GH  
  $}}T3<<t||E#Er&   c                 z    U R                  SU R                  S9nU R                  U R                  U5      SS5      $ )zCheck to see if the pull request was merged.

.. versionchanged:: 1.0.0

    This now always makes a call to the GitHub API. To avoid that,
    check :attr:`merged` before making this call.

:returns:
    True if merged, False otherwise
:rtype:
    bool
merger      r   )r   r   r   rU   )r!   ra   s     r#   	is_merged_PullRequest.is_merged  s5     oog		o:}}TYYs^S#66r&   c                     U R                  U R                  U R                  5      S5      nU R                  [        U5      $ )zRetrieve the issue associated with this pull request.

:returns:
    the issue object that this pull request builds upon
:rtype:
    :class:`~github3.issues.Issue`
rS   )rT   rU   rq   rV   r	   rX   s     r#   issue_PullRequest.issue  s4     zz$))DNN3S9%%eT22r&   c                     U R                  SU R                  S9nU R                  [        U5      U[        R
                  US9$ )a^  Iterate over the commits on this pull request.

:param int number:
    (optional), number of commits to return. Default: -1 returns all
    available commits.
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of repository commit objects
:rtype:
    :class:`~github3.repos.commit.ShortCommit`
commitsr   etag)r   r   _iterr   rcommitShortCommitr!   rv   r   ra   s       r#   r   _PullRequest.commits  s;     ooi$))o<zz#f+sG,?,?dzKKr&   c                 t    U R                  SU R                  S9nU R                  [        U5      U[        US9$ )a>  Iterate over the files associated with this pull request.

:param int number:
    (optional), number of files to return. Default: -1 returns all
    available files.
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns: generator of pull request files
:rtype: :class:`~PullFile`
filesr   r   )r   r   r   r   r?   r   s       r#   r   _PullRequest.files  s5     oog		o:zz#f+sH4z@@r&   c                     U R                   R                  S0 5      nUR                  S5      nU R                  [        U5      U[        US9$ )aC  Iterate over the issue comments on this pull request.

In this case, GitHub leaks implementation details. Pull Requests are
really just Issues with a diff. As such, comments on a pull request
that are not in-line with code, are technically issue comments.

:param int number:
    (optional), number of comments to return. Default: -1 returns all
    available comments.
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of non-review comments on this pull request
:rtype:
    :class:`~github3.issues.comment.IssueComment`
r   hrefr   )r   r   r   r   r
   )r!   rv   r   r   ra   s        r#   issue_comments_PullRequest.issue_comments  sA    " ::>>*b1ll6"zz#f+sLtzDDr&   c                     SU0nU(       a  X%S'   Ub  XS'   Ub  XES'   U R                  SU R                  S9nU R                  U R                  U[	        U5      S9S5      nU(       d  g	US
   $ )a  Merge this pull request.

.. versionchanged:: 1.3.0

    The ``commit_title`` parameter has been added to allow users to
    set the merge commit title.

.. versionchanged:: 1.0.0

    The boolean ``squash`` parameter has been replaced with
    ``merge_method`` which requires a string.

:param str commit_message:
    (optional), message to be used for the merge commit
:param str commit_title:
    (optional), message to be used for the merge commit title
:param str sha:
    (optional), SHA that pull request head must match to merge.
:param str merge_method: (optional), Change the merge method.
    Either 'merge', 'squash' or 'rebase'. Default is 'merge'.
:returns:
    True if successful, False otherwise
:rtype:
    bool
:returns: bool
merge_methodr   commit_messagecommit_titler   r   r   rS   Fmerged)r   r   rT   _putr   )r!   r   r   r   r   
parametersra   rY   s           r#   r   _PullRequest.merge  s    D %l3
 #u%+9'(#)5~&oog		o:zz$))CeJ.?)@#FH~r&   c                     U R                  U R                  SS0S9nU R                  USS5      (       a  UR                  $ S$ )zZReturn the patch.

:returns:
    bytestring representation of the patch
:rtype:
    bytes
r   zapplication/vnd.github.patchr   rS   r   r&   r   r   s     r#   rI   _PullRequest.patch  sI     yyII*HI  
  $}}T3<<t||E#Er&   c                 L    U R                  U R                  U R                  SS9$ )zcRe-open a closed Pull Request.

:returns:
    True if successful, False otherwise
:rtype:
    bool
open)r}   r   r+   s    r#   reopen_PullRequest.reopen&  s!     {{4::tyy{??r&   c                 t    U R                  SU R                  S9nU R                  [        U5      U[        US9$ )aY  Iterate over the review comments on this pull request.

:param int number:
    (optional), number of comments to return. Default: -1 returns all
    available comments.
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of review comments
:rtype:
    :class:`~github3.pulls.ReviewComment`
r   r   r   )r   r   r   r   r   r   s       r#   review_comments_PullRequest.review_comments1  s5     ooj499o=zz#f+sMzEEr&   c                     U R                  SU R                  S9nU R                  U R                  U5      S5      nU R	                  [
        U5      $ )zRetrieve the review requests associated with this pull request.

:returns:
    review requests associated with this pull request
:rtype:
    :class:`~github3.pulls.ReviewRequests`
ry   r   rS   )r   r   rT   rU   rV   ReviewRequests)r!   ra   rY   s      r#   review_requests_PullRequest.review_requestsA  sF     oo3diioHzz$))C.#.%%nd;;r&   c                 t    U R                  SU R                  S9nU R                  [        U5      U[        US9$ )ae  Iterate over the reviews associated with this pull request.

:param int number:
    (optional), number of reviews to return. Default: -1 returns all
    available files.
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of reviews for this pull request
:rtype:
    :class:`~github3.pulls.PullReview`
r   r   r   )r   r   r   r   r   r   s       r#   r   _PullRequest.reviewsM  s5     ooi$))o<zz#f+sJTzBBr&   c                     UUUUUS.nSnU R                  U5        U(       a3  U R                  U R                  U R                  [	        U5      S9S5      nU(       a  U R                  U5        gg)a  Update this pull request.

:param str title:
    (optional), title of the pull
:param str body:
    (optional), body of the pull request
:param str state:
    (optional), one of ('open', 'closed')
:param str base:
    (optional), Name of the branch on the current repository that the
    changes should be pulled into.
:param bool maintainer_can_modify:
    (optional), Indicates whether a maintainer is allowed to modify the
    pull request or not.
:returns:
    True if successful, False otherwise
:rtype:
    bool
)r   rf   r}   re   maintainer_can_modifyNr   rS   TF)_remove_nonerT   _patchr   r   r$   )r!   r   rf   r}   re   r   r   rY   s           r#   r   _PullRequest.update]  sn    : %:
 $::dkk$))%+kFLD##D)r&   )"r   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   r   rs   rt   ru   rv   rw   rx   r    ry   rz   r   r|   r}   r~   r   r   r   )NN)NNN)N)NNr   N)NNNNN)r.   r/   r0   r1   r2   r   r$   r,   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rI   r   r   r   r   r   r3   r4   r&   r#   r\   r\      s+     J.8`7 < < : :  ; ;< > >. -8 -8^ L L,F7 	3L AE*  , ,\F @ @F 
<C   "+ +r&   r\   c                   0   ^  \ rS rSrSrSrU 4S jrSrU =r$ )PullRequesti  a  Object for the full representation of a PullRequest.

GitHub's API returns different amounts of information about prs based
upon how that information is retrieved. This object exists to represent
the full amount of information returned for a specific pr. For example,
you would receive this class when calling
:meth:`~github3.github.GitHub.pull_request`. To provide a clear
distinction between the types of prs, github3.py uses different classes
with different sets of attributes.

.. versionchanged:: 1.0.0

This object has all of the same attributes as
:class:`~github3.pulls.ShortPullRequest` as well as the following:

.. attribute:: additions_count

    The number of lines of code added in this pull request.

.. attribute:: deletions_count

    The number of lines of code deleted in this pull request.

.. attribute:: comments_count

    The number of comments left on this pull request.

.. attribute:: commits_count

    The number of commits included in this pull request.

.. attribute:: mergeable

    A boolean attribute indicating whether GitHub deems this pull request
    is mergeable.

.. attribute:: mergeable_state

    A string indicating whether this would be a 'clean' or 'dirty' merge.

.. attribute:: merged

    A boolean attribute indicating whether the pull request has been merged
    or not.

.. attribute:: merged_by

    An instance of :class:`~github3.users.ShortUser` to indicate the user
    who merged this pull request. If this hasn't been merged or if
    :attr:`mergeable` is still being decided by GitHub this will be
    ``None``.

.. attribute:: review_comments_count

    The number of review comments on this pull request.
zPull Requestc                   > [         TU ]  U5        US   U l        UR                  SS 5      U l        US   U l        US   U l        US   U l        US   U l        US   U l	        US   U l
        US	   U l        US
   U l        US   U l        U R                  b&  [        R                  " U R                  U 5      U l        US   U l        US   n/ U l        U(       a,  SSKJn  U Vs/ s H  oCR)                  X@5      PM     snU l        US   n/ U l        U(       a-  U Vs/ s H  n[        R                  " X`5      PM     snU l        g g s  snf s  snf )NrD   
auto_mergeauthor_associationr   r   rE   draft	mergeablemergeable_stater   	merged_byr   rz   r   r_   ry   )superr$   rK   r   r   r   comments_countcommits_countrL   r   r   r  r   r  r   r   review_comments_countrz   r   r`   r   ry   )r!   r   rz   r`   teamry   r   	__class__s          r#   r$   PullRequest._update_attributes  sZ   "4(#K0((<6"&';"<":.!)_#K0']
k*#$568nk*>>%"__T^^TBDN%)*;%<"01! 8G$7Ftt*$D  ##89#% 8K(8K+8K(D$ $(s   &E	 E)rK   r   r   r  r  rL   r   r   r  r   r  ry   rz   r  )	r.   r/   r0   r1   r2   r   r$   r3   __classcell__)r  s   @r#   r   r     s    7r  J r&   r   c                        \ rS rSrSrSr\rSrg)r   i  aN  Object for the shortened representation of a PullRequest.

GitHub's API returns different amounts of information about prs based
upon how that information is retrieved. Often times, when iterating over
several prs, GitHub will return less information. To provide a clear
distinction between the types of Pull Requests, github3.py uses different
classes with different sets of attributes.

.. versionadded:: 1.0.0

The attributes available on this object are:

.. attribute:: url

    The URL that describes this exact pull request.

.. attribute:: assignee

    .. deprecated:: 1.0.0

        Use :attr:`assignees` instead.

    The assignee of the pull request, if present, represented as an
    instance of :class:`~github3.users.ShortUser`

.. attribute:: assignees

    .. versionadded:: 1.0.0

    A list of the assignees of the pull request. If not empty, a list
    of instances of :class:`~github3.users.ShortUser`.

.. attribute:: base

    A :class:`~github3.pulls.Base` object representing the base pull
    request destination.

.. attribute:: body

    The Markdown formatted body of the pull request message.

.. attribute:: body_html

    The HTML formatted body of the pull request mesage.

.. attribute:: body_text

    The plain-text formatted body of the pull request message.

.. attribute:: closed_at

    A :class:`~datetime.datetime` object representing the date and time
    when this pull request was closed.

.. attribute:: comments_url

    The URL to retrieve the comments on this pull request from the API.

.. attribute:: commits_url

    The URL to retrieve the commits in this pull request from the API.

.. attribute:: created_at

    A :class:`~datetime.datetime` object representing the date and time
    when this pull request was created.

.. attribute:: diff_url

    The URL to retrieve the diff for this pull request via the API.

.. attribute:: head

    A :class:`~github3.pulls.Head` object representing the head pull
    request destination.

.. attribute:: html_url

    The URL one would use to view this pull request in the browser.

.. attribute:: id

    The unique ID of this pull request across all of GitHub.

.. attribute:: issue_url

    The URL of the resource that represents this pull request as an issue.

.. attribute:: links

    A dictionary provided by ``_links`` in the API response.

    .. versionadded:: 1.0.0

.. attribute:: merge_commit_sha

    If unmerged, holds the sha of the commit to test mergability.
    If merged, holds commit sha of the merge commit, squashed commit on
    the base branch or the commit that the base branch was updated to
    after rebasing the PR.

.. attribute:: merged_at

    A :class:`~datetime.datetime` object representing the date and time
    this pull request was merged. If this pull request has not been merged
    then this attribute will be ``None``.

.. attribute:: number

    The number of the pull request on the repository.

.. attribute:: patch_url

    The URL to retrieve the patch for this pull request via the API.

.. attribute:: rebaseable

    A boolean attribute indicating whether GitHub deems this pull request
    is rebaseable. None if not set.

.. attribute:: repository

    A :class:`~github3.repos.repo.ShortRepository` from the :attr:`base`
    instance.

.. attribute:: requested_reviewers

    A list of :class:`~github3.users.ShortUser` from which a review was
    requested.

.. attribute:: requested_teams

   A list of :class:`~github3.orgs.ShortTeam` from which a review was
   requested.

.. attribute:: review_comment_urlt

    A URITemplate instance that expands to provide the review comment URL
    provided a number.

.. attribute:: review_comments_url

    The URl to retrieve all review comments on this pull request from the
    API.

.. attribute:: state

    The current state of this pull request.

.. attribute:: title

    The title of this pull request.

.. attribute:: updated_at

    A :class:`~datetime.datetime` instance representing the date and time
    when this pull request was last updated.

.. attribute:: user

    A :class:`~github3.users.ShortUser` instance representing who opened
    this pull request.
zShort Pull Requestr4   N)	r.   r/   r0   r1   r2   r   r   _refresh_tor3   r4   r&   r#   r   r     s    bH &JKr&   r   c                   8    \ rS rSrSrS rS r\SS j5       rSr	g)	r   i  a	  Object representing a Pull Request Review returned by the API.

Please see GitHub's `Pull Review Documentation`_ for more information.

.. _PullReview Documentation:
    https://developer.github.com/v3/pulls/reviews/

.. attribute:: id

    The unique ID of this pull request review.

.. attribute:: author_association

    .. versionadded:: 1.0.0

    The relationship of this review's author to the project.

.. attribute:: body

    The Markdown formatted body of this review.

.. attribute:: body_html

    .. versionadded:: 1.0.0

    The HTML formatted body of this review.

.. attribute:: body_text

    .. versionadded:: 1.0.0

    The plain-text formatted body of this review.

.. attribute:: commit_id

    The SHA of the commit that the review was left on.

    .. note::

        It is possible for the attribute to be set to ``None``, if the
        review references a commit that is no longer available in the pull
        request branch, such as after a force push.

.. attribute:: html_url

    .. versionadded:: 1.0.0

    The URL to view this pull request in a browser.

.. attribute:: pull_request_url

    The URL to retrieve the pull request via the API.

.. attribute:: state

    The state of this review, e.g., the option specified in the review
    dialog by the author.

.. attribute:: submitted_at

    A :class:`~datetime.datetime` object representing the date and time
    this review was submitted.

.. attribute:: user

    A :class:`~github3.users.ShortUser` instance representing the author
    of this review.
c                 Z   US   U l         US   U l        US   U l        US   U l        US   U l        UR                  SS 5      U l        US   U l        [        R                  " US   U 5      U l
        US	   U l        U R                  UR                  S
5      5      U l        US   U l        g )Nrp   r   rf   rg   rh   r   ro   r   r}   submitted_atpull_request_url)rp   r   rf   rg   rh   r   r   ro   r   r   r   r}   r   r  r  )r!   reviews     r#   r$   PullReview._update_attributes  s    ,"()=">6N	,,  K6z*OOF6ND9	G_
 NN6::n+EF &'9 :r&   c                 "    SU R                    S3$ )Nz<Pull Request Review [r)   )rp   r+   s    r#   r,   PullReview._repr  s    'y33r&   Nc                     U R                  SU R                  SU R                  S9nSU0nUb  X$S'   U R                  U R	                  X4S9S5      nU(       a  U R                  U5        gg	)
a  Submit a pull request review.

:param str body:
    The body text of the pull request review.
:param str event:
    The review action you want to perform. Actions include
    APPROVE, REQUEST_CHANGES or COMMENT. By leaving this blank
    you set the action to PENDING and will need to submit the
    review. Leaving blank will result in a 422 error response
    which will need to be handled.
:returns:
    True if successful, False otherwise
:rtype:
    bool
r   eventsr   rf   r   r   rS   TF)r   rp   r  rT   r   r$   )r!   rf   r   ra   r   rY   s         r#   submitPullReview.submit  st    " ootww43H3H  
 ~!Mzz$**S*4c:##D)r&   )r   rf   rg   rh   r   ro   rp   r  r}   r  r   )N)
r.   r/   r0   r1   r2   r$   r,   r   r  r3   r4   r&   r#   r   r     s'    CJ;4  r&   r   c                   T    \ rS rSrSrS rS r\S 5       r\S 5       r	\S 5       r
Srg	)
r   i	  a  Object representing review comments left on a pull request.

Please see GitHub's `Pull Comments Documentation`_ for more information.

.. _Pull Comments Documentation:
    http://developer.github.com/v3/pulls/comments/

.. attribute:: id

    The unique identifier for this comment across all GitHub review
    comments.

.. attribute:: author_association

    The role of the author of this comment on the repository.

.. attribute:: body

    The Markdown formatted body of this comment.

.. attribute:: body_html

    The HTML formatted body of this comment.

.. attribute:: body_text

    The plain text formatted body of this comment.

.. attribute:: commit_id

    The SHA of current commit this comment was left on.

.. attribute:: created_at

    A :class:`~datetime.datetime` instance representing the date and time
    this comment was created.

.. attribute:: diff_hunk

    A string representation of the hunk of the diff where the comment was
    left.

.. attribute:: html_url

    The URL to view this comment in the webbrowser.

.. attribute:: links

    A dictionary of relevant URLs usually returned in the ``_links``
    attribute.

.. attribute:: original_commit_id

    The SHA of the original commit this comment was left on.

.. attribute:: original_position

    The original position within the diff that this comment was left on.

.. attribute:: pull_request_url

    The URL to retrieve the pull request via the API.

.. attribute:: updated_at

    A :class:`~datetime.datetime` instance representing the date and time
    this comment was updated.

.. attribute:: user

    A :class:`~github3.users.ShortUser` instance representing the author
    of this comment.

c                    US   U l         US   U l        US   U l        US   U l        US   U l        US   U l        US   U l        U R                  US   5      U l        US	   U l	        US
   U l
        US   U l        US   U l        US   U l        US   U l        US   U l        US   U l        U R                  US   5      U l        [$        R&                  " US   U 5      U l        g )Nra   rp   r   rf   rg   rh   r   rl   	diff_hunkro   rr   original_commit_idoriginal_positionr   r   r  r   r   )r   rp   r   rf   rg   rh   r   r   rl   r  ro   r   r  r  r   r   r  r   r   r   r   )r!   comments     r#   r$    ReviewComment._update_attributesU  s    EN	$-")*>"?FO	 - - -..)>? -
+X&
")*>"?!()<!=FO	
+ '(: ;..)>?OOGFOT:	r&   c                 6    SU R                   R                   S3$ )Nz<Review Comment [r)   )r   r   r+   s    r#   r,   ReviewComment._repri  s    "499??"3266r&   c                 Z    U R                  U R                  U R                  5      SS5      $ )zYDelete this comment.

:returns:
    True if successful, False otherwise
:rtype:
    bool
r   r   )r   r   r   r+   s    r#   deleteReviewComment.deletel  s$     }}T\\$))4c3??r&   c           	          U(       aN  U R                  U R                  U R                  [        SU05      S9S5      nU(       a  U R	                  U5        gg)zEdit this comment.

:param str body:
    (required), new body of the comment, Markdown formatted
:returns:
    True if successful, False otherwise
:rtype:
    bool
rf   r   rS   TF)rT   r   r   r   r$   )r!   rf   rY   s      r#   editReviewComment.editw  sM     ::DIIE64.,ABCD ''-r&   c                    U R                  SU R                  S9nU R                  R                  S5      S-   n[	        U R                  US 5      nU R                  U R                  X!US.S9S5      nU R                  [        U5      $ )	zReply to this review comment with a new review comment.

:param str body:
    The text of the comment.
:returns:
    The created review comment.
:rtype:
    :class:`~github3.pulls.ReviewComment`
r   r   /r   N)rf   in_reply_tor   r   )	r   r  r   rfindr   rT   r   rV   r   )r!   rf   ra   indexr*  rY   s         r#   replyReviewComment.reply  s     ooj43H3HoI		$q($))EF+,zzJJs{!KJL
 %%mT::r&   )r   r   rf   rg   rh   r   rl   r  ro   rp   r   r  r  r   r   r  r   r   N)r.   r/   r0   r1   r2   r$   r,   r   r#  r&  r-  r3   r4   r&   r#   r   r   	  sQ    IV;(7 @ @  & ; ;r&   r   c                   $    \ rS rSrSrS rS rSrg)r   i  as  Object representing review requests in the GitHub API.

.. attribute:: teams

    The list of teams that were requested a review

.. attribute:: users

    The list of users that were requested a review

Please see GitHub's `Review Request Documentation`_ for more information.

.. _Review Request Documentation:
   https://developer.github.com/v3/pulls/review_requests/
c                     SSK Jn  US    Vs/ s H  o2R                  X05      PM     snU l        US    Vs/ s H  n[        R
                  " X@5      PM     snU l        g s  snf s  snf )Nr   r_   teamsr   )r   r`   r   r1  r   r   )r!   requestsr`   r   us        r#   r$   !ReviewRequests._update_attributes  sX    7?7HI7H!nnQ-7HI
8@8IJ8I1eooa.8IJ
 JJs
   A  A%c                 r    SR                  [        U R                  5      [        U R                  5      5      $ )Nz(<Review Requests [users: {}, teams: {}]>)formatlenr   r1  r+   s    r#   r,   ReviewRequests._repr  s*    9@@

OS_
 	
r&   )r1  r   N)r.   r/   r0   r1   r2   r$   r,   r3   r4   r&   r#   r   r     s     K
r&   r   N)r2   rY   r   uritemplater   r   r   r   
decoratorsr   issuesr	   issues.commentr
   reposr   r   r   
GitHubCorer   r6   r<   r?   r\   r   r   r   r   r   r4   r&   r#   <module>r?     s    E  #   %  ( $ @4f'' @4F? ? P?v   P?fR6$$ Rj[, [|f| fRs"" slT;F%% T;n
V&& 
r&   