3 @qhc@sddlmZddlmZmZmZddlmZm Z m Z m Z m Z m Z mZmZddddgZGdddee e eZGd dde eee eZGd ddee e eZGd dde eee eZd S) ) exceptions)RequiredOptional RESTManager RESTObject) CreateMixin DeleteMixin ListMixinObjectDeleteMixin RetrieveMixin SaveMixinSubscribableMixin UpdateMixin GroupLabelGroupLabelManager ProjectLabelProjectLabelManagerc@s$eZdZdZejejddZdS)rnamecKs(|j}|jjd|f|}|j|dS)auSaves the changes made to the object to the server. The object is updated to match what the server returns. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct. GitlabUpdateError: If the server cannot perform the request. N)_get_updated_datamanagerupdate _update_attrs)selfkwargs updated_data server_datarW/home/ec2-user/environment/venv/lib/python3.6/dist-packages/gitlab/v4/objects/labels.pysaves zGroupLabel.saveN)__name__ __module__ __qualname___id_attrexc on_http_errorGitlabUpdateErrorrrrrrrscsZeZdZdZeZddiZedddZedddZ dfd d Z e j e j d dZZS)rz/groups/%(group_id)s/labelsZgroup_ididrcolor descriptionpriority)requiredoptionalnew_nameNc s,|pi}|r||d<tjfd|d|S)zUpdate a Label on the server. Args: name: The name of the label **kwargs: Extra options to send to the server (e.g. sudo) rN)r%new_data)superr)rrr,r) __class__rrr:szGroupLabelManager.updatecKs"|jj|jfdd|ii|dS)aDDelete a Label on the server. Args: name: The name of the label **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server cannot perform the request query_datarN)gitlab http_deletepath)rrrrrrdeleteGs zGroupLabelManager.delete)rr&)r'r()r)r+r&r'r()N)rrr _pathr_obj_cls_from_parent_attrsr _create_attrsrrr"r#GitlabDeleteErrorr3 __classcell__rr)r.rr.s   c@s$eZdZdZejejddZdS)rrcKs(|j}|jjd|f|}|j|dS)auSaves the changes made to the object to the server. The object is updated to match what the server returns. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct. GitlabUpdateError: If the server cannot perform the request. N)rrrr)rrrrrrrrZs zProjectLabel.saveN)rrr r!r"r#r$rrrrrrVscsZeZdZdZeZddiZedddZedddZ dfd d Z e j e j d dZZS)rz/projects/%(project_id)s/labelsZ project_idr%rr&r'r()r)r*r+Nc s,|pi}|r||d<tjfd|d|S)zUpdate a Label on the server. Args: name: The name of the label **kwargs: Extra options to send to the server (e.g. sudo) rN)r%r,)r-r)rrr,r)r.rrr|szProjectLabelManager.updatecKs"|jj|jfdd|ii|dS)aDDelete a Label on the server. Args: name: The name of the label **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server cannot perform the request r/rN)r0r1r2)rrrrrrr3s zProjectLabelManager.delete)rr&)r'r()r)r+r&r'r()N)rrr r4rr5r6rr7rrr"r#r8r3r9rr)r.rrns   N)r0rr"Z gitlab.baserrrZ gitlab.mixinsrrrr r r r r __all__rrrrrrrrs ( (