use required enums to validate 'type' args

Change-Id: Id7c6a4eed2b6a3a55502b8bbd8d8fbfad16abb45
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-02-15 19:19:22 -05:00 committed by Jeremy Stanley
parent bbd24e941c
commit b496f4b18d
1 changed files with 4 additions and 4 deletions

View File

@ -521,9 +521,6 @@ class TaskStatus(base.APIBase):
class FilterCriterion(base.APIBase):
"""Represents a filter used to construct an automatic worklist."""
type = wtypes.text
"""The type of objects to filter, Story or Task."""
title = wtypes.text
"""The title of the criterion, as displayed in the UI."""
@ -549,10 +546,13 @@ class FilterCriterion(base.APIBase):
field='status')
WorklistFilterType = wtypes.Enum(wtypes.text, 'Story', 'Task')
class WorklistFilter(base.APIBase):
"""Represents a set of criteria to filter items using AND."""
type = wtypes.text
type = wtypes.wsattr(WorklistFilterType, mandatory=True)
"""The type of objects to filter, Story or Task."""
list_id = int