3 @qhc @s\ddlmZddlmZddlmZddlmZmZmZddl m Z m Z m Z m Z mZmZmZmZmZmZmZmZddlmZddlmZdd lmZmZmZdd lmZd d d dddddgZ Gdd d eZ!Gdd d eeZ"Gdd d eZ#Gddde eZ$Gdddeeeeeeee Z%Gddde eZ&GdddeeZ'Gddde e e eZ(dS))cli) exceptions)types)RequiredOptional RESTManager RESTObject) CreateMixin CRUDMixin DeleteMixin ListMixinObjectDeleteMixinParticipantsMixin RetrieveMixin SaveMixinSubscribableMixinTimeTrackingMixin TodoMixinUserAgentDetailMixin)ProjectIssueAwardEmojiManager)ProjectIssueDiscussionManager)%ProjectIssueResourceLabelEventManager)ProjectIssueResourceMilestoneEventManager%ProjectIssueResourceStateEventManager)ProjectIssueNoteManagerIssue IssueManager GroupIssueGroupIssueManager ProjectIssueProjectIssueManagerProjectIssueLinkProjectIssueLinkManagerc@seZdZdZdZdS)rz/issuestitleN)__name__ __module__ __qualname___url_short_print_attrr)r)W/home/ec2-user/environment/venv/lib/python3.6/dist-packages/gitlab/v4/objects/issues.pyr)sc@s&eZdZdZeZdZejejdZ dS)rz/issuesstatelabels milestonescope author_id assignee_idmy_reaction_emojiiidsorder_bysortsearch created_aftercreated_before updated_afterupdated_before)r2r,N)r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9) r$r%r&_pathr_obj_cls _list_filtersr ListAttribute_typesr)r)r)r*r.s$c@s eZdZdS)rN)r$r%r&r)r)r)r*rEsc@s.eZdZdZeZddiZdZej ej dZ dS)rz/groups/%(group_id)s/issuesZgroup_ididr+r,r-r3r4r2r/r0r1r5r6r7r8r9)r2r,N)r+r,r-r3r4r2r/r0r1r5r6r7r8r9) r$r%r&r:rr;_from_parent_attrsr<rr=r>r)r)r)r*rIs$c@steZdZdZdZd Zejdd!ej ej ddZ ejdej ej ddZ ejdej ej ddZdS)"rr#iid awardemojisr discussionsrlinksr"notesrresourcelabeleventsrresourcemilestoneeventsrresourcestateeventsr to_project_idcKsDd|jj|jf}d|i}|jjj|fd|i|}|j|dS)aQMove the issue to another project. Args: to_project_id(int): ID of the target project **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabUpdateError: If the issue could not be moved z %s/%s/moverI post_dataN)managerpathget_idgitlab http_post _update_attrs)selfrIkwargsrLdata server_datar)r)r*movevs zProjectIssue.movecKs&d|jj|jf}|jjj|f|S)aiList merge requests related to the issue. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetErrot: If the merge requests could not be retrieved Returns: list: The list of merge requests. z%s/%s/related_merge_requests)rKrLrMrNhttp_get)rQrRrLr)r)r*related_merge_requestssz#ProjectIssue.related_merge_requestscKs&d|jj|jf}|jjj|f|S)azList merge requests that will close the issue when merged. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetErrot: If the merge requests could not be retrieved Returns: list: The list of merge requests. z%s/%s/closed_by)rKrLrMrNrV)rQrRrLr)r)r* closed_byszProjectIssue.closed_byNrBrrCrrDr"rErrFrrGrrHr)rYrZr[r\r]r^r_)rI)r$r%r&r(_id_attrZ _managersrZregister_custom_actionexc on_http_errorZGitlabUpdateErrorrUZGitlabGetErrorrWrXr)r)r)r*r`s  c@sDeZdZdZeZddiZd#Zed$d%dZ ed&d Z e j e j d!Z d"S)'r z/projects/%(project_id)s/issues project_idr?r2r+r,r-r.r/r0r1r3r4r5r6r7r8r9r# description confidential assignee_ids milestone_id created_atdue_date'merge_request_to_resolve_discussions_ofdiscussion_to_resolve)requiredoptional state_event updated_atdiscussion_locked)rm)r2r,N)r2r+r,r-r.r/r0r1r3r4r5r6r7r8r9)r#) rdrerfr0rgr,rhrirjrk) r#rdrerfr0rgr,rnrorirp)r$r%r&r:rr;r@r<r _create_attrsrPrr=r>r)r)r)r*r sVc@seZdZdZdS)r!Z issue_link_idN)r$r%r&r`r)r)r)r*r!sc@s<eZdZdZeZdddZed dZe j e j dd Z d S) r"z3/projects/%(project_id)s/issues/%(issue_iid)s/linksrcrA)rcZ issue_iidtarget_project_idtarget_issue_iid)rlcKsP|j||jj|jfd|i|}t|jj|d}t|jj|d}||fS)aCreate a new object. Args: data (dict): parameters to send to the server to create the resource **kwargs: Extra options to send to the server (e.g. sudo) Returns: RESTObject, RESTObject: The source and target issues Raises: GitlabAuthenticationError: If authentication is not correct GitlabCreateError: If the server cannot perform the request rJ source_issue target_issue)Z_check_missing_create_attrsrNrOrLr_parentrK)rQrSrRrTrtrur)r)r*creates  zProjectIssueLinkManager.createN)rrrs) r$r%r&r:r!r;r@rrqrarbZGitlabCreateErrorrwr)r)r)r*r"s   N))rNrrrarZ gitlab.baserrrZ gitlab.mixinsrr r r r r rrrrrrZ award_emojisrrCreventsrrrrEr__all__rrrrrr r!r"r)r)r)r*s@   8    E6