diff options
author | Walter Rowe <walter.rowe@gmail.com> | 2022-05-31 15:36:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-31 21:36:14 +0200 |
commit | 3fa330cc341bbedb163ba757c7f6578d735c6efb (patch) | |
tree | 6a27d234a22e77233990ba89991aa41d438c2528 /gitlab/v4/objects/boards.py | |
parent | 37eb8e0a4f0fd5fc7e221163b84df3461e64475b (diff) | |
download | gitlab-3fa330cc341bbedb163ba757c7f6578d735c6efb.tar.gz |
feat: support mutually exclusive attributes and consolidate validation to fix board lists (#2037)
add exclusive tuple to RequiredOptional data class to support for
mutually exclusive attributes
consolidate _check_missing_create_attrs and _check_missing_update_attrs
from mixins.py into _validate_attrs in utils.py
change _create_attrs in board list manager classes from
required=('label_ld',) to
exclusive=('label_id','asignee_id','milestone_id')
closes https://github.com/python-gitlab/python-gitlab/issues/1897
Diffstat (limited to 'gitlab/v4/objects/boards.py')
-rw-r--r-- | gitlab/v4/objects/boards.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gitlab/v4/objects/boards.py b/gitlab/v4/objects/boards.py index a5c59b3..c5243db 100644 --- a/gitlab/v4/objects/boards.py +++ b/gitlab/v4/objects/boards.py @@ -24,7 +24,9 @@ class GroupBoardListManager(CRUDMixin, RESTManager): _path = "/groups/{group_id}/boards/{board_id}/lists" _obj_cls = GroupBoardList _from_parent_attrs = {"group_id": "group_id", "board_id": "id"} - _create_attrs = RequiredOptional(required=("label_id",)) + _create_attrs = RequiredOptional( + exclusive=("label_id", "assignee_id", "milestone_id") + ) _update_attrs = RequiredOptional(required=("position",)) def get( @@ -55,7 +57,9 @@ class ProjectBoardListManager(CRUDMixin, RESTManager): _path = "/projects/{project_id}/boards/{board_id}/lists" _obj_cls = ProjectBoardList _from_parent_attrs = {"project_id": "project_id", "board_id": "id"} - _create_attrs = RequiredOptional(required=("label_id",)) + _create_attrs = RequiredOptional( + exclusive=("label_id", "assignee_id", "milestone_id") + ) _update_attrs = RequiredOptional(required=("position",)) def get( |