Repository: googlemaps/google-maps-services-go (go)

Issue:
ParsePlaceSearchFieldMask missing case for 'business_status'
#### Environment details

Places: FindPlaceFromText
OS: Linux
v1.4.0

#### Code example

```go
const return_fields = "formatted_address,name,geometry,business_status"

func main() {
  client, err := maps.NewClient(maps.WithAPIKey("<REDACTED>"))

 r := & maps.FindPlaceFromTextRequest{
		Input: "Some Address to Look For",
		InputType: maps.FindPlaceFromTextInputTypeTextQuery,
 }

  var fields []maps.PlaceSearchFieldMask
	for _, s := range strings.Split(return_fields, ",") {
		f, err := maps.ParsePlaceSearchFieldMask(s)
		check(err)

		fields = append(fields, f)
	}
}
```

#### Stack trace
```
2023/05/29 16:44:50 ERROR: Unknown PlaceSearchFieldMask "business_status"
exit status 1
```

types.go - is missing the business_status in the switch statement on line 726.



Pull request:
fix: business_status placessearchfieldmask
Thank you for opening a Pull Request!

---

Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [ X] Make sure to open a GitHub issue as a bug/feature request before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [X ] Ensure the tests and linter pass
- [ X] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes #284


Patch:
diff --git a/places.go b/places.go
index e847b9e..5f867f4 100644
--- a/places.go
+++ b/places.go
@@ -404,7 +404,6 @@ func (r *PlaceDetailsRequest) params() url.Values {
 		q.Set("reviews_no_translations", "true")
 	}
 
-
 	if r.ReviewsSort != "" {
 		q.Set("reviews_sort", r.ReviewsSort)
 	}
