def reopen(self): """ Reopens the issue. :raises RuntimeError: If something goes wrong (network, auth...). """ self.data = patch(self._token, self._url, {'state': 'open'})
def title(self, new_title): """ Sets the title of the issue. :param new_title: The new title. """ self.data = patch(self._token, self._url, {'title': new_title})
def close(self): """ Closes the issue. :raises RuntimeError: If something goes wrong (network, auth...). """ self.data = patch(self._token, self._url, {'state': 'closed'})
def body(self, value: str): """ Sets comment body to value on GitHub. :param value: A string containing comment body. """ payload = {'body': value} self.data = patch(self._token, self._url, payload)
def description(self, new_description): """ Sets the description of the issue. :param new_description: The new description. """ self.data = patch(self._token, self._url, {'body': new_description})
def labels(self, value: Set[str]): """ Sets the labels to the given set of labels. :param value: A set of label texts. """ # Only if self.data is populated we actually save a request here if 'labels' in self.data and value == self.labels: return # No need to patch self.data = patch(self._token, self._url, {'labels': list(value)})
def mark_done(self): """ Marks the notification as done/read. """ patch(self._token, self._url, {}) self.data.update({'unread': False})