
    _Og4                     L    S r SSKJr  SSKJr   " S S\5      r " S S\5      rg)	z'The module containing deployment logic.   )users)
GitHubCorec                   8    \ rS rSrSrS rS rS	S jrS
S jrSr	g)
Deployment   a  Representation of a deployment of a repository at a point in time.

See also: https://developer.github.com/v3/repos/deployments/

This object has the following attributes:

.. attribute:: created_at

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

.. attribute:: creator

    A :class:`~github3.users.ShortUser` representing the user who created
    this deployment.

.. attribute:: description

    The description of this deployment as provided by the :attr:`creator`.

.. attribute:: environment

    The environment targeted for this deployment, e.g., ``'production'``,
    ``'staging'``.

.. attribute:: id

    The unique identifier of this deployment.

.. attribute:: payload

    The JSON payload string sent as part to trigger this deployment.

.. attribute:: ref

    The reference used to create this deployment, e.g.,
    ``'deploy-20140526'``.

.. attribute:: sha

    The SHA1 of the branch on GitHub when it was deployed.

.. attribute:: statuses_url

    The URL to retrieve the statuses of this deployment from the API.

.. attribute:: updated_at

    A :class:`~datetime.datetime` object representing the date and time
    when this deployment was most recently updated.
c                 F   US   U l         U R                  US   5      U l        [        R                  " 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S
   U l        U R                  US   5      U l        g )Nurl
created_atcreatordescriptionenvironmentidpayloadrefshastatuses_url
updated_at)_api	_strptimer
   r   	ShortUserr   r   r   r   r   r   r   r   r   )self
deployments     ]/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/github3/repos/deployment.py_update_attributesDeployment._update_attributes;   s    u%	..L)ABz)'<dC%m4%m4T"!),e$e$&~6..L)AB    c                 <    SU R                    SU R                   S3$ )Nz<Deployment [z @ ]>)r   r   r   s    r   _reprDeployment._reprH   s    twwis488*B77r   Nc                     SnUS;   aC  UUUS.nU R                  U5        U R                  U R                  US9nU R                  US5      nU R	                  [
        U5      $ )a  Create a new deployment status for this deployment.

:param str state:
    (required), The state of the status. Can be one of
    ``pending``, ``success``, ``error``, ``inactive``,
    ``in_progress``, ``queued``, or ``failure``.
:param str target_url:
    The target URL to associate with this status.
    This URL should contain output to keep the user updated while the
    task is running or serve as historical information for what
    happened in the deployment. Default: ''.
:param str description:
    A short description of the status. Default: ''.
:return:
    the incomplete deployment status
:rtype:
    :class:`~github3.repos.deployment.DeploymentStatus`
N)pendingsuccesserrorinactivein_progressqueuedfailure)state
target_urlr   )data   )_remove_none_postr   _json_instance_or_nullDeploymentStatus)r   r*   r+   r   jsonr,   responses          r   create_statusDeployment.create_statusK   st    &  
 
 (*D
 d#zz$"3"3$z?H::h,D%%&6==r   c                 X    U R                  [        U5      U R                  [        US9nU$ )a  Iterate over the deployment statuses for this deployment.

:param int number:
    (optional), the number of statuses to return.
    Default: -1, returns all statuses.
:param str etag:
    (optional), the ETag header value from the last time
    you iterated over the statuses.
:returns:
    generator of the statuses of this deployment
:rtype:
    :class:`~github3.repos.deployment.DeploymentStatus`
)etag)_iterintr   r2   )r   numberr8   is       r   statusesDeployment.statusest   s2     JJK**,<4  
 r   )r   r
   r   r   r   r   r   r   r   r   r   )NN)N)
__name__
__module____qualname____firstlineno____doc__r   r    r5   r=   __static_attributes__ r   r   r   r      s    2hC8'>Rr   r   c                   $    \ rS rSrSrS rS rSrg)r2      a  Representation of the status of a deployment of a repository.

See also
https://developer.github.com/v3/repos/deployments/#get-a-single-deployment-status

This object has the following attributes:

.. attribute:: created_at

    A :class:`~datetime.datetime` representing the date and time when this
    deployment status was created.

.. attribute:: creator

    A :class:`~github3.users.ShortUser` representing the user who created
    this deployment status.

.. attribute:: deployment_url

    The URL to retrieve the information about the deployment from the API.

.. attribute:: description

    The description of this status as provided by the :attr:`creator`.

.. attribute:: id

    The unique identifier of this deployment.

.. attribute:: state

    The state of the deployment, e.g., ``'success'``.

.. attribute:: target_url

    The URL to associate with this status. This should link to the output
    of the deployment.
c                    US   U l         U R                  US   5      U l        [        R                  " 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 R                  US	   5      U l        g )
Nr	   r
   r   deployment_urlr   r   r*   r+   r   )r   r   r
   r   r   r   rJ   r   r   r*   r+   r   )r   statuss     r   r   #DeploymentStatus._update_attributes   s    5M	..)=>vi'8$?$%56!-0,G_
 ...)=>r   c                 "    SU R                    S3$ )Nz<DeploymentStatus [r   )r   r   s    r   r    DeploymentStatus._repr   s    $TWWIR00r   )	r   r
   r   rJ   r   r   r*   r+   r   N)r@   rA   rB   rC   rD   r   r    rE   rF   r   r   r2   r2      s    %N	?1r   r2   N)rD    r   modelsr   r   r2   rF   r   r   <module>rQ      s)    -   D41z 41r   