Skip to content

Commit

Permalink
fix: remove old fields #201 (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaWong authored Oct 6, 2020
1 parent 9c4a66a commit f2f6eaa
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
20 changes: 0 additions & 20 deletions places.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,6 @@ type PlacesSearchResult struct {
Icon string `json:"icon,omitempty"`
// PlaceID is a textual identifier that uniquely identifies a place.
PlaceID string `json:"place_id,omitempty"`
// Scope indicates the scope of the PlaceID.
Scope string `json:"scope,omitempty"`
// Rating contains the place's rating, from 1.0 to 5.0, based on aggregated user
// reviews.
Rating float32 `json:"rating,omitempty"`
Expand All @@ -336,9 +334,6 @@ type PlacesSearchResult struct {
OpeningHours *OpeningHours `json:"opening_hours,omitempty"`
// Photos is an array of photo objects, each containing a reference to an image.
Photos []Photo `json:"photos,omitempty"`
// AltIDs — An array of zero, one or more alternative place IDs for the place, with
// a scope related to each alternative ID.
AltIDs []AltID `json:"alt_ids,omitempty"`
// PriceLevel is the price level of the place, on a scale of 0 to 4.
PriceLevel int `json:"price_level,omitempty"`
// Vicinity contains a feature name of a nearby location.
Expand All @@ -353,16 +348,6 @@ type PlacesSearchResult struct {
ID string `json:"id,omitempty"`
}

// AltID is the alternative place IDs for a place.
type AltID struct {
// PlaceID is the APP scoped Place ID that you received when you initially created
// this Place, before it was given a Google wide Place ID.
PlaceID string `json:"place_id,omitempty"`
// Scope is the scope of this alternative place ID. It will always be APP,
// indicating that the alternative place ID is recognised by your application only.
Scope string `json:"scope,omitempty"`
}

var placeDetailsAPI = &apiConfig{
host: "https://maps.googleapis.com",
path: "/maps/api/place/details/json",
Expand Down Expand Up @@ -469,8 +454,6 @@ type PlaceDetailsResult struct {
Icon string `json:"icon,omitempty"`
// PlaceID is a textual identifier that uniquely identifies a place.
PlaceID string `json:"place_id,omitempty"`
// Scope indicates the scope of the PlaceID.
Scope string `json:"scope,omitempty"`
// Rating contains the place's rating, from 1.0 to 5.0, based on aggregated user
// reviews.
Rating float32 `json:"rating,omitempty"`
Expand All @@ -482,9 +465,6 @@ type PlaceDetailsResult struct {
OpeningHours *OpeningHours `json:"opening_hours,omitempty"`
// Photos is an array of photo objects, each containing a reference to an image.
Photos []Photo `json:"photos,omitempty"`
// AltIDs — An array of zero, one or more alternative place IDs for the place, with
// a scope related to each alternative ID.
AltIDs []AltID `json:"alt_ids,omitempty"`
// PriceLevel is the price level of the place, on a scale of 0 to 4.
PriceLevel int `json:"price_level,omitempty"`
// Vicinity contains a feature name of a nearby location.
Expand Down
2 changes: 0 additions & 2 deletions places_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ func TestPlaceDetails(t *testing.T) {
"time" : 1441848853
}
],
"scope" : "GOOGLE",
"types" : [ "restaurant", "food", "point_of_interest", "establishment" ],
"url" : "https://plus.google.com/105746337161979416551/about?hl=en-US",
"user_ratings_total" : 275,
Expand Down Expand Up @@ -845,7 +844,6 @@ func TestPlaceDetailsUTCOffsetAbsent(t *testing.T) {
"place_id" : "ChIJ02qnq0KuEmsRHUJF4zo1x4I",
"price_level" : 4,
"rating" : 4.1,
"scope" : "GOOGLE",
"types" : [ "restaurant", "food", "point_of_interest", "establishment" ],
"url" : "https://plus.google.com/105746337161979416551/about?hl=en-US",
"user_ratings_total" : 275,
Expand Down
9 changes: 0 additions & 9 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ type PlaceDetailsFieldMask string
const (
PlaceDetailsFieldMaskAddressComponent = PlaceDetailsFieldMask("address_component")
PlaceDetailsFieldMaskADRAddress = PlaceDetailsFieldMask("adr_address")
PlaceDetailsFieldMaskAltID = PlaceDetailsFieldMask("alt_id")
PlaceDetailsFieldMaskBusinessStatus = PlaceDetailsFieldMask("business_status")
PlaceDetailsFieldMaskFormattedAddress = PlaceDetailsFieldMask("formatted_address")
PlaceDetailsFieldMaskFormattedPhoneNumber = PlaceDetailsFieldMask("formatted_phone_number")
Expand All @@ -536,7 +535,6 @@ const (
PlaceDetailsFieldMaskRatings = PlaceDetailsFieldMask("rating")
PlaceDetailsFieldMaskUserRatingsTotal = PlaceDetailsFieldMask("user_ratings_total")
PlaceDetailsFieldMaskReviews = PlaceDetailsFieldMask("reviews")
PlaceDetailsFieldMaskScope = PlaceDetailsFieldMask("scope")
PlaceDetailsFieldMaskTypes = PlaceDetailsFieldMask("types")
PlaceDetailsFieldMaskURL = PlaceDetailsFieldMask("url")
PlaceDetailsFieldMaskUTCOffset = PlaceDetailsFieldMask("utc_offset")
Expand All @@ -552,8 +550,6 @@ func ParsePlaceDetailsFieldMask(placeDetailsFieldMask string) (PlaceDetailsField
return PlaceDetailsFieldMaskAddressComponent, nil
case "adr_address":
return PlaceDetailsFieldMaskADRAddress, nil
case "alt_id":
return PlaceDetailsFieldMaskAltID, nil
case "business_status":
return PlaceDetailsFieldMaskBusinessStatus, nil
case "formatted_address":
Expand Down Expand Up @@ -606,8 +602,6 @@ func ParsePlaceDetailsFieldMask(placeDetailsFieldMask string) (PlaceDetailsField
return PlaceDetailsFieldMaskUserRatingsTotal, nil
case "reviews":
return PlaceDetailsFieldMaskReviews, nil
case "scope":
return PlaceDetailsFieldMaskScope, nil
case "types":
return PlaceDetailsFieldMaskTypes, nil
case "url":
Expand Down Expand Up @@ -639,7 +633,6 @@ type PlaceSearchFieldMask string

// The individual Place Search Field Masks.
const (
PlaceSearchFieldMaskAltID = PlaceSearchFieldMask("alt_id")
PlaceSearchFieldMaskBusinessStatus = PlaceSearchFieldMask("business_status")
PlaceSearchFieldMaskFormattedAddress = PlaceSearchFieldMask("formatted_address")
PlaceSearchFieldMaskGeometry = PlaceSearchFieldMask("geometry")
Expand Down Expand Up @@ -673,8 +666,6 @@ const (
// PlaceSearchFieldMask.
func ParsePlaceSearchFieldMask(placeSearchFieldMask string) (PlaceSearchFieldMask, error) {
switch strings.ToLower(placeSearchFieldMask) {
case "alt_id":
return PlaceSearchFieldMaskAltID, nil
case "formatted_address":
return PlaceSearchFieldMaskFormattedAddress, nil
case "geometry":
Expand Down

0 comments on commit f2f6eaa

Please sign in to comment.