
    _Og(;                     (   S r SSKJr  SSKJr  SSKJr   " S S\R                  5      r " S S	\R                  5      r " S
 S\R                  5      r	 " S S\R                  5      r
 " S S\R                  5      r " S S\R                  5      rg)z8This module contains all the classes relating to Checks.    )dumps   )
decorators)modelsc                   .    \ rS rSrSrS rS rS r\rSr	g)CheckPullRequest   a  Representation of a Pull Request returned in Checks APIs.

.. versionadded:: 1.3.0

.. note::

    Refreshing this object returns a :class:`~github3.pulls.PullRequest`.

This object has the following attributes:

.. attribute:: id

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

.. attribute:: number

    The number of this pull request on its repository.

.. attribute:: head

    A dict of minimal head information retrieved from the Check data
    representing the source of the pull request

.. attribute:: base

    A dict of minimal base information retrieved from the Check data
    representing the pull request destination.
c                 v    US   U l         US   U l        US   U l        US   U l        US   =U l        U l        g )Nidnumberbaseheadurl)r   r   r   r   _apir   )selfpulls     S/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/github3/checks.py_update_attributes#CheckPullRequest._update_attributes&   s@    t*8nL	L	#E{*	DH    c                 "    SU R                    S3$ )Nz<CheckPullRequest [#z]>)r   r   s    r   _reprCheckPullRequest._repr-   s    %dkk]"55r   c                     SSK Jn  U R                  U R                  U R                  5      S5      nU R                  UR                  U5      $ )zRetrieve a full PullRequest object for this CheckPullRequest.

:returns:
    The full information about this pull request.
:rtype:
    :class:`~github3.pulls.PullRequest`
r   )pulls   ) r   _json_getr   _instance_or_nullPullRequest)r   r   jsons      r   to_pullCheckPullRequest.to_pull0   s=     	zz$))DHH-s3%%e&7&7>>r   )r   r   r   r   r   r   N)
__name__
__module____qualname____firstlineno____doc__r   r   r$   refresh__static_attributes__ r   r   r   r      s    :+6? Gr   r   c                   6    \ rS rSrSrSS0rS rS rS r\r	Sr
g	)
CheckApp@   a.  Representation of an App returned in Checks APIs.

.. versionadded:: 1.3.0

.. note::

    Refreshing this object returns a :class:`~github3.apps.App`.

This object has the following attributes:

.. attribute:: description

    The description of the App provided by the owner.

.. attribute:: external_url

    The URL provided for the App by the owner.

.. attribute:: html_url

    The HTML URL provided for the App by the owner.

.. attribute:: id

    The unique identifier for the App. This is useful in cases where you
    may want to authenticate either as an App or as a specific
    installation of an App.

.. attribute:: name

    The display name of the App that the user sees.

.. attribute:: owner

    A dict of minimal user information retrieved from the Check data
    representing the app owner
Acceptz/application/vnd.github.machine-man-preview+jsonc                     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   R                  SS5      u  p#U R                  S	U5      =U l        U l	        g )
Ndescriptionexternal_urlhtml_urlr   nameowner/r   apps)
r3   r4   r5   r   r6   r7   rsplit
_build_urlr   r   )r   app_slugs       r   r   CheckApp._update_attributesk   sy    }-/Jd)K	\
j/((a0#vt<<	DHr   c                 f    SR                  U R                  [        U R                  S   5      5      $ )Nz<App ["{}" by {}]>login)formatr6   strr7   r   s    r   r   CheckApp._repru   s,    #**IIs4::g./
 	
r   c                     SSK Jn  [        U SS5      nU R                  U R	                  U R
                  US9S5      nU R                  UR                  U5      $ )zRetrieve a full App object for this CheckApp.

:returns:
    The full information about this App.
:rtype:
    :class:`~github3.apps.App`
r   )r9   CUSTOM_HEADERSNheadersr   )r   r9   getattrr   r    r   r!   App)r   r9   rH   r#   s       r   to_appCheckApp.to_appz   sN     	$ 0$7zz$))DIIw)?E%%dhh55r   )r   r3   r4   r5   r   r6   r7   r   N)r&   r'   r(   r)   r*   rF   r   r   rK   r+   r,   r-   r   r   r/   r/   @   s-    $N 	CN=

6 Gr   r/   c                   Z    \ rS rSrSrS rSS0rS rS r\	R                  S 5       rS rS	rg
)
CheckSuite   a!  The :class:`CheckSuite <CheckSuite>` object.

.. versionadded:: 1.3.0

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

.. attribute:: status

    The status of the Check Suite

.. attribute:: conclusion

    The highest priority check run conclusion. If it has not completed this
    will be None

.. attribute:: head_sha

    The sha of the commit at the head of the branch the check was run
    against (the source of the pull request)

.. attribute:: head_branch

    The branch checked

.. attribute:: before

    The sha of the pull request target branch at the time of the checks

.. attribute:: after

    The sha of the target branch after the change is applied

.. attribute:: repository

    A representation of the repository the suite belongs to as
    :class:`~github3.repos.repo.ShortRepository`.

