This repository was archived by the owner on May 22, 2021. It is now read-only.
forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathissue_import.py
More file actions
51 lines (33 loc) · 1.46 KB
/
Copy pathissue_import.py
File metadata and controls
51 lines (33 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- coding: utf-8 -*-
"""This module contains the logic for GitHub's import issue API."""
from .. import models
class ImportedIssue(models.GitHubCore):
"""Represents an issue imported via the unofficial API.
See also: https://gist.github.com/jonmagic/5282384165e0f86ef105
This object has the following attributes:
.. attribute:: created_at
A :class:`~datetime.datetime` object representing the date and time
when this imported issue was created.
.. attribute:: id
The globally unique identifier for this imported issue.
.. attribute:: import_issues_url
The URL used to import more issues via the API.
.. attribute:: repository_url
The URL used to retrieve the repository via the API.
.. attribute:: status
The status of this imported issue.
.. attribute:: updated_at
A :class:`~datetime.datetime` object representing te date and time
when this imported issue was last updated.
"""
IMPORT_CUSTOM_HEADERS = {
"Accept": "application/vnd.github.golden-comet-preview+json"
}
def _update_attributes(self, issue):
self._api = issue["url"]
self.created_at = self._strptime(issue["created_at"])
self.id = issue["id"]
self.import_issues_url = issue["import_issues_url"]
self.repository_url = issue["repository_url"]
self.status = issue["status"]
self.updated_at = self._strptime(issue["updated_at"])