We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add an option to delete workflow runs
This worked for me:

```python
# get repo
repo = g.get_repo("repo name")

# list workflows
for workflow in repo.get_workflows():
    print("ID: '{}', Name: '{}', State: '{}'".format(workflow.id, workflow.name, workflow.state))

# get runs and delete workflow run: if workflow id match
for run in repo.get_workflow_runs():
    print("ID: '{}', Satus: '{}', Run Number: '{}', Workflow ID: '{}'".format(run.id, run.status, run.run_number, run.workflow_id))
    if run.workflow_id == xyz:
        print("delete ID: '{}'".format(run.workflow_id))
        repo._requester.requestJson("DELETE", run.url)  
```

Please add this into a function:
`repo._requester.requestJson("DELETE", run.url)  `


--- 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/WorkflowRun.py`
Content:
```
1 ############################ Copyrights and license ############################
2 #                                                                              #
3 # Copyright 2020 Steve Kowalik <steven@wedontsleep.org>                        #
4 #                                                                              #
5 # This file is part of PyGithub.                                               #
6 # http://pygithub.readthedocs.io/                                              #
7 #                                                                              #
8 # PyGithub is free software: you can redistribute it and/or modify it under    #
9 # the terms of the GNU Lesser General Public License as published by the Free  #
10 # Software Foundation, either version 3 of the License, or (at your option)    #
11 # any later version.                                                           #
12 #                                                                              #
13 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #
15 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
16 # details.                                                                     #
17 #                                                                              #
18 # You should have received a copy of the GNU Lesser General Public License     #
19 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #
20 #                                                                              #
21 ################################################################################
22 
23 from collections import namedtuple
24 
25 import github.GithubObject
26 import github.PullRequest
27 
28 
29 class WorkflowRun(github.GithubObject.CompletableGithubObject):
30     """
31     This class represents Workflow Runs. The reference can be found here https://docs.github.com/en/rest/reference/actions#workflow-runs
32     """
33 
34     def __repr__(self):
35         return self.get__repr__({"id": self._id.value, "url": self._url.value})
36 
37     @property
38     def id(self):
39         """
40         :type: int
41         """
42         self._completeIfNotSet(self._id)
43         return self._id.value
44 
45     @property
46     def head_branch(self):
47         """
48         :type: string
49         """
50         self._completeIfNotSet(self._head_branch)
51         return self._head_branch.value
52 
53     @property
54     def head_sha(self):
55         """
56         :type: string
57         """
58         self._completeIfNotSet(self._head_sha)
59         return self._head_sha.value
60 
61     @property
62     def run_number(self):
63         """
64         :type: int
65         """
66         self._completeIfNotSet(self._run_number)
67         return self._run_number.value
68 
69     @property
70     def event(self):
71         """
72         :type: string
73         """
74         self._completeIfNotSet(self._event)
75         return self._event.value
76 
77     @property
78     def status(self):
79         """
80         :type: string
81         """
82         self._completeIfNotSet(self._status)
83         return self._status.value
84 
85     @property
86     def conclusion(self):
87         """
88         :type: string
89         """
90         self._completeIfNotSet(self._conclusion)
91         return self._conclusion.value
92 
93     @property
94     def workflow_id(self):
95         """
96         :type: int
97         """
98         self._completeIfNotSet(self._workflow_id)
99         return self._workflow_id.value
100 
101     @property
102     def url(self):
103         """
104         :type: string
105         """
106         self._completeIfNotSet(self._url)
107         return self._url.value
108 
109     @property
110     def html_url(self):
111         """
112         :type: string
113         """
114         self._completeIfNotSet(self._html_url)
115         return self._html_url.value
116 
117     @property
118     def pull_requests(self):
119         """
120         :type: list of :class:`github.PullRequest.PullRequest`
121         """
122         self._completeIfNotSet(self._pull_requests)
123         return self._pull_requests.value
124 
125     @property
126     def created_at(self):
127         """
128         :type: datetime.datetime
129         """
130         self._completeIfNotSet(self._created_at)
131         return self._created_at.value
132 
133     @property
134     def updated_at(self):
135         """
136         :type: datetime.datetime
137         """
138         self._completeIfNotSet(self._updated_at)
139         return self._updated_at.value
140 
141     @property
142     def jobs_url(self):
143         """
144         :type: string
145         """
146         self._completeIfNotSet(self._jobs_url)
147         return self._jobs_url.value
148 
149     @property
150     def logs_url(self):
151         """
152         :type: string
153         """
154         self._completeIfNotSet(self._logs_url)
155         return self._logs_url.value
156 
157     @property
158     def check_suite_url(self):
159         """
160         :type: string
161         """
162         self._completeIfNotSet(self._check_suite_url)
163         return self._check_suite_url.value
164 
165     @property
166     def artifacts_url(self):
167         """
168         :type: string
169         """
170         self._completeIfNotSet(self._artifacts_url)
171         return self._artifacts_url.value
172 
173     @property
174     def cancel_url(self):
175         """
176         :type: string
177         """
178         self._completeIfNotSet(self._cancel_url)
179         return self._cancel_url.value
180 
181     @property
182     def rerun_url(self):
183         """
184         :type: string
185         """
186         self._completeIfNotSet(self._rerun_url)
187         return self._rerun_url.value
188 
189     @property
190     def workflow_url(self):
191         """
192         :type: string
193         """
194         self._completeIfNotSet(self._workflow_url)
195         return self._workflow_url.value
196 
197     @property
198     def head_commit(self):
199         """
200         :type: :class:`github.GitCommit.GitCommit`
201         """
202         self._completeIfNotSet(self._head_commit)
203         return self._head_commit.value
204 
205     @property
206     def repository(self):
207         """
208         :type: :class:`github.Repository.Repository`
209         """
210         self._completeIfNotSet(self._repository)
211         return self._repository.value
212 
213     @property
214     def head_repository(self):
215         """
216         :type: :class:`github.Repository.Repository`
217         """
218         self._completeIfNotSet(self._head_repository)
219         return self._head_repository.value
220 
221     def cancel(self):
222         """
223         :calls: `POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_
224         :rtype: bool
225         """
226         status, _, _ = self._requester.requestJson("POST", self.cancel_url)
227         return status == 202
228 
229     def rerun(self):
230         """
231         :calls: `POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_
232         :rtype: bool
233         """
234         status, _, _ = self._requester.requestJson("POST", self.rerun_url)
235         return status == 201
236 
237     def timing(self):
238         """
239         :calls: `GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_
240         :rtype: namedtuple with billable and run_duration_ms members
241         """
242         headers, data = self._requester.requestJsonAndCheck("GET", f"{self.url}/timing")
243         timingdata = namedtuple("TimingData", data.keys())
244         return timingdata._make(data.values())
245 
246     def _initAttributes(self):
247         self._id = github.GithubObject.NotSet
248         self._head_branch = github.GithubObject.NotSet
249         self._head_sha = github.GithubObject.NotSet
250         self._run_number = github.GithubObject.NotSet
251         self._event = github.GithubObject.NotSet
252         self._status = github.GithubObject.NotSet
253         self._conclusion = github.GithubObject.NotSet
254         self._workflow_id = github.GithubObject.NotSet
255         self._url = github.GithubObject.NotSet
256         self._html_url = github.GithubObject.NotSet
257         self._pull_requests = github.GithubObject.NotSet
258         self._created_at = github.GithubObject.NotSet
259         self._updated_at = github.GithubObject.NotSet
260         self._jobs_url = github.GithubObject.NotSet
261         self._logs_url = github.GithubObject.NotSet
262         self._check_suite_url = github.GithubObject.NotSet
263         self._artifacts_url = github.GithubObject.NotSet
264         self._cancel_url = github.GithubObject.NotSet
265         self._rerun_url = github.GithubObject.NotSet
266         self._workflow_url = github.GithubObject.NotSet
267         self._head_commit = github.GithubObject.NotSet
268         self._repository = github.GithubObject.NotSet
269         self._head_repository = github.GithubObject.NotSet
270 
271     def _useAttributes(self, attributes):
272         if "id" in attributes:  # pragma no branch
273             self._id = self._makeIntAttribute(attributes["id"])
274         if "head_branch" in attributes:  # pragma no branch
275             self._head_branch = self._makeStringAttribute(attributes["head_branch"])
276         if "head_sha" in attributes:  # pragma no branch
277             self._head_sha = self._makeStringAttribute(attributes["head_sha"])
278         if "run_number" in attributes:  # pragma no branch
279             self._run_number = self._makeIntAttribute(attributes["run_number"])
280         if "event" in attributes:  # pragma no branch
281             self._event = self._makeStringAttribute(attributes["event"])
282         if "status" in attributes:  # pragma no branch
283             self._status = self._makeStringAttribute(attributes["status"])
284         if "conclusion" in attributes:  # pragma no branch
285             self._conclusion = self._makeStringAttribute(attributes["conclusion"])
286         if "workflow_id" in attributes:  # pragma no branch
287             self._workflow_id = self._makeIntAttribute(attributes["workflow_id"])
288         if "url" in attributes:  # pragma no branch
289             self._url = self._makeStringAttribute(attributes["url"])
290         if "html_url" in attributes:  # pragma no branch
291             self._html_url = self._makeStringAttribute(attributes["html_url"])
292         if "pull_requests" in attributes:  # pragma no branch
293             self._pull_requests = self._makeListOfClassesAttribute(
294                 github.PullRequest.PullRequest, attributes["pull_requests"]
295             )
296         if "created_at" in attributes:  # pragma no branch
297             self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
298         if "updated_at" in attributes:  # pragma no branch
299             self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
300         if "jobs_url" in attributes:  # pragma no branch
301             self._jobs_url = self._makeStringAttribute(attributes["jobs_url"])
302         if "logs_url" in attributes:  # pragma no branch
303             self._logs_url = self._makeStringAttribute(attributes["logs_url"])
304         if "check_suite_url" in attributes:  # pragma no branch
305             self._check_suite_url = self._makeStringAttribute(
306                 attributes["check_suite_url"]
307             )
308         if "artifacts_url" in attributes:  # pragma no branch
309             self._artifacts_url = self._makeStringAttribute(attributes["artifacts_url"])
310         if "cancel_url" in attributes:  # pragma no branch
311             self._cancel_url = self._makeStringAttribute(attributes["cancel_url"])
312         if "rerun_url" in attributes:  # pragma no branch
313             self._rerun_url = self._makeStringAttribute(attributes["rerun_url"])
314         if "workflow_url" in attributes:  # pragma no branch
315             self._workflow_url = self._makeStringAttribute(attributes["workflow_url"])
316         if "head_commit" in attributes:  # pragma no branch
317             self._head_commit = self._makeClassAttribute(
318                 github.GitCommit.GitCommit, attributes["head_commit"]
319             )
320         if "repository" in attributes:  # pragma no branch
321             self._repository = self._makeClassAttribute(
322                 github.Repository.Repository, attributes["repository"]
323             )
324         if "head_repository" in attributes:  # pragma no branch
325             self._head_repository = self._makeClassAttribute(
326                 github.Repository.Repository, attributes["head_repository"]
327             )
328
```
--- 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/WorkflowRun.py b/github/WorkflowRun.py
--- a/github/WorkflowRun.py
+++ b/github/WorkflowRun.py
@@ -243,6 +243,14 @@
         timingdata = namedtuple("TimingData", data.keys())
         return timingdata._make(data.values())
 
+    def delete(self):
+        """
+        :calls: `DELETE /repos/{owner}/{repo}/actions/runs/{run_id} <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_
+        :rtype: bool
+        """
+        status, _, _ = self._requester.requestJson("DELETE", self.url)
+        return status == 204
+
     def _initAttributes(self):
         self._id = github.GithubObject.NotSet
         self._head_branch = github.GithubObject.NotSet

{"golden_diff": "diff --git a/github/WorkflowRun.py b/github/WorkflowRun.py\n--- a/github/WorkflowRun.py\n+++ b/github/WorkflowRun.py\n@@ -243,6 +243,14 @@\n         timingdata = namedtuple(\"TimingData\", data.keys())\n         return timingdata._make(data.values())\n \n+    def delete(self):\n+        \"\"\"\n+        :calls: `DELETE /repos/{owner}/{repo}/actions/runs/{run_id} <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_\n+        :rtype: bool\n+        \"\"\"\n+        status, _, _ = self._requester.requestJson(\"DELETE\", self.url)\n+        return status == 204\n+\n     def _initAttributes(self):\n         self._id = github.GithubObject.NotSet\n         self._head_branch = github.GithubObject.NotSet\n", "issue": "Add an option to delete workflow runs\nThis worked for me:\r\n\r\n```python\r\n# get repo\r\nrepo = g.get_repo(\"repo name\")\r\n\r\n# list workflows\r\nfor workflow in repo.get_workflows():\r\n    print(\"ID: '{}', Name: '{}', State: '{}'\".format(workflow.id, workflow.name, workflow.state))\r\n\r\n# get runs and delete workflow run: if workflow id match\r\nfor run in repo.get_workflow_runs():\r\n    print(\"ID: '{}', Satus: '{}', Run Number: '{}', Workflow ID: '{}'\".format(run.id, run.status, run.run_number, run.workflow_id))\r\n    if run.workflow_id == xyz:\r\n        print(\"delete ID: '{}'\".format(run.workflow_id))\r\n        repo._requester.requestJson(\"DELETE\", run.url)  \r\n```\r\n\r\nPlease add this into a function:\r\n`repo._requester.requestJson(\"DELETE\", run.url)  `\r\n\n", "before_files": [{"content": "############################ Copyrights and license ############################\n#                                                                              #\n# Copyright 2020 Steve Kowalik <steven@wedontsleep.org>                        #\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 collections import namedtuple\n\nimport github.GithubObject\nimport github.PullRequest\n\n\nclass WorkflowRun(github.GithubObject.CompletableGithubObject):\n    \"\"\"\n    This class represents Workflow Runs. The reference can be found here https://docs.github.com/en/rest/reference/actions#workflow-runs\n    \"\"\"\n\n    def __repr__(self):\n        return self.get__repr__({\"id\": self._id.value, \"url\": self._url.value})\n\n    @property\n    def id(self):\n        \"\"\"\n        :type: int\n        \"\"\"\n        self._completeIfNotSet(self._id)\n        return self._id.value\n\n    @property\n    def head_branch(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._head_branch)\n        return self._head_branch.value\n\n    @property\n    def head_sha(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._head_sha)\n        return self._head_sha.value\n\n    @property\n    def run_number(self):\n        \"\"\"\n        :type: int\n        \"\"\"\n        self._completeIfNotSet(self._run_number)\n        return self._run_number.value\n\n    @property\n    def event(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._event)\n        return self._event.value\n\n    @property\n    def status(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._status)\n        return self._status.value\n\n    @property\n    def conclusion(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._conclusion)\n        return self._conclusion.value\n\n    @property\n    def workflow_id(self):\n        \"\"\"\n        :type: int\n        \"\"\"\n        self._completeIfNotSet(self._workflow_id)\n        return self._workflow_id.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 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 pull_requests(self):\n        \"\"\"\n        :type: list of :class:`github.PullRequest.PullRequest`\n        \"\"\"\n        self._completeIfNotSet(self._pull_requests)\n        return self._pull_requests.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 updated_at(self):\n        \"\"\"\n        :type: datetime.datetime\n        \"\"\"\n        self._completeIfNotSet(self._updated_at)\n        return self._updated_at.value\n\n    @property\n    def jobs_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._jobs_url)\n        return self._jobs_url.value\n\n    @property\n    def logs_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._logs_url)\n        return self._logs_url.value\n\n    @property\n    def check_suite_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._check_suite_url)\n        return self._check_suite_url.value\n\n    @property\n    def artifacts_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._artifacts_url)\n        return self._artifacts_url.value\n\n    @property\n    def cancel_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._cancel_url)\n        return self._cancel_url.value\n\n    @property\n    def rerun_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._rerun_url)\n        return self._rerun_url.value\n\n    @property\n    def workflow_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._workflow_url)\n        return self._workflow_url.value\n\n    @property\n    def head_commit(self):\n        \"\"\"\n        :type: :class:`github.GitCommit.GitCommit`\n        \"\"\"\n        self._completeIfNotSet(self._head_commit)\n        return self._head_commit.value\n\n    @property\n    def repository(self):\n        \"\"\"\n        :type: :class:`github.Repository.Repository`\n        \"\"\"\n        self._completeIfNotSet(self._repository)\n        return self._repository.value\n\n    @property\n    def head_repository(self):\n        \"\"\"\n        :type: :class:`github.Repository.Repository`\n        \"\"\"\n        self._completeIfNotSet(self._head_repository)\n        return self._head_repository.value\n\n    def cancel(self):\n        \"\"\"\n        :calls: `POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_\n        :rtype: bool\n        \"\"\"\n        status, _, _ = self._requester.requestJson(\"POST\", self.cancel_url)\n        return status == 202\n\n    def rerun(self):\n        \"\"\"\n        :calls: `POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_\n        :rtype: bool\n        \"\"\"\n        status, _, _ = self._requester.requestJson(\"POST\", self.rerun_url)\n        return status == 201\n\n    def timing(self):\n        \"\"\"\n        :calls: `GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_\n        :rtype: namedtuple with billable and run_duration_ms members\n        \"\"\"\n        headers, data = self._requester.requestJsonAndCheck(\"GET\", f\"{self.url}/timing\")\n        timingdata = namedtuple(\"TimingData\", data.keys())\n        return timingdata._make(data.values())\n\n    def _initAttributes(self):\n        self._id = github.GithubObject.NotSet\n        self._head_branch = github.GithubObject.NotSet\n        self._head_sha = github.GithubObject.NotSet\n        self._run_number = github.GithubObject.NotSet\n        self._event = github.GithubObject.NotSet\n        self._status = github.GithubObject.NotSet\n        self._conclusion = github.GithubObject.NotSet\n        self._workflow_id = github.GithubObject.NotSet\n        self._url = github.GithubObject.NotSet\n        self._html_url = github.GithubObject.NotSet\n        self._pull_requests = github.GithubObject.NotSet\n        self._created_at = github.GithubObject.NotSet\n        self._updated_at = github.GithubObject.NotSet\n        self._jobs_url = github.GithubObject.NotSet\n        self._logs_url = github.GithubObject.NotSet\n        self._check_suite_url = github.GithubObject.NotSet\n        self._artifacts_url = github.GithubObject.NotSet\n        self._cancel_url = github.GithubObject.NotSet\n        self._rerun_url = github.GithubObject.NotSet\n        self._workflow_url = github.GithubObject.NotSet\n        self._head_commit = github.GithubObject.NotSet\n        self._repository = github.GithubObject.NotSet\n        self._head_repository = github.GithubObject.NotSet\n\n    def _useAttributes(self, attributes):\n        if \"id\" in attributes:  # pragma no branch\n            self._id = self._makeIntAttribute(attributes[\"id\"])\n        if \"head_branch\" in attributes:  # pragma no branch\n            self._head_branch = self._makeStringAttribute(attributes[\"head_branch\"])\n        if \"head_sha\" in attributes:  # pragma no branch\n            self._head_sha = self._makeStringAttribute(attributes[\"head_sha\"])\n        if \"run_number\" in attributes:  # pragma no branch\n            self._run_number = self._makeIntAttribute(attributes[\"run_number\"])\n        if \"event\" in attributes:  # pragma no branch\n            self._event = self._makeStringAttribute(attributes[\"event\"])\n        if \"status\" in attributes:  # pragma no branch\n            self._status = self._makeStringAttribute(attributes[\"status\"])\n        if \"conclusion\" in attributes:  # pragma no branch\n            self._conclusion = self._makeStringAttribute(attributes[\"conclusion\"])\n        if \"workflow_id\" in attributes:  # pragma no branch\n            self._workflow_id = self._makeIntAttribute(attributes[\"workflow_id\"])\n        if \"url\" in attributes:  # pragma no branch\n            self._url = self._makeStringAttribute(attributes[\"url\"])\n        if \"html_url\" in attributes:  # pragma no branch\n            self._html_url = self._makeStringAttribute(attributes[\"html_url\"])\n        if \"pull_requests\" in attributes:  # pragma no branch\n            self._pull_requests = self._makeListOfClassesAttribute(\n                github.PullRequest.PullRequest, attributes[\"pull_requests\"]\n            )\n        if \"created_at\" in attributes:  # pragma no branch\n            self._created_at = self._makeDatetimeAttribute(attributes[\"created_at\"])\n        if \"updated_at\" in attributes:  # pragma no branch\n            self._updated_at = self._makeDatetimeAttribute(attributes[\"updated_at\"])\n        if \"jobs_url\" in attributes:  # pragma no branch\n            self._jobs_url = self._makeStringAttribute(attributes[\"jobs_url\"])\n        if \"logs_url\" in attributes:  # pragma no branch\n            self._logs_url = self._makeStringAttribute(attributes[\"logs_url\"])\n        if \"check_suite_url\" in attributes:  # pragma no branch\n            self._check_suite_url = self._makeStringAttribute(\n                attributes[\"check_suite_url\"]\n            )\n        if \"artifacts_url\" in attributes:  # pragma no branch\n            self._artifacts_url = self._makeStringAttribute(attributes[\"artifacts_url\"])\n        if \"cancel_url\" in attributes:  # pragma no branch\n            self._cancel_url = self._makeStringAttribute(attributes[\"cancel_url\"])\n        if \"rerun_url\" in attributes:  # pragma no branch\n            self._rerun_url = self._makeStringAttribute(attributes[\"rerun_url\"])\n        if \"workflow_url\" in attributes:  # pragma no branch\n            self._workflow_url = self._makeStringAttribute(attributes[\"workflow_url\"])\n        if \"head_commit\" in attributes:  # pragma no branch\n            self._head_commit = self._makeClassAttribute(\n                github.GitCommit.GitCommit, attributes[\"head_commit\"]\n            )\n        if \"repository\" in attributes:  # pragma no branch\n            self._repository = self._makeClassAttribute(\n                github.Repository.Repository, attributes[\"repository\"]\n            )\n        if \"head_repository\" in attributes:  # pragma no branch\n            self._head_repository = self._makeClassAttribute(\n                github.Repository.Repository, attributes[\"head_repository\"]\n            )\n", "path": "github/WorkflowRun.py"}], "after_files": [{"content": "############################ Copyrights and license ############################\n#                                                                              #\n# Copyright 2020 Steve Kowalik <steven@wedontsleep.org>                        #\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 collections import namedtuple\n\nimport github.GithubObject\nimport github.PullRequest\n\n\nclass WorkflowRun(github.GithubObject.CompletableGithubObject):\n    \"\"\"\n    This class represents Workflow Runs. The reference can be found here https://docs.github.com/en/rest/reference/actions#workflow-runs\n    \"\"\"\n\n    def __repr__(self):\n        return self.get__repr__({\"id\": self._id.value, \"url\": self._url.value})\n\n    @property\n    def id(self):\n        \"\"\"\n        :type: int\n        \"\"\"\n        self._completeIfNotSet(self._id)\n        return self._id.value\n\n    @property\n    def head_branch(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._head_branch)\n        return self._head_branch.value\n\n    @property\n    def head_sha(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._head_sha)\n        return self._head_sha.value\n\n    @property\n    def run_number(self):\n        \"\"\"\n        :type: int\n        \"\"\"\n        self._completeIfNotSet(self._run_number)\n        return self._run_number.value\n\n    @property\n    def event(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._event)\n        return self._event.value\n\n    @property\n    def status(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._status)\n        return self._status.value\n\n    @property\n    def conclusion(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._conclusion)\n        return self._conclusion.value\n\n    @property\n    def workflow_id(self):\n        \"\"\"\n        :type: int\n        \"\"\"\n        self._completeIfNotSet(self._workflow_id)\n        return self._workflow_id.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 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 pull_requests(self):\n        \"\"\"\n        :type: list of :class:`github.PullRequest.PullRequest`\n        \"\"\"\n        self._completeIfNotSet(self._pull_requests)\n        return self._pull_requests.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 updated_at(self):\n        \"\"\"\n        :type: datetime.datetime\n        \"\"\"\n        self._completeIfNotSet(self._updated_at)\n        return self._updated_at.value\n\n    @property\n    def jobs_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._jobs_url)\n        return self._jobs_url.value\n\n    @property\n    def logs_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._logs_url)\n        return self._logs_url.value\n\n    @property\n    def check_suite_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._check_suite_url)\n        return self._check_suite_url.value\n\n    @property\n    def artifacts_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._artifacts_url)\n        return self._artifacts_url.value\n\n    @property\n    def cancel_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._cancel_url)\n        return self._cancel_url.value\n\n    @property\n    def rerun_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._rerun_url)\n        return self._rerun_url.value\n\n    @property\n    def workflow_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._workflow_url)\n        return self._workflow_url.value\n\n    @property\n    def head_commit(self):\n        \"\"\"\n        :type: :class:`github.GitCommit.GitCommit`\n        \"\"\"\n        self._completeIfNotSet(self._head_commit)\n        return self._head_commit.value\n\n    @property\n    def repository(self):\n        \"\"\"\n        :type: :class:`github.Repository.Repository`\n        \"\"\"\n        self._completeIfNotSet(self._repository)\n        return self._repository.value\n\n    @property\n    def head_repository(self):\n        \"\"\"\n        :type: :class:`github.Repository.Repository`\n        \"\"\"\n        self._completeIfNotSet(self._head_repository)\n        return self._head_repository.value\n\n    def cancel(self):\n        \"\"\"\n        :calls: `POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_\n        :rtype: bool\n        \"\"\"\n        status, _, _ = self._requester.requestJson(\"POST\", self.cancel_url)\n        return status == 202\n\n    def rerun(self):\n        \"\"\"\n        :calls: `POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_\n        :rtype: bool\n        \"\"\"\n        status, _, _ = self._requester.requestJson(\"POST\", self.rerun_url)\n        return status == 201\n\n    def timing(self):\n        \"\"\"\n        :calls: `GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_\n        :rtype: namedtuple with billable and run_duration_ms members\n        \"\"\"\n        headers, data = self._requester.requestJsonAndCheck(\"GET\", f\"{self.url}/timing\")\n        timingdata = namedtuple(\"TimingData\", data.keys())\n        return timingdata._make(data.values())\n\n    def delete(self):\n        \"\"\"\n        :calls: `DELETE /repos/{owner}/{repo}/actions/runs/{run_id} <https://docs.github.com/en/rest/reference/actions#workflow-runs>`_\n        :rtype: bool\n        \"\"\"\n        status, _, _ = self._requester.requestJson(\"DELETE\", self.url)\n        return status == 204\n\n    def _initAttributes(self):\n        self._id = github.GithubObject.NotSet\n        self._head_branch = github.GithubObject.NotSet\n        self._head_sha = github.GithubObject.NotSet\n        self._run_number = github.GithubObject.NotSet\n        self._event = github.GithubObject.NotSet\n        self._status = github.GithubObject.NotSet\n        self._conclusion = github.GithubObject.NotSet\n        self._workflow_id = github.GithubObject.NotSet\n        self._url = github.GithubObject.NotSet\n        self._html_url = github.GithubObject.NotSet\n        self._pull_requests = github.GithubObject.NotSet\n        self._created_at = github.GithubObject.NotSet\n        self._updated_at = github.GithubObject.NotSet\n        self._jobs_url = github.GithubObject.NotSet\n        self._logs_url = github.GithubObject.NotSet\n        self._check_suite_url = github.GithubObject.NotSet\n        self._artifacts_url = github.GithubObject.NotSet\n        self._cancel_url = github.GithubObject.NotSet\n        self._rerun_url = github.GithubObject.NotSet\n        self._workflow_url = github.GithubObject.NotSet\n        self._head_commit = github.GithubObject.NotSet\n        self._repository = github.GithubObject.NotSet\n        self._head_repository = github.GithubObject.NotSet\n\n    def _useAttributes(self, attributes):\n        if \"id\" in attributes:  # pragma no branch\n            self._id = self._makeIntAttribute(attributes[\"id\"])\n        if \"head_branch\" in attributes:  # pragma no branch\n            self._head_branch = self._makeStringAttribute(attributes[\"head_branch\"])\n        if \"head_sha\" in attributes:  # pragma no branch\n            self._head_sha = self._makeStringAttribute(attributes[\"head_sha\"])\n        if \"run_number\" in attributes:  # pragma no branch\n            self._run_number = self._makeIntAttribute(attributes[\"run_number\"])\n        if \"event\" in attributes:  # pragma no branch\n            self._event = self._makeStringAttribute(attributes[\"event\"])\n        if \"status\" in attributes:  # pragma no branch\n            self._status = self._makeStringAttribute(attributes[\"status\"])\n        if \"conclusion\" in attributes:  # pragma no branch\n            self._conclusion = self._makeStringAttribute(attributes[\"conclusion\"])\n        if \"workflow_id\" in attributes:  # pragma no branch\n            self._workflow_id = self._makeIntAttribute(attributes[\"workflow_id\"])\n        if \"url\" in attributes:  # pragma no branch\n            self._url = self._makeStringAttribute(attributes[\"url\"])\n        if \"html_url\" in attributes:  # pragma no branch\n            self._html_url = self._makeStringAttribute(attributes[\"html_url\"])\n        if \"pull_requests\" in attributes:  # pragma no branch\n            self._pull_requests = self._makeListOfClassesAttribute(\n                github.PullRequest.PullRequest, attributes[\"pull_requests\"]\n            )\n        if \"created_at\" in attributes:  # pragma no branch\n            self._created_at = self._makeDatetimeAttribute(attributes[\"created_at\"])\n        if \"updated_at\" in attributes:  # pragma no branch\n            self._updated_at = self._makeDatetimeAttribute(attributes[\"updated_at\"])\n        if \"jobs_url\" in attributes:  # pragma no branch\n            self._jobs_url = self._makeStringAttribute(attributes[\"jobs_url\"])\n        if \"logs_url\" in attributes:  # pragma no branch\n            self._logs_url = self._makeStringAttribute(attributes[\"logs_url\"])\n        if \"check_suite_url\" in attributes:  # pragma no branch\n            self._check_suite_url = self._makeStringAttribute(\n                attributes[\"check_suite_url\"]\n            )\n        if \"artifacts_url\" in attributes:  # pragma no branch\n            self._artifacts_url = self._makeStringAttribute(attributes[\"artifacts_url\"])\n        if \"cancel_url\" in attributes:  # pragma no branch\n            self._cancel_url = self._makeStringAttribute(attributes[\"cancel_url\"])\n        if \"rerun_url\" in attributes:  # pragma no branch\n            self._rerun_url = self._makeStringAttribute(attributes[\"rerun_url\"])\n        if \"workflow_url\" in attributes:  # pragma no branch\n            self._workflow_url = self._makeStringAttribute(attributes[\"workflow_url\"])\n        if \"head_commit\" in attributes:  # pragma no branch\n            self._head_commit = self._makeClassAttribute(\n                github.GitCommit.GitCommit, attributes[\"head_commit\"]\n            )\n        if \"repository\" in attributes:  # pragma no branch\n            self._repository = self._makeClassAttribute(\n                github.Repository.Repository, attributes[\"repository\"]\n            )\n        if \"head_repository\" in attributes:  # pragma no branch\n            self._head_repository = self._makeClassAttribute(\n                github.Repository.Repository, attributes[\"head_repository\"]\n            )\n", "path": "github/WorkflowRun.py"}]}