.. attribute:: original_pull_requests

    A list of representations of the pull requests the suite belongs to as
    :class:`~github3.checks.CheckPullRequest`.

    .. note::

        This may be empty.

.. attribute:: id

    The unique GitHub assigned numerical id of this check suite.

.. attribute:: app

    A :class:`~github3.checks.CheckApp` representing the App
    this suite belongs to.

.. CheckSuite Documentation:
    http://developer.github.com/v3/checks/suites/
r1   +application/vnd.github.antiope-preview+jsonc                 |   SSK Jn  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      nU Vs/ s H  n[        X@5      PM     snU l        UR                  US   U 5      U l        US   U l        [        US   U 5      U l        g s  snf )Nr   )reposr   status
conclusionhead_branchhead_shabeforeafterpull_requests
repositoryr   r<   )r   rR   r   rS   rT   rU   rV   rW   rX   getr   original_pull_requestsShortRepositoryrZ   r   r/   r<   )r   suiterR   prsps        r   r   CheckSuite._update_attributes   s    %L	Ho- /j)Ho7^
ii,JM&N#Q'7'@#&N#//l0CTJ+E%L$/ 'Os   #B9c                      SR                  U S9$ )Nz$<{s.class_name} [{s.id}:{s.status}]>srB   r   s    r   r   CheckSuite._repr   s    5<<t<DDr   c                     U R                  SU R                  S9nU R                  U R                  U[        R
                  S9SS5      $ )z_Rerequest the check suite.

:returns:
    True if successful, False otherwise
:rtype:
    bool
	rerequestbase_urlrG      i  )r;   r   _boolean_postrN   rF   r   r   s     r   rh   CheckSuite.rerequest   sE     ookDIIo>}}JJsJ$=$=J>S
 	
r   c                     U R                  SU R                  S9nU R                  SU[        [        R                  SS9$ )zRetrieve the check runs for this suite.

:returns:
    the check runs for this commit
:rtype:
    :class:`~github3.checks.CheckRun`
z
check-runsri   
check_runs)rH   list_key)r;   r   _iterCheckRunrF   rn   s     r   rr   CheckSuite.check_runs   sE     oolTYYo?zz++!  
 	
r   )r   rX   r<   rW   rT   rU   rV   r   r\   rZ   rS   N)r&   r'   r(   r)   r*   
class_namerF   r   r   r   requires_authrh   rr   r,   r-   r   r   rN   rN      sD    9v J MNN0"E 
 

r   rN   c                   0    \ rS rSrSrS rSS0rS rS rSr	g)	CheckRunAnnotation   a  Representation of an annotation of a check run.

.. versionadded:: 1.3.0

.. attribute:: path

    The path of the file of the annotation.

.. attribute:: start_line

    The start line of the annotation.

.. attribute:: end_line

    The end line of the annotation.

.. attribute:: start_column

    The start column of the annotation.

.. attribute:: end_column

    The end column of the annotation.

.. attribute:: annotation_level

    The level of the annotation. Can be one of 'notice', 'warning'
    or 'failure'.

.. attribute:: title

    The title that represents the annotation.

.. attribute:: message

    The short descript of the feedback for the lines of code.

.. attribute:: raw_details

    The details about this annotation.
r1   rP   c                      SR                  U S9$ )Nz7<{s.class_name} [{s.path}:{s.start_line}-{s.end_line}]>rc   re   r   s    r   r   CheckRunAnnotation._repr,  s    E
&4&.	r   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S	   U l        g )
Npath
start_lineend_linestart_column
end_columnannotation_leveltitlemessageraw_details)	r   r   r   r   r   r   r   r   r   )r   notes     r   r   %CheckRunAnnotation._update_attributes1  so    L	|,Z( 0|, $%7 8']
I.r   )	r   r   r   r   r   r   r   r   r   N)
r&   r'   r(   r)   r*   rw   rF   r   r   r,   r-   r   r   rz   rz      s$    (T &J MNN
	/r   rz   c                   .    \ rS rSrSrS rS rS rS rSr	g)CheckRunOutputi=  a  Representation of the output of a check run.

.. versionadded:: 1.3.0

.. attribute:: title

    The title for the check run output.

.. attribute:: summary

    The summary for the check run output.

.. attribute:: text

    The output text of the check run.

.. attribute:: annotations_count

    The number of annotations for this check run.

.. attribute:: annotations_url

    The URL to retrieve the annotations
c                 h    US   U l         US   U l        US   U l        US   U l        US   U l        g )Nr   summarytextannotations_countannotations_url)r   r   r   r   r   )r   outputs     r   r   !CheckRunOutput._update_attributesY  s@    G_
i(6N	!'(;!<%&78r   c                      SR                  U S9$ )Nz<{s.class_name} [{s.title}]>rc   re   r   s    r   r   CheckRunOutput._repr`  s    -44t4<<r   c                 |    U R                  U R                  S9nU R                  SU[        [        R                  S9$ )zRetrieve the annotations for a check run.

:returns:
    the annotations for this check run
:rtype:
    :class:`~github3.checks.CheckRunAnnotations`
ri   rq   rG   )r;   r   rt   rz   rF   rn   s     r   annotationsCheckRunOutput.annotationsc  sB     oot';';o<zz&55	  
 	
