Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions go/pkg/generated/client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions go/pkg/hey/calendar_periods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,32 @@ func TestCalendarsToggleAnswersTheSelection(t *testing.T) {
}
}

// The calendar list carries the selection too, so a client can open on what is already on
// without a toggle to tell it.
func TestCalendarsListCarriesTheSelection(t *testing.T) {
client := periodsClient(t, func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{
"calendars": [
{ "calendar": { "id": 41, "name": "Design Team", "color": "teal", "personal": false } },
{ "calendar": { "id": 42, "name": "", "personal": true } }
],
"selected_calendar_ids": [42]
}`))
})

payload, err := client.Calendars().List(context.Background())
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if len(payload.SelectedCalendarIds) != 1 || payload.SelectedCalendarIds[0] != 42 {
t.Errorf("selected ids = %v, want [42]", payload.SelectedCalendarIds)
}
if payload.Calendars[0].Calendar.Color != "teal" {
t.Errorf("color = %q, want teal", payload.Calendars[0].Calendar.Color)
}
}

func TestCalendarPeriodsReportNotFound(t *testing.T) {
client := periodsClient(t, func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
Expand Down
2 changes: 1 addition & 1 deletion go/pkg/hey/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hey

// Version is the current version of the HEY Go SDK.
const Version = "0.16.0"
const Version = "0.17.0"

// APIVersion is the HEY API version this SDK targets.
const APIVersion = "2026-08-21"
8 changes: 8 additions & 0 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -9832,6 +9832,14 @@
},
"calendar_changes_url": {
"type": "string"
},
"selected_calendar_ids": {
"type": "array",
"items": {
"type": "integer",
"format": "int64"
},
"description": "The calendars every period read is drawn from. ToggleCalendar changes this and\nanswers the new one, so a client reads it here once — to open on what is already\non — and takes it from the toggle after that."
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions spec/hey.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ list CalendarWithRecordingChangesUrlList {
structure CalendarListPayload {
calendars: CalendarWithRecordingChangesUrlList
calendar_changes_url: String

/// The calendars every period read is drawn from. ToggleCalendar changes this and
/// answers the new one, so a client reads it here once — to open on what is already
/// on — and takes it from the toggle after that.
selected_calendar_ids: CalendarIdList
}

/// RecurrenceSchedule
Expand Down
Loading