diff --git a/api/gitlab_classes.py b/api/gitlab_classes.py index a82d3ee1830004007515e25bb644083ab09ef06c..628d5ef9b05bc3702ccfd9cf29691793fa1456fe 100644 --- a/api/gitlab_classes.py +++ b/api/gitlab_classes.py @@ -1,4 +1,5 @@ from datetime import datetime, date +from deprecated import deprecated from functools import reduce from typing import ClassVar, Dict, Iterable, List, Optional, Set, Union @@ -110,12 +111,25 @@ class GitlabIssue: """ return self.git_issue.description - def get_state(self) -> str: # TODO, deprecate and replace with is_opened & is_closed + @deprecated + def get_state(self) -> str: # TODO, delete after we're sure there are no uses """ :return: opened or closed """ return self.git_issue.state + def is_open(self) -> bool: + """ + :return: True if the issue is open; False if the issue is closed + """ + return self.git_issue.state == 'opened' + + def is_closed(self) -> bool: + """ + :return: True if the issue is closed; False if the issue is open + """ + return self.git_issue.state == 'closed' + def get_created_at(self) -> datetime: """ :return: an "aware" datetime object representing the creation date/time