@@ -514,7 +513,7 @@ type PlaceDetailsResult struct {
 	// or TAKEOUT) based on the types of the place. This field includes the
 	// special_days subfield of all hours, set for dates that have exceptional
 	// hours.
-	SecondaryOpeningHours *OpeningHours `json:"secondary_opening_hours,omitempty"`
+	SecondaryOpeningHours []OpeningHours `json:"secondary_opening_hours,omitempty"`
 	// PermanentlyClosed is a boolean flag indicating whether the place has permanently
 	// shut down (value true). If the place is not permanently closed, the flag is
 	// absent from the response.
diff --git a/types.go b/types.go
index bf3b379..4b40d0a 100644
--- a/types.go
+++ b/types.go
@@ -725,6 +725,8 @@ const (
 // PlaceSearchFieldMask.
 func ParsePlaceSearchFieldMask(placeSearchFieldMask string) (PlaceSearchFieldMask, error) {
 	switch strings.ToLower(placeSearchFieldMask) {
+	case "business_status":
+		return PlaceSearchFieldMaskBusinessStatus, nil
 	case "formatted_address":
 		return PlaceSearchFieldMaskFormattedAddress, nil
 	case "geometry":


Test patch:
diff --git a/places_test.go b/places_test.go
index cd47ce7..469671a 100644
--- a/places_test.go
+++ b/places_test.go
@@ -727,6 +727,63 @@ func TestPlaceDetails(t *testing.T) {
                 "Sunday: 12:00 – 8:45 PM"
             ]
         },
+		"secondary_opening_hours": [
+            {
+                "open_now": true,
+                "periods": [
+                    {
+                        "close": {
+                            "day": 0,
+                            "time": "2045"
+                        },
+                        "open": {
+                            "day": 0,
+                            "time": "1200"
+                        }
+                    },
+                    {
+                        "close": {
+                            "day": 4,
+                            "time": "2045"
+                        },
+                        "open": {
+                            "day": 4,
+                            "time": "1800"
+                        }
+                    },
+                    {
+                        "close": {
+                            "day": 5,
+                            "time": "2045"
+                        },
+                        "open": {
+                            "day": 5,
+                            "time": "1800"
+                        }
+                    },
+                    {
+                        "close": {
+                            "day": 6,
+                            "time": "2045"
+                        },
+                        "open": {
+                            "day": 6,
+                            "time": "1200"
+                        }
+                    }
+                ],
+                "type": "KITCHEN",
+                "weekday_text": [
+                    "Monday: 11:30 AM – 2:00 PM, 5:00 – 10:00 PM",
+                    "Tuesday: 11:30 AM – 2:00 PM, 5:00 – 10:00 PM",
+                    "Wednesday: 11:30 AM – 2:00 PM, 5:00 – 10:00 PM",
+                    "Thursday: 11:30 AM – 2:00 PM, 5:00 – 10:00 PM",
+                    "Friday: 11:30 AM – 2:00 PM, 5:00 – 10:00 PM",
+                    "Saturday: 11:30 AM – 2:00 PM, 5:00 – 10:00 PM",
+                    "Sunday: 11:30 AM – 2:00 PM, 5:00 – 9:00 PM"
+                ]
+            }
+	    ],
         "place_id": "ChIJ4cQcDV2uEmsRMxTEHBIe9ZQ",
         "serves_dinner": true,
         "utc_offset": 660,
@@ -739,10 +796,10 @@ func TestPlaceDetails(t *testing.T) {
 	defer server.Close()
 	c, _ := NewClient(WithAPIKey(apiKey), WithBaseURL(server.URL))
 	placeID := "ChIJ4cQcDV2uEmsRMxTEHBIe9ZQ"
-	fields := []PlaceDetailsFieldMask{PlaceDetailsFieldMaskBusinessStatus, PlaceDetailsFieldMaskDineIn, PlaceDetailsFieldMaskFormattedAddress, PlaceDetailsFieldMaskGeometry, PlaceDetailsFieldMaskName, PlaceDetailsFieldMaskCurrentOpeningHours, PlaceDetailsFieldMaskPlaceID, PlaceDetailsFieldMaskServesDinner, PlaceDetailsFieldMaskUTCOffset, PlaceDetailsFieldMaskWheelchairAccessibleEntrance}
+	fields := []PlaceDetailsFieldMask{PlaceDetailsFieldMaskBusinessStatus, PlaceDetailsFieldMaskDineIn, PlaceDetailsFieldMaskFormattedAddress, PlaceDetailsFieldMaskGeometry, PlaceDetailsFieldMaskName, PlaceDetailsFieldMaskCurrentOpeningHours, PlaceDetailsFieldMaskSecondaryOpeningHours, PlaceDetailsFieldMaskPlaceID, PlaceDetailsFieldMaskServesDinner, PlaceDetailsFieldMaskUTCOffset, PlaceDetailsFieldMaskWheelchairAccessibleEntrance}
 	r := &PlaceDetailsRequest{
 		PlaceID: placeID,
-		Fields: fields,
+		Fields:  fields,
 	}
 
 	resp, err := c.PlaceDetails(context.Background(), r)
@@ -779,6 +836,14 @@ func TestPlaceDetails(t *testing.T) {
 		t.Errorf("OpeningHours.Periods[0].Open.Time or Close.Time incorrect")
 	}
 
+	if resp.SecondaryOpeningHours[0].Periods[0].Open.Day != time.Sunday || resp.OpeningHours.Periods[0].Close.Day != time.Sunday {
+		t.Errorf("SecondaryOpeningHours[0].Periods[0].Open.Day or Close.Day incorrect")
+	}
+
+	if resp.SecondaryOpeningHours[0].Periods[0].Open.Time != "1200" || resp.OpeningHours.Periods[0].Close.Time != "2045" {
+		t.Errorf("SecondaryOpeningHours[0].Periods[0].Open.Time or Close.Time incorrect")
+	}
+
 	weekdayText := "Monday: Closed"
 	if weekdayText != resp.OpeningHours.WeekdayText[0] {
 		t.Errorf("expected %+v, was %+v", weekdayText, resp.OpeningHours.WeekdayText[0])