Draft Patched File Resource¶
Added in 2.0.4
Provides the patched file corresponding to a draft file diff.
Details¶
| Name | draft_patched_file |
| URI | /api/review-requests/{review_request_id}/draft/diffs/{diff_revision}/files/{filediff_id}/patched-file/ |
| Token Policy ID | draft_patched_file |
| HTTP Methods |
|
| Parent Resource | |
| Child Resources | None |
Links¶
Name |
Method |
Resource |
|---|---|---|
| self | GET |
HTTP GET¶
Returns the patched file.
The file is returned as text/plain and is the result of applying the patch to the original file.
Errors¶
| 100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
| 101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
| 103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
| 112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
| 113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
Examples¶
text/plain¶
$ curl https://reviews.example.com/api/review-requests/10/draft/diffs/3/files/47/patched-file/ -H "Accept: text/plain"
HTTP 200 OK
Content-Disposition: inline; filename=tests.py
Content-Length: 233
Content-Type: text/plain
ETag: dc91caada9afdba1e1ada830e16d5d728da75918
Last-Modified: Fri, 10 Aug 2018 22:16:56 GMT
Vary: Accept, Cookie
from unittest import TestCase
from myproject import initialize, frobnicate
class MyTests(TestCase):
def setUp(self):
initialize()
def test_frobnicate(self):
self.assertEqual(frobnicate(1), 'frobnication')