{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/comments/237624588","pull_request_review_id":179970496,"id":237624588,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzYyNDU4OA==","diff_hunk":"@@ -12,55 +12,67 @@\n # See the License for the specific language governing permissions and\n # limitations under the License.\n \n-def detect_image_properties project_id:, image_path:\n+require \"uri\"\n+\n+def detect_image_properties image_path:\n   # [START vision_image_property_detection]\n-  # project_id = \"Your Google Cloud project ID\"\n   # image_path = \"Path to local image file, eg. './image.png'\"\n-  \n+\n   require \"google/cloud/vision\"\n \n-  vision = Google::Cloud::Vision.new project: project_id\n-  image  = vision.image image_path\n+  image_annotator = Google::Cloud::Vision::ImageAnnotator.new\n \n-  image.properties.colors.each do |color|\n-    puts \"Color #{color.red}, #{color.green}, #{color.blue}\"\n+  response = image_annotator.image_properties_detection(\n+    image: image_path\n+  )\n+\n+  response.responses.each do |res|\n+    res.image_properties_annotation.dominant_colors.colors.each do |color|\n+      puts \"Color #{color.color.red}, #{color.color.green}, #{color.color.blue}\"","path":"vision/detect_image_properties.rb","position":null,"original_position":27,"commit_id":"0a567af79085d07932e339d43052493024b21636","original_commit_id":"fa6f6a2b1f1a471e593f4f3b88efb1b6181c00f3","user":{"login":"blowmage","id":730,"node_id":"MDQ6VXNlcjczMA==","avatar_url":"https://avatars0.githubusercontent.com/u/730?v=4","gravatar_id":"","url":"https://api.github.com/users/blowmage","html_url":"https://github.com/blowmage","followers_url":"https://api.github.com/users/blowmage/followers","following_url":"https://api.github.com/users/blowmage/following{/other_user}","gists_url":"https://api.github.com/users/blowmage/gists{/gist_id}","starred_url":"https://api.github.com/users/blowmage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blowmage/subscriptions","organizations_url":"https://api.github.com/users/blowmage/orgs","repos_url":"https://api.github.com/users/blowmage/repos","events_url":"https://api.github.com/users/blowmage/events{/privacy}","received_events_url":"https://api.github.com/users/blowmage/received_events","type":"User","site_admin":false},"body":"```ruby\r\nres.image_properties_annotation.dominant_colors.colors.map(&:color).each do |color|\r\n  puts \"Color #{color.red}, #{color.green}, #{color.blue}\"\r\nend\r\n```","created_at":"2018-11-29T19:21:29Z","updated_at":"2018-11-29T19:21:29Z","html_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/363#discussion_r237624588","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/363","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/comments/237624588"},"html":{"href":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/363#discussion_r237624588"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/363"}},"in_reply_to_id":237617565},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/363","id":227415050,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3NDE1MDUw","html_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/363","diff_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/363.diff","patch_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/363.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/363","number":363,"state":"open","locked":false,"title":"update samples to reflect new vision client and migration","user":{"login":"TheRoyalTnetennba","id":5883769,"node_id":"MDQ6VXNlcjU4ODM3Njk=","avatar_url":"https://avatars0.githubusercontent.com/u/5883769?v=4","gravatar_id":"","url":"https://api.github.com/users/TheRoyalTnetennba","html_url":"https://github.com/TheRoyalTnetennba","followers_url":"https://api.github.com/users/TheRoyalTnetennba/followers","following_url":"https://api.github.com/users/TheRoyalTnetennba/following{/other_user}","gists_url":"https://api.github.com/users/TheRoyalTnetennba/gists{/gist_id}","starred_url":"https://api.github.com/users/TheRoyalTnetennba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheRoyalTnetennba/subscriptions","organizations_url":"https://api.github.com/users/TheRoyalTnetennba/orgs","repos_url":"https://api.github.com/users/TheRoyalTnetennba/repos","events_url":"https://api.github.com/users/TheRoyalTnetennba/events{/privacy}","received_events_url":"https://api.github.com/users/TheRoyalTnetennba/received_events","type":"User","site_admin":false},"body":"To test, find and replace `Google::Cloud::Vision::ImageAnnotator` with `Google::Cloud::Vision::V1`.","created_at":"2018-10-31T19:31:01Z","updated_at":"2018-11-29T19:21:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"405bb8cca9dd41a0a58aca2ff9b31c986f8d90d9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":962869586,"node_id":"MDU6TGFiZWw5NjI4Njk1ODY=","url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/labels/cla:%20yes","name":"cla: yes","color":"1eaa64","default":false},{"id":935482843,"node_id":"MDU6TGFiZWw5MzU0ODI4NDM=","url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/labels/do-not-merge","name":"do-not-merge","color":"d93f0b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/363/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/363/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/363/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/statuses/0a567af79085d07932e339d43052493024b21636","head":{"label":"GoogleCloudPlatform:vision-migration","ref":"vision-migration","sha":"0a567af79085d07932e339d43052493024b21636","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":41501829,"node_id":"MDEwOlJlcG9zaXRvcnk0MTUwMTgyOQ==","name":"ruby-docs-samples","full_name":"GoogleCloudPlatform/ruby-docs-samples","private":false,"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},"html_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples","description":"Ruby samples for Google Cloud Platform products.","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/deployments","created_at":"2015-08-27T17:40:52Z","updated_at":"2018-11-28T19:59:41Z","pushed_at":"2018-11-29T19:19:17Z","git_url":"git://github.com/GoogleCloudPlatform/ruby-docs-samples.git","ssh_url":"git@github.com:GoogleCloudPlatform/ruby-docs-samples.git","clone_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples.git","svn_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples","homepage":"https://cloud.google.com/ruby","size":5469,"stargazers_count":117,"watchers_count":117,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":103,"mirror_url":null,"archived":false,"open_issues_count":21,"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":103,"open_issues":21,"watchers":117,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"c41037378f2e89fe029c6e008a9b49eedb5ce240","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":41501829,"node_id":"MDEwOlJlcG9zaXRvcnk0MTUwMTgyOQ==","name":"ruby-docs-samples","full_name":"GoogleCloudPlatform/ruby-docs-samples","private":false,"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},"html_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples","description":"Ruby samples for Google Cloud Platform products.","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/deployments","created_at":"2015-08-27T17:40:52Z","updated_at":"2018-11-28T19:59:41Z","pushed_at":"2018-11-29T19:19:17Z","git_url":"git://github.com/GoogleCloudPlatform/ruby-docs-samples.git","ssh_url":"git@github.com:GoogleCloudPlatform/ruby-docs-samples.git","clone_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples.git","svn_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples","homepage":"https://cloud.google.com/ruby","size":5469,"stargazers_count":117,"watchers_count":117,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":103,"mirror_url":null,"archived":false,"open_issues_count":21,"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":103,"open_issues":21,"watchers":117,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/363"},"html":{"href":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/363"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/363"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/363/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/363/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/363/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/statuses/0a567af79085d07932e339d43052493024b21636"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"blowmage"}}