We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Allow updating tag_name and target_commitish of GitRelease
GitHub API [allows updating](https://developer.github.com/v3/repos/releases/#edit-a-release) `tag_name` and `target_commitish` of a release, among `name`, `body`, `draft` and `prerelease`, but PyGithub API wrapper allows updating all of them but  `tag_name` and `target_commitish`:

https://github.com/PyGithub/PyGithub/blob/e389396405146bb1b0c4587de1f6f757a9514a43/github/GitRelease.py#L178-L199

Could we add `tag_name` and `target_commitish` parameters to that function?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `github/GitRelease.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 ############################ Copyrights and license ############################
4 #                                                                              #
5 # Copyright 2015 Ed Holland <eholland@alertlogic.com>                          #
6 # Copyright 2016 Benjamin Whitney <benjamin.whitney@ironnetcybersecurity.com>  #
7 # Copyright 2016 Jannis Gebauer <ja.geb@me.com>                                #
8 # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #
9 # Copyright 2017 Chris McBride <thehighlander@users.noreply.github.com>        #
10 # Copyright 2017 Simon <spam@esemi.ru>                                         #
11 # Copyright 2018 Shinichi TAMURA <shnch.tmr@gmail.com>                         #
12 # Copyright 2018 Wan Liuyang <tsfdye@gmail.com>                                #
13 # Copyright 2018 edquist <edquist@users.noreply.github.com>                    #
14 # Copyright 2018 sfdye <tsfdye@gmail.com>                                      #
15 #                                                                              #
16 # This file is part of PyGithub.                                               #
17 # http://pygithub.readthedocs.io/                                              #
18 #                                                                              #
19 # PyGithub is free software: you can redistribute it and/or modify it under    #
20 # the terms of the GNU Lesser General Public License as published by the Free  #
21 # Software Foundation, either version 3 of the License, or (at your option)    #
22 # any later version.                                                           #
23 #                                                                              #
24 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #
25 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #
26 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
27 # details.                                                                     #
28 #                                                                              #
29 # You should have received a copy of the GNU Lesser General Public License     #
30 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #
31 #                                                                              #
32 ################################################################################
33 
34 from os.path import basename
35 import github.GithubObject
36 import github.GitAuthor
37 import github.GitReleaseAsset
38 
39 
40 class GitRelease(github.GithubObject.CompletableGithubObject):
41     """
42     This class represents GitReleases. The reference can be found here https://developer.github.com/v3/repos/releases
43     """
44 
45     def __repr__(self):
46         return self.get__repr__({"title": self._title.value})
47 
48     @property
49     def id(self):
50         """
51         :type: integer
52         """
53         self._completeIfNotSet(self._id)
54         return self._id.value
55 
56     @property
57     def body(self):
58         """
59         :type: string
60         """
61         self._completeIfNotSet(self._body)
62         return self._body.value
63 
64     @property
65     def title(self):
66         """
67         :type: string
68         """
69         self._completeIfNotSet(self._title)
70         return self._title.value
71 
72     @property
73     def tag_name(self):
74         """
75         :type: string
76         """
77         self._completeIfNotSet(self._tag_name)
78         return self._tag_name.value
79 
80     @property
81     def target_commitish(self):
82         """
83         :type: string
84         """
85         self._completeIfNotSet(self._target_commitish)
86         return self._target_commitish.value
87 
88     @property
89     def draft(self):
90         """
91         :type: bool
92         """
93         self._completeIfNotSet(self._draft)
94         return self._draft.value
95 
96     @property
97     def prerelease(self):
98         """
99         :type: bool
100         """
101         self._completeIfNotSet(self._prerelease)
102         return self._prerelease.value
103 
104     @property
105     def author(self):
106         """
107         :type: :class:`github.GitAuthor.GitAuthor`
108         """
109         self._completeIfNotSet(self._author)
110         return self._author.value
111 
112     @property
113     def created_at(self):
114         """
115         :type: datetime.datetime
116         """
117         self._completeIfNotSet(self._created_at)
118         return self._created_at.value
119 
120     @property
121     def published_at(self):
122         """
123         :type: datetime.datetime
124         """
125         self._completeIfNotSet(self._published_at)
126         return self._published_at.value
127 
128     @property
129     def url(self):
130         """
131         :type: string
132         """
133         self._completeIfNotSet(self._url)
134         return self._url.value
135 
136     @property
137     def upload_url(self):
138         """
139         :type: string
140         """
141         self._completeIfNotSet(self._upload_url)
142         return self._upload_url.value
143 
144     @property
145     def html_url(self):
146         """
147         :type: string
148         """
149         self._completeIfNotSet(self._html_url)
150         return self._html_url.value
151 
152     @property
153     def tarball_url(self):
154         """
155         :type: string
156         """
157         self._completeIfNotSet(self._tarball_url)
158         return self._tarball_url.value
159 
160     @property
161     def zipball_url(self):
162         """
163         :type: string
164         """
165         self._completeIfNotSet(self._zipball_url)
166         return self._zipball_url.value
167 
168     def delete_release(self):
169         """
170         :calls: `DELETE /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#delete-a-release>`_
171         :rtype: None
172         """
173         headers, data = self._requester.requestJsonAndCheck(
174             "DELETE",
175             self.url
176         )
177 
178     def update_release(self, name, message, draft=False, prerelease=False):
179         """
180         :calls: `PATCH /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#edit-a-release>`_
181         :rtype: :class:`github.GitRelease.GitRelease`
182         """
183         assert isinstance(name, (str, unicode)), name
184         assert isinstance(message, (str, unicode)), message
185         assert isinstance(draft, bool), draft
186         assert isinstance(prerelease, bool), prerelease
187         post_parameters = {
188             "tag_name": self.tag_name,
189             "name": name,
190             "body": message,
191             "draft": draft,
192             "prerelease": prerelease,
193         }
194         headers, data = self._requester.requestJsonAndCheck(
195             "PATCH",
196             self.url,
197             input=post_parameters
198         )
199         return github.GitRelease.GitRelease(self._requester, headers, data, completed=True)
200 
201     def upload_asset(self, path, label="", content_type=""):
202         """
203         :calls: `POST https://<upload_url>/repos/:owner/:repo/releases/:release_id/assets?name=foo.zip <https://developer.github.com/v3/repos/releases/#upload-a-release-asset>`_
204         :rtype: :class:`github.GitReleaseAsset.GitReleaseAsset`
205         """
206         assert isinstance(path, (str, unicode)), path
207         assert isinstance(label, (str, unicode)), label
208 
209         post_parameters = {
210             "name": basename(path),
211             "label": label
212         }
213         headers = {}
214         if len(content_type) > 0:
215             headers["Content-Type"] = content_type
216         resp_headers, data = self._requester.requestBlobAndCheck(
217             "POST",
218             self.upload_url.split("{?")[0],
219             parameters=post_parameters,
220             headers=headers,
221             input=path
222         )
223         return github.GitReleaseAsset.GitReleaseAsset(self._requester, resp_headers, data, completed=True)
224 
225     def get_assets(self):
226         """
227         :calls: `GET /repos/:owner/:repo/releases/:release_id/assets <https://developer.github.com/v3/repos/releases/#list-assets-for-a-release>`_
228         :rtype: :class:`github.PaginatedList.PaginatedList`
229         """
230         return github.PaginatedList.PaginatedList(
231             github.GitReleaseAsset.GitReleaseAsset,
232             self._requester,
233             self.url + "/assets",
234             None
235         )
236 
237     def _initAttributes(self):
238         self._id = github.GithubObject.NotSet
239         self._body = github.GithubObject.NotSet
240         self._title = github.GithubObject.NotSet
241         self._tag_name = github.GithubObject.NotSet
242         self._target_commitish = github.GithubObject.NotSet
243         self._draft = github.GithubObject.NotSet
244         self._prerelease = github.GithubObject.NotSet
245         self._author = github.GithubObject.NotSet
246         self._url = github.GithubObject.NotSet
247         self._upload_url = github.GithubObject.NotSet
248         self._html_url = github.GithubObject.NotSet
249         self._created_at = github.GithubObject.NotSet
250         self._published_at = github.GithubObject.NotSet
251         self._tarball_url = github.GithubObject.NotSet
252         self._zipball_url = github.GithubObject.NotSet
253 
254     def _useAttributes(self, attributes):
255         if "id" in attributes:
256             self._id = self._makeIntAttribute(attributes["id"])
257         if "body" in attributes:
258             self._body = self._makeStringAttribute(attributes["body"])
259         if "name" in attributes:
260             self._title = self._makeStringAttribute(attributes["name"])
261         if "tag_name" in attributes:
262             self._tag_name = self._makeStringAttribute(attributes["tag_name"])
263         if "target_commitish" in attributes:
264             self._target_commitish = self._makeStringAttribute(attributes["target_commitish"])
265         if "draft" in attributes:
266             self._draft = self._makeBoolAttribute(attributes["draft"])
267         if "prerelease" in attributes:
268             self._prerelease = self._makeBoolAttribute(attributes["prerelease"])
269         if "author" in attributes:
270             self._author = self._makeClassAttribute(github.GitAuthor.GitAuthor, attributes["author"])
271         if "url" in attributes:
272             self._url = self._makeStringAttribute(attributes["url"])
273         if "upload_url" in attributes:
274             self._upload_url = self._makeStringAttribute(attributes["upload_url"])
275         if "html_url" in attributes:
276             self._html_url = self._makeStringAttribute(attributes["html_url"])
277         if "created_at" in attributes:
278             self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
279         if "published_at" in attributes:
280             self._published_at = self._makeDatetimeAttribute(attributes["published_at"])
281         if "tarball_url" in attributes:
282             self._tarball_url = self._makeStringAttribute(attributes["tarball_url"])
283         if "zipball_url" in attributes:
284             self._zipball_url = self._makeStringAttribute(attributes["zipball_url"])
285
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/github/GitRelease.py b/github/GitRelease.py
--- a/github/GitRelease.py
+++ b/github/GitRelease.py
@@ -175,22 +175,36 @@
             self.url
         )
 
-    def update_release(self, name, message, draft=False, prerelease=False):
+    def update_release(self, name, message, draft=False, prerelease=False,
+                       tag_name=github.GithubObject.NotSet,
+                       target_commitish=github.GithubObject.NotSet):
         """
         :calls: `PATCH /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#edit-a-release>`_
         :rtype: :class:`github.GitRelease.GitRelease`
         """
+        assert tag_name is github.GithubObject.NotSet              \
+            or isinstance(tag_name, (str, unicode)),               \
+            'tag_name must be a str/unicode object'
+        assert target_commitish is github.GithubObject.NotSet      \
+            or isinstance(target_commitish, (str, unicode)),       \
+            'target_commitish must be a str/unicode object'
         assert isinstance(name, (str, unicode)), name
         assert isinstance(message, (str, unicode)), message
         assert isinstance(draft, bool), draft
         assert isinstance(prerelease, bool), prerelease
+        if tag_name is github.GithubObject.NotSet:
+            tag_name = self.tag_name
         post_parameters = {
-            "tag_name": self.tag_name,
+            "tag_name": tag_name,
             "name": name,
             "body": message,
             "draft": draft,
             "prerelease": prerelease,
         }
+        # Do not set target_commitish to self.target_commitish when ommited, just don't send it
+        # alltogether in that case, in order to match the Github API behaviour. Only send it when set.
+        if target_commitish is not github.GithubObject.NotSet:
+            post_parameters['target_commitish'] = target_commitish
         headers, data = self._requester.requestJsonAndCheck(
             "PATCH",
             self.url,

{"golden_diff": "diff --git a/github/GitRelease.py b/github/GitRelease.py\n--- a/github/GitRelease.py\n+++ b/github/GitRelease.py\n@@ -175,22 +175,36 @@\n             self.url\n         )\n \n-    def update_release(self, name, message, draft=False, prerelease=False):\n+    def update_release(self, name, message, draft=False, prerelease=False,\n+                       tag_name=github.GithubObject.NotSet,\n+                       target_commitish=github.GithubObject.NotSet):\n         \"\"\"\n         :calls: `PATCH /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#edit-a-release>`_\n         :rtype: :class:`github.GitRelease.GitRelease`\n         \"\"\"\n+        assert tag_name is github.GithubObject.NotSet              \\\n+            or isinstance(tag_name, (str, unicode)),               \\\n+            'tag_name must be a str/unicode object'\n+        assert target_commitish is github.GithubObject.NotSet      \\\n+            or isinstance(target_commitish, (str, unicode)),       \\\n+            'target_commitish must be a str/unicode object'\n         assert isinstance(name, (str, unicode)), name\n         assert isinstance(message, (str, unicode)), message\n         assert isinstance(draft, bool), draft\n         assert isinstance(prerelease, bool), prerelease\n+        if tag_name is github.GithubObject.NotSet:\n+            tag_name = self.tag_name\n         post_parameters = {\n-            \"tag_name\": self.tag_name,\n+            \"tag_name\": tag_name,\n             \"name\": name,\n             \"body\": message,\n             \"draft\": draft,\n             \"prerelease\": prerelease,\n         }\n+        # Do not set target_commitish to self.target_commitish when ommited, just don't send it\n+        # alltogether in that case, in order to match the Github API behaviour. Only send it when set.\n+        if target_commitish is not github.GithubObject.NotSet:\n+            post_parameters['target_commitish'] = target_commitish\n         headers, data = self._requester.requestJsonAndCheck(\n             \"PATCH\",\n             self.url,\n", "issue": "Allow updating tag_name and target_commitish of GitRelease\nGitHub API [allows updating](https://developer.github.com/v3/repos/releases/#edit-a-release) `tag_name` and `target_commitish` of a release, among `name`, `body`, `draft` and `prerelease`, but PyGithub API wrapper allows updating all of them but  `tag_name` and `target_commitish`:\r\n\r\nhttps://github.com/PyGithub/PyGithub/blob/e389396405146bb1b0c4587de1f6f757a9514a43/github/GitRelease.py#L178-L199\r\n\r\nCould we add `tag_name` and `target_commitish` parameters to that function?\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n############################ Copyrights and license ############################\n#                                                                              #\n# Copyright 2015 Ed Holland <eholland@alertlogic.com>                          #\n# Copyright 2016 Benjamin Whitney <benjamin.whitney@ironnetcybersecurity.com>  #\n# Copyright 2016 Jannis Gebauer <ja.geb@me.com>                                #\n# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #\n# Copyright 2017 Chris McBride <thehighlander@users.noreply.github.com>        #\n# Copyright 2017 Simon <spam@esemi.ru>                                         #\n# Copyright 2018 Shinichi TAMURA <shnch.tmr@gmail.com>                         #\n# Copyright 2018 Wan Liuyang <tsfdye@gmail.com>                                #\n# Copyright 2018 edquist <edquist@users.noreply.github.com>                    #\n# Copyright 2018 sfdye <tsfdye@gmail.com>                                      #\n#                                                                              #\n# This file is part of PyGithub.                                               #\n# http://pygithub.readthedocs.io/                                              #\n#                                                                              #\n# PyGithub is free software: you can redistribute it and/or modify it under    #\n# the terms of the GNU Lesser General Public License as published by the Free  #\n# Software Foundation, either version 3 of the License, or (at your option)    #\n# any later version.                                                           #\n#                                                                              #\n# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #\n# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #\n# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #\n# details.                                                                     #\n#                                                                              #\n# You should have received a copy of the GNU Lesser General Public License     #\n# along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #\n#                                                                              #\n################################################################################\n\nfrom os.path import basename\nimport github.GithubObject\nimport github.GitAuthor\nimport github.GitReleaseAsset\n\n\nclass GitRelease(github.GithubObject.CompletableGithubObject):\n    \"\"\"\n    This class represents GitReleases. The reference can be found here https://developer.github.com/v3/repos/releases\n    \"\"\"\n\n    def __repr__(self):\n        return self.get__repr__({\"title\": self._title.value})\n\n    @property\n    def id(self):\n        \"\"\"\n        :type: integer\n        \"\"\"\n        self._completeIfNotSet(self._id)\n        return self._id.value\n\n    @property\n    def body(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._body)\n        return self._body.value\n\n    @property\n    def title(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._title)\n        return self._title.value\n\n    @property\n    def tag_name(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._tag_name)\n        return self._tag_name.value\n\n    @property\n    def target_commitish(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._target_commitish)\n        return self._target_commitish.value\n\n    @property\n    def draft(self):\n        \"\"\"\n        :type: bool\n        \"\"\"\n        self._completeIfNotSet(self._draft)\n        return self._draft.value\n\n    @property\n    def prerelease(self):\n        \"\"\"\n        :type: bool\n        \"\"\"\n        self._completeIfNotSet(self._prerelease)\n        return self._prerelease.value\n\n    @property\n    def author(self):\n        \"\"\"\n        :type: :class:`github.GitAuthor.GitAuthor`\n        \"\"\"\n        self._completeIfNotSet(self._author)\n        return self._author.value\n\n    @property\n    def created_at(self):\n        \"\"\"\n        :type: datetime.datetime\n        \"\"\"\n        self._completeIfNotSet(self._created_at)\n        return self._created_at.value\n\n    @property\n    def published_at(self):\n        \"\"\"\n        :type: datetime.datetime\n        \"\"\"\n        self._completeIfNotSet(self._published_at)\n        return self._published_at.value\n\n    @property\n    def url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._url)\n        return self._url.value\n\n    @property\n    def upload_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._upload_url)\n        return self._upload_url.value\n\n    @property\n    def html_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._html_url)\n        return self._html_url.value\n\n    @property\n    def tarball_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._tarball_url)\n        return self._tarball_url.value\n\n    @property\n    def zipball_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._zipball_url)\n        return self._zipball_url.value\n\n    def delete_release(self):\n        \"\"\"\n        :calls: `DELETE /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#delete-a-release>`_\n        :rtype: None\n        \"\"\"\n        headers, data = self._requester.requestJsonAndCheck(\n            \"DELETE\",\n            self.url\n        )\n\n    def update_release(self, name, message, draft=False, prerelease=False):\n        \"\"\"\n        :calls: `PATCH /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#edit-a-release>`_\n        :rtype: :class:`github.GitRelease.GitRelease`\n        \"\"\"\n        assert isinstance(name, (str, unicode)), name\n        assert isinstance(message, (str, unicode)), message\n        assert isinstance(draft, bool), draft\n        assert isinstance(prerelease, bool), prerelease\n        post_parameters = {\n            \"tag_name\": self.tag_name,\n            \"name\": name,\n            \"body\": message,\n            \"draft\": draft,\n            \"prerelease\": prerelease,\n        }\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PATCH\",\n            self.url,\n            input=post_parameters\n        )\n        return github.GitRelease.GitRelease(self._requester, headers, data, completed=True)\n\n    def upload_asset(self, path, label=\"\", content_type=\"\"):\n        \"\"\"\n        :calls: `POST https://<upload_url>/repos/:owner/:repo/releases/:release_id/assets?name=foo.zip <https://developer.github.com/v3/repos/releases/#upload-a-release-asset>`_\n        :rtype: :class:`github.GitReleaseAsset.GitReleaseAsset`\n        \"\"\"\n        assert isinstance(path, (str, unicode)), path\n        assert isinstance(label, (str, unicode)), label\n\n        post_parameters = {\n            \"name\": basename(path),\n            \"label\": label\n        }\n        headers = {}\n        if len(content_type) > 0:\n            headers[\"Content-Type\"] = content_type\n        resp_headers, data = self._requester.requestBlobAndCheck(\n            \"POST\",\n            self.upload_url.split(\"{?\")[0],\n            parameters=post_parameters,\n            headers=headers,\n            input=path\n        )\n        return github.GitReleaseAsset.GitReleaseAsset(self._requester, resp_headers, data, completed=True)\n\n    def get_assets(self):\n        \"\"\"\n        :calls: `GET /repos/:owner/:repo/releases/:release_id/assets <https://developer.github.com/v3/repos/releases/#list-assets-for-a-release>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.GitReleaseAsset.GitReleaseAsset,\n            self._requester,\n            self.url + \"/assets\",\n            None\n        )\n\n    def _initAttributes(self):\n        self._id = github.GithubObject.NotSet\n        self._body = github.GithubObject.NotSet\n        self._title = github.GithubObject.NotSet\n        self._tag_name = github.GithubObject.NotSet\n        self._target_commitish = github.GithubObject.NotSet\n        self._draft = github.GithubObject.NotSet\n        self._prerelease = github.GithubObject.NotSet\n        self._author = github.GithubObject.NotSet\n        self._url = github.GithubObject.NotSet\n        self._upload_url = github.GithubObject.NotSet\n        self._html_url = github.GithubObject.NotSet\n        self._created_at = github.GithubObject.NotSet\n        self._published_at = github.GithubObject.NotSet\n        self._tarball_url = github.GithubObject.NotSet\n        self._zipball_url = github.GithubObject.NotSet\n\n    def _useAttributes(self, attributes):\n        if \"id\" in attributes:\n            self._id = self._makeIntAttribute(attributes[\"id\"])\n        if \"body\" in attributes:\n            self._body = self._makeStringAttribute(attributes[\"body\"])\n        if \"name\" in attributes:\n            self._title = self._makeStringAttribute(attributes[\"name\"])\n        if \"tag_name\" in attributes:\n            self._tag_name = self._makeStringAttribute(attributes[\"tag_name\"])\n        if \"target_commitish\" in attributes:\n            self._target_commitish = self._makeStringAttribute(attributes[\"target_commitish\"])\n        if \"draft\" in attributes:\n            self._draft = self._makeBoolAttribute(attributes[\"draft\"])\n        if \"prerelease\" in attributes:\n            self._prerelease = self._makeBoolAttribute(attributes[\"prerelease\"])\n        if \"author\" in attributes:\n            self._author = self._makeClassAttribute(github.GitAuthor.GitAuthor, attributes[\"author\"])\n        if \"url\" in attributes:\n            self._url = self._makeStringAttribute(attributes[\"url\"])\n        if \"upload_url\" in attributes:\n            self._upload_url = self._makeStringAttribute(attributes[\"upload_url\"])\n        if \"html_url\" in attributes:\n            self._html_url = self._makeStringAttribute(attributes[\"html_url\"])\n        if \"created_at\" in attributes:\n            self._created_at = self._makeDatetimeAttribute(attributes[\"created_at\"])\n        if \"published_at\" in attributes:\n            self._published_at = self._makeDatetimeAttribute(attributes[\"published_at\"])\n        if \"tarball_url\" in attributes:\n            self._tarball_url = self._makeStringAttribute(attributes[\"tarball_url\"])\n        if \"zipball_url\" in attributes:\n            self._zipball_url = self._makeStringAttribute(attributes[\"zipball_url\"])\n", "path": "github/GitRelease.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n############################ Copyrights and license ############################\n#                                                                              #\n# Copyright 2015 Ed Holland <eholland@alertlogic.com>                          #\n# Copyright 2016 Benjamin Whitney <benjamin.whitney@ironnetcybersecurity.com>  #\n# Copyright 2016 Jannis Gebauer <ja.geb@me.com>                                #\n# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #\n# Copyright 2017 Chris McBride <thehighlander@users.noreply.github.com>        #\n# Copyright 2017 Simon <spam@esemi.ru>                                         #\n# Copyright 2018 Shinichi TAMURA <shnch.tmr@gmail.com>                         #\n# Copyright 2018 Wan Liuyang <tsfdye@gmail.com>                                #\n# Copyright 2018 edquist <edquist@users.noreply.github.com>                    #\n# Copyright 2018 sfdye <tsfdye@gmail.com>                                      #\n#                                                                              #\n# This file is part of PyGithub.                                               #\n# http://pygithub.readthedocs.io/                                              #\n#                                                                              #\n# PyGithub is free software: you can redistribute it and/or modify it under    #\n# the terms of the GNU Lesser General Public License as published by the Free  #\n# Software Foundation, either version 3 of the License, or (at your option)    #\n# any later version.                                                           #\n#                                                                              #\n# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #\n# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #\n# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #\n# details.                                                                     #\n#                                                                              #\n# You should have received a copy of the GNU Lesser General Public License     #\n# along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #\n#                                                                              #\n################################################################################\n\nfrom os.path import basename\nimport github.GithubObject\nimport github.GitAuthor\nimport github.GitReleaseAsset\n\n\nclass GitRelease(github.GithubObject.CompletableGithubObject):\n    \"\"\"\n    This class represents GitReleases. The reference can be found here https://developer.github.com/v3/repos/releases\n    \"\"\"\n\n    def __repr__(self):\n        return self.get__repr__({\"title\": self._title.value})\n\n    @property\n    def id(self):\n        \"\"\"\n        :type: integer\n        \"\"\"\n        self._completeIfNotSet(self._id)\n        return self._id.value\n\n    @property\n    def body(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._body)\n        return self._body.value\n\n    @property\n    def title(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._title)\n        return self._title.value\n\n    @property\n    def tag_name(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._tag_name)\n        return self._tag_name.value\n\n    @property\n    def target_commitish(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._target_commitish)\n        return self._target_commitish.value\n\n    @property\n    def draft(self):\n        \"\"\"\n        :type: bool\n        \"\"\"\n        self._completeIfNotSet(self._draft)\n        return self._draft.value\n\n    @property\n    def prerelease(self):\n        \"\"\"\n        :type: bool\n        \"\"\"\n        self._completeIfNotSet(self._prerelease)\n        return self._prerelease.value\n\n    @property\n    def author(self):\n        \"\"\"\n        :type: :class:`github.GitAuthor.GitAuthor`\n        \"\"\"\n        self._completeIfNotSet(self._author)\n        return self._author.value\n\n    @property\n    def created_at(self):\n        \"\"\"\n        :type: datetime.datetime\n        \"\"\"\n        self._completeIfNotSet(self._created_at)\n        return self._created_at.value\n\n    @property\n    def published_at(self):\n        \"\"\"\n        :type: datetime.datetime\n        \"\"\"\n        self._completeIfNotSet(self._published_at)\n        return self._published_at.value\n\n    @property\n    def url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._url)\n        return self._url.value\n\n    @property\n    def upload_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._upload_url)\n        return self._upload_url.value\n\n    @property\n    def html_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._html_url)\n        return self._html_url.value\n\n    @property\n    def tarball_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._tarball_url)\n        return self._tarball_url.value\n\n    @property\n    def zipball_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._zipball_url)\n        return self._zipball_url.value\n\n    def delete_release(self):\n        \"\"\"\n        :calls: `DELETE /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#delete-a-release>`_\n        :rtype: None\n        \"\"\"\n        headers, data = self._requester.requestJsonAndCheck(\n            \"DELETE\",\n            self.url\n        )\n\n    def update_release(self, name, message, draft=False, prerelease=False,\n                       tag_name=github.GithubObject.NotSet,\n                       target_commitish=github.GithubObject.NotSet):\n        \"\"\"\n        :calls: `PATCH /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#edit-a-release>`_\n        :rtype: :class:`github.GitRelease.GitRelease`\n        \"\"\"\n        assert tag_name is github.GithubObject.NotSet              \\\n            or isinstance(tag_name, (str, unicode)),               \\\n            'tag_name must be a str/unicode object'\n        assert target_commitish is github.GithubObject.NotSet      \\\n            or isinstance(target_commitish, (str, unicode)),       \\\n            'target_commitish must be a str/unicode object'\n        assert isinstance(name, (str, unicode)), name\n        assert isinstance(message, (str, unicode)), message\n        assert isinstance(draft, bool), draft\n        assert isinstance(prerelease, bool), prerelease\n        if tag_name is github.GithubObject.NotSet:\n            tag_name = self.tag_name\n        post_parameters = {\n            \"tag_name\": tag_name,\n            \"name\": name,\n            \"body\": message,\n            \"draft\": draft,\n            \"prerelease\": prerelease,\n        }\n        # Do not set target_commitish to self.target_commitish when ommited, just don't send it\n        # alltogether in that case, in order to match the Github API behaviour. Only send it when set.\n        if target_commitish is not github.GithubObject.NotSet:\n            post_parameters['target_commitish'] = target_commitish\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PATCH\",\n            self.url,\n            input=post_parameters\n        )\n        return github.GitRelease.GitRelease(self._requester, headers, data, completed=True)\n\n    def upload_asset(self, path, label=\"\", content_type=\"\"):\n        \"\"\"\n        :calls: `POST https://<upload_url>/repos/:owner/:repo/releases/:release_id/assets?name=foo.zip <https://developer.github.com/v3/repos/releases/#upload-a-release-asset>`_\n        :rtype: :class:`github.GitReleaseAsset.GitReleaseAsset`\n        \"\"\"\n        assert isinstance(path, (str, unicode)), path\n        assert isinstance(label, (str, unicode)), label\n\n        post_parameters = {\n            \"name\": basename(path),\n            \"label\": label\n        }\n        headers = {}\n        if len(content_type) > 0:\n            headers[\"Content-Type\"] = content_type\n        resp_headers, data = self._requester.requestBlobAndCheck(\n            \"POST\",\n            self.upload_url.split(\"{?\")[0],\n            parameters=post_parameters,\n            headers=headers,\n            input=path\n        )\n        return github.GitReleaseAsset.GitReleaseAsset(self._requester, resp_headers, data, completed=True)\n\n    def get_assets(self):\n        \"\"\"\n        :calls: `GET /repos/:owner/:repo/releases/:release_id/assets <https://developer.github.com/v3/repos/releases/#list-assets-for-a-release>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.GitReleaseAsset.GitReleaseAsset,\n            self._requester,\n            self.url + \"/assets\",\n            None\n        )\n\n    def _initAttributes(self):\n        self._id = github.GithubObject.NotSet\n        self._body = github.GithubObject.NotSet\n        self._title = github.GithubObject.NotSet\n        self._tag_name = github.GithubObject.NotSet\n        self._target_commitish = github.GithubObject.NotSet\n        self._draft = github.GithubObject.NotSet\n        self._prerelease = github.GithubObject.NotSet\n        self._author = github.GithubObject.NotSet\n        self._url = github.GithubObject.NotSet\n        self._upload_url = github.GithubObject.NotSet\n        self._html_url = github.GithubObject.NotSet\n        self._created_at = github.GithubObject.NotSet\n        self._published_at = github.GithubObject.NotSet\n        self._tarball_url = github.GithubObject.NotSet\n        self._zipball_url = github.GithubObject.NotSet\n\n    def _useAttributes(self, attributes):\n        if \"id\" in attributes:\n            self._id = self._makeIntAttribute(attributes[\"id\"])\n        if \"body\" in attributes:\n            self._body = self._makeStringAttribute(attributes[\"body\"])\n        if \"name\" in attributes:\n            self._title = self._makeStringAttribute(attributes[\"name\"])\n        if \"tag_name\" in attributes:\n            self._tag_name = self._makeStringAttribute(attributes[\"tag_name\"])\n        if \"target_commitish\" in attributes:\n            self._target_commitish = self._makeStringAttribute(attributes[\"target_commitish\"])\n        if \"draft\" in attributes:\n            self._draft = self._makeBoolAttribute(attributes[\"draft\"])\n        if \"prerelease\" in attributes:\n            self._prerelease = self._makeBoolAttribute(attributes[\"prerelease\"])\n        if \"author\" in attributes:\n            self._author = self._makeClassAttribute(github.GitAuthor.GitAuthor, attributes[\"author\"])\n        if \"url\" in attributes:\n            self._url = self._makeStringAttribute(attributes[\"url\"])\n        if \"upload_url\" in attributes:\n            self._upload_url = self._makeStringAttribute(attributes[\"upload_url\"])\n        if \"html_url\" in attributes:\n            self._html_url = self._makeStringAttribute(attributes[\"html_url\"])\n        if \"created_at\" in attributes:\n            self._created_at = self._makeDatetimeAttribute(attributes[\"created_at\"])\n        if \"published_at\" in attributes:\n            self._published_at = self._makeDatetimeAttribute(attributes[\"published_at\"])\n        if \"tarball_url\" in attributes:\n            self._tarball_url = self._makeStringAttribute(attributes[\"tarball_url\"])\n        if \"zipball_url\" in attributes:\n            self._zipball_url = self._makeStringAttribute(attributes[\"zipball_url\"])\n", "path": "github/GitRelease.py"}]}