a *Na @sPddlmZddlmZddlmZddlmZmZmZddl m Z m Z m Z m Z mZmZmZmZmZmZmZmZddlmZddlmZdd lmZmZmZdd lmZgd Z Gd d d eZ!GdddeeZ"GdddeZ#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)ProjectIssueNoteManager)Issue IssueManager GroupIssueGroupIssueManager ProjectIssueProjectIssueManagerProjectIssueLinkProjectIssueLinkManagerc@seZdZdZdZdS)r/issuestitleN)__name__ __module__ __qualname___url_short_print_attrr*r*s/private/var/folders/js/6pj4vh5d4zd0k6bxv74qrbhr0000gr/T/pip-target-22xwyzbs/lib/python/gitlab/v4/objects/issues.pyr)src@s&eZdZdZeZdZejejdZ dS)rr#)statelabels milestonescope author_id assignee_idmy_reaction_emojiiidsorder_bysortsearch created_aftercreated_before updated_afterupdated_beforer3r-N) r%r&r'_pathr_obj_cls _list_filtersr ListAttribute_typesr*r*r*r+r.src@s eZdZdS)rN)r%r&r'r*r*r*r+rEsrc@s.eZdZdZeZddiZdZej ej dZ dS)rz/groups/%(group_id)s/issuesZgroup_idid)r,r-r.r4r5r3r0r1r2r6r7r8r9r:r;N) r%r&r'r<rr=_from_parent_attrsr>rr?r@r*r*r*r+rIs rc@steZdZdZdZdZedde ej ddZ ede ej ddZ ede ej d d Zd S) rr$iid))Z awardemojisr) discussionsr)linksr")notesr)Zresourcelabeleventsr)Zresourcemilestoneeventsr)Zresourcestateeventsr) to_project_idcKsDd|jj|f}d|i}|jjj|fd|i|}||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/moverG post_dataN)managerpathget_idgitlab http_post _update_attrs)selfrGkwargsrJdata server_datar*r*r+movevs zProjectIssue.movecKs*d|jj|f}|jjj|fi|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_requestsrIrJrKrLZhttp_getrOrPrJr*r*r+related_merge_requestssz#ProjectIssue.related_merge_requestscKs*d|jj|f}|jjj|fi|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_byrTrUr*r*r+ closed_byszProjectIssue.closed_byN)r%r&r'r)_id_attrZ _managersrZregister_custom_actionexc on_http_errorZGitlabUpdateErrorrSZGitlabGetErrorrVrWr*r*r*r+r`s       rc@sDeZdZdZeZddiZdZedddZ edd Z e j e j d Z d S) r z/projects/%(project_id)s/issues project_idrA)r3r,r-r.r/r0r1r2r4r5r6r7r8r9r:)r$) description confidential assignee_idsr1 milestone_idr-Z created_atdue_dateZ'merge_request_to_resolve_discussions_ofZdiscussion_to_resolve)requiredoptional) r$r\r]r^r1r_r-Z state_eventZ updated_atr`Zdiscussion_locked)rbr;N)r%r&r'r<rr=rBr>r _create_attrsrNrr?r@r*r*r*r+r sr c@seZdZdZdS)r!Z issue_link_idN)r%r&r'rXr*r*r*r+r!sr!c@s<eZdZdZeZdddZeddZe e j ddZ d S) r"z3/projects/%(project_id)s/issues/%(issue_iid)s/linksr[rC)r[Z issue_iid)Ztarget_project_idZtarget_issue_iid)racKsP|||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 rH source_issue target_issue)Z_check_missing_create_attrsrLrMrJr_parentrI)rOrQrPrRrdrer*r*r+creates  zProjectIssueLinkManager.createN) r%r&r'r<r!r=rBrrcrYrZZGitlabCreateErrorrgr*r*r*r+r"s    r"N))rLrrrYrZ gitlab.baserrrZ gitlab.mixinsrr r r r r rrrrrrZ award_emojisrrDreventsrrrrFr__all__rrrrrr r!r"r*r*r*r+s4   8     M6