{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/comments/215333885","pull_request_review_id":152574389,"id":215333885,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTMzMzg4NQ==","diff_hunk":"@@ -428,11 +443,49 @@ def update_revision(self, request):\n             version = self.revisions.get(int(generation))\n             if version is None:\n                 raise ErrorResponse(\n-                    'Precondition Failed: generation %s not found' % generation)\n+                    'Precondition Failed: generation %s not found' %\n+                    generation)\n         metadata = json.loads(request.data)\n         version.update_from_metadata(metadata)\n         return version\n \n+    def patch_revision(self, request):\n+        \"\"\"\n+        Patch the metadata of particular object revision or raise.\n+\n+        :param request:flask.Request\n+        :return:GcsObjectRevision the object revision.\n+        :raises:ErrorResponse if the request contains an invalid generation\n+            number.\n+        \"\"\"\n+        generation = request.args.get('generation')\n+        if generation is None:\n+            version = self.get_latest()\n+        else:\n+            version = self.revisions.get(int(generation))\n+            if version is None:\n+                raise ErrorResponse(\n+                    'Precondition Failed: generation %s not found' %\n+                    generation)\n+        patch = json.loads(request.data)\n+        writeable_keys = {\n+            'acl', 'cacheControl', 'contentDisposition', 'contentEncoding',\n+            'contentLanguage', 'contentType', 'metadata'\n+        }\n+        for key, value in patch.iteritems():\n+            if key not in writeable_keys:\n+                raise ErrorResponse(\n+                    'Invalid metadata change. %s is not writeable' % key,\n+                    status_code=503)\n+        # Recursively apply the patch to 'labels' because it is special.\n+        if patch.get('metadata') is not None:","path":"google/cloud/storage/tests/testbench.py","position":null,"original_position":93,"commit_id":"ae93067abfbc47502fa12c7d47b2c28e8d10dccd","original_commit_id":"f555a58e3ea25efd7d5d7fcbe154874ae751115d","user":{"login":"coryan","id":6241635,"node_id":"MDQ6VXNlcjYyNDE2MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/6241635?v=4","gravatar_id":"","url":"https://api.github.com/users/coryan","html_url":"https://github.com/coryan","followers_url":"https://api.github.com/users/coryan/followers","following_url":"https://api.github.com/users/coryan/following{/other_user}","gists_url":"https://api.github.com/users/coryan/gists{/gist_id}","starred_url":"https://api.github.com/users/coryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coryan/subscriptions","organizations_url":"https://api.github.com/users/coryan/orgs","repos_url":"https://api.github.com/users/coryan/repos","events_url":"https://api.github.com/users/coryan/events{/privacy}","received_events_url":"https://api.github.com/users/coryan/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2018-09-05T16:09:16Z","updated_at":"2018-09-05T16:09:16Z","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-cpp/pull/1072#discussion_r215333885","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/1072","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/comments/215333885"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-cpp/pull/1072#discussion_r215333885"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/1072"}},"in_reply_to_id":215110599},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/1072","id":212521763,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyNTIxNzYz","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-cpp/pull/1072","diff_url":"https://github.com/GoogleCloudPlatform/google-cloud-cpp/pull/1072.diff","patch_url":"https://github.com/GoogleCloudPlatform/google-cloud-cpp/pull/1072.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/issues/1072","number":1072,"state":"open","locked":false,"title":"Implement Client::PatchObject.","user":{"login":"coryan","id":6241635,"node_id":"MDQ6VXNlcjYyNDE2MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/6241635?v=4","gravatar_id":"","url":"https://api.github.com/users/coryan","html_url":"https://github.com/coryan","followers_url":"https://api.github.com/users/coryan/followers","following_url":"https://api.github.com/users/coryan/following{/other_user}","gists_url":"https://api.github.com/users/coryan/gists{/gist_id}","starred_url":"https://api.github.com/users/coryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coryan/subscriptions","organizations_url":"https://api.github.com/users/coryan/orgs","repos_url":"https://api.github.com/users/coryan/repos","events_url":"https://api.github.com/users/coryan/events{/privacy}","received_events_url":"https://api.github.com/users/coryan/received_events","type":"User","site_admin":false},"body":"This fixes #815. It implements the Patch API, the usual unit tests,\r\nexpands the integration tests to use the new API, adds examples, and\r\nruns the examples as part of the CI build.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/googlecloudplatform/google-cloud-cpp/1072)\n<!-- Reviewable:end -->\n","created_at":"2018-09-01T01:33:44Z","updated_at":"2018-09-05T16:09:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"560a4a39776009c51815179ff0d5a5e637ff1e4f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"frankyn","id":1907648,"node_id":"MDQ6VXNlcjE5MDc2NDg=","avatar_url":"https://avatars1.githubusercontent.com/u/1907648?v=4","gravatar_id":"","url":"https://api.github.com/users/frankyn","html_url":"https://github.com/frankyn","followers_url":"https://api.github.com/users/frankyn/followers","following_url":"https://api.github.com/users/frankyn/following{/other_user}","gists_url":"https://api.github.com/users/frankyn/gists{/gist_id}","starred_url":"https://api.github.com/users/frankyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankyn/subscriptions","organizations_url":"https://api.github.com/users/frankyn/orgs","repos_url":"https://api.github.com/users/frankyn/repos","events_url":"https://api.github.com/users/frankyn/events{/privacy}","received_events_url":"https://api.github.com/users/frankyn/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":760104389,"node_id":"MDU6TGFiZWw3NjAxMDQzODk=","url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/labels/cla:%20yes","name":"cla: yes","color":"0e8a16","default":false},{"id":921026962,"node_id":"MDU6TGFiZWw5MjEwMjY5NjI=","url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/labels/storage","name":"storage","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/1072/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/1072/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/issues/1072/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/statuses/ae93067abfbc47502fa12c7d47b2c28e8d10dccd","head":{"label":"coryan:implement-object-patch","ref":"implement-object-patch","sha":"ae93067abfbc47502fa12c7d47b2c28e8d10dccd","user":{"login":"coryan","id":6241635,"node_id":"MDQ6VXNlcjYyNDE2MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/6241635?v=4","gravatar_id":"","url":"https://api.github.com/users/coryan","html_url":"https://github.com/coryan","followers_url":"https://api.github.com/users/coryan/followers","following_url":"https://api.github.com/users/coryan/following{/other_user}","gists_url":"https://api.github.com/users/coryan/gists{/gist_id}","starred_url":"https://api.github.com/users/coryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coryan/subscriptions","organizations_url":"https://api.github.com/users/coryan/orgs","repos_url":"https://api.github.com/users/coryan/repos","events_url":"https://api.github.com/users/coryan/events{/privacy}","received_events_url":"https://api.github.com/users/coryan/received_events","type":"User","site_admin":false},"repo":{"id":111937615,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE5Mzc2MTU=","name":"google-cloud-cpp","full_name":"coryan/google-cloud-cpp","owner":{"login":"coryan","id":6241635,"node_id":"MDQ6VXNlcjYyNDE2MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/6241635?v=4","gravatar_id":"","url":"https://api.github.com/users/coryan","html_url":"https://github.com/coryan","followers_url":"https://api.github.com/users/coryan/followers","following_url":"https://api.github.com/users/coryan/following{/other_user}","gists_url":"https://api.github.com/users/coryan/gists{/gist_id}","starred_url":"https://api.github.com/users/coryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coryan/subscriptions","organizations_url":"https://api.github.com/users/coryan/orgs","repos_url":"https://api.github.com/users/coryan/repos","events_url":"https://api.github.com/users/coryan/events{/privacy}","received_events_url":"https://api.github.com/users/coryan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/coryan/google-cloud-cpp","description":"Google Cloud Platform C++ client libraries","fork":true,"url":"https://api.github.com/repos/coryan/google-cloud-cpp","forks_url":"https://api.github.com/repos/coryan/google-cloud-cpp/forks","keys_url":"https://api.github.com/repos/coryan/google-cloud-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coryan/google-cloud-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coryan/google-cloud-cpp/teams","hooks_url":"https://api.github.com/repos/coryan/google-cloud-cpp/hooks","issue_events_url":"https://api.github.com/repos/coryan/google-cloud-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/coryan/google-cloud-cpp/events","assignees_url":"https://api.github.com/repos/coryan/google-cloud-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/coryan/google-cloud-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/coryan/google-cloud-cpp/tags","blobs_url":"https://api.github.com/repos/coryan/google-cloud-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coryan/google-cloud-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coryan/google-cloud-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/coryan/google-cloud-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coryan/google-cloud-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/coryan/google-cloud-cpp/languages","stargazers_url":"https://api.github.com/repos/coryan/google-cloud-cpp/stargazers","contributors_url":"https://api.github.com/repos/coryan/google-cloud-cpp/contributors","subscribers_url":"https://api.github.com/repos/coryan/google-cloud-cpp/subscribers","subscription_url":"https://api.github.com/repos/coryan/google-cloud-cpp/subscription","commits_url":"https://api.github.com/repos/coryan/google-cloud-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/coryan/google-cloud-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/coryan/google-cloud-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/coryan/google-cloud-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/coryan/google-cloud-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/coryan/google-cloud-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coryan/google-cloud-cpp/merges","archive_url":"https://api.github.com/repos/coryan/google-cloud-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coryan/google-cloud-cpp/downloads","issues_url":"https://api.github.com/repos/coryan/google-cloud-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/coryan/google-cloud-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/coryan/google-cloud-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/coryan/google-cloud-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coryan/google-cloud-cpp/labels{/name}","releases_url":"https://api.github.com/repos/coryan/google-cloud-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/coryan/google-cloud-cpp/deployments","created_at":"2017-11-24T16:28:07Z","updated_at":"2018-09-03T03:46:29Z","pushed_at":"2018-09-05T16:06:12Z","git_url":"git://github.com/coryan/google-cloud-cpp.git","ssh_url":"git@github.com:coryan/google-cloud-cpp.git","clone_url":"https://github.com/coryan/google-cloud-cpp.git","svn_url":"https://github.com/coryan/google-cloud-cpp","homepage":"https://cloud.google.com/","size":96643,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"47804abd4741bb50ce0b1d7901bc562026369587","user":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":111860063,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE4NjAwNjM=","name":"google-cloud-cpp","full_name":"GoogleCloudPlatform/google-cloud-cpp","owner":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-cpp","description":"Google Cloud Client Library for C++","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/deployments","created_at":"2017-11-24T00:19:31Z","updated_at":"2018-09-05T14:10:58Z","pushed_at":"2018-09-05T16:06:24Z","git_url":"git://github.com/GoogleCloudPlatform/google-cloud-cpp.git","ssh_url":"git@github.com:GoogleCloudPlatform/google-cloud-cpp.git","clone_url":"https://github.com/GoogleCloudPlatform/google-cloud-cpp.git","svn_url":"https://github.com/GoogleCloudPlatform/google-cloud-cpp","homepage":"https://cloud.google.com/","size":90062,"stargazers_count":40,"watchers_count":40,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":152,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":30,"open_issues":152,"watchers":40,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/1072"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-cpp/pull/1072"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/issues/1072"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/issues/1072/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/1072/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/pulls/1072/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-cpp/statuses/ae93067abfbc47502fa12c7d47b2c28e8d10dccd"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"coryan"}}