From a73f50fa84bb3f882eb4d37433a47c9a983d592e Mon Sep 17 00:00:00 2001 From: Brian Zimmer Date: Tue, 9 Aug 2022 06:47:20 +0200 Subject: [PATCH] renamed hidden to muted --- strava/activity_test.go | 22 +++++++++++----------- strava/model.go | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/strava/activity_test.go b/strava/activity_test.go index a7f7f34..cf35ef7 100644 --- a/strava/activity_test.go +++ b/strava/activity_test.go @@ -512,31 +512,31 @@ func TestUpdate(t *testing.T) { act := decoder(r) a.NotNil(act.Name) a.Nil(act.Description) - a.False(*act.Hidden) + a.False(*act.Muted) http.ServeFile(w, r, "testdata/activity.json") }) mux.HandleFunc("/activities/1002", func(w http.ResponseWriter, r *http.Request) { a.Equal(http.MethodPut, r.Method) act := decoder(r) - a.True(*act.Hidden) + a.True(*act.Muted) http.ServeFile(w, r, "testdata/activity.json") }) return mux } tests := []struct { - id int64 - name string - hidden bool + id int64 + name string + muted bool }{ { id: 1001, name: "empty update", }, { - id: 1002, - name: "hide", - hidden: true, + id: 1002, + name: "mute", + muted: true, }, } @@ -549,9 +549,9 @@ func TestUpdate(t *testing.T) { client, err := newTestClient(strava.WithBaseURL(svr.URL)) a.NoError(err) update := &strava.UpdatableActivity{ - ID: tt.id, - Name: &tt.name, - Hidden: &tt.hidden, + ID: tt.id, + Name: &tt.name, + Muted: &tt.muted, } act, err := client.Activity.Update(context.Background(), update) a.NoError(err) diff --git a/strava/model.go b/strava/model.go index 3517c30..d8b1d78 100644 --- a/strava/model.go +++ b/strava/model.go @@ -357,7 +357,7 @@ type UpdatableActivity struct { ID int64 `json:"id"` Commute *bool `json:"commute,omitempty"` Trainer *bool `json:"trainer,omitempty"` - Hidden *bool `json:"hide_from_home,omitempty"` + Muted *bool `json:"hide_from_home,omitempty"` Description *string `json:"description,omitempty"` Name *string `json:"name,omitempty"` SportType *string `json:"sport_type,omitempty"` @@ -372,7 +372,7 @@ type Activity struct { UploadID int64 `json:"upload_id"` Athlete *Athlete `json:"athlete"` Name string `json:"name"` - Hidden bool `json:"hide_from_home"` + Muted bool `json:"hide_from_home"` Distance unit.Length `json:"distance" units:"m"` MovingTime unit.Duration `json:"moving_time" units:"s"` ElapsedTime unit.Duration `json:"elapsed_time" units:"s"`