r   )r   r   r   r   r   N)
r&   r'   r(   r)   r*   rw   r   r   r   r,   r-   r   r   r   r   =  s    2 "J9=
r   r   c                   j    \ rS rSrSrS rSS0rS rS r\	R                           S
S j5       rS	rg)ru   it  ad  The :class:`CheckRun <CheckRun>` object.

.. versionadded:: 1.3.0

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

.. attribute:: status

    The current status of the check.

.. attribute:: conclusion

    The final conclusion of the check. If the run has not concluded
    this will be None.

.. attribute:: head_sha

    The sha of the commit at the head of the branch checked.

.. attribute:: name

    The name of the check.

.. attribute:: started_at

    A :class:`~datetime.datetime` object representing the date and time
    when this check run started.

.. attribute:: completed_at

    A :class:`~datetime.datetime` object representing the date and time
    when this check run completed. If this run is not completed it will
    be ``None``.

.. attribute:: original_pull_requests

    A list of representations of the pull requests the run belongs to as
    :class:`~github3.checks.CheckPullRequest`.

    .. note::

        This may be empty.


.. attribute:: id

    The unique GitHub assigned numerical id of this check run.

.. attribute:: external_id

    A reference for the run on the integrator's system. This may be None.

.. attribute:: html_url

    The URL one would use to view this check run in the browser.

.. attribute:: check_suite

    The ID of the check suite this run belongs to.

.. attribute:: output

    A :class:`~github3.checks.CheckRunOutput` representing the output
    of this check run.

.. attribute:: app

    A :class:`~github3.checks.CheckApp` representing the App
    this run belongs to.

.. CheckRun Documentation:
    http://developer.github.com/v3/checks/runs/
r1   rP   c                    US   U l         US   U l        US   U l        US   U l        U R	                  US   5      U l        U R	                  US   5      U l        US   U l        US   U l        UR                  S	/ 5      nU Vs/ s H  n[        X05      PM     snU l        US
   U l        US   U l        [        US   U 5      U l        US   S
   U l        [#        US   U 5      U l        g s  snf )Nr   r5   rS   rT   
started_atcompleted_atrV   r6   rY   r   external_idr<   check_suiter   )r   r5   rS   rT   	_strptimer   r   rV   r6   r[   r   r\   r   r   r/   r<   r   r   r   )r   runr_   r`   s       r   r   CheckRun._update_attributes  s    J	J(ml+..\):; NN3~+>?JK	ggor*JM&N#Q'7'@#&N#d)}-CJ-}-d3$S]D9 'Os   C,c                      SR                  U S9$ )Nz&<{s.class_name} [{s.name}:{s.status}]>rc   re   r   s    r   r   CheckRun._repr  s    7>>>FFr   Nc
           
         UUUUUUUUU	S.	n
U R                  U
5        SnU
(       aB  U R                  U R                  U R                  [	        U
5      [
        R                  S9S5      nU(       a  U R                  U5        gg)a  Update this check run.

All parameters are optional.

:param str name:
    (optional), new name of the check
:param str details_url:
    (optional), The URL of the integrator's site that has the full
    details of the check
:param str external_id:
    (optional), A reference for the run on the integrator's system
:param str started_at:
    (optional), ISO 8601 time format: YYYY-MM-DDTHH:MM:SSZ
:param str status:
    (optional), ('queued', 'in_progress', 'completed')
:param str conclusion:
    (optional), Required if you provide 'completed_at', or a
    'status' of 'completed'. The final conclusion of the check.
    ('success', 'failure', 'neutral', 'cancelled', 'timed_out',
    'action_required')
:param str completed_at:
    (optional), Required if you provide 'conclusion'. ISO 8601 time
    format: YYYY-MM-DDTHH:MM:SSZ
:param dict output:
    (optional), key-value pairs representing the output. Format:
    ``{'title': 'string', 'summary', 'text, can be markdown', 'text':
    'text, can be markdown', 'annotations': [{}], 'images': [{}]}``
:param list actions:
    (optional), list of action objects. Format is:
    ``[{'label': 'text', 'description', 'text', 'identifier', 'text'},
    ...]``
:returns:
    True if successful, False otherwise
:rtype:
    bool
)	r6   details_urlr   r   rS   rT   r   r   actionsN)datarH   r   TF)_remove_noner   _patchr   r   rN   rF   r   )r   r6   r   r   r   rS   rT   r   r   r   r   r#   s               r   updateCheckRun.update  s    d &&$$(

 	$::IIt&55  
 D ##D)r   )r   r<   r   r   rT   r   rV   r5   r   r6   r\   r   r   rS   )	NNNNNNNNN)r&   r'   r(   r)   r*   rw   rF   r   r   r   requires_app_installation_authr   r,   r-   r   r   ru   ru   t  s_    HT J MNN:"G .. J /Jr   ru   N)r*   r#   r   r   r   r   
GitHubCorer   r/   rN   rz   r   ru   r-   r   r   <module>r      s    >   5v(( 5pHv   HVp
"" p
f</** </~4
V&& 4
nmv   mr   