{"action":"created","comment":{"url":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/comments/52666490","id":52666490,"diff_hunk":"@@ -28,6 +29,122 @@ import (\n \t_ \"image/jpeg\"\n )\n \n+var placesNearbySearchAPI = &apiConfig{\n+\thost:            \"https://maps.googleapis.com\",\n+\tpath:            \"/maps/api/place/nearbysearch/json\",\n+\tacceptsClientID: true,\n+}\n+\n+// NearbySearch lets you search for places within a specified area. You can refine your search request by supplying keywords or specifying the type of place you are searching for.\n+func (c *Client) NearbySearch(ctx context.Context, r *NearbySearchRequest) (PlacesSearchResponse, error) {\n+\n+\tif r.PageToken == \"\" && r.Location == nil {\n+\t\treturn PlacesSearchResponse{}, errors.New(\"maps: Location and PageToken both missing\")\n+\t}\n+\n+\tif r.PageToken == \"\" && r.Radius > 0 && r.Rankby == RankbyDistance {\n+\t\treturn PlacesSearchResponse{}, errors.New(\"maps: Radius specified with RankbyDistance\")\n+\t}\n+\n+\tif r.Rankby == RankbyDistance && r.Keyword == \"\" && r.Name == \"\" && r.Type == \"\" {\n+\t\treturn PlacesSearchResponse{}, errors.New(\"maps: Rankby=distance and Keyword, Name and Type are missing\")\n+\t}\n+\n+\tvar response struct {\n+\t\tResults          []PlacesSearchResult `json:\"results\"`\n+\t\tHTMLAttributions []string             `json:\"html_attributions\"`\n+\t\tNextPageToken    string               `json:\"next_page_token\"`\n+\t\tcommonResponse\n+\t}\n+\n+\tif err := c.getJSON(ctx, placesNearbySearchAPI, r, &response); err != nil {\n+\t\treturn PlacesSearchResponse{}, err\n+\t}\n+\n+\tif err := response.StatusError(); err != nil {\n+\t\treturn PlacesSearchResponse{}, err\n+\t}\n+\n+\treturn PlacesSearchResponse{response.Results, response.HTMLAttributions, response.NextPageToken}, nil\n+\n+}\n+\n+func (r *NearbySearchRequest) params() url.Values {\n+\tq := make(url.Values)\n+\n+\tif r.Location != nil {\n+\t\tq.Set(\"location\", r.Location.String())\n+\t}\n+\n+\tif r.Radius != 0 {\n+\t\tq.Set(\"radius\", fmt.Sprint(r.Radius))\n+\t}\n+\n+\tif r.Keyword != \"\" {\n+\t\tq.Set(\"keyword\", r.Keyword)\n+\t}\n+\n+\tif r.Language != \"\" {\n+\t\tq.Set(\"language\", r.Language)\n+\t}\n+\n+\tif r.MinPrice != \"\" {\n+\t\tq.Set(\"minprice\", string(r.MinPrice))\n+\t}\n+\n+\tif r.MaxPrice != \"\" {\n+\t\tq.Set(\"maxprice\", string(r.MaxPrice))\n+\t}\n+\n+\tif r.Name != \"\" {\n+\t\tq.Set(\"name\", r.Name)\n+\t}\n+\n+\tif r.OpenNow {\n+\t\tq.Set(\"opennow\", \"true\")\n+\t}\n+\n+\tif r.Rankby != \"\" {\n+\t\tq.Set(\"rankby\", string(r.Rankby))\n+\t}\n+\n+\tif r.Type != \"\" {\n+\t\tq.Set(\"type\", string(r.Type))\n+\t}\n+\n+\tif r.PageToken != \"\" {\n+\t\tq.Set(\"pagetoken\", r.PageToken)\n+\t}\n+\n+\treturn q\n+}\n+\n+// NearbySearchRequest is the functional options struct for NearbySearch\n+type NearbySearchRequest struct {\n+\t// Location is the latitude/longitude around which to retrieve place information. If you specify a location parameter, you must also specify a radius parameter.\n+\tLocation *LatLng\n+\t// Radius defines the distance (in meters) within which to bias place results. The maximum allowed radius is 50,000 meters. Results inside of this region will be ranked higher than results outside of the search circle; however, prominent results from outside of the search radius may be included.\n+\tRadius uint\n+\t// Keyword is a term to be matched against all content that Google has indexed for this place, including but not limited to name, type, and address, as well as customer reviews and other third-party content.\n+\tKeyword string\n+\t// Language specifies the language in which to return results. Optional.\n+\tLanguage string\n+\t// MinPrice restricts results to only those places within the specified price level. Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive.\n+\tMinPrice PriceLevel\n+\t// MaxPrice restricts results to only those places within the specified price level. Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive.\n+\tMaxPrice PriceLevel\n+\t// Name is one or more terms to be matched against the names of places, separated with a space character.\n+\tName string\n+\t// OpenNow returns only those places that are open for business at the time the query is sent. Places that do not specify opening hours in the Google Places database will not be returned if you include this parameter in your query.\n+\tOpenNow bool\n+\t// Rankby specifies the order in which results are listed.","path":"places.go","position":120,"original_position":120,"commit_id":"c18be8a946ea11616a32373dc6a54f64bc83b42d","original_commit_id":"c18be8a946ea11616a32373dc6a54f64bc83b42d","user":{"login":"samthor","id":119184,"avatar_url":"https://avatars.githubusercontent.com/u/119184?v=3","gravatar_id":"","url":"https://api.github.com/users/samthor","html_url":"https://github.com/samthor","followers_url":"https://api.github.com/users/samthor/followers","following_url":"https://api.github.com/users/samthor/following{/other_user}","gists_url":"https://api.github.com/users/samthor/gists{/gist_id}","starred_url":"https://api.github.com/users/samthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samthor/subscriptions","organizations_url":"https://api.github.com/users/samthor/orgs","repos_url":"https://api.github.com/users/samthor/repos","events_url":"https://api.github.com/users/samthor/events{/privacy}","received_events_url":"https://api.github.com/users/samthor/received_events","type":"User","site_admin":false},"body":"Maybe `RankBy`?","created_at":"2016-02-11T21:05:12Z","updated_at":"2016-02-11T21:05:12Z","html_url":"https://github.com/googlemaps/google-maps-services-go/pull/61#discussion_r52666490","pull_request_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/61","_links":{"self":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/comments/52666490"},"html":{"href":"https://github.com/googlemaps/google-maps-services-go/pull/61#discussion_r52666490"},"pull_request":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/61"}}},"pull_request":{"url":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/61","id":58991222,"html_url":"https://github.com/googlemaps/google-maps-services-go/pull/61","diff_url":"https://github.com/googlemaps/google-maps-services-go/pull/61.diff","patch_url":"https://github.com/googlemaps/google-maps-services-go/pull/61.patch","issue_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/issues/61","number":61,"state":"open","locked":false,"title":"Places api updates","user":{"login":"domesticmouse","id":30503,"avatar_url":"https://avatars.githubusercontent.com/u/30503?v=3","gravatar_id":"","url":"https://api.github.com/users/domesticmouse","html_url":"https://github.com/domesticmouse","followers_url":"https://api.github.com/users/domesticmouse/followers","following_url":"https://api.github.com/users/domesticmouse/following{/other_user}","gists_url":"https://api.github.com/users/domesticmouse/gists{/gist_id}","starred_url":"https://api.github.com/users/domesticmouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domesticmouse/subscriptions","organizations_url":"https://api.github.com/users/domesticmouse/orgs","repos_url":"https://api.github.com/users/domesticmouse/repos","events_url":"https://api.github.com/users/domesticmouse/events{/privacy}","received_events_url":"https://api.github.com/users/domesticmouse/received_events","type":"User","site_admin":false},"body":"PTAL @samthor @markmcd \r\n\r\nDO NOT SUBMIT kthnxsbi =)","created_at":"2016-02-11T04:43:36Z","updated_at":"2016-02-11T21:05:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3407237ed9ce074b42fef82e8d73cb094169663e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/61/commits","review_comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/61/comments","review_comment_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/issues/61/comments","statuses_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/statuses/c18be8a946ea11616a32373dc6a54f64bc83b42d","head":{"label":"domesticmouse:places-api-updates","ref":"places-api-updates","sha":"c18be8a946ea11616a32373dc6a54f64bc83b42d","user":{"login":"domesticmouse","id":30503,"avatar_url":"https://avatars.githubusercontent.com/u/30503?v=3","gravatar_id":"","url":"https://api.github.com/users/domesticmouse","html_url":"https://github.com/domesticmouse","followers_url":"https://api.github.com/users/domesticmouse/followers","following_url":"https://api.github.com/users/domesticmouse/following{/other_user}","gists_url":"https://api.github.com/users/domesticmouse/gists{/gist_id}","starred_url":"https://api.github.com/users/domesticmouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domesticmouse/subscriptions","organizations_url":"https://api.github.com/users/domesticmouse/orgs","repos_url":"https://api.github.com/users/domesticmouse/repos","events_url":"https://api.github.com/users/domesticmouse/events{/privacy}","received_events_url":"https://api.github.com/users/domesticmouse/received_events","type":"User","site_admin":false},"repo":{"id":46540180,"name":"google-maps-services-go","full_name":"domesticmouse/google-maps-services-go","owner":{"login":"domesticmouse","id":30503,"avatar_url":"https://avatars.githubusercontent.com/u/30503?v=3","gravatar_id":"","url":"https://api.github.com/users/domesticmouse","html_url":"https://github.com/domesticmouse","followers_url":"https://api.github.com/users/domesticmouse/followers","following_url":"https://api.github.com/users/domesticmouse/following{/other_user}","gists_url":"https://api.github.com/users/domesticmouse/gists{/gist_id}","starred_url":"https://api.github.com/users/domesticmouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domesticmouse/subscriptions","organizations_url":"https://api.github.com/users/domesticmouse/orgs","repos_url":"https://api.github.com/users/domesticmouse/repos","events_url":"https://api.github.com/users/domesticmouse/events{/privacy}","received_events_url":"https://api.github.com/users/domesticmouse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/domesticmouse/google-maps-services-go","description":"Go client library for Google Maps API Web Services","fork":true,"url":"https://api.github.com/repos/domesticmouse/google-maps-services-go","forks_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/forks","keys_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/teams","hooks_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/hooks","issue_events_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/issues/events{/number}","events_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/events","assignees_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/assignees{/user}","branches_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/branches{/branch}","tags_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/tags","blobs_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/statuses/{sha}","languages_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/languages","stargazers_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/stargazers","contributors_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/contributors","subscribers_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/subscribers","subscription_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/subscription","commits_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/contents/{+path}","compare_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/merges","archive_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/downloads","issues_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/issues{/number}","pulls_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/pulls{/number}","milestones_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/milestones{/number}","notifications_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/labels{/name}","releases_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/releases{/id}","deployments_url":"https://api.github.com/repos/domesticmouse/google-maps-services-go/deployments","created_at":"2015-11-20T04:52:31Z","updated_at":"2016-02-10T03:29:15Z","pushed_at":"2016-02-11T04:37:31Z","git_url":"git://github.com/domesticmouse/google-maps-services-go.git","ssh_url":"git@github.com:domesticmouse/google-maps-services-go.git","clone_url":"https://github.com/domesticmouse/google-maps-services-go.git","svn_url":"https://github.com/domesticmouse/google-maps-services-go","homepage":"","size":369,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"googlemaps:master","ref":"master","sha":"d328d19e86225239321b7c21b2b3bb2e2e5482e1","user":{"login":"googlemaps","id":3717923,"avatar_url":"https://avatars.githubusercontent.com/u/3717923?v=3","gravatar_id":"","url":"https://api.github.com/users/googlemaps","html_url":"https://github.com/googlemaps","followers_url":"https://api.github.com/users/googlemaps/followers","following_url":"https://api.github.com/users/googlemaps/following{/other_user}","gists_url":"https://api.github.com/users/googlemaps/gists{/gist_id}","starred_url":"https://api.github.com/users/googlemaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlemaps/subscriptions","organizations_url":"https://api.github.com/users/googlemaps/orgs","repos_url":"https://api.github.com/users/googlemaps/repos","events_url":"https://api.github.com/users/googlemaps/events{/privacy}","received_events_url":"https://api.github.com/users/googlemaps/received_events","type":"Organization","site_admin":false},"repo":{"id":29164077,"name":"google-maps-services-go","full_name":"googlemaps/google-maps-services-go","owner":{"login":"googlemaps","id":3717923,"avatar_url":"https://avatars.githubusercontent.com/u/3717923?v=3","gravatar_id":"","url":"https://api.github.com/users/googlemaps","html_url":"https://github.com/googlemaps","followers_url":"https://api.github.com/users/googlemaps/followers","following_url":"https://api.github.com/users/googlemaps/following{/other_user}","gists_url":"https://api.github.com/users/googlemaps/gists{/gist_id}","starred_url":"https://api.github.com/users/googlemaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlemaps/subscriptions","organizations_url":"https://api.github.com/users/googlemaps/orgs","repos_url":"https://api.github.com/users/googlemaps/repos","events_url":"https://api.github.com/users/googlemaps/events{/privacy}","received_events_url":"https://api.github.com/users/googlemaps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googlemaps/google-maps-services-go","description":"Go client library for Google Maps API Web Services","fork":false,"url":"https://api.github.com/repos/googlemaps/google-maps-services-go","forks_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/forks","keys_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/teams","hooks_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/hooks","issue_events_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/issues/events{/number}","events_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/events","assignees_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/assignees{/user}","branches_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/branches{/branch}","tags_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/tags","blobs_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/statuses/{sha}","languages_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/languages","stargazers_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/stargazers","contributors_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/contributors","subscribers_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/subscribers","subscription_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/subscription","commits_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/contents/{+path}","compare_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/merges","archive_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/downloads","issues_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/issues{/number}","pulls_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls{/number}","milestones_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/milestones{/number}","notifications_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/labels{/name}","releases_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/releases{/id}","deployments_url":"https://api.github.com/repos/googlemaps/google-maps-services-go/deployments","created_at":"2015-01-13T00:21:15Z","updated_at":"2016-02-06T14:53:33Z","pushed_at":"2016-02-11T04:43:36Z","git_url":"git://github.com/googlemaps/google-maps-services-go.git","ssh_url":"git@github.com:googlemaps/google-maps-services-go.git","clone_url":"https://github.com/googlemaps/google-maps-services-go.git","svn_url":"https://github.com/googlemaps/google-maps-services-go","homepage":"","size":349,"stargazers_count":15,"watchers_count":15,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/61"},"html":{"href":"https://github.com/googlemaps/google-maps-services-go/pull/61"},"issue":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-go/issues/61"},"comments":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-go/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/61/comments"},"review_comment":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-go/pulls/61/commits"},"statuses":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-go/statuses/c18be8a946ea11616a32373dc6a54f64bc83b42d"}}}}