From 4e39a38a92d93a44a9ab0b6e5adb72d85f0be69e Mon Sep 17 00:00:00 2001 From: Tiankai Ma Date: Tue, 15 Sep 2026 15:41:02 +0800 Subject: [PATCH 1/4] feat: add Young community CLI commands --- README.md | 15 +- internal/api/json.go | 36 ++ internal/auth/auth.go | 5 + internal/auth/auth_test.go | 10 +- internal/cmd/catalog/catalog.go | 2 + internal/cmd/comment/comment.go | 82 +++- internal/cmd/comment/comment_test.go | 80 ++++ internal/cmd/root/completions.go | 1 + internal/cmd/root/root_test.go | 11 +- internal/cmd/workspace/workspace.go | 106 +++-- internal/cmd/workspace/workspace_test.go | 46 +++ internal/cmd/young_event/young_event.go | 200 ++++++++-- .../cmd/young_event/young_event_http_test.go | 5 +- internal/cmd/young_event/young_event_test.go | 34 +- .../cmd/young_organizer/young_organizer.go | 178 +++++++++ .../young_organizer/young_organizer_test.go | 86 +++++ .../cmd/young_workspace/young_workspace.go | 364 ++++++++++++++++++ .../young_workspace/young_workspace_test.go | 98 +++++ internal/cmd/youngutil/youngutil.go | 254 ++++++++++++ internal/cmd/youngutil/youngutil_test.go | 90 +++++ 20 files changed, 1624 insertions(+), 79 deletions(-) create mode 100644 internal/api/json.go create mode 100644 internal/cmd/workspace/workspace_test.go create mode 100644 internal/cmd/young_organizer/young_organizer.go create mode 100644 internal/cmd/young_organizer/young_organizer_test.go create mode 100644 internal/cmd/young_workspace/young_workspace.go create mode 100644 internal/cmd/young_workspace/young_workspace_test.go create mode 100644 internal/cmd/youngutil/youngutil.go create mode 100644 internal/cmd/youngutil/youngutil_test.go diff --git a/README.md b/README.md index aadb2b9..32d4f26 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ | 域 | 能做什么 | |----|----------| -| `catalog` | 公开事实:学期、课程、教学班、教师、课表、校车、校园链接、元数据、第二课堂活动、天气、教室地图、新闻公告 | -| `workspace` | 个人概览、概览中的有界日历样例 / iCal、课表、考试、待办 CRUD、作业完成态、教学班订阅、校车偏好、链接置顶、上传 | +| `catalog` | 公开事实:学期、课程、教学班、教师、课表、校车、校园链接、元数据、第二课堂活动与主办方、天气、教室地图、新闻公告 | +| `workspace` | 个人概览、完整个人日历 / iCal、课表、考试、待办 CRUD、作业完成态、教学班订阅、第二课堂活动与主办方订阅、提醒通知、校车偏好、链接置顶、上传 | | `workspace school` | 直连校方站点:本科/研究生学期、课表、考试、成绩、作业,并可 `sync` 回 Life@USTC 订阅 | | `community` | 评论(含反应)、描述、教学班作业、公开用户资料 | | `account` | 登录 / 登出、session、token、资料、语言、当前客户端活动 | @@ -34,6 +34,10 @@ ```bash life-ustc catalog young-event --active true --limit 20 +life-ustc catalog young-organizer list --search 学生会 +life-ustc catalog young-event date week 2026-09-15 +life-ustc workspace calendar events --date-from 2026-09-01 --date-to 2026-09-30 +life-ustc workspace young-event-subscription set --subscribed true --remind-start true life-ustc catalog weather --location-key ustc-main life-ustc catalog room map life-ustc catalog publication --type notice --limit 20 @@ -45,9 +49,10 @@ life-ustc community user get 当前客户端活动需要 `account.client-activity:read` 权限。旧版本登录的用户需运行 `life-ustc account login` 重新授权,刷新旧 token 不会增加权限。 -`workspace calendar events` 展示 compact overview 返回的样例:课表是今天的, -考试、作业和待办来自有限时间窗与条数上限。要订阅完整 iCal 日历,请使用 -`workspace calendar feed`,并将返回的 URL 导入日历应用。 +`workspace calendar events` 使用完整个人日历 REST 接口,默认读取当前上海日期起的 +七天窗口;使用成对的 `--date-from` / `--date-to` 查询其它包含端点的日期范围。 +Young 活动的 `catalog young-event date day|week|month` 会遍历该范围的所有分页。 +要订阅 iCal 日历,请使用 `workspace calendar feed`,并将返回的 URL 导入日历应用。 ## OpenAPI 契约 diff --git a/internal/api/json.go b/internal/api/json.go new file mode 100644 index 0000000..6522dbb --- /dev/null +++ b/internal/api/json.go @@ -0,0 +1,36 @@ +package api + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" +) + +// DoJSON performs a JSON request through the authenticated transport and +// decodes the response using the same error handling as the generated client. +// It is used for endpoints whose generated OpenAPI client is refreshed with +// the server contract independently from the CLI command implementation. +func (c *Client) DoJSON( + ctx context.Context, + method string, + path string, + params url.Values, + body any, +) (any, error) { + var requestBody io.Reader + contentType := "" + if body != nil { + encoded, err := json.Marshal(body) + if err != nil { + return nil, fmt.Errorf("encode JSON request: %w", err) + } + requestBody = bytes.NewReader(encoded) + contentType = "application/json" + } + resp, err := c.DoRaw(ctx, method, path, params, requestBody, contentType, http.Header{}) + return ParseResponseRaw(resp, err) +} diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 744d87c..9e7398f 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -103,6 +103,7 @@ var cliOAuthScopes = []string{ "community.description:write", "community.section-homework:write", "workspace.bus-preferences:write", + "workspace.calendar:read", "workspace.calendar-feed:read", "workspace.homework:write", "workspace.link-pin:write", @@ -111,6 +112,10 @@ var cliOAuthScopes = []string{ "workspace.subscription:write", "workspace.todo:write", "workspace.upload:write", + "workspace.young-notification:read", + "workspace.young-notification:write", + "workspace.young-subscription:read", + "workspace.young-subscription:write", } func oauthScopesFromMetadata(meta map[string]any) ([]string, error) { diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go index 9fb753a..5fe8e2e 100644 --- a/internal/auth/auth_test.go +++ b/internal/auth/auth_test.go @@ -116,7 +116,15 @@ func TestOAuthScopesFromMetadata(t *testing.T) { for _, scope := range scopes { granted[scope] = true } - for _, required := range []string{"account.client-activity:read", "workspace.subscription:write"} { + for _, required := range []string{ + "account.client-activity:read", + "workspace.subscription:write", + "workspace.calendar:read", + "workspace.young-subscription:read", + "workspace.young-subscription:write", + "workspace.young-notification:read", + "workspace.young-notification:write", + } { if !granted[required] { t.Fatalf("command scope missing: %q", required) } diff --git a/internal/cmd/catalog/catalog.go b/internal/cmd/catalog/catalog.go index b9f340c..70e2478 100644 --- a/internal/cmd/catalog/catalog.go +++ b/internal/cmd/catalog/catalog.go @@ -15,6 +15,7 @@ import ( "github.com/Life-USTC/CLI/internal/cmd/teacher" "github.com/Life-USTC/CLI/internal/cmd/weather" "github.com/Life-USTC/CLI/internal/cmd/young_event" + "github.com/Life-USTC/CLI/internal/cmd/young_organizer" ) func NewCmdCatalog() *cobra.Command { @@ -33,6 +34,7 @@ func NewCmdCatalog() *cobra.Command { bus.NewCmdBus(), link.NewCmdCatalogLink(), young_event.NewCmdYoungEvent(), + young_organizer.NewCmdYoungOrganizer(), weather.NewCmdWeather(), room.NewCmdRoom(), publication.NewCmdPublication(), diff --git a/internal/cmd/comment/comment.go b/internal/cmd/comment/comment.go index 30ba232..c69daa3 100644 --- a/internal/cmd/comment/comment.go +++ b/internal/cmd/comment/comment.go @@ -4,6 +4,8 @@ import ( "bytes" "encoding/json" "fmt" + "net/http" + "net/url" "strings" "github.com/spf13/cobra" @@ -14,11 +16,12 @@ import ( "github.com/Life-USTC/CLI/internal/output" ) -var targetTypes = []string{"section", "course", "teacher", "section-teacher", "homework"} +var targetTypes = []string{"section", "course", "teacher", "section-teacher", "homework", "young-event"} type commentTarget struct { targetType string targetID string + youngID string sectionID string teacherID string } @@ -45,6 +48,13 @@ func validateTarget(target commentTarget, requireID bool) error { if !validCommentTargetType(target.targetType) { return fmt.Errorf("invalid --target-type %q", target.targetType) } + if target.targetType == "young-event" { + target = normalizeTarget(target) + if target.youngID == "" { + return fmt.Errorf("--young-id is required for young-event target") + } + return nil + } if !requireID { return nil } @@ -60,6 +70,13 @@ func validateTarget(target commentTarget, requireID bool) error { return nil } +func normalizeTarget(target commentTarget) commentTarget { + if target.targetType == "young-event" && target.youngID == "" { + target.youngID = target.targetID + } + return target +} + func listCommentColumns() []output.Column { return []output.Column{ {Header: "ID", Key: "id"}, @@ -70,9 +87,26 @@ func listCommentColumns() []output.Column { } func runCommentList(cmd *cobra.Command, target commentTarget) error { + target = normalizeTarget(target) if err := validateTarget(target, false); err != nil { return err } + if target.targetType == "young-event" { + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) + if err != nil { + return err + } + params := url.Values{ + "targetType": []string{"young-event"}, + "youngId": []string{target.youngID}, + } + data, err := client.DoJSON(cmd.Context(), http.MethodGet, "/api/community/comments", params, nil) + if err != nil { + return err + } + _, rows, total, pg := cmdutil.ExtractList(data, "comments", "data") + return output.OutputList(data, rows, listCommentColumns(), total, pg) + } c, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), false) if err != nil { return err @@ -104,12 +138,37 @@ func runCommentList(cmd *cobra.Command, target commentTarget) error { } func runCommentCreate(cmd *cobra.Command, target commentTarget, body, visibility, parentID string, anonymous bool) error { + target = normalizeTarget(target) if !validVisibility(visibility) { return fmt.Errorf("invalid --visibility %q (use public, logged_in_only, or anonymous)", visibility) } if err := validateTarget(target, true); err != nil { return err } + if target.targetType == "young-event" { + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + request := map[string]any{ + "targetType": "young-event", + "youngId": target.youngID, + "body": body, + "visibility": visibility, + "isAnonymous": anonymous, + } + if parentID != "" { + request["parentId"] = parentID + } + data, err := client.DoJSON(cmd.Context(), http.MethodPost, "/api/community/comments", nil, request) + if err != nil { + return err + } + m := cmdutil.AsMap(data) + id, _ := m["id"].(string) + output.Success(fmt.Sprintf("Comment created: %s", id)) + return nil + } c, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), true) if err != nil { return err @@ -222,7 +281,7 @@ func newCmdCreateFor(targetType string) *cobra.Command { func newCmdList() *cobra.Command { var ( - targetType, targetID, sectionID, teacherID string + targetType, targetID, youngID, sectionID, teacherID string ) cmd := &cobra.Command{ Use: "list", @@ -235,13 +294,15 @@ func newCmdList() *cobra.Command { return runCommentList(cmd, commentTarget{ targetType: targetType, targetID: targetID, + youngID: youngID, sectionID: sectionID, teacherID: teacherID, }) }, } - cmd.Flags().StringVar(&targetType, "target-type", "", "Target type (section, course, teacher, section-teacher, homework)") + cmd.Flags().StringVar(&targetType, "target-type", "", "Target type (section, course, teacher, section-teacher, homework, young-event)") cmd.Flags().StringVar(&targetID, "target-id", "", "Target ID") + cmd.Flags().StringVar(&youngID, "young-id", "", "Young event ID (for --target-type young-event)") cmd.Flags().StringVar(§ionID, "section-id", "", "Section ID (for section-teacher)") cmd.Flags().StringVar(&teacherID, "teacher-id", "", "Teacher ID (for section-teacher)") return cmd @@ -292,9 +353,9 @@ func newCmdView() *cobra.Command { func newCmdCreate() *cobra.Command { var ( - targetType, targetID, sectionID, teacherID string - body, visibility, parentID string - anonymous bool + targetType, targetID, youngID, sectionID, teacherID string + body, visibility, parentID string + anonymous bool ) cmd := &cobra.Command{ Use: "create", @@ -316,6 +377,13 @@ func newCmdCreate() *cobra.Command { if teacherID == "" { teacherID = cmdutil.PromptText("Teacher ID") } + } else if targetType == "young-event" { + if youngID == "" && targetID != "" { + youngID = targetID + } + if youngID == "" { + youngID = cmdutil.PromptText("Young event ID") + } } else if targetID == "" { targetID = cmdutil.PromptText("Target ID") } @@ -327,6 +395,7 @@ func newCmdCreate() *cobra.Command { return runCommentCreate(cmd, commentTarget{ targetType: targetType, targetID: targetID, + youngID: youngID, sectionID: sectionID, teacherID: teacherID, }, body, visibility, parentID, anonymous) @@ -334,6 +403,7 @@ func newCmdCreate() *cobra.Command { } cmd.Flags().StringVar(&targetType, "target-type", "", "Target type") cmd.Flags().StringVar(&targetID, "target-id", "", "Target ID") + cmd.Flags().StringVar(&youngID, "young-id", "", "Young event ID (for young-event target)") cmd.Flags().StringVar(§ionID, "section-id", "", "Section ID") cmd.Flags().StringVar(&teacherID, "teacher-id", "", "Teacher ID") cmd.Flags().StringVarP(&body, "body", "b", "", "Comment body") diff --git a/internal/cmd/comment/comment_test.go b/internal/cmd/comment/comment_test.go index 594dfc9..0bad13c 100644 --- a/internal/cmd/comment/comment_test.go +++ b/internal/cmd/comment/comment_test.go @@ -1,10 +1,90 @@ package comment import ( + "context" + "io" + "net/http" + "net/http/httptest" "strings" "testing" + "time" + + "github.com/Life-USTC/CLI/internal/config" + "github.com/spf13/cobra" ) +func TestYoungEventCommentTargetRequiresYoungID(t *testing.T) { + if err := validateTarget(commentTarget{targetType: "young-event"}, false); err == nil { + t.Fatal("young-event target without young ID was accepted") + } + if err := validateTarget(commentTarget{targetType: "young-event", youngID: "young-1"}, false); err != nil { + t.Fatal(err) + } +} + +func TestYoungEventCommentListUsesYoungIDQuery(t *testing.T) { + t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet || r.URL.Path != "/api/community/comments" { + t.Fatalf("request = %s %s", r.Method, r.URL) + } + if got := r.URL.Query().Get("targetType"); got != "young-event" { + t.Fatalf("targetType = %q", got) + } + if got := r.URL.Query().Get("youngId"); got != "young-1" { + t.Fatalf("youngId = %q", got) + } + w.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(w, `{"comments":[],"pagination":{"page":1,"pageSize":20,"total":0,"totalPages":1}}`) + })) + defer server.Close() + cmd := commandWithServer(server.URL) + if err := runCommentList(cmd, commentTarget{targetType: "young-event", youngID: "young-1"}); err != nil { + t.Fatal(err) + } +} + +func TestYoungEventCommentCreateUsesYoungIDBody(t *testing.T) { + t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) + var gotAuth string + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost || r.URL.Path != "/api/community/comments" { + t.Fatalf("request = %s %s", r.Method, r.URL) + } + gotAuth = r.Header.Get("Authorization") + body, err := io.ReadAll(r.Body) + if err != nil { + t.Fatal(err) + } + if got, want := string(body), `{"body":"hello","isAnonymous":false,"targetType":"young-event","visibility":"public","youngId":"young-1"}`; got != want { + t.Fatalf("body = %q, want %q", got, want) + } + w.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(w, `{"id":"comment-1"}`) + })) + defer server.Close() + if err := config.SaveCredentials(server.URL, &config.Credential{ + AccessToken: "access-token", + ExpiresAt: float64(time.Now().Add(time.Hour).Unix()), + }); err != nil { + t.Fatal(err) + } + cmd := commandWithServer(server.URL) + if err := runCommentCreate(cmd, commentTarget{targetType: "young-event", youngID: "young-1"}, "hello", "public", "", false); err != nil { + t.Fatal(err) + } + if gotAuth != "Bearer access-token" { + t.Fatalf("Authorization = %q", gotAuth) + } +} + +func commandWithServer(server string) *cobra.Command { + cmd := &cobra.Command{Use: "test"} + cmd.PersistentFlags().String("server", server, "") + cmd.SetContext(context.Background()) + return cmd +} + func TestReportCommentBatchResults_AllSuccess(t *testing.T) { data := map[string]any{ "results": []any{ diff --git a/internal/cmd/root/completions.go b/internal/cmd/root/completions.go index dac8b4a..4bf3f2c 100644 --- a/internal/cmd/root/completions.go +++ b/internal/cmd/root/completions.go @@ -15,6 +15,7 @@ var ( "teacher\tTeacher comments", "section-teacher\tSection-teacher comments", "homework\tHomework comments", + "young-event\tYoung event comments", } descriptionTargetTypeCompletions = []string{ "section\tSection descriptions", diff --git a/internal/cmd/root/root_test.go b/internal/cmd/root/root_test.go index a974bce..1659063 100644 --- a/internal/cmd/root/root_test.go +++ b/internal/cmd/root/root_test.go @@ -43,11 +43,12 @@ func TestUnifiedDomainContents(t *testing.T) { expected := map[string][]string{ "catalog": { "metadata", "semester", "course", "section", "teacher", "schedule", "bus", "link", - "young-event", "weather", "room", "publication", + "young-event", "young-organizer", "weather", "room", "publication", }, "workspace": { "overview", "calendar", "schedule", "exam", "todo", "homework", - "subscription", "bus-preferences", "link-pin", "upload", "school", + "subscription", "young-event-subscription", "young-organizer-subscription", + "young-notification", "bus-preferences", "link-pin", "upload", "school", }, "community": { "comment", "description", "user", "section-homework", @@ -61,6 +62,12 @@ func TestUnifiedDomainContents(t *testing.T) { {"community", "user", "get"}, {"workspace", "subscription", "kind"}, {"catalog", "young-event", "get"}, + {"catalog", "young-organizer", "get"}, + {"catalog", "young-event", "date", "week"}, + {"workspace", "calendar", "events"}, + {"workspace", "young-event-subscription", "set"}, + {"workspace", "young-organizer-subscription", "set"}, + {"workspace", "young-notification", "read"}, {"catalog", "room", "map"}, {"catalog", "publication", "get"}, } { diff --git a/internal/cmd/workspace/workspace.go b/internal/cmd/workspace/workspace.go index f1e0397..a01551d 100644 --- a/internal/cmd/workspace/workspace.go +++ b/internal/cmd/workspace/workspace.go @@ -2,6 +2,9 @@ package workspace import ( "fmt" + "net/http" + "net/url" + "strings" "github.com/spf13/cobra" @@ -15,6 +18,8 @@ import ( schoolcmd "github.com/Life-USTC/CLI/internal/cmd/school" "github.com/Life-USTC/CLI/internal/cmd/todo" "github.com/Life-USTC/CLI/internal/cmd/upload" + "github.com/Life-USTC/CLI/internal/cmd/young_workspace" + "github.com/Life-USTC/CLI/internal/cmd/youngutil" openapi "github.com/Life-USTC/CLI/internal/openapi" "github.com/Life-USTC/CLI/internal/output" ) @@ -33,6 +38,9 @@ func NewCmdWorkspace() *cobra.Command { todo.NewCmdTodo(), homework.NewCmdMyHomework(), calendar.NewCmdSubscription(), + young_workspace.NewCmdYoungEventSubscription(), + young_workspace.NewCmdYoungOrganizerSubscription(), + young_workspace.NewCmdYoungNotification(), bus.NewCmdBusPreferences(), link.NewCmdWorkspaceLinkPin(), upload.NewCmdUpload(), @@ -41,6 +49,55 @@ func NewCmdWorkspace() *cobra.Command { return cmd } +type calendarEventOpts struct { + dateFrom string + dateTo string + page int + pageSize int +} + +func runCalendarEvents(cmd *cobra.Command, opts calendarEventOpts) error { + params, err := buildCalendarEventParams(opts) + if err != nil { + return err + } + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.PersonalCalendarEventsPath, params, nil) + if err != nil { + return err + } + list := cmdutil.NewListResult(data, "data") + return output.OutputList(list.Raw, list.Rows, []output.Column{ + {Header: "At", Key: "at"}, + {Header: "End", Key: "endsAt"}, + {Header: "Type", Key: "type"}, + {Header: "Title", Key: "title"}, + {Header: "Location", Key: "location"}, + {Header: "Young ID", Key: "youngId"}, + {Header: "URL", Key: "url"}, + }, list.Total, list.Page) +} + +func buildCalendarEventParams(opts calendarEventOpts) (url.Values, error) { + params, err := youngutil.PageParams(opts.page, opts.pageSize) + if err != nil { + return nil, err + } + from := strings.TrimSpace(opts.dateFrom) + to := strings.TrimSpace(opts.dateTo) + if (from == "") != (to == "") { + return nil, fmt.Errorf("--date-from and --date-to must be provided together") + } + if from != "" { + params.Set("dateFrom", from) + params.Set("dateTo", to) + } + return params, nil +} + func newCmdOverview() *cobra.Command { return &cobra.Command{ Use: "overview", @@ -75,44 +132,29 @@ func newCmdOverview() *cobra.Command { func newCmdCalendar() *cobra.Command { cmd := calendar.NewCmdCalendar() + var dateFrom, dateTo string + var page, pageSize int events := &cobra.Command{ Use: "events", - Short: "Show bounded event samples from the workspace overview", - Long: `Show the event samples included in the compact workspace overview. - -Schedules cover today. Exams, homeworks, and due todos are bounded upcoming -samples from the overview window; this command is not a complete calendar.`, + Short: "List your complete personal calendar events", + Long: `List personal calendar events from the date range returned by the +workspace calendar API. With no bounds, the server uses the current Shanghai +date and the following seven days. Use --date-from and --date-to together for +another inclusive range.`, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { - data, err := getOverview(cmd) - if err != nil { - return err - } - if output.IsJSON() { - return output.JSON(data) - } - m := cmdutil.AsMap(data) - for _, group := range []struct { - key, title string - cols []output.Column - }{ - {"schedules", "Today's schedules", []output.Column{{Header: "Course", Key: "section.course.namePrimary"}, {Header: "Time", Key: "startTime"}, {Header: "Place", Key: "customPlace"}}}, - {"exams", "Upcoming exam samples", []output.Column{{Header: "Course", Key: "section.course.namePrimary"}, {Header: "Date", Key: "examDate"}, {Header: "Mode", Key: "examMode"}}}, - {"homeworks", "Homework samples", []output.Column{{Header: "Title", Key: "title"}, {Header: "Due", Key: "submissionDueAt"}, {Header: "Course", Key: "section.course.namePrimary"}}}, - {"dueTodos", "Due todo samples", []output.Column{{Header: "Title", Key: "title"}, {Header: "Due", Key: "dueAt"}, {Header: "Priority", Key: "priority"}}}, - } { - part := cmdutil.AsMap(m[group.key]) - rows := cmdutil.RowsFromAny(part["items"]) - if len(rows) == 0 { - continue - } - fmt.Println() - output.Bold(" " + group.title) - output.Table(rows, group.cols) - } - return nil + return runCalendarEvents(cmd, calendarEventOpts{ + dateFrom: dateFrom, + dateTo: dateTo, + page: page, + pageSize: pageSize, + }) }, } + events.Flags().StringVar(&dateFrom, "date-from", "", "Inclusive Shanghai date/time range start") + events.Flags().StringVar(&dateTo, "date-to", "", "Inclusive Shanghai date/time range end") + events.Flags().IntVarP(&page, "page", "p", 0, "Page number") + events.Flags().IntVarP(&pageSize, "limit", "L", 0, "Number of calendar events per page") cmd.AddCommand(events) return cmd } diff --git a/internal/cmd/workspace/workspace_test.go b/internal/cmd/workspace/workspace_test.go new file mode 100644 index 0000000..3403a7a --- /dev/null +++ b/internal/cmd/workspace/workspace_test.go @@ -0,0 +1,46 @@ +package workspace + +import ( + "io" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/Life-USTC/CLI/internal/config" + "github.com/spf13/cobra" +) + +func TestBuildCalendarEventParamsRequiresPairedBounds(t *testing.T) { + if _, err := buildCalendarEventParams(calendarEventOpts{dateFrom: "2026-09-01"}); err == nil { + t.Fatal("calendar params accepted an unpaired date bound") + } +} + +func TestCalendarEventsUsesCompletePersonalCalendarEndpoint(t *testing.T) { + t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet || r.URL.Path != "/api/workspace/calendar/events" { + t.Fatalf("request = %s %s", r.Method, r.URL) + } + if r.URL.Query().Get("dateFrom") != "2026-09-01" || r.URL.Query().Get("dateTo") != "2026-09-30" { + t.Fatalf("query = %s", r.URL.RawQuery) + } + w.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(w, `{"data":[{"id":"young-event-1","type":"young_event","at":"2026-09-01T01:00:00Z","endsAt":null,"title":"Activity","location":null,"url":"/catalog/young-events/event-1","youngId":"event-1"}],"pagination":{"page":1,"pageSize":20,"total":1,"totalPages":1}}`) + })) + defer server.Close() + if err := config.SaveCredentials(server.URL, &config.Credential{ + AccessToken: "access-token", + ExpiresAt: float64(time.Now().Add(time.Hour).Unix()), + }); err != nil { + t.Fatal(err) + } + root := &cobra.Command{Use: "test"} + root.PersistentFlags().String("server", server.URL, "") + root.AddCommand(newCmdCalendar()) + root.SetArgs([]string{"calendar", "events", "--date-from", "2026-09-01", "--date-to", "2026-09-30"}) + if err := root.Execute(); err != nil { + t.Fatal(err) + } +} diff --git a/internal/cmd/young_event/young_event.go b/internal/cmd/young_event/young_event.go index bbddeab..9939bbf 100644 --- a/internal/cmd/young_event/young_event.go +++ b/internal/cmd/young_event/young_event.go @@ -1,22 +1,31 @@ package young_event import ( + "context" "fmt" + "net/http" + "net/url" + "strings" + "time" "github.com/spf13/cobra" "github.com/Life-USTC/CLI/internal/api" "github.com/Life-USTC/CLI/internal/cmd/cmdutil" - openapi "github.com/Life-USTC/CLI/internal/openapi" + "github.com/Life-USTC/CLI/internal/cmd/youngutil" "github.com/Life-USTC/CLI/internal/output" ) type listOpts struct { - active string - category string - search string - page int - pageSize int + active string + category string + search string + organizerID string + dateFrom string + dateTo string + timeBasis string + page int + pageSize int } // NewCmdYoungEvent exposes the public second-classroom event catalog. @@ -33,6 +42,9 @@ func NewCmdYoungEvent() *cobra.Command { # Search events and request a specific page size life-ustc catalog young-event --search robotics --page 1 --limit 20 + # Filter by organizer and an activity date range + life-ustc catalog young-event --organizer-id --date-from 2026-09-01 --date-to 2026-09-30 + # View one event life-ustc catalog young-event get `, Args: cobra.NoArgs, @@ -43,6 +55,7 @@ func NewCmdYoungEvent() *cobra.Command { addListFlags(cmd, &opts) cmd.AddCommand(newCmdList()) cmd.AddCommand(newCmdGet()) + cmd.AddCommand(newCmdDate()) return cmd } @@ -50,6 +63,10 @@ func addListFlags(cmd *cobra.Command, opts *listOpts) { cmd.Flags().StringVar(&opts.active, "active", "", "Filter by signup status (true or false)") cmd.Flags().StringVar(&opts.category, "category", "", "Exact event category") cmd.Flags().StringVarP(&opts.search, "search", "s", "", "Search event names") + cmd.Flags().StringVar(&opts.organizerID, "organizer-id", "", "Filter by stable organizer ID") + cmd.Flags().StringVar(&opts.dateFrom, "date-from", "", "Inclusive date/time range start") + cmd.Flags().StringVar(&opts.dateTo, "date-to", "", "Inclusive date/time range end") + cmd.Flags().StringVar(&opts.timeBasis, "time-basis", "", "Date fields for range filtering (activity or registration)") cmd.Flags().IntVarP(&opts.page, "page", "p", 0, "Page number") // The CLI's standard --limit spelling maps to the API's canonical pageSize. cmd.Flags().IntVarP(&opts.pageSize, "limit", "L", 0, "Number of items per page") @@ -74,11 +91,11 @@ func runList(cmd *cobra.Command, opts listOpts) error { if err != nil { return err } - client, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), false) + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) if err != nil { return err } - data, err := fetchList(client, params) + data, err := fetchList(cmd.Context(), client, params) if err != nil { return err } @@ -93,39 +110,53 @@ func runList(cmd *cobra.Command, opts listOpts) error { }, list.Total, list.Page) } -func fetchList(client *api.TypedClient, params *openapi.GetApiCatalogYoungEventsParams) (any, error) { - return api.ParseResponseRaw(client.GetApiCatalogYoungEvents(api.Ctx(), params)) +func fetchList(ctx context.Context, client *api.Client, params url.Values) (any, error) { + return client.DoJSON(ctx, http.MethodGet, youngutil.EventsPath, params, nil) } -func buildListParams(opts listOpts) (*openapi.GetApiCatalogYoungEventsParams, error) { - if opts.page < 0 { - return nil, fmt.Errorf("--page must be zero or greater") - } - if opts.pageSize < 0 { - return nil, fmt.Errorf("--limit must be zero or greater") +func buildListParams(opts listOpts) (url.Values, error) { + params, err := youngutil.PageParams(opts.page, opts.pageSize) + if err != nil { + return nil, err } active, err := normalizeActive(opts.active) if err != nil { return nil, err } - return &openapi.GetApiCatalogYoungEventsParams{ - Active: active, - Category: cmdutil.StringPtrIfSet(opts.category), - Search: cmdutil.StringPtrIfSet(opts.search), - Page: cmdutil.Int64PtrIfPositive(opts.page), - PageSize: cmdutil.Int64PtrIfPositive(opts.pageSize), - }, nil + if active != "" { + params.Set("active", active) + } + for key, value := range map[string]string{ + "category": opts.category, + "search": opts.search, + "organizerId": opts.organizerID, + "dateFrom": opts.dateFrom, + "dateTo": opts.dateTo, + } { + if value = strings.TrimSpace(value); value != "" { + params.Set(key, value) + } + } + if (opts.dateFrom == "") != (opts.dateTo == "") { + return nil, fmt.Errorf("--date-from and --date-to must be provided together") + } + if opts.timeBasis != "" { + if opts.timeBasis != "activity" && opts.timeBasis != "registration" { + return nil, fmt.Errorf("--time-basis must be activity or registration") + } + params.Set("timeBasis", opts.timeBasis) + } + return params, nil } -func normalizeActive(value string) (*openapi.GetApiCatalogYoungEventsParamsActive, error) { +func normalizeActive(value string) (string, error) { if value == "" { - return nil, nil + return "", nil } if value != "true" && value != "false" { - return nil, fmt.Errorf("--active must be true or false") + return "", fmt.Errorf("--active must be true or false") } - active := openapi.GetApiCatalogYoungEventsParamsActive(value) - return &active, nil + return value, nil } func newCmdGet() *cobra.Command { @@ -135,11 +166,17 @@ func newCmdGet() *cobra.Command { Short: "View a Young event", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - client, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), false) + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) if err != nil { return err } - data, err := api.ParseResponseRaw(client.GetApiCatalogYoungEventsYoungId(api.Ctx(), args[0])) + data, err := client.DoJSON( + cmd.Context(), + http.MethodGet, + youngutil.PathID(youngutil.EventsPath, args[0]), + nil, + nil, + ) if err != nil { return err } @@ -149,6 +186,7 @@ func newCmdGet() *cobra.Command { {Key: "category", Label: "Category", SkipEmpty: true}, {Key: "department", Label: "Department", SkipEmpty: true}, {Key: "organizer", Label: "Organizer", SkipEmpty: true}, + {Key: "organizerId", Label: "Organizer ID", SkipEmpty: true}, {Key: "location", Label: "Location", SkipEmpty: true}, {Key: "startAt", Label: "Start", SkipEmpty: true}, {Key: "endAt", Label: "End", SkipEmpty: true}, @@ -160,8 +198,110 @@ func newCmdGet() *cobra.Command { {Key: "registrationStatus", Label: "Registration", SkipEmpty: true}, {Key: "status", Label: "Status", SkipEmpty: true}, {Key: "isActive", Label: "Active"}, + {Key: "sourceMissing", Label: "Source missing", SkipEmpty: true}, + {Key: "lastSeenAt", Label: "Last seen", SkipEmpty: true}, + {Key: "createdAt", Label: "Created", SkipEmpty: true}, {Key: "imageUrl", Label: "Image", SkipEmpty: true}, }, "Young event") }, } } + +type dateOpts struct { + active string + category string + search string + organizerID string + timeBasis string +} + +func newCmdDate() *cobra.Command { + cmd := &cobra.Command{ + Use: "date ", + Short: "List every event in a day, week, or month", + Args: cobra.NoArgs, + } + for _, view := range []youngutil.DateView{ + youngutil.DateDay, + youngutil.DateWeek, + youngutil.DateMonth, + } { + cmd.AddCommand(newDateViewCommand(view)) + } + return cmd +} + +func newDateViewCommand(view youngutil.DateView) *cobra.Command { + opts := dateOpts{} + cmd := &cobra.Command{ + Use: string(view) + " [YYYY-MM-DD]", + Short: "List all Young events for a " + string(view), + Args: cobra.MaximumNArgs(1), + Example: " life-ustc catalog young-event date " + string(view) + " 2026-09-15", + RunE: func(cmd *cobra.Command, args []string) error { + anchor := "" + if len(args) == 1 { + anchor = args[0] + } + return runDateView(cmd, view, anchor, opts) + }, + } + cmd.Flags().StringVar(&opts.active, "active", "", "Filter by signup status (true or false)") + cmd.Flags().StringVar(&opts.category, "category", "", "Exact event category") + cmd.Flags().StringVarP(&opts.search, "search", "s", "", "Search event names") + cmd.Flags().StringVar(&opts.organizerID, "organizer-id", "", "Filter by stable organizer ID") + cmd.Flags().StringVar(&opts.timeBasis, "time-basis", "activity", "Date fields for range filtering (activity or registration)") + return cmd +} + +func runDateView(cmd *cobra.Command, view youngutil.DateView, anchor string, opts dateOpts) error { + dateFrom, dateTo, err := youngutil.DateRange(view, anchor, timeNow()) + if err != nil { + return err + } + params := listOpts{ + active: opts.active, + category: opts.category, + search: opts.search, + organizerID: opts.organizerID, + dateFrom: dateFrom, + dateTo: dateTo, + timeBasis: opts.timeBasis, + } + query, err := buildListParams(params) + if err != nil { + return err + } + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) + if err != nil { + return err + } + data, err := fetchDateEvents(cmd.Context(), client, query) + if err != nil { + return err + } + list := cmdutil.NewListResult(data, "data") + return output.OutputList(list.Raw, list.Rows, []output.Column{ + {Header: "Name", Key: "name"}, + {Header: "Category", Key: "category"}, + {Header: "Start", Key: "startAt"}, + {Header: "End", Key: "endAt"}, + {Header: "Organizer", Key: "organizer"}, + {Header: "Young ID", Key: "youngId"}, + }, list.Total, list.Page) +} + +func fetchDateEvents(ctx context.Context, client *api.Client, query url.Values) (any, error) { + return youngutil.FetchAllPages( + ctx, + client, + youngutil.EventsPath, + query, + "data", + 100, + "youngId", + ) +} + +// timeNow is a variable for deterministic date-range tests. +var timeNow = func() time.Time { return time.Now() } diff --git a/internal/cmd/young_event/young_event_http_test.go b/internal/cmd/young_event/young_event_http_test.go index 4c60f2f..2d1e1b8 100644 --- a/internal/cmd/young_event/young_event_http_test.go +++ b/internal/cmd/young_event/young_event_http_test.go @@ -1,6 +1,7 @@ package young_event import ( + "context" "io" "net/http" "net/http/httptest" @@ -27,7 +28,7 @@ func TestFetchListMapsAllServerFilters(t *testing.T) { _, _ = io.WriteString(w, `{"data":[],"pagination":{"page":2,"pageSize":20,"total":0,"totalPages":0}}`) })) defer server.Close() - client, err := api.NewTypedClient(server.URL, false) + client, err := api.NewClient(server.URL, false) if err != nil { t.Fatal(err) } @@ -41,7 +42,7 @@ func TestFetchListMapsAllServerFilters(t *testing.T) { if err != nil { t.Fatal(err) } - if _, err := fetchList(client, params); err != nil { + if _, err := fetchList(context.Background(), client, params); err != nil { t.Fatal(err) } } diff --git a/internal/cmd/young_event/young_event_test.go b/internal/cmd/young_event/young_event_test.go index 2f0aaba..17cf8ac 100644 --- a/internal/cmd/young_event/young_event_test.go +++ b/internal/cmd/young_event/young_event_test.go @@ -17,11 +17,37 @@ func TestYoungEventFlagsMapToCanonicalPageSize(t *testing.T) { if err != nil { t.Fatal(err) } - if *params.Active != "true" || *params.Category != "系列项目" || *params.Search != "robotics" || *params.Page != 2 || *params.PageSize != 20 { + for key, want := range map[string]string{ + "active": "true", "category": "系列项目", "search": "robotics", "page": "2", "pageSize": "20", + } { + if got := params.Get(key); got != want { + t.Errorf("params[%s] = %q, want %q", key, got, want) + } + } + if len(params) != 5 { t.Fatalf("params = %#v", params) } } +func TestYoungEventFlagsMapNewFilters(t *testing.T) { + params, err := buildListParams(listOpts{ + organizerID: "org-1", + dateFrom: "2026-09-01", + dateTo: "2026-09-30", + timeBasis: "registration", + }) + if err != nil { + t.Fatal(err) + } + for key, want := range map[string]string{ + "organizerId": "org-1", "dateFrom": "2026-09-01", "dateTo": "2026-09-30", "timeBasis": "registration", + } { + if got := params.Get(key); got != want { + t.Errorf("params[%s] = %q, want %q", key, got, want) + } + } +} + func TestNormalizeActiveRejectsUnknownValue(t *testing.T) { if _, err := normalizeActive("yes"); err == nil { t.Fatal("normalizeActive accepted unknown value") @@ -36,3 +62,9 @@ func TestBuildListParamsRejectsNegativePagination(t *testing.T) { t.Fatal("buildListParams accepted a negative limit") } } + +func TestBuildListParamsRequiresDatePair(t *testing.T) { + if _, err := buildListParams(listOpts{dateFrom: "2026-09-01"}); err == nil { + t.Fatal("buildListParams accepted an unpaired date-from") + } +} diff --git a/internal/cmd/young_organizer/young_organizer.go b/internal/cmd/young_organizer/young_organizer.go new file mode 100644 index 0000000..aa65f5d --- /dev/null +++ b/internal/cmd/young_organizer/young_organizer.go @@ -0,0 +1,178 @@ +package young_organizer + +import ( + "fmt" + "net/http" + "net/url" + "strings" + + "github.com/spf13/cobra" + + "github.com/Life-USTC/CLI/internal/api" + "github.com/Life-USTC/CLI/internal/cmd/cmdutil" + "github.com/Life-USTC/CLI/internal/cmd/youngutil" + "github.com/Life-USTC/CLI/internal/output" +) + +type listOpts struct { + search string + page int + pageSize int +} + +// NewCmdYoungOrganizer exposes the public organizer view for Young events. +func NewCmdYoungOrganizer() *cobra.Command { + opts := listOpts{} + cmd := &cobra.Command{ + Use: "young-organizer [command]", + Aliases: []string{"young-organizers"}, + Short: "Browse second-classroom organizers", + Long: "List and view normalized Young (second-classroom) organizers.", + Example: ` # List organizers + life-ustc catalog young-organizer list + + # View one organizer and its event groups + life-ustc catalog young-organizer get `, + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + return runList(cmd, opts) + }, + } + addListFlags(cmd, &opts) + cmd.AddCommand(newCmdList()) + cmd.AddCommand(newCmdGet()) + return cmd +} + +func addListFlags(cmd *cobra.Command, opts *listOpts) { + cmd.Flags().StringVarP(&opts.search, "search", "s", "", "Search organizer names") + cmd.Flags().IntVarP(&opts.page, "page", "p", 0, "Page number") + cmd.Flags().IntVarP(&opts.pageSize, "limit", "L", 0, "Number of organizers per page") +} + +func newCmdList() *cobra.Command { + opts := listOpts{} + cmd := &cobra.Command{ + Use: "list", + Aliases: []string{"ls"}, + Short: "List Young organizers", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + return runList(cmd, opts) + }, + } + addListFlags(cmd, &opts) + return cmd +} + +func buildListParams(opts listOpts) (url.Values, error) { + params, err := youngutil.PageParams(opts.page, opts.pageSize) + if err != nil { + return nil, err + } + if search := strings.TrimSpace(opts.search); search != "" { + params.Set("search", search) + } + return params, nil +} + +func runList(cmd *cobra.Command, opts listOpts) error { + params, err := buildListParams(opts) + if err != nil { + return err + } + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) + if err != nil { + return err + } + data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.OrganizersPath, params, nil) + if err != nil { + return err + } + list := cmdutil.NewListResult(data, "data") + return output.OutputList(list.Raw, list.Rows, []output.Column{ + {Header: "ID", Key: "id"}, + {Header: "Name", Key: "name"}, + {Header: "Active", Key: "activeCount"}, + {Header: "Upcoming", Key: "upcomingCount"}, + {Header: "History", Key: "historyCount"}, + }, list.Total, list.Page) +} + +func newCmdGet() *cobra.Command { + return &cobra.Command{ + Use: "get ", + Aliases: []string{"show"}, + Short: "View a Young organizer", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + return runGet(cmd, args[0]) + }, + } +} + +func runGet(cmd *cobra.Command, organizerID string) error { + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) + if err != nil { + return err + } + data, err := client.DoJSON( + cmd.Context(), + http.MethodGet, + youngutil.PathID(youngutil.OrganizersPath, organizerID), + nil, + nil, + ) + if err != nil { + return err + } + + params := url.Values{"organizerId": []string{organizerID}} + events, err := youngutil.FetchAllPages( + cmd.Context(), + client, + youngutil.EventsPath, + params, + "data", + 100, + "youngId", + ) + if err != nil { + return err + } + eventList := cmdutil.NewListResult(events, "data") + if output.IsJSON() { + result := make(map[string]any) + if organizer := cmdutil.AsMap(data); organizer != nil { + for key, value := range organizer { + result[key] = value + } + } + result["events"] = eventList.Rows + return output.JSON(result) + } + if err := output.OutputDetail(data, []output.FieldDef{ + {Key: "id", Label: "ID"}, + {Key: "name", Label: "Name"}, + {Key: "normalizedName", Label: "Normalized name", SkipEmpty: true}, + {Key: "activeCount", Label: "Active events"}, + {Key: "upcomingCount", Label: "Upcoming events"}, + {Key: "historyCount", Label: "Historical events"}, + }, "Young organizer"); err != nil { + return err + } + if len(eventList.Rows) == 0 { + return nil + } + fmt.Println() + output.Bold(" Events") + output.Table(eventList.Rows, []output.Column{ + {Header: "Name", Key: "name"}, + {Header: "Category", Key: "category"}, + {Header: "Start", Key: "startAt"}, + {Header: "End", Key: "endAt"}, + {Header: "Active", Key: "isActive"}, + {Header: "Young ID", Key: "youngId"}, + }) + return nil +} diff --git a/internal/cmd/young_organizer/young_organizer_test.go b/internal/cmd/young_organizer/young_organizer_test.go new file mode 100644 index 0000000..a0ca871 --- /dev/null +++ b/internal/cmd/young_organizer/young_organizer_test.go @@ -0,0 +1,86 @@ +package young_organizer + +import ( + "io" + "net/http" + "net/http/httptest" + "testing" + + "github.com/Life-USTC/CLI/internal/api" + "github.com/spf13/cobra" +) + +func TestBuildListParamsMapsSearchAndPagination(t *testing.T) { + params, err := buildListParams(listOpts{search: "学生会", page: 2, pageSize: 25}) + if err != nil { + t.Fatal(err) + } + for key, want := range map[string]string{"search": "学生会", "page": "2", "pageSize": "25"} { + if got := params.Get(key); got != want { + t.Errorf("params[%s] = %q, want %q", key, got, want) + } + } +} + +func TestBuildListParamsRejectsNegativePagination(t *testing.T) { + if _, err := buildListParams(listOpts{page: -1}); err == nil { + t.Fatal("negative page accepted") + } + if _, err := buildListParams(listOpts{pageSize: -1}); err == nil { + t.Fatal("negative limit accepted") + } +} + +func TestOrganizerListUsesPublicEndpoint(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet || r.URL.Path != "/api/catalog/young-organizers" { + t.Fatalf("request = %s %s", r.Method, r.URL) + } + if got := r.URL.Query().Get("search"); got != "学生会" { + t.Fatalf("search = %q", got) + } + w.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(w, `{"data":[],"pagination":{"page":1,"pageSize":20,"total":0,"totalPages":1}}`) + })) + defer server.Close() + client, err := api.NewClient(server.URL, false) + if err != nil { + t.Fatal(err) + } + params, err := buildListParams(listOpts{search: "学生会"}) + if err != nil { + t.Fatal(err) + } + if _, err := client.DoJSON(t.Context(), http.MethodGet, "/api/catalog/young-organizers", params, nil); err != nil { + t.Fatal(err) + } +} + +func TestOrganizerGetLoadsEventsFromPaginatedCatalog(t *testing.T) { + t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + switch r.URL.Path { + case "/api/catalog/young-organizers/org-1": + _, _ = io.WriteString(w, `{"id":"org-1","name":"Students Union","normalizedName":"students union","activeCount":1,"upcomingCount":1,"historyCount":0}`) + case "/api/catalog/young-events": + if r.URL.Query().Get("organizerId") != "org-1" { + t.Fatalf("organizerId = %q", r.URL.Query().Get("organizerId")) + } + if r.URL.Query().Get("page") != "1" || r.URL.Query().Get("pageSize") != "100" { + t.Fatalf("pagination = %s", r.URL.RawQuery) + } + _, _ = io.WriteString(w, `{"data":[{"youngId":"event-1","name":"Activity","category":"single","startAt":"2026-09-01T09:00:00+08:00","endAt":null,"isActive":true}],"pagination":{"page":1,"pageSize":100,"total":1,"totalPages":1},"unknownDates":[],"source":{"status":"fresh","lastSyncedAt":null}}`) + default: + http.NotFound(w, r) + } + })) + defer server.Close() + root := &cobra.Command{Use: "test"} + root.PersistentFlags().String("server", server.URL, "") + root.AddCommand(NewCmdYoungOrganizer()) + root.SetArgs([]string{"young-organizer", "get", "org-1"}) + if err := root.Execute(); err != nil { + t.Fatal(err) + } +} diff --git a/internal/cmd/young_workspace/young_workspace.go b/internal/cmd/young_workspace/young_workspace.go new file mode 100644 index 0000000..5f9bcba --- /dev/null +++ b/internal/cmd/young_workspace/young_workspace.go @@ -0,0 +1,364 @@ +package young_workspace + +import ( + "fmt" + "net/http" + "net/url" + "strconv" + + "github.com/spf13/cobra" + + "github.com/Life-USTC/CLI/internal/api" + "github.com/Life-USTC/CLI/internal/cmd/cmdutil" + "github.com/Life-USTC/CLI/internal/cmd/youngutil" + "github.com/Life-USTC/CLI/internal/output" +) + +// NewCmdYoungEventSubscription manages personal Young event subscriptions. +func NewCmdYoungEventSubscription() *cobra.Command { + cmd := &cobra.Command{ + Use: "young-event-subscription ", + Aliases: []string{"young-event-subscriptions"}, + Short: "Manage Young event subscriptions", + Args: cobra.NoArgs, + } + cmd.AddCommand(newEventSubscriptionList(), newEventSubscriptionGet(), newEventSubscriptionSet()) + return cmd +} + +func newEventSubscriptionList() *cobra.Command { + var page, limit int + cmd := &cobra.Command{ + Use: "list", + Aliases: []string{"ls"}, + Short: "List your Young event subscriptions", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + params, err := listParams(page, limit) + if err != nil { + return err + } + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.YoungEventSubscriptionsPath, params, nil) + if err != nil { + return err + } + list := cmdutil.NewListResult(data, "data") + return output.OutputList(list.Raw, list.Rows, []output.Column{ + {Header: "Young ID", Key: "youngId"}, + {Header: "Name", Key: "event.name"}, + {Header: "Start", Key: "event.startAt"}, + {Header: "Signup", Key: "remindSignup"}, + {Header: "Deadline", Key: "remindDeadline"}, + {Header: "Start reminder", Key: "remindStart"}, + }, list.Total, list.Page) + }, + } + cmd.Flags().IntVarP(&page, "page", "p", 0, "Page number") + cmd.Flags().IntVarP(&limit, "limit", "L", 0, "Number of subscriptions per page") + return cmd +} + +func newEventSubscriptionGet() *cobra.Command { + return &cobra.Command{ + Use: "get ", + Aliases: []string{"show"}, + Short: "Read one Young event subscription state", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + data, err := client.DoJSON( + cmd.Context(), + http.MethodGet, + youngutil.PathID(youngutil.YoungEventSubscriptionsPath, args[0]), + nil, + nil, + ) + if err != nil { + return err + } + return output.OutputDetail(data, eventSubscriptionFields(), "Young event subscription") + }, + } +} + +func newEventSubscriptionSet() *cobra.Command { + var subscribed, remindSignup, remindDeadline, remindStart string + cmd := &cobra.Command{ + Use: "set ", + Short: "Set a Young event subscription and reminder flags", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + if !cmd.Flags().Changed("subscribed") { + return fmt.Errorf("--subscribed is required (true or false)") + } + subscribedValue, err := parseBoolValue("--subscribed", subscribed) + if err != nil { + return err + } + body := map[string]any{"subscribed": subscribedValue} + if cmd.Flags().Changed("remind-signup") { + value, err := parseBoolValue("--remind-signup", remindSignup) + if err != nil { + return err + } + body["remindSignup"] = value + } + if cmd.Flags().Changed("remind-deadline") { + value, err := parseBoolValue("--remind-deadline", remindDeadline) + if err != nil { + return err + } + body["remindDeadline"] = value + } + if cmd.Flags().Changed("remind-start") { + value, err := parseBoolValue("--remind-start", remindStart) + if err != nil { + return err + } + body["remindStart"] = value + } + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + data, err := client.DoJSON( + cmd.Context(), + http.MethodPut, + youngutil.PathID(youngutil.YoungEventSubscriptionsPath, args[0]), + nil, + body, + ) + if err != nil { + return err + } + return output.OutputDetail(data, eventSubscriptionFields(), "Young event subscription") + }, + } + cmd.Flags().StringVar(&subscribed, "subscribed", "", "Subscribe (true) or unsubscribe (false)") + cmd.Flags().StringVar(&remindSignup, "remind-signup", "", "Notify when signup opens (true or false)") + cmd.Flags().StringVar(&remindDeadline, "remind-deadline", "", "Notify 24 hours before signup closes (true or false)") + cmd.Flags().StringVar(&remindStart, "remind-start", "", "Notify one hour before the event starts (true or false)") + return cmd +} + +func eventSubscriptionFields() []output.FieldDef { + return []output.FieldDef{ + {Key: "youngId", Label: "Young ID"}, + {Key: "subscribed", Label: "Subscribed"}, + {Key: "remindSignup", Label: "Signup reminder"}, + {Key: "remindDeadline", Label: "Deadline reminder"}, + {Key: "remindStart", Label: "Start reminder"}, + } +} + +// NewCmdYoungOrganizerSubscription manages personal Young organizer follows. +func NewCmdYoungOrganizerSubscription() *cobra.Command { + cmd := &cobra.Command{ + Use: "young-organizer-subscription ", + Aliases: []string{"young-organizer-subscriptions"}, + Short: "Manage Young organizer subscriptions", + Args: cobra.NoArgs, + } + cmd.AddCommand(newOrganizerSubscriptionList(), newOrganizerSubscriptionGet(), newOrganizerSubscriptionSet()) + return cmd +} + +func newOrganizerSubscriptionList() *cobra.Command { + var page, limit int + cmd := &cobra.Command{ + Use: "list", + Aliases: []string{"ls"}, + Short: "List your Young organizer subscriptions", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + params, err := listParams(page, limit) + if err != nil { + return err + } + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.YoungOrganizerSubscriptionsPath, params, nil) + if err != nil { + return err + } + list := cmdutil.NewListResult(data, "data") + return output.OutputList(list.Raw, list.Rows, []output.Column{ + {Header: "Organizer ID", Key: "organizerId"}, + {Header: "Name", Key: "organizer.name"}, + {Header: "Created", Key: "createdAt"}, + }, list.Total, list.Page) + }, + } + cmd.Flags().IntVarP(&page, "page", "p", 0, "Page number") + cmd.Flags().IntVarP(&limit, "limit", "L", 0, "Number of subscriptions per page") + return cmd +} + +func newOrganizerSubscriptionGet() *cobra.Command { + return &cobra.Command{ + Use: "get ", + Aliases: []string{"show"}, + Short: "Read one Young organizer subscription state", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + data, err := client.DoJSON( + cmd.Context(), + http.MethodGet, + youngutil.PathID(youngutil.YoungOrganizerSubscriptionsPath, args[0]), + nil, + nil, + ) + if err != nil { + return err + } + return output.OutputDetail(data, organizerSubscriptionFields(), "Young organizer subscription") + }, + } +} + +func newOrganizerSubscriptionSet() *cobra.Command { + var subscribed string + cmd := &cobra.Command{ + Use: "set ", + Short: "Set a Young organizer subscription", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + if !cmd.Flags().Changed("subscribed") { + return fmt.Errorf("--subscribed is required (true or false)") + } + subscribedValue, err := parseBoolValue("--subscribed", subscribed) + if err != nil { + return err + } + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + data, err := client.DoJSON( + cmd.Context(), + http.MethodPut, + youngutil.PathID(youngutil.YoungOrganizerSubscriptionsPath, args[0]), + nil, + map[string]any{"subscribed": subscribedValue}, + ) + if err != nil { + return err + } + return output.OutputDetail(data, organizerSubscriptionFields(), "Young organizer subscription") + }, + } + cmd.Flags().StringVar(&subscribed, "subscribed", "", "Follow (true) or unfollow (false)") + return cmd +} + +func organizerSubscriptionFields() []output.FieldDef { + return []output.FieldDef{ + {Key: "organizerId", Label: "Organizer ID"}, + {Key: "subscribed", Label: "Subscribed"}, + } +} + +// NewCmdYoungNotification manages personal Young activity notifications. +func NewCmdYoungNotification() *cobra.Command { + cmd := &cobra.Command{ + Use: "young-notification ", + Aliases: []string{"young-notifications"}, + Short: "Read Young activity notifications", + Args: cobra.NoArgs, + } + cmd.AddCommand(newNotificationList(), newNotificationRead()) + return cmd +} + +func newNotificationList() *cobra.Command { + var page, limit int + var unread bool + cmd := &cobra.Command{ + Use: "list", + Aliases: []string{"ls"}, + Short: "List your Young notifications", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + params, err := listParams(page, limit) + if err != nil { + return err + } + if cmd.Flags().Changed("unread") { + params.Set("unread", strconv.FormatBool(unread)) + } + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.YoungNotificationsPath, params, nil) + if err != nil { + return err + } + list := cmdutil.NewListResult(data, "data") + return output.OutputList(list.Raw, list.Rows, []output.Column{ + {Header: "Created", Key: "createdAt"}, + {Header: "Title", Key: "title"}, + {Header: "Kind", Key: "kind"}, + {Header: "Read", Key: "readAt"}, + {Header: "Young ID", Key: "youngId"}, + {Header: "Organizer ID", Key: "organizerId"}, + }, list.Total, list.Page) + }, + } + cmd.Flags().BoolVar(&unread, "unread", false, "Show only unread notifications (or false for read notifications)") + cmd.Flags().IntVarP(&page, "page", "p", 0, "Page number") + cmd.Flags().IntVarP(&limit, "limit", "L", 0, "Number of notifications per page") + return cmd +} + +func newNotificationRead() *cobra.Command { + return &cobra.Command{ + Use: "read ", + Short: "Mark a Young notification as read", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) + if err != nil { + return err + } + data, err := client.DoJSON( + cmd.Context(), + http.MethodPost, + youngutil.PathID(youngutil.YoungNotificationsPath, args[0])+"/read", + nil, + nil, + ) + if err != nil { + return err + } + return output.OutputDetail(data, []output.FieldDef{ + {Key: "id", Label: "Notification ID"}, + {Key: "success", Label: "Success"}, + }, "Young notification") + }, + } +} + +func listParams(page, limit int) (url.Values, error) { + return youngutil.PageParams(page, limit) +} + +func parseBoolValue(flag, value string) (bool, error) { + if value != "true" && value != "false" { + return false, fmt.Errorf("%s must be true or false", flag) + } + return value == "true", nil +} diff --git a/internal/cmd/young_workspace/young_workspace_test.go b/internal/cmd/young_workspace/young_workspace_test.go new file mode 100644 index 0000000..a14e0e4 --- /dev/null +++ b/internal/cmd/young_workspace/young_workspace_test.go @@ -0,0 +1,98 @@ +package young_workspace + +import ( + "io" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/Life-USTC/CLI/internal/config" + "github.com/spf13/cobra" +) + +func TestEventSubscriptionSetSendsReminderFlags(t *testing.T) { + t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) + var gotAuth string + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPut || r.URL.Path != "/api/workspace/young-event-subscriptions/event-1" { + t.Fatalf("request = %s %s", r.Method, r.URL) + } + gotAuth = r.Header.Get("Authorization") + body, err := io.ReadAll(r.Body) + if err != nil { + t.Fatal(err) + } + if got, want := string(body), `{"remindDeadline":false,"remindSignup":true,"remindStart":true,"subscribed":true}`; got != want { + t.Fatalf("body = %q, want %q", got, want) + } + w.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(w, `{"youngId":"event-1","subscribed":true,"remindSignup":true,"remindDeadline":false,"remindStart":true}`) + })) + defer server.Close() + saveTestCredentials(t, server.URL) + root := commandRoot(server.URL, NewCmdYoungEventSubscription()) + root.SetArgs([]string{"young-event-subscription", "set", "--subscribed", "true", "--remind-signup", "true", "--remind-deadline", "false", "--remind-start", "true", "event-1"}) + if err := root.Execute(); err != nil { + t.Fatal(err) + } + if gotAuth != "Bearer access-token" { + t.Fatalf("Authorization = %q", gotAuth) + } +} + +func TestOrganizerSubscriptionListMapsPagination(t *testing.T) { + t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet || r.URL.Path != "/api/workspace/young-organizer-subscriptions" { + t.Fatalf("request = %s %s", r.Method, r.URL) + } + if r.URL.Query().Get("page") != "2" || r.URL.Query().Get("pageSize") != "10" { + t.Fatalf("query = %s", r.URL.RawQuery) + } + w.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(w, `{"data":[],"pagination":{"page":2,"pageSize":10,"total":0,"totalPages":1}}`) + })) + defer server.Close() + saveTestCredentials(t, server.URL) + root := commandRoot(server.URL, NewCmdYoungOrganizerSubscription()) + root.SetArgs([]string{"young-organizer-subscription", "list", "--page", "2", "--limit", "10"}) + if err := root.Execute(); err != nil { + t.Fatal(err) + } +} + +func TestNotificationReadPostsToReadRoute(t *testing.T) { + t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost || r.URL.Path != "/api/workspace/young-notifications/notification-1/read" { + t.Fatalf("request = %s %s", r.Method, r.URL) + } + w.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(w, `{"id":"notification-1","success":true}`) + })) + defer server.Close() + saveTestCredentials(t, server.URL) + root := commandRoot(server.URL, NewCmdYoungNotification()) + root.SetArgs([]string{"young-notification", "read", "notification-1"}) + if err := root.Execute(); err != nil { + t.Fatal(err) + } +} + +func commandRoot(server string, child *cobra.Command) *cobra.Command { + root := &cobra.Command{Use: "test"} + root.PersistentFlags().String("server", server, "") + root.AddCommand(child) + return root +} + +func saveTestCredentials(t *testing.T, server string) { + t.Helper() + if err := config.SaveCredentials(server, &config.Credential{ + AccessToken: "access-token", + ExpiresAt: float64(time.Now().Add(time.Hour).Unix()), + }); err != nil { + t.Fatal(err) + } +} diff --git a/internal/cmd/youngutil/youngutil.go b/internal/cmd/youngutil/youngutil.go new file mode 100644 index 0000000..40a054a --- /dev/null +++ b/internal/cmd/youngutil/youngutil.go @@ -0,0 +1,254 @@ +// Package youngutil contains the small amount of transport and date handling +// shared by Young catalog and workspace commands. +package youngutil + +import ( + "context" + "fmt" + "net/url" + "strconv" + "strings" + "time" + + "github.com/Life-USTC/CLI/internal/api" + "github.com/Life-USTC/CLI/internal/cmd/cmdutil" +) + +const ( + EventsPath = "/api/catalog/young-events" + OrganizersPath = "/api/catalog/young-organizers" + YoungEventSubscriptionsPath = "/api/workspace/young-event-subscriptions" + YoungOrganizerSubscriptionsPath = "/api/workspace/young-organizer-subscriptions" + YoungNotificationsPath = "/api/workspace/young-notifications" + PersonalCalendarEventsPath = "/api/workspace/calendar/events" +) + +var Shanghai = time.FixedZone("Asia/Shanghai", 8*60*60) + +// PathID appends an opaque public identifier to a REST path safely. +func PathID(base, id string) string { + return strings.TrimRight(base, "/") + "/" + url.PathEscape(id) +} + +// PageParams validates CLI pagination flags and maps --limit to pageSize. +func PageParams(page, limit int) (url.Values, error) { + if page < 0 { + return nil, fmt.Errorf("--page must be zero or greater") + } + if limit < 0 { + return nil, fmt.Errorf("--limit must be zero or greater") + } + params := url.Values{} + if page > 0 { + params.Set("page", strconv.Itoa(page)) + } + if limit > 0 { + params.Set("pageSize", strconv.Itoa(limit)) + } + return params, nil +} + +func cloneValues(values url.Values) url.Values { + clone := make(url.Values, len(values)) + for key, items := range values { + clone[key] = append([]string(nil), items...) + } + return clone +} + +// FetchAllPages reads every page of a standard {data, pagination} response. +// The returned response is rewritten as one complete page so table, JSON and +// jq output all describe the same result. +func FetchAllPages( + ctx context.Context, + client *api.Client, + path string, + params url.Values, + key string, + pageSize int, + identityKey string, +) (any, error) { + if pageSize < 1 { + return nil, fmt.Errorf("page size must be positive") + } + + firstParams := cloneValues(params) + firstParams.Set("page", "1") + firstParams.Set("pageSize", strconv.Itoa(pageSize)) + first, err := client.DoJSON(ctx, "GET", path, firstParams, nil) + if err != nil { + return nil, err + } + total, totalPages, err := pagination(first) + if err != nil { + return nil, err + } + firstResult := cmdutil.NewListResult(first, key) + if len(firstResult.Rows) > pageSize { + return nil, fmt.Errorf("%s returned an oversized page", path) + } + rows := append([]map[string]any(nil), firstResult.Rows...) + seen := make(map[string]struct{}, len(rows)) + if identityKey != "" { + if err := collectIDs(seen, rows, identityKey, path); err != nil { + return nil, err + } + } + + if totalPages < 0 || totalPages > 10000 { + return nil, fmt.Errorf("%s returned an invalid page count", path) + } + if total == 0 { + if len(rows) != 0 || totalPages > 1 { + return nil, fmt.Errorf("%s returned inconsistent empty pagination", path) + } + } else { + if totalPages < 1 { + return nil, fmt.Errorf("%s returned no pages for %d results", path, total) + } + for page := 2; page <= totalPages; page++ { + pageParams := cloneValues(params) + pageParams.Set("page", strconv.Itoa(page)) + pageParams.Set("pageSize", strconv.Itoa(pageSize)) + payload, fetchErr := client.DoJSON(ctx, "GET", path, pageParams, nil) + if fetchErr != nil { + return nil, fetchErr + } + pageTotal, pageCount, pageErr := pagination(payload) + if pageErr != nil { + return nil, pageErr + } + if pageTotal != total || pageCount != totalPages { + return nil, fmt.Errorf("%s changed pagination between pages", path) + } + pageResult := cmdutil.NewListResult(payload, key) + if len(pageResult.Rows) > pageSize { + return nil, fmt.Errorf("%s returned an oversized page", path) + } + if identityKey != "" { + if err := collectIDs(seen, pageResult.Rows, identityKey, path); err != nil { + return nil, err + } + } + rows = append(rows, pageResult.Rows...) + } + } + if len(rows) != total { + return nil, fmt.Errorf("%s returned %d of %d results", path, len(rows), total) + } + + result := cmdutil.NewListResult(first, key) + result.Raw = cmdutil.WithListRows(first, key, rows, total, 1) + if m := cmdutil.AsMap(result.Raw); m != nil { + if pg := cmdutil.AsMap(m["pagination"]); pg != nil { + pg["page"] = 1 + resultPageSize := len(rows) + if resultPageSize == 0 { + resultPageSize = pageSize + } + pg["pageSize"] = resultPageSize + pg["total"] = total + pg["totalPages"] = 1 + } + } + return result.Raw, nil +} + +func pagination(data any) (total, totalPages int, err error) { + m := cmdutil.AsMap(data) + if m == nil { + return 0, 0, fmt.Errorf("paginated response is not an object") + } + pg := cmdutil.AsMap(m["pagination"]) + if pg == nil { + return 0, 0, fmt.Errorf("paginated response has no pagination") + } + total, ok := integer(pg["total"]) + if !ok || total < 0 { + return 0, 0, fmt.Errorf("paginated response has an invalid total") + } + totalPages, ok = integer(pg["totalPages"]) + if !ok || totalPages < 0 { + return 0, 0, fmt.Errorf("paginated response has an invalid totalPages") + } + return total, totalPages, nil +} + +func integer(value any) (int, bool) { + switch v := value.(type) { + case float64: + if v != float64(int(v)) { + return 0, false + } + return int(v), true + case int: + return v, true + case int64: + return int(v), true + default: + return 0, false + } +} + +func collectIDs(seen map[string]struct{}, rows []map[string]any, key, path string) error { + for _, row := range rows { + value, ok := row[key] + if !ok || value == nil || strings.TrimSpace(fmt.Sprint(value)) == "" { + return fmt.Errorf("%s returned a row without %s", path, key) + } + id := fmt.Sprint(value) + if _, exists := seen[id]; exists { + return fmt.Errorf("%s returned duplicate %s %q", path, key, id) + } + seen[id] = struct{}{} + } + return nil +} + +type DateView string + +const ( + DateDay DateView = "day" + DateWeek DateView = "week" + DateMonth DateView = "month" +) + +// DateRange returns inclusive Shanghai calendar-date bounds for an anchor. +// An empty anchor means today in Asia/Shanghai. +func DateRange(view DateView, anchor string, now time.Time) (string, string, error) { + date, err := anchorDate(anchor, now) + if err != nil { + return "", "", err + } + switch view { + case DateDay: + formatted := formatDate(date) + return formatted, formatted, nil + case DateWeek: + offset := (int(date.Weekday()) + 6) % 7 + start := date.AddDate(0, 0, -offset) + return formatDate(start), formatDate(start.AddDate(0, 0, 6)), nil + case DateMonth: + start := time.Date(date.Year(), date.Month(), 1, 0, 0, 0, 0, Shanghai) + end := start.AddDate(0, 1, -1) + return formatDate(start), formatDate(end), nil + default: + return "", "", fmt.Errorf("unsupported date view %q", view) + } +} + +func anchorDate(anchor string, now time.Time) (time.Time, error) { + if strings.TrimSpace(anchor) == "" { + now = now.In(Shanghai) + return time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, Shanghai), nil + } + date, err := time.ParseInLocation("2006-01-02", strings.TrimSpace(anchor), Shanghai) + if err != nil { + return time.Time{}, fmt.Errorf("invalid date %q (use YYYY-MM-DD)", anchor) + } + return date, nil +} + +func formatDate(date time.Time) string { + return date.In(Shanghai).Format("2006-01-02") +} diff --git a/internal/cmd/youngutil/youngutil_test.go b/internal/cmd/youngutil/youngutil_test.go new file mode 100644 index 0000000..20ea583 --- /dev/null +++ b/internal/cmd/youngutil/youngutil_test.go @@ -0,0 +1,90 @@ +package youngutil + +import ( + "io" + "net/http" + "net/http/httptest" + "net/url" + "testing" + "time" + + "github.com/Life-USTC/CLI/internal/api" +) + +func TestDateRangeUsesShanghaiCalendarBoundaries(t *testing.T) { + now := time.Date(2026, time.September, 16, 23, 30, 0, 0, time.FixedZone("UTC", 0)) + tests := []struct { + view DateView + from, to string + }{ + {DateDay, "2026-09-17", "2026-09-17"}, + {DateWeek, "2026-09-14", "2026-09-20"}, + {DateMonth, "2026-09-01", "2026-09-30"}, + } + for _, tt := range tests { + from, to, err := DateRange(tt.view, "", now) + if err != nil { + t.Fatalf("DateRange(%q): %v", tt.view, err) + } + if from != tt.from || to != tt.to { + t.Errorf("DateRange(%q) = %s..%s, want %s..%s", tt.view, from, to, tt.from, tt.to) + } + } +} + +func TestDateRangeRejectsInvalidAnchor(t *testing.T) { + if _, _, err := DateRange(DateDay, "2026-02-30", time.Now()); err == nil { + t.Fatal("DateRange accepted an invalid anchor") + } +} + +func TestFetchAllPagesTraversesCompleteResponse(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Query().Get("pageSize") != "2" { + t.Errorf("pageSize = %q", r.URL.Query().Get("pageSize")) + } + page := r.URL.Query().Get("page") + w.Header().Set("Content-Type", "application/json") + if page == "1" { + _, _ = io.WriteString(w, `{"data":[{"youngId":"a"},{"youngId":"b"}],"pagination":{"page":1,"pageSize":2,"total":3,"totalPages":2}}`) + return + } + if page == "2" { + _, _ = io.WriteString(w, `{"data":[{"youngId":"c"}],"pagination":{"page":2,"pageSize":2,"total":3,"totalPages":2}}`) + return + } + http.Error(w, "unexpected page", http.StatusBadRequest) + })) + defer server.Close() + client, err := api.NewClient(server.URL, false) + if err != nil { + t.Fatal(err) + } + data, err := FetchAllPages(t.Context(), client, "/events", url.Values{"dateFrom": []string{"2026-09-01"}}, "data", 2, "youngId") + if err != nil { + t.Fatal(err) + } + rows := data.(map[string]any)["data"].([]any) + if len(rows) != 3 { + t.Fatalf("rows = %#v", rows) + } + pagination := data.(map[string]any)["pagination"].(map[string]any) + if pagination["totalPages"] != 1 { + t.Fatalf("pagination = %#v", pagination) + } +} + +func TestFetchAllPagesRejectsIncompleteResponse(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(w, `{"data":[{"youngId":"a"}],"pagination":{"page":1,"pageSize":2,"total":3,"totalPages":2}}`) + })) + defer server.Close() + client, err := api.NewClient(server.URL, false) + if err != nil { + t.Fatal(err) + } + if _, err := FetchAllPages(t.Context(), client, "/events", nil, "data", 2, "youngId"); err == nil { + t.Fatal("FetchAllPages accepted an incomplete response") + } +} From 339f334be3eb9162bbf58d568b45e4ffde272314 Mon Sep 17 00:00:00 2001 From: Tiankai Ma Date: Tue, 15 Sep 2026 16:17:17 +0800 Subject: [PATCH 2/4] fix: complete Young CLI pagination and contracts --- internal/cmd/comment/comment.go | 185 +++++++++++++----- internal/cmd/comment/comment_test.go | 26 ++- internal/cmd/workspace/workspace.go | 21 +- internal/cmd/workspace/workspace_test.go | 26 ++- internal/cmd/young_event/young_event.go | 77 ++++++-- internal/cmd/young_event/young_event_test.go | 25 +++ .../cmd/young_organizer/young_organizer.go | 70 +++---- .../young_organizer/young_organizer_test.go | 12 +- .../cmd/young_workspace/young_workspace.go | 62 +++++- internal/cmd/youngutil/youngutil.go | 30 +++ internal/cmd/youngutil/youngutil_test.go | 9 + 11 files changed, 406 insertions(+), 137 deletions(-) diff --git a/internal/cmd/comment/comment.go b/internal/cmd/comment/comment.go index c69daa3..ec81c95 100644 --- a/internal/cmd/comment/comment.go +++ b/internal/cmd/comment/comment.go @@ -12,12 +12,15 @@ import ( "github.com/Life-USTC/CLI/internal/api" "github.com/Life-USTC/CLI/internal/cmd/cmdutil" + "github.com/Life-USTC/CLI/internal/cmd/youngutil" openapi "github.com/Life-USTC/CLI/internal/openapi" "github.com/Life-USTC/CLI/internal/output" ) var targetTypes = []string{"section", "course", "teacher", "section-teacher", "homework", "young-event"} +const commentsPath = "/api/community/comments" + type commentTarget struct { targetType string targetID string @@ -45,13 +48,14 @@ func validCommentTargetType(targetType string) bool { } func validateTarget(target commentTarget, requireID bool) error { + target = normalizeTarget(target) if !validCommentTargetType(target.targetType) { return fmt.Errorf("invalid --target-type %q", target.targetType) } if target.targetType == "young-event" { target = normalizeTarget(target) - if target.youngID == "" { - return fmt.Errorf("--young-id is required for young-event target") + if _, err := youngutil.RequireID(target.youngID, "--young-id"); err != nil { + return err } return nil } @@ -59,18 +63,26 @@ func validateTarget(target commentTarget, requireID bool) error { return nil } if target.targetType == "section-teacher" { - if target.sectionID == "" || target.teacherID == "" { - return fmt.Errorf("--section-id and --teacher-id are required for section-teacher target") + if _, err := youngutil.RequireID(target.sectionID, "--section-id"); err != nil { + return err + } + if _, err := youngutil.RequireID(target.teacherID, "--teacher-id"); err != nil { + return err } return nil } - if target.targetID == "" { - return fmt.Errorf("--target-id is required for this target type") + if _, err := youngutil.RequireID(target.targetID, "--target-id"); err != nil { + return err } return nil } func normalizeTarget(target commentTarget) commentTarget { + target.targetType = strings.TrimSpace(target.targetType) + target.targetID = strings.TrimSpace(target.targetID) + target.youngID = strings.TrimSpace(target.youngID) + target.sectionID = strings.TrimSpace(target.sectionID) + target.teacherID = strings.TrimSpace(target.teacherID) if target.targetType == "young-event" && target.youngID == "" { target.youngID = target.targetID } @@ -91,50 +103,66 @@ func runCommentList(cmd *cobra.Command, target commentTarget) error { if err := validateTarget(target, false); err != nil { return err } - if target.targetType == "young-event" { - client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) - if err != nil { - return err - } - params := url.Values{ - "targetType": []string{"young-event"}, - "youngId": []string{target.youngID}, - } - data, err := client.DoJSON(cmd.Context(), http.MethodGet, "/api/community/comments", params, nil) - if err != nil { - return err - } - _, rows, total, pg := cmdutil.ExtractList(data, "comments", "data") - return output.OutputList(data, rows, listCommentColumns(), total, pg) + params, err := commentListParams(cmd, target) + if err != nil { + return err } - c, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), false) + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) if err != nil { return err } - params := &openapi.ListCommentsParams{ - TargetType: openapi.ListCommentsParamsTargetType(target.targetType), + data, err := youngutil.FetchAllIfUnpaged( + cmd.Context(), + client, + commentsPath, + params, + "data", + 100, + "id", + ) + if err != nil { + return err } - if target.targetID != "" { - params.TargetId = &target.targetID + list := cmdutil.NewListResult(data, "data") + return output.OutputList(list.Raw, list.Rows, listCommentColumns(), list.Total, list.Page) +} + +func commentListParams(cmd *cobra.Command, target commentTarget) (url.Values, error) { + params, err := youngutil.PageParams(commandIntFlag(cmd, "page"), commandIntFlag(cmd, "limit")) + if err != nil { + return nil, err + } + params.Set("targetType", target.targetType) + if target.targetID != "" && target.targetType != "young-event" { + params.Set("targetId", target.targetID) + } + if target.youngID != "" { + params.Set("youngId", target.youngID) } if target.sectionID != "" { - params.SectionId, err = cmdutil.Int64PtrIfSet(target.sectionID) - if err != nil { - return err + if _, err := cmdutil.Int64PtrIfSet(target.sectionID); err != nil { + return nil, err } + params.Set("sectionId", target.sectionID) } if target.teacherID != "" { - params.TeacherId, err = cmdutil.Int64PtrIfSet(target.teacherID) - if err != nil { - return err + if _, err := cmdutil.Int64PtrIfSet(target.teacherID); err != nil { + return nil, err } + params.Set("teacherId", target.teacherID) } - data, err := api.ParseResponseRaw(c.ListComments(api.Ctx(), params)) + return params, nil +} + +func commandIntFlag(cmd *cobra.Command, name string) int { + if cmd.Flags().Lookup(name) == nil { + return 0 + } + value, err := cmd.Flags().GetInt(name) if err != nil { - return err + return 0 } - _, rows, total, pg := cmdutil.ExtractList(data, "comments") - return output.OutputList(data, rows, listCommentColumns(), total, pg) + return value } func runCommentCreate(cmd *cobra.Command, target commentTarget, body, visibility, parentID string, anonymous bool) error { @@ -160,14 +188,11 @@ func runCommentCreate(cmd *cobra.Command, target commentTarget, body, visibility if parentID != "" { request["parentId"] = parentID } - data, err := client.DoJSON(cmd.Context(), http.MethodPost, "/api/community/comments", nil, request) + data, err := client.DoJSON(cmd.Context(), http.MethodPost, commentsPath, nil, request) if err != nil { return err } - m := cmdutil.AsMap(data) - id, _ := m["id"].(string) - output.Success(fmt.Sprintf("Comment created: %s", id)) - return nil + return reportCommentCreated(data) } c, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), true) if err != nil { @@ -203,8 +228,21 @@ func runCommentCreate(cmd *cobra.Command, target commentTarget, body, visibility if err != nil { return err } + return reportCommentCreated(data) +} + +func reportCommentCreated(data any) error { + if output.IsJSON() { + return output.JSON(data) + } m := cmdutil.AsMap(data) + if m == nil { + return fmt.Errorf("unexpected comment response format") + } id, _ := m["id"].(string) + if id == "" { + return fmt.Errorf("comment response has no id") + } output.Success(fmt.Sprintf("Comment created: %s", id)) return nil } @@ -213,6 +251,7 @@ func NewCmdComment() *cobra.Command { cmd := &cobra.Command{ Use: "comment ", Short: "Read and write comments", + Args: cobra.NoArgs, } cmd.AddCommand(newCmdList()) cmd.AddCommand(newCmdView()) @@ -229,6 +268,7 @@ func NewCmdCommentFor(targetType string) *cobra.Command { cmd := &cobra.Command{ Use: "comment ", Short: fmt.Sprintf("Comments on this %s", targetType), + Args: cobra.NoArgs, } cmd.AddCommand(newCmdListFor(targetType)) cmd.AddCommand(newCmdView()) @@ -246,9 +286,16 @@ func newCmdListFor(targetType string) *cobra.Command { Short: fmt.Sprintf("List comments for a %s", targetType), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - return runCommentList(cmd, commentTarget{targetType: targetType, targetID: args[0]}) + targetID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } + return runCommentList(cmd, commentTarget{targetType: targetType, targetID: targetID}) }, } + var page, limit int + cmd.Flags().IntVarP(&page, "page", "p", 0, "Page number") + cmd.Flags().IntVarP(&limit, "limit", "L", 0, "Number of comments per page") return cmd } @@ -263,13 +310,17 @@ func newCmdCreateFor(targetType string) *cobra.Command { Short: fmt.Sprintf("Post a comment on a %s", targetType), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + targetID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } if body == "" { if !cmdutil.IsInteractive() { return fmt.Errorf("--body is required in non-interactive mode") } body = cmdutil.PromptText("Comment body") } - return runCommentCreate(cmd, commentTarget{targetType: targetType, targetID: args[0]}, body, visibility, parentID, anonymous) + return runCommentCreate(cmd, commentTarget{targetType: targetType, targetID: targetID}, body, visibility, parentID, anonymous) }, } cmd.Flags().StringVarP(&body, "body", "b", "", "Comment body") @@ -287,6 +338,7 @@ func newCmdList() *cobra.Command { Use: "list", Aliases: []string{"ls"}, Short: "List comments for a target", + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { if targetType == "" { return fmt.Errorf("--target-type is required") @@ -305,6 +357,9 @@ func newCmdList() *cobra.Command { cmd.Flags().StringVar(&youngID, "young-id", "", "Young event ID (for --target-type young-event)") cmd.Flags().StringVar(§ionID, "section-id", "", "Section ID (for section-teacher)") cmd.Flags().StringVar(&teacherID, "teacher-id", "", "Teacher ID (for section-teacher)") + var page, limit int + cmd.Flags().IntVarP(&page, "page", "p", 0, "Page number") + cmd.Flags().IntVarP(&limit, "limit", "L", 0, "Number of comments per page") return cmd } @@ -315,11 +370,15 @@ func newCmdView() *cobra.Command { Short: "View a comment thread", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + commentID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } c, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), false) if err != nil { return err } - data, err := api.ParseResponseRaw(c.GetComment(api.Ctx(), args[0])) + data, err := api.ParseResponseRaw(c.GetComment(api.Ctx(), commentID)) if err != nil { return err } @@ -362,6 +421,7 @@ func newCmdCreate() *cobra.Command { Aliases: []string{"new"}, Short: "Post a comment", Long: "Post a comment. Prompts interactively when --target-type/--body are omitted.", + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { if targetType == "" || body == "" { if !cmdutil.IsInteractive() { @@ -462,12 +522,11 @@ func newCmdUpdate() *cobra.Command { if err != nil { return err } - _, err = api.ParseResponseRaw(c.UpdateCommentWithBody(api.Ctx(), id, "application/json", bytes.NewReader(jsonBytes))) + data, err := api.ParseResponseRaw(c.UpdateCommentWithBody(api.Ctx(), id, "application/json", bytes.NewReader(jsonBytes))) if err != nil { return err } - output.Success("Comment updated.") - return nil + return reportCommentMutation(data, "Comment updated.") }, } cmd.Flags().StringVarP(&body, "body", "b", "", "New body") @@ -489,7 +548,11 @@ func newCmdDelete() *cobra.Command { if len(args) > 0 { ids = make([]string, len(args)) for i, arg := range args { - ids[i] = strings.TrimSpace(arg) + id, err := youngutil.RequireID(arg, "") + if err != nil { + return err + } + ids[i] = id } } else { if !cmdutil.IsInteractive() { @@ -545,6 +608,9 @@ func deleteComments(cmd *cobra.Command, ids []string, rows []map[string]any) err } func reportCommentBatchResults(data any, rows []map[string]any) error { + if output.IsJSON() { + return output.JSON(data) + } labels := make(map[string]string, len(rows)) for _, row := range rows { id, _ := row["id"].(string) @@ -597,6 +663,10 @@ func newCmdReact() *cobra.Command { Short: "Add or remove a reaction", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + commentID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } c, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), true) if err != nil { return err @@ -605,22 +675,21 @@ func newCmdReact() *cobra.Command { params := &openapi.RemoveCommentReactionParams{ Type: openapi.RemoveCommentReactionParamsType(reactionType), } - _, err = api.ParseResponseRaw(c.RemoveCommentReaction(api.Ctx(), args[0], params)) + data, err := api.ParseResponseRaw(c.RemoveCommentReaction(api.Ctx(), commentID, params)) if err != nil { return err } - output.Success("Reaction removed.") + return reportCommentMutation(data, "Reaction removed.") } else { body := openapi.AddCommentReactionJSONRequestBody{ Type: openapi.CommentReactionRequestSchemaType(reactionType), } - _, err = api.ParseResponseRaw(c.AddCommentReaction(api.Ctx(), args[0], body)) + data, err := api.ParseResponseRaw(c.AddCommentReaction(api.Ctx(), commentID, body)) if err != nil { return err } - output.Success("Reaction added.") + return reportCommentMutation(data, "Reaction added.") } - return nil }, } cmd.Flags().StringVar(&reactionType, "type", "", "Reaction type/emoji (required)") @@ -629,6 +698,14 @@ func newCmdReact() *cobra.Command { return cmd } +func reportCommentMutation(data any, message string) error { + if output.IsJSON() { + return output.JSON(data) + } + output.Success(message) + return nil +} + // promptCommentPick loads the user's recent comments and lets them pick one. func promptCommentPick(cmd *cobra.Command, prompt string) (map[string]any, error) { c, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), true) @@ -641,7 +718,7 @@ func promptCommentPick(cmd *cobra.Command, prompt string) (map[string]any, error if err != nil { return nil, err } - list := cmdutil.NewListResult(data, "comments").FinalizeServerSide(20) + list := cmdutil.NewListResult(data, "data").FinalizeServerSide(20) if len(list.Rows) == 0 { output.Dim(" No comments found.") return nil, nil diff --git a/internal/cmd/comment/comment_test.go b/internal/cmd/comment/comment_test.go index 0bad13c..cacfd7e 100644 --- a/internal/cmd/comment/comment_test.go +++ b/internal/cmd/comment/comment_test.go @@ -6,6 +6,7 @@ import ( "net/http" "net/http/httptest" "strings" + "sync" "testing" "time" @@ -24,6 +25,8 @@ func TestYoungEventCommentTargetRequiresYoungID(t *testing.T) { func TestYoungEventCommentListUsesYoungIDQuery(t *testing.T) { t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) + seenPages := map[string]bool{} + var seenPagesMu sync.Mutex server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodGet || r.URL.Path != "/api/community/comments" { t.Fatalf("request = %s %s", r.Method, r.URL) @@ -34,14 +37,35 @@ func TestYoungEventCommentListUsesYoungIDQuery(t *testing.T) { if got := r.URL.Query().Get("youngId"); got != "young-1" { t.Fatalf("youngId = %q", got) } + if r.URL.Query().Get("pageSize") != "100" { + t.Fatalf("pageSize = %q", r.URL.Query().Get("pageSize")) + } w.Header().Set("Content-Type", "application/json") - _, _ = io.WriteString(w, `{"comments":[],"pagination":{"page":1,"pageSize":20,"total":0,"totalPages":1}}`) + page := r.URL.Query().Get("page") + seenPagesMu.Lock() + seenPages[page] = true + seenPagesMu.Unlock() + switch page { + case "1": + _, _ = io.WriteString(w, `{"data":[{"id":"comment-1","body":"one"}],"pagination":{"page":1,"pageSize":100,"total":2,"totalPages":2},"meta":{}}`) + case "2": + _, _ = io.WriteString(w, `{"data":[{"id":"comment-2","body":"two"}],"pagination":{"page":2,"pageSize":100,"total":2,"totalPages":2},"meta":{}}`) + default: + http.Error(w, "unexpected page", http.StatusBadRequest) + } })) defer server.Close() cmd := commandWithServer(server.URL) if err := runCommentList(cmd, commentTarget{targetType: "young-event", youngID: "young-1"}); err != nil { t.Fatal(err) } + seenPagesMu.Lock() + pageCount := len(seenPages) + pageOne, pageTwo := seenPages["1"], seenPages["2"] + seenPagesMu.Unlock() + if !pageOne || !pageTwo || pageCount != 2 { + t.Fatalf("pages fetched = %v (page 1: %v, page 2: %v), want pages 1 and 2", pageCount, pageOne, pageTwo) + } } func TestYoungEventCommentCreateUsesYoungIDBody(t *testing.T) { diff --git a/internal/cmd/workspace/workspace.go b/internal/cmd/workspace/workspace.go index a01551d..f9c530f 100644 --- a/internal/cmd/workspace/workspace.go +++ b/internal/cmd/workspace/workspace.go @@ -65,7 +65,26 @@ func runCalendarEvents(cmd *cobra.Command, opts calendarEventOpts) error { if err != nil { return err } - data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.PersonalCalendarEventsPath, params, nil) + var data any + if opts.page == 0 && opts.pageSize == 0 { + data, err = youngutil.FetchAllPages( + cmd.Context(), + client, + youngutil.PersonalCalendarEventsPath, + params, + "data", + 100, + "id", + ) + } else { + data, err = client.DoJSON( + cmd.Context(), + http.MethodGet, + youngutil.PersonalCalendarEventsPath, + params, + nil, + ) + } if err != nil { return err } diff --git a/internal/cmd/workspace/workspace_test.go b/internal/cmd/workspace/workspace_test.go index 3403a7a..04d0825 100644 --- a/internal/cmd/workspace/workspace_test.go +++ b/internal/cmd/workspace/workspace_test.go @@ -4,6 +4,7 @@ import ( "io" "net/http" "net/http/httptest" + "sync" "testing" "time" @@ -19,6 +20,8 @@ func TestBuildCalendarEventParamsRequiresPairedBounds(t *testing.T) { func TestCalendarEventsUsesCompletePersonalCalendarEndpoint(t *testing.T) { t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) + seenPages := map[string]bool{} + var seenPagesMu sync.Mutex server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodGet || r.URL.Path != "/api/workspace/calendar/events" { t.Fatalf("request = %s %s", r.Method, r.URL) @@ -26,8 +29,22 @@ func TestCalendarEventsUsesCompletePersonalCalendarEndpoint(t *testing.T) { if r.URL.Query().Get("dateFrom") != "2026-09-01" || r.URL.Query().Get("dateTo") != "2026-09-30" { t.Fatalf("query = %s", r.URL.RawQuery) } + if r.URL.Query().Get("pageSize") != "100" { + t.Fatalf("pageSize = %q", r.URL.Query().Get("pageSize")) + } w.Header().Set("Content-Type", "application/json") - _, _ = io.WriteString(w, `{"data":[{"id":"young-event-1","type":"young_event","at":"2026-09-01T01:00:00Z","endsAt":null,"title":"Activity","location":null,"url":"/catalog/young-events/event-1","youngId":"event-1"}],"pagination":{"page":1,"pageSize":20,"total":1,"totalPages":1}}`) + page := r.URL.Query().Get("page") + seenPagesMu.Lock() + seenPages[page] = true + seenPagesMu.Unlock() + switch page { + case "1": + _, _ = io.WriteString(w, `{"data":[{"id":"young-event-1","type":"young_event","at":"2026-09-01T01:00:00Z","endsAt":null,"title":"Activity 1","location":null,"url":"/catalog/young-events/event-1","youngId":"event-1"}],"pagination":{"page":1,"pageSize":100,"total":2,"totalPages":2}}`) + case "2": + _, _ = io.WriteString(w, `{"data":[{"id":"young-event-2","type":"young_event","at":"2026-09-02T01:00:00Z","endsAt":null,"title":"Activity 2","location":null,"url":"/catalog/young-events/event-2","youngId":"event-2"}],"pagination":{"page":2,"pageSize":100,"total":2,"totalPages":2}}`) + default: + http.Error(w, "unexpected page", http.StatusBadRequest) + } })) defer server.Close() if err := config.SaveCredentials(server.URL, &config.Credential{ @@ -43,4 +60,11 @@ func TestCalendarEventsUsesCompletePersonalCalendarEndpoint(t *testing.T) { if err := root.Execute(); err != nil { t.Fatal(err) } + seenPagesMu.Lock() + pageCount := len(seenPages) + pageOne, pageTwo := seenPages["1"], seenPages["2"] + seenPagesMu.Unlock() + if !pageOne || !pageTwo || pageCount != 2 { + t.Fatalf("pages fetched = %v (page 1: %v, page 2: %v), want pages 1 and 2", pageCount, pageOne, pageTwo) + } } diff --git a/internal/cmd/young_event/young_event.go b/internal/cmd/young_event/young_event.go index 9939bbf..efde7c6 100644 --- a/internal/cmd/young_event/young_event.go +++ b/internal/cmd/young_event/young_event.go @@ -18,6 +18,7 @@ import ( type listOpts struct { active string + dateUnknown string category string search string organizerID string @@ -61,6 +62,7 @@ func NewCmdYoungEvent() *cobra.Command { func addListFlags(cmd *cobra.Command, opts *listOpts) { cmd.Flags().StringVar(&opts.active, "active", "", "Filter by signup status (true or false)") + cmd.Flags().StringVar(&opts.dateUnknown, "date-unknown", "", "Filter events with unknown activity dates (true or false)") cmd.Flags().StringVar(&opts.category, "category", "", "Exact event category") cmd.Flags().StringVarP(&opts.search, "search", "s", "", "Search event names") cmd.Flags().StringVar(&opts.organizerID, "organizer-id", "", "Filter by stable organizer ID") @@ -78,6 +80,7 @@ func newCmdList() *cobra.Command { Use: "list", Aliases: []string{"ls"}, Short: "List Young events", + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return runList(cmd, opts) }, @@ -95,7 +98,15 @@ func runList(cmd *cobra.Command, opts listOpts) error { if err != nil { return err } - data, err := fetchList(cmd.Context(), client, params) + data, err := youngutil.FetchAllIfUnpaged( + cmd.Context(), + client, + youngutil.EventsPath, + params, + "data", + 100, + "youngId", + ) if err != nil { return err } @@ -103,8 +114,8 @@ func runList(cmd *cobra.Command, opts listOpts) error { return output.OutputList(list.Raw, list.Rows, []output.Column{ {Header: "Name", Key: "name"}, {Header: "Category", Key: "category"}, - {Header: "Start", Key: "startAt"}, - {Header: "End", Key: "endAt"}, + {Header: "Start", Key: dateStartKey(opts.timeBasis)}, + {Header: "End", Key: dateEndKey(opts.timeBasis)}, {Header: "Active", Key: "isActive"}, {Header: "Young ID", Key: "youngId"}, }, list.Total, list.Page) @@ -126,35 +137,53 @@ func buildListParams(opts listOpts) (url.Values, error) { if active != "" { params.Set("active", active) } + dateUnknown, err := normalizeBooleanFilter("--date-unknown", opts.dateUnknown) + if err != nil { + return nil, err + } + from := strings.TrimSpace(opts.dateFrom) + to := strings.TrimSpace(opts.dateTo) + if (from == "") != (to == "") { + return nil, fmt.Errorf("--date-from and --date-to must be provided together") + } + if dateUnknown != "" && (from != "" || to != "") { + return nil, fmt.Errorf("--date-unknown cannot be combined with --date-from or --date-to") + } + if dateUnknown != "" { + params.Set("dateUnknown", dateUnknown) + } for key, value := range map[string]string{ "category": opts.category, "search": opts.search, "organizerId": opts.organizerID, - "dateFrom": opts.dateFrom, - "dateTo": opts.dateTo, + "dateFrom": from, + "dateTo": to, } { if value = strings.TrimSpace(value); value != "" { params.Set(key, value) } } - if (opts.dateFrom == "") != (opts.dateTo == "") { - return nil, fmt.Errorf("--date-from and --date-to must be provided together") - } - if opts.timeBasis != "" { - if opts.timeBasis != "activity" && opts.timeBasis != "registration" { + timeBasis := strings.TrimSpace(opts.timeBasis) + if timeBasis != "" { + if timeBasis != "activity" && timeBasis != "registration" { return nil, fmt.Errorf("--time-basis must be activity or registration") } - params.Set("timeBasis", opts.timeBasis) + params.Set("timeBasis", timeBasis) } return params, nil } func normalizeActive(value string) (string, error) { + return normalizeBooleanFilter("--active", value) +} + +func normalizeBooleanFilter(flag, value string) (string, error) { + value = strings.TrimSpace(value) if value == "" { return "", nil } if value != "true" && value != "false" { - return "", fmt.Errorf("--active must be true or false") + return "", fmt.Errorf("%s must be true or false", flag) } return value, nil } @@ -166,6 +195,10 @@ func newCmdGet() *cobra.Command { Short: "View a Young event", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + youngID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) if err != nil { return err @@ -173,7 +206,7 @@ func newCmdGet() *cobra.Command { data, err := client.DoJSON( cmd.Context(), http.MethodGet, - youngutil.PathID(youngutil.EventsPath, args[0]), + youngutil.PathID(youngutil.EventsPath, youngID), nil, nil, ) @@ -284,13 +317,27 @@ func runDateView(cmd *cobra.Command, view youngutil.DateView, anchor string, opt return output.OutputList(list.Raw, list.Rows, []output.Column{ {Header: "Name", Key: "name"}, {Header: "Category", Key: "category"}, - {Header: "Start", Key: "startAt"}, - {Header: "End", Key: "endAt"}, + {Header: "Start", Key: dateStartKey(opts.timeBasis)}, + {Header: "End", Key: dateEndKey(opts.timeBasis)}, {Header: "Organizer", Key: "organizer"}, {Header: "Young ID", Key: "youngId"}, }, list.Total, list.Page) } +func dateStartKey(timeBasis string) string { + if strings.TrimSpace(timeBasis) == "registration" { + return "applyStartAt" + } + return "startAt" +} + +func dateEndKey(timeBasis string) string { + if strings.TrimSpace(timeBasis) == "registration" { + return "applyEndAt" + } + return "endAt" +} + func fetchDateEvents(ctx context.Context, client *api.Client, query url.Values) (any, error) { return youngutil.FetchAllPages( ctx, diff --git a/internal/cmd/young_event/young_event_test.go b/internal/cmd/young_event/young_event_test.go index 17cf8ac..6efbfc7 100644 --- a/internal/cmd/young_event/young_event_test.go +++ b/internal/cmd/young_event/young_event_test.go @@ -68,3 +68,28 @@ func TestBuildListParamsRequiresDatePair(t *testing.T) { t.Fatal("buildListParams accepted an unpaired date-from") } } + +func TestBuildListParamsSupportsUnknownDateFilter(t *testing.T) { + params, err := buildListParams(listOpts{dateUnknown: "true"}) + if err != nil { + t.Fatal(err) + } + if got := params.Get("dateUnknown"); got != "true" { + t.Fatalf("dateUnknown = %q, want true", got) + } + if _, err := buildListParams(listOpts{dateUnknown: "true", dateFrom: "2026-09-01", dateTo: "2026-09-30"}); err == nil { + t.Fatal("buildListParams accepted dateUnknown with date bounds") + } +} + +func TestDateRegistrationUsesRegistrationColumns(t *testing.T) { + if got := dateStartKey("registration"); got != "applyStartAt" { + t.Fatalf("registration start key = %q", got) + } + if got := dateEndKey("registration"); got != "applyEndAt" { + t.Fatalf("registration end key = %q", got) + } + if got := dateStartKey("activity"); got != "startAt" { + t.Fatalf("activity start key = %q", got) + } +} diff --git a/internal/cmd/young_organizer/young_organizer.go b/internal/cmd/young_organizer/young_organizer.go index aa65f5d..0af6072 100644 --- a/internal/cmd/young_organizer/young_organizer.go +++ b/internal/cmd/young_organizer/young_organizer.go @@ -1,7 +1,6 @@ package young_organizer import ( - "fmt" "net/http" "net/url" "strings" @@ -31,8 +30,11 @@ func NewCmdYoungOrganizer() *cobra.Command { Example: ` # List organizers life-ustc catalog young-organizer list - # View one organizer and its event groups - life-ustc catalog young-organizer get `, + # View organizer metadata and activity counts + life-ustc catalog young-organizer get + + # List the organizer's activities + life-ustc catalog young-event --organizer-id `, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return runList(cmd, opts) @@ -85,7 +87,15 @@ func runList(cmd *cobra.Command, opts listOpts) error { if err != nil { return err } - data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.OrganizersPath, params, nil) + data, err := youngutil.FetchAllIfUnpaged( + cmd.Context(), + client, + youngutil.OrganizersPath, + params, + "data", + 100, + "id", + ) if err != nil { return err } @@ -93,6 +103,7 @@ func runList(cmd *cobra.Command, opts listOpts) error { return output.OutputList(list.Raw, list.Rows, []output.Column{ {Header: "ID", Key: "id"}, {Header: "Name", Key: "name"}, + {Header: "Total", Key: "totalCount"}, {Header: "Active", Key: "activeCount"}, {Header: "Upcoming", Key: "upcomingCount"}, {Header: "History", Key: "historyCount"}, @@ -106,7 +117,11 @@ func newCmdGet() *cobra.Command { Short: "View a Young organizer", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - return runGet(cmd, args[0]) + organizerID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } + return runGet(cmd, organizerID) }, } } @@ -127,52 +142,13 @@ func runGet(cmd *cobra.Command, organizerID string) error { return err } - params := url.Values{"organizerId": []string{organizerID}} - events, err := youngutil.FetchAllPages( - cmd.Context(), - client, - youngutil.EventsPath, - params, - "data", - 100, - "youngId", - ) - if err != nil { - return err - } - eventList := cmdutil.NewListResult(events, "data") - if output.IsJSON() { - result := make(map[string]any) - if organizer := cmdutil.AsMap(data); organizer != nil { - for key, value := range organizer { - result[key] = value - } - } - result["events"] = eventList.Rows - return output.JSON(result) - } - if err := output.OutputDetail(data, []output.FieldDef{ + return output.OutputDetail(data, []output.FieldDef{ {Key: "id", Label: "ID"}, {Key: "name", Label: "Name"}, {Key: "normalizedName", Label: "Normalized name", SkipEmpty: true}, + {Key: "totalCount", Label: "Total events"}, {Key: "activeCount", Label: "Active events"}, {Key: "upcomingCount", Label: "Upcoming events"}, {Key: "historyCount", Label: "Historical events"}, - }, "Young organizer"); err != nil { - return err - } - if len(eventList.Rows) == 0 { - return nil - } - fmt.Println() - output.Bold(" Events") - output.Table(eventList.Rows, []output.Column{ - {Header: "Name", Key: "name"}, - {Header: "Category", Key: "category"}, - {Header: "Start", Key: "startAt"}, - {Header: "End", Key: "endAt"}, - {Header: "Active", Key: "isActive"}, - {Header: "Young ID", Key: "youngId"}, - }) - return nil + }, "Young organizer") } diff --git a/internal/cmd/young_organizer/young_organizer_test.go b/internal/cmd/young_organizer/young_organizer_test.go index a0ca871..e9689c6 100644 --- a/internal/cmd/young_organizer/young_organizer_test.go +++ b/internal/cmd/young_organizer/young_organizer_test.go @@ -56,21 +56,13 @@ func TestOrganizerListUsesPublicEndpoint(t *testing.T) { } } -func TestOrganizerGetLoadsEventsFromPaginatedCatalog(t *testing.T) { +func TestOrganizerGetUsesMetadataWithoutEmbeddedEvents(t *testing.T) { t.Setenv("LIFE_USTC_CONFIG_DIR", t.TempDir()) server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") switch r.URL.Path { case "/api/catalog/young-organizers/org-1": - _, _ = io.WriteString(w, `{"id":"org-1","name":"Students Union","normalizedName":"students union","activeCount":1,"upcomingCount":1,"historyCount":0}`) - case "/api/catalog/young-events": - if r.URL.Query().Get("organizerId") != "org-1" { - t.Fatalf("organizerId = %q", r.URL.Query().Get("organizerId")) - } - if r.URL.Query().Get("page") != "1" || r.URL.Query().Get("pageSize") != "100" { - t.Fatalf("pagination = %s", r.URL.RawQuery) - } - _, _ = io.WriteString(w, `{"data":[{"youngId":"event-1","name":"Activity","category":"single","startAt":"2026-09-01T09:00:00+08:00","endAt":null,"isActive":true}],"pagination":{"page":1,"pageSize":100,"total":1,"totalPages":1},"unknownDates":[],"source":{"status":"fresh","lastSyncedAt":null}}`) + _, _ = io.WriteString(w, `{"id":"org-1","name":"Students Union","normalizedName":"students union","totalCount":1,"activeCount":1,"upcomingCount":1,"historyCount":0}`) default: http.NotFound(w, r) } diff --git a/internal/cmd/young_workspace/young_workspace.go b/internal/cmd/young_workspace/young_workspace.go index 5f9bcba..967e00b 100644 --- a/internal/cmd/young_workspace/young_workspace.go +++ b/internal/cmd/young_workspace/young_workspace.go @@ -5,6 +5,7 @@ import ( "net/http" "net/url" "strconv" + "strings" "github.com/spf13/cobra" @@ -42,7 +43,15 @@ func newEventSubscriptionList() *cobra.Command { if err != nil { return err } - data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.YoungEventSubscriptionsPath, params, nil) + data, err := youngutil.FetchAllIfUnpaged( + cmd.Context(), + client, + youngutil.YoungEventSubscriptionsPath, + params, + "data", + 100, + "youngId", + ) if err != nil { return err } @@ -69,6 +78,10 @@ func newEventSubscriptionGet() *cobra.Command { Short: "Read one Young event subscription state", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + youngID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) if err != nil { return err @@ -76,7 +89,7 @@ func newEventSubscriptionGet() *cobra.Command { data, err := client.DoJSON( cmd.Context(), http.MethodGet, - youngutil.PathID(youngutil.YoungEventSubscriptionsPath, args[0]), + youngutil.PathID(youngutil.YoungEventSubscriptionsPath, youngID), nil, nil, ) @@ -95,6 +108,10 @@ func newEventSubscriptionSet() *cobra.Command { Short: "Set a Young event subscription and reminder flags", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + youngID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } if !cmd.Flags().Changed("subscribed") { return fmt.Errorf("--subscribed is required (true or false)") } @@ -131,7 +148,7 @@ func newEventSubscriptionSet() *cobra.Command { data, err := client.DoJSON( cmd.Context(), http.MethodPut, - youngutil.PathID(youngutil.YoungEventSubscriptionsPath, args[0]), + youngutil.PathID(youngutil.YoungEventSubscriptionsPath, youngID), nil, body, ) @@ -186,7 +203,15 @@ func newOrganizerSubscriptionList() *cobra.Command { if err != nil { return err } - data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.YoungOrganizerSubscriptionsPath, params, nil) + data, err := youngutil.FetchAllIfUnpaged( + cmd.Context(), + client, + youngutil.YoungOrganizerSubscriptionsPath, + params, + "data", + 100, + "organizerId", + ) if err != nil { return err } @@ -210,6 +235,10 @@ func newOrganizerSubscriptionGet() *cobra.Command { Short: "Read one Young organizer subscription state", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + organizerID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) if err != nil { return err @@ -217,7 +246,7 @@ func newOrganizerSubscriptionGet() *cobra.Command { data, err := client.DoJSON( cmd.Context(), http.MethodGet, - youngutil.PathID(youngutil.YoungOrganizerSubscriptionsPath, args[0]), + youngutil.PathID(youngutil.YoungOrganizerSubscriptionsPath, organizerID), nil, nil, ) @@ -236,6 +265,10 @@ func newOrganizerSubscriptionSet() *cobra.Command { Short: "Set a Young organizer subscription", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + organizerID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } if !cmd.Flags().Changed("subscribed") { return fmt.Errorf("--subscribed is required (true or false)") } @@ -250,7 +283,7 @@ func newOrganizerSubscriptionSet() *cobra.Command { data, err := client.DoJSON( cmd.Context(), http.MethodPut, - youngutil.PathID(youngutil.YoungOrganizerSubscriptionsPath, args[0]), + youngutil.PathID(youngutil.YoungOrganizerSubscriptionsPath, organizerID), nil, map[string]any{"subscribed": subscribedValue}, ) @@ -303,7 +336,15 @@ func newNotificationList() *cobra.Command { if err != nil { return err } - data, err := client.DoJSON(cmd.Context(), http.MethodGet, youngutil.YoungNotificationsPath, params, nil) + data, err := youngutil.FetchAllIfUnpaged( + cmd.Context(), + client, + youngutil.YoungNotificationsPath, + params, + "data", + 100, + "id", + ) if err != nil { return err } @@ -330,6 +371,10 @@ func newNotificationRead() *cobra.Command { Short: "Mark a Young notification as read", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + notificationID, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), true) if err != nil { return err @@ -337,7 +382,7 @@ func newNotificationRead() *cobra.Command { data, err := client.DoJSON( cmd.Context(), http.MethodPost, - youngutil.PathID(youngutil.YoungNotificationsPath, args[0])+"/read", + youngutil.PathID(youngutil.YoungNotificationsPath, notificationID)+"/read", nil, nil, ) @@ -357,6 +402,7 @@ func listParams(page, limit int) (url.Values, error) { } func parseBoolValue(flag, value string) (bool, error) { + value = strings.TrimSpace(value) if value != "true" && value != "false" { return false, fmt.Errorf("%s must be true or false", flag) } diff --git a/internal/cmd/youngutil/youngutil.go b/internal/cmd/youngutil/youngutil.go index 40a054a..d993549 100644 --- a/internal/cmd/youngutil/youngutil.go +++ b/internal/cmd/youngutil/youngutil.go @@ -5,6 +5,7 @@ package youngutil import ( "context" "fmt" + "net/http" "net/url" "strconv" "strings" @@ -48,6 +49,35 @@ func PageParams(page, limit int) (url.Values, error) { return params, nil } +// FetchAllIfUnpaged follows every page when the caller did not explicitly +// select a page or page size. Explicit pagination remains server-side so the +// command can be used for bounded scripts as well as complete interactive +// listings. +func FetchAllIfUnpaged( + ctx context.Context, + client *api.Client, + path string, + params url.Values, + key string, + pageSize int, + identityKey string, +) (any, error) { + if params.Get("page") == "" && params.Get("pageSize") == "" { + return FetchAllPages(ctx, client, path, params, key, pageSize, identityKey) + } + return client.DoJSON(ctx, http.MethodGet, path, params, nil) +} + +// RequireID trims a positional or path identifier and rejects an empty value. +// Cobra's argument count checks do not catch whitespace-only IDs. +func RequireID(value, flag string) (string, error) { + id := strings.TrimSpace(value) + if id == "" { + return "", fmt.Errorf("%s must not be empty", flag) + } + return id, nil +} + func cloneValues(values url.Values) url.Values { clone := make(url.Values, len(values)) for key, items := range values { diff --git a/internal/cmd/youngutil/youngutil_test.go b/internal/cmd/youngutil/youngutil_test.go index 20ea583..8a814e5 100644 --- a/internal/cmd/youngutil/youngutil_test.go +++ b/internal/cmd/youngutil/youngutil_test.go @@ -38,6 +38,15 @@ func TestDateRangeRejectsInvalidAnchor(t *testing.T) { } } +func TestRequireIDRejectsWhitespace(t *testing.T) { + if _, err := RequireID(" \t", ""); err == nil { + t.Fatal("RequireID accepted whitespace-only input") + } + if got, err := RequireID(" event-1 ", ""); err != nil || got != "event-1" { + t.Fatalf("RequireID = %q, %v; want event-1", got, err) + } +} + func TestFetchAllPagesTraversesCompleteResponse(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Query().Get("pageSize") != "2" { From 9cce8164a1b1f52eb7d1bffc97c3eb1ca255c798 Mon Sep 17 00:00:00 2001 From: Tiankai Ma Date: Tue, 15 Sep 2026 16:26:05 +0800 Subject: [PATCH 3/4] chore: sync Young server OpenAPI contract --- api/openapi.json | 3099 +++++++++++++---- api/openapi.provenance.json | 4 +- internal/cmd/apicmd/api_paths_gen.go | 9 + internal/openapi/client.gen.go | 4778 +++++++++++++++++++------- 4 files changed, 6028 insertions(+), 1862 deletions(-) diff --git a/api/openapi.json b/api/openapi.json index e93c0b5..fb6a0cd 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -96,6 +96,10 @@ "name": "catalog.young-events", "description": "catalog.young-events operations" }, + { + "name": "catalog.young-organizers", + "description": "catalog.young-organizers operations" + }, { "name": "community.comments", "description": "community.comments operations" @@ -147,6 +151,18 @@ { "name": "workspace.upload", "description": "workspace.upload operations" + }, + { + "name": "workspace.young-event-subscriptions", + "description": "workspace.young-event-subscriptions operations" + }, + { + "name": "workspace.young-notifications", + "description": "workspace.young-notifications operations" + }, + { + "name": "workspace.young-organizer-subscriptions", + "description": "workspace.young-organizer-subscriptions operations" } ], "x-tagGroups": [ @@ -163,7 +179,8 @@ "catalog.semesters", "catalog.teachers", "catalog.weather", - "catalog.young-events" + "catalog.young-events", + "catalog.young-organizers" ] }, { @@ -177,7 +194,10 @@ "workspace.schedule", "workspace.subscription", "workspace.todo", - "workspace.upload" + "workspace.upload", + "workspace.young-event-subscriptions", + "workspace.young-notifications", + "workspace.young-organizer-subscriptions" ] }, { @@ -2190,6 +2210,25 @@ } } } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } } } } @@ -2202,6 +2241,19 @@ "catalog.young-events" ], "parameters": [ + { + "in": "query", + "name": "dateUnknown", + "schema": { + "description": "Filter activities missing the selected time basis start; incompatible with date bounds.", + "type": "string", + "enum": [ + "true", + "false" + ] + }, + "description": "Filter activities missing the selected time basis start; incompatible with date bounds." + }, { "in": "query", "name": "active", @@ -2237,6 +2289,50 @@ }, "description": "Case-insensitive substring match on the event name." }, + { + "in": "query", + "name": "organizerId", + "schema": { + "description": "Stable local Young organizer ID.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "description": "Stable local Young organizer ID." + }, + { + "in": "query", + "name": "dateFrom", + "schema": { + "description": "Inclusive Shanghai date/time range start.", + "type": "string", + "minLength": 1 + }, + "description": "Inclusive Shanghai date/time range start." + }, + { + "in": "query", + "name": "dateTo", + "schema": { + "description": "Inclusive Shanghai date/time range end.", + "type": "string", + "minLength": 1 + }, + "description": "Inclusive Shanghai date/time range end." + }, + { + "in": "query", + "name": "timeBasis", + "schema": { + "description": "Date fields to use for range overlap filtering.", + "type": "string", + "enum": [ + "activity", + "registration" + ] + }, + "description": "Date fields to use for range overlap filtering." + }, { "in": "query", "name": "page", @@ -2295,82 +2391,21 @@ } } }, - "/api/community/comments": { + "/api/catalog/young-organizers": { "get": { - "operationId": "listComments", - "summary": "List comments", + "operationId": "get-api-catalog-young-organizers", + "summary": "List normalized Young organizers and their active, upcoming, and historical", "tags": [ - "community.comments" + "catalog.young-organizers" ], "parameters": [ { "in": "query", - "name": "targetType", - "schema": { - "type": "string", - "enum": [ - "section", - "course", - "teacher", - "section-teacher", - "homework" - ] - }, - "required": true - }, - { - "in": "query", - "name": "targetId", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "sectionId", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "in": "query", - "name": "sectionJwId", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "in": "query", - "name": "courseJwId", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "in": "query", - "name": "teacherId", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "in": "query", - "name": "homeworkId", + "name": "search", "schema": { "type": "string", - "minLength": 1 - } - }, - { - "in": "query", - "name": "sectionTeacherId", - "schema": { - "type": "integer", - "format": "int64" + "minLength": 1, + "maxLength": 100 } }, { @@ -2378,7 +2413,9 @@ "name": "page", "schema": { "type": "integer", - "format": "int64" + "format": "int64", + "minimum": 1, + "maximum": 1000 } }, { @@ -2411,72 +2448,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/commentsListResponseSchema" - } - } - } - }, - "400": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, - "404": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - } - } - }, - "post": { - "operationId": "createComment", - "summary": "Create one comment", - "tags": [ - "community.comments" - ], - "security": [ - { - "bearerAuth": [] - }, - { - "sessionCookie": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/commentCreateRequestSchema" - } - } - } - }, - "responses": { - "201": { - "description": "Successful response", - "headers": { - "Location": { - "description": "Relative URL of the created resource", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/idResponseSchema" + "$ref": "#/components/schemas/paginatedYoungOrganizerResponseSchema" } } } @@ -2490,84 +2462,16 @@ } } } - }, - "401": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, - "403": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, - "404": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, - "429": { - "description": "Error response", - "headers": { - "Retry-After": { - "description": "Seconds before retrying the mutation", - "schema": { - "type": "integer", - "minimum": 0 - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, - "503": { - "description": "Error response", - "headers": { - "Retry-After": { - "description": "Seconds before retrying the mutation", - "schema": { - "type": "integer", - "minimum": 0 - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } } } } }, - "/api/community/descriptions": { + "/api/community/comments": { "get": { - "operationId": "getDescription", - "summary": "Get description history", + "operationId": "listComments", + "summary": "List comments", "tags": [ - "community.descriptions" + "community.comments" ], "parameters": [ { @@ -2579,7 +2483,9 @@ "section", "course", "teacher", - "homework" + "section-teacher", + "homework", + "young-event" ] }, "required": true @@ -2587,11 +2493,26 @@ { "in": "query", "name": "targetId", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "youngId", "schema": { "type": "string", "minLength": 1 } }, + { + "in": "query", + "name": "sectionId", + "schema": { + "type": "integer", + "format": "int64" + } + }, { "in": "query", "name": "sectionJwId", @@ -2623,6 +2544,45 @@ "type": "string", "minLength": 1 } + }, + { + "in": "query", + "name": "sectionTeacherId", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + }, + "description": "Number of items per page." + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + }, + "deprecated": true, + "description": "Deprecated alias for pageSize. pageSize takes precedence when both are supplied." } ], "responses": { @@ -2631,7 +2591,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/descriptionsResponseSchema" + "$ref": "#/components/schemas/commentsListResponseSchema" } } } @@ -2659,10 +2619,10 @@ } }, "post": { - "operationId": "upsertDescription", - "summary": "Upsert description", + "operationId": "createComment", + "summary": "Create one comment", "tags": [ - "community.descriptions" + "community.comments" ], "security": [ { @@ -2677,18 +2637,26 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/descriptionUpsertRequestSchema" + "$ref": "#/components/schemas/commentCreateRequestSchema" } } } }, "responses": { - "200": { + "201": { "description": "Successful response", + "headers": { + "Location": { + "description": "Relative URL of the created resource", + "schema": { + "type": "string" + } + } + }, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/descriptionUpsertResponseSchema" + "$ref": "#/components/schemas/idResponseSchema" } } } @@ -2774,25 +2742,31 @@ } } }, - "/api/community/section-homeworks": { + "/api/community/descriptions": { "get": { - "operationId": "community_section_homework_list", - "summary": "List shared section homeworks", + "operationId": "getDescription", + "summary": "Get description history", "tags": [ - "community.section-homework" + "community.descriptions" ], "parameters": [ { "in": "query", - "name": "sectionId", + "name": "targetType", "schema": { - "type": "integer", - "format": "int64" - } + "type": "string", + "enum": [ + "section", + "course", + "teacher", + "homework" + ] + }, + "required": true }, { "in": "query", - "name": "sectionIds", + "name": "targetId", "schema": { "type": "string", "minLength": 1 @@ -2808,35 +2782,27 @@ }, { "in": "query", - "name": "includeDeleted", + "name": "courseJwId", "schema": { - "type": "string", - "enum": [ - "true", - "false" - ] + "type": "integer", + "format": "int64" } }, { "in": "query", - "name": "page", + "name": "teacherId", "schema": { "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 + "format": "int64" } }, { "in": "query", - "name": "pageSize", + "name": "homeworkId", "schema": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 50 - }, - "description": "Number of items per page." + "type": "string", + "minLength": 1 + } } ], "responses": { @@ -2845,7 +2811,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/homeworksListResponseSchema" + "$ref": "#/components/schemas/descriptionsResponseSchema" } } } @@ -2873,10 +2839,10 @@ } }, "post": { - "operationId": "community_section_homework_create", - "summary": "Create one shared section homework", + "operationId": "upsertDescription", + "summary": "Upsert description", "tags": [ - "community.section-homework" + "community.descriptions" ], "security": [ { @@ -2891,26 +2857,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/homeworkCreateRequestSchema" + "$ref": "#/components/schemas/descriptionUpsertRequestSchema" } } } }, "responses": { - "201": { + "200": { "description": "Successful response", - "headers": { - "Location": { - "description": "Relative URL of the created resource", - "schema": { - "type": "string" - } - } - }, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/homeworkCreateResponseSchema" + "$ref": "#/components/schemas/descriptionUpsertResponseSchema" } } } @@ -2996,23 +2954,69 @@ } } }, - "/api/publications/{id}": { + "/api/community/section-homeworks": { "get": { - "operationId": "get-api-publications-id", - "summary": "Get one public USTC news item or notice", + "operationId": "community_section_homework_list", + "summary": "List shared section homeworks", "tags": [ - "Api" + "community.section-homework" ], "parameters": [ { - "in": "path", - "name": "id", + "in": "query", + "name": "sectionId", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "in": "query", + "name": "sectionIds", "schema": { "type": "string", - "minLength": 1, - "maxLength": 128 + "minLength": 1 + } + }, + { + "in": "query", + "name": "sectionJwId", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "in": "query", + "name": "includeDeleted", + "schema": { + "type": "string", + "enum": [ + "true", + "false" + ] + } + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 50 }, - "required": true + "description": "Number of items per page." } ], "responses": { @@ -3021,7 +3025,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicPublicationDetailSchema" + "$ref": "#/components/schemas/homeworksListResponseSchema" } } } @@ -3047,51 +3051,12 @@ } } } - } - }, - "/api/workspace/bus-preferences": { - "get": { - "operationId": "workspace_bus_preferences_get", - "summary": "Get bus preferences", - "tags": [ - "workspace.bus-preferences" - ], - "security": [ - { - "bearerAuth": [] - }, - { - "sessionCookie": [] - } - ], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/busPreferenceResponseSchema" - } - } - } - }, - "401": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - } - } }, "post": { - "operationId": "workspace_bus_preferences_set", - "summary": "Update bus preferences", + "operationId": "community_section_homework_create", + "summary": "Create one shared section homework", "tags": [ - "workspace.bus-preferences" + "community.section-homework" ], "security": [ { @@ -3106,18 +3071,233 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/busPreferenceRequestSchema" + "$ref": "#/components/schemas/homeworkCreateRequestSchema" } } } }, "responses": { - "200": { + "201": { "description": "Successful response", + "headers": { + "Location": { + "description": "Relative URL of the created resource", + "schema": { + "type": "string" + } + } + }, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/busPreferenceResponseSchema" + "$ref": "#/components/schemas/homeworkCreateResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/publications/{id}": { + "get": { + "operationId": "get-api-publications-id", + "summary": "Get one public USTC news item or notice", + "tags": [ + "Api" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicPublicationDetailSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/workspace/bus-preferences": { + "get": { + "operationId": "workspace_bus_preferences_get", + "summary": "Get bus preferences", + "tags": [ + "workspace.bus-preferences" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/busPreferenceResponseSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + }, + "post": { + "operationId": "workspace_bus_preferences_set", + "summary": "Update bus preferences", + "tags": [ + "workspace.bus-preferences" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/busPreferenceRequestSchema" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/busPreferenceResponseSchema" } } } @@ -4155,37 +4335,292 @@ } } }, - "403": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "413": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/workspace/young-event-subscriptions": { + "get": { + "operationId": "get-api-workspace-young-event-subscriptions", + "summary": "List personal young-event-subscriptions", + "tags": [ + "workspace.young-event-subscriptions" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "query", + "name": "unread", + "schema": { + "type": "string", + "enum": [ + "true", + "false" + ] + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/youngEventSubscriptionListSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/workspace/young-notifications": { + "get": { + "operationId": "get-api-workspace-young-notifications", + "summary": "List personal young-notifications", + "tags": [ + "workspace.young-notifications" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "query", + "name": "unread", + "schema": { + "type": "string", + "enum": [ + "true", + "false" + ] + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/youngNotificationListSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/workspace/young-organizer-subscriptions": { + "get": { + "operationId": "get-api-workspace-young-organizer-subscriptions", + "summary": "List personal young-organizer-subscriptions", + "tags": [ + "workspace.young-organizer-subscriptions" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100000 } }, - "413": { - "description": "Error response", + { + "in": "query", + "name": "pageSize", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "query", + "name": "unread", + "schema": { + "type": "string", + "enum": [ + "true", + "false" + ] + } + } + ], + "responses": { + "200": { + "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" + "$ref": "#/components/schemas/youngOrganizerSubscriptionListSchema" } } } }, - "429": { + "400": { "description": "Error response", - "headers": { - "Retry-After": { - "description": "Seconds before retrying the mutation", - "schema": { - "type": "integer", - "minimum": 0 - } - } - }, "content": { "application/json": { "schema": { @@ -4194,17 +4629,8 @@ } } }, - "503": { + "401": { "description": "Error response", - "headers": { - "Retry-After": { - "description": "Seconds before retrying the mutation", - "schema": { - "type": "integer", - "minimum": 0 - } - } - }, "content": { "application/json": { "schema": { @@ -5793,6 +6219,60 @@ } } }, + "/api/catalog/young-organizers/{organizerId}": { + "get": { + "operationId": "get-api-catalog-young-organizers-organizerId", + "summary": "Fetch one normalized Young organizer and its event groups", + "tags": [ + "catalog.young-organizers" + ], + "parameters": [ + { + "in": "path", + "name": "organizerId", + "schema": { + "type": "string", + "minLength": 1, + "description": "Stable local Young organizer identifier." + }, + "required": true, + "description": "Stable local Young organizer identifier." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/youngOrganizerSummarySchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, "/api/community/comments/{id}": { "get": { "operationId": "getComment", @@ -6765,6 +7245,95 @@ } } }, + "/api/workspace/calendar/events": { + "get": { + "operationId": "get-api-workspace-calendar-events", + "summary": "List complete personal calendar events by date range, with explicit pagination", + "tags": [ + "workspace.calendar" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "query", + "name": "dateFrom", + "schema": { + "type": "string", + "minLength": 1, + "description": "YYYY-MM-DD or ISO date/time accepted by parseDateInput" + } + }, + { + "in": "query", + "name": "dateTo", + "schema": { + "type": "string", + "minLength": 1, + "description": "YYYY-MM-DD or ISO date/time accepted by parseDateInput" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/personalCalendarPageSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, "/api/workspace/homeworks/completions": { "put": { "operationId": "put-api-homeworks-completions", @@ -7539,10 +8108,118 @@ } } } - }, - "delete": { - "operationId": "deleteTodo", - "summary": "Delete one todo", + }, + "delete": { + "operationId": "deleteTodo", + "summary": "Delete one todo", + "tags": [ + "workspace.todo" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponseSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/workspace/todos/batch": { + "patch": { + "operationId": "patch-api-todos-batch", + "summary": "Update completion state for multiple todos", "tags": [ "workspace.todo" ], @@ -7554,39 +8231,28 @@ "sessionCookie": [] } ], - "parameters": [ - { - "in": "path", - "name": "id", - "schema": { - "type": "string", - "minLength": 1 - }, - "required": true + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/todoCompletionBatchRequestSchema" + } + } } - ], + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/successResponseSchema" - } - } - } - }, - "401": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" + "$ref": "#/components/schemas/todoCompletionBatchResponseSchema" } } } }, - "403": { + "400": { "description": "Error response", "content": { "application/json": { @@ -7596,7 +8262,7 @@ } } }, - "404": { + "401": { "description": "Error response", "content": { "application/json": { @@ -7645,12 +8311,10 @@ } } } - } - }, - "/api/workspace/todos/batch": { - "patch": { - "operationId": "patch-api-todos-batch", - "summary": "Update completion state for multiple todos", + }, + "delete": { + "operationId": "delete-api-todos-batch", + "summary": "Delete multiple todos by id", "tags": [ "workspace.todo" ], @@ -7667,7 +8331,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/todoCompletionBatchRequestSchema" + "$ref": "#/components/schemas/todoBatchDeleteRequestSchema" } } } @@ -7678,7 +8342,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/todoCompletionBatchResponseSchema" + "$ref": "#/components/schemas/todoBatchDeleteResponseSchema" } } } @@ -7742,12 +8406,14 @@ } } } - }, - "delete": { - "operationId": "delete-api-todos-batch", - "summary": "Delete multiple todos by id", + } + }, + "/api/workspace/uploads/{id}": { + "patch": { + "operationId": "updateUpload", + "summary": "Rename one upload", "tags": [ - "workspace.todo" + "workspace.upload" ], "security": [ { @@ -7757,12 +8423,23 @@ "sessionCookie": [] } ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/todoBatchDeleteRequestSchema" + "$ref": "#/components/schemas/uploadRenameRequestSchema" } } } @@ -7773,7 +8450,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/todoBatchDeleteResponseSchema" + "$ref": "#/components/schemas/uploadRenameResponseSchema" } } } @@ -7798,6 +8475,26 @@ } } }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, "429": { "description": "Error response", "headers": { @@ -7837,12 +8534,10 @@ } } } - } - }, - "/api/workspace/uploads/{id}": { - "patch": { - "operationId": "updateUpload", - "summary": "Rename one upload", + }, + "delete": { + "operationId": "deleteUpload", + "summary": "Delete one upload", "tags": [ "workspace.upload" ], @@ -7865,12 +8560,119 @@ "required": true } ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uploadDeleteResponseSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "502": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/workspace/uploads/complete": { + "post": { + "operationId": "completeUpload", + "summary": "Complete upload", + "tags": [ + "workspace.upload" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadRenameRequestSchema" + "$ref": "#/components/schemas/uploadCompleteRequestSchema" } } } @@ -7881,7 +8683,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadRenameResponseSchema" + "$ref": "#/components/schemas/uploadCompleteResponseSchema" } } } @@ -7916,16 +8718,6 @@ } } }, - "404": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, "429": { "description": "Error response", "headers": { @@ -7965,10 +8757,12 @@ } } } - }, - "delete": { - "operationId": "deleteUpload", - "summary": "Delete one upload", + } + }, + "/api/workspace/uploads/object": { + "put": { + "operationId": "put-api-uploads-object", + "summary": "Write upload object", "tags": [ "workspace.upload" ], @@ -7982,8 +8776,8 @@ ], "parameters": [ { - "in": "path", - "name": "id", + "in": "query", + "name": "key", "schema": { "type": "string", "minLength": 1 @@ -7991,13 +8785,34 @@ "required": true } ], + "requestBody": { + "required": true, + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadDeleteResponseSchema" + "$ref": "#/components/schemas/successResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" } } } @@ -8022,7 +8837,7 @@ } } }, - "404": { + "413": { "description": "Error response", "content": { "application/json": { @@ -8051,16 +8866,6 @@ } } }, - "502": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, "503": { "description": "Error response", "headers": { @@ -8083,12 +8888,12 @@ } } }, - "/api/workspace/uploads/complete": { - "post": { - "operationId": "completeUpload", - "summary": "Complete upload", + "/api/workspace/young-event-subscriptions/{youngId}": { + "get": { + "operationId": "get-api-workspace-young-event-subscriptions-youngId", + "summary": "Read personal activity subscription state", "tags": [ - "workspace.upload" + "workspace.young-event-subscriptions" ], "security": [ { @@ -8098,12 +8903,75 @@ "sessionCookie": [] } ], + "parameters": [ + { + "in": "path", + "name": "youngId", + "schema": { + "type": "string", + "minLength": 1, + "description": "Upstream young.ustc.edu.cn event identifier." + }, + "required": true, + "description": "Upstream young.ustc.edu.cn event identifier." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/youngEventSubscriptionStateSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + }, + "put": { + "operationId": "put-api-workspace-young-event-subscriptions-youngId", + "summary": "Set personal events subscription state. This does not register attendance", + "tags": [ + "workspace.young-event-subscriptions" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "youngId", + "schema": { + "type": "string", + "minLength": 1, + "description": "Upstream young.ustc.edu.cn event identifier." + }, + "required": true, + "description": "Upstream young.ustc.edu.cn event identifier." + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadCompleteRequestSchema" + "$ref": "#/components/schemas/youngEventSubscriptionRequestSchema" } } } @@ -8114,7 +8982,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadCompleteResponseSchema" + "$ref": "#/components/schemas/youngEventSubscriptionStateSchema" } } } @@ -8139,7 +9007,7 @@ } } }, - "403": { + "404": { "description": "Error response", "content": { "application/json": { @@ -8190,12 +9058,62 @@ } } }, - "/api/workspace/uploads/object": { + "/api/workspace/young-organizer-subscriptions/{organizerId}": { + "get": { + "operationId": "get-api-workspace-young-organizer-subscriptions-organizerId", + "summary": "Read personal organizer follow state", + "tags": [ + "workspace.young-organizer-subscriptions" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "organizerId", + "schema": { + "type": "string", + "minLength": 1, + "description": "Stable local Young organizer identifier." + }, + "required": true, + "description": "Stable local Young organizer identifier." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/youngOrganizerSubscriptionStateSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + }, "put": { - "operationId": "put-api-uploads-object", - "summary": "Write upload object", + "operationId": "put-api-workspace-young-organizer-subscriptions-organizerId", + "summary": "Set personal organizers subscription state. This does not register attendance", "tags": [ - "workspace.upload" + "workspace.young-organizer-subscriptions" ], "security": [ { @@ -8207,22 +9125,23 @@ ], "parameters": [ { - "in": "query", - "name": "key", + "in": "path", + "name": "organizerId", "schema": { "type": "string", - "minLength": 1 + "minLength": 1, + "description": "Stable local Young organizer identifier." }, - "required": true + "required": true, + "description": "Stable local Young organizer identifier." } ], "requestBody": { "required": true, "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/youngOrganizerSubscriptionRequestSchema" } } } @@ -8233,7 +9152,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/successResponseSchema" + "$ref": "#/components/schemas/youngOrganizerSubscriptionStateSchema" } } } @@ -8258,17 +9177,7 @@ } } }, - "403": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, - "413": { + "404": { "description": "Error response", "content": { "application/json": { @@ -9169,12 +10078,130 @@ } } }, - "/api/workspace/homeworks/{id}/completion": { - "put": { - "operationId": "setHomeworkCompletion", - "summary": "Update homework completion", + "/api/workspace/homeworks/{id}/completion": { + "put": { + "operationId": "setHomeworkCompletion", + "summary": "Update homework completion", + "tags": [ + "workspace.homework" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/homeworkCompletionRequestSchema" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/homeworkCompletionResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/workspace/uploads/{id}/download": { + "get": { + "operationId": "downloadUpload", + "summary": "Download upload", "tags": [ - "workspace.homework" + "workspace.upload" ], "security": [ { @@ -9195,33 +10222,14 @@ "required": true } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/homeworkCompletionRequestSchema" - } - } - } - }, "responses": { "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/homeworkCompletionResponseSchema" - } - } - } - }, - "400": { - "description": "Error response", + "description": "Binary response", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" + "type": "string", + "format": "binary" } } } @@ -9245,54 +10253,16 @@ } } } - }, - "429": { - "description": "Error response", - "headers": { - "Retry-After": { - "description": "Seconds before retrying the mutation", - "schema": { - "type": "integer", - "minimum": 0 - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, - "503": { - "description": "Error response", - "headers": { - "Retry-After": { - "description": "Seconds before retrying the mutation", - "schema": { - "type": "integer", - "minimum": 0 - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } } } } }, - "/api/workspace/uploads/{id}/download": { - "get": { - "operationId": "downloadUpload", - "summary": "Download upload", + "/api/workspace/young-notifications/{id}/read": { + "post": { + "operationId": "post-api-workspace-young-notifications-id-read", + "summary": "Mark a personal activity notification read", "tags": [ - "workspace.upload" + "workspace.young-notifications" ], "security": [ { @@ -9315,12 +10285,11 @@ ], "responses": { "200": { - "description": "Binary response", + "description": "Successful response", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/youngNotificationReadSchema" } } } @@ -9344,6 +10313,44 @@ } } } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } } } } @@ -9715,6 +10722,50 @@ ], "additionalProperties": false }, + "youngOrganizerSummarySchema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "normalizedName": { + "type": "string" + }, + "totalCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "activeCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "upcomingCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "historyCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + } + }, + "required": [ + "id", + "name", + "normalizedName", + "totalCount", + "activeCount", + "upcomingCount", + "historyCount" + ], + "additionalProperties": false + }, "__schema1": { "type": "object", "properties": { @@ -10444,6 +11495,12 @@ "nullable": true, "type": "string" }, + "youngEventId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, "user": { "nullable": true, "type": "object", @@ -10635,6 +11692,29 @@ "teacher" ], "additionalProperties": false + }, + "youngEvent": { + "nullable": true, + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "name": { + "type": "string" + }, + "youngId": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "youngId" + ], + "additionalProperties": false } }, "required": [ @@ -10658,12 +11738,14 @@ "teacherId", "sectionTeacherId", "homeworkId", + "youngEventId", "user", "section", "course", "teacher", "homework", - "sectionTeacher" + "sectionTeacher", + "youngEvent" ], "additionalProperties": false } @@ -14412,6 +15494,10 @@ "nullable": true, "type": "string" }, + "organizerId": { + "nullable": true, + "type": "string" + }, "status": { "nullable": true, "type": "string" @@ -14470,6 +15556,21 @@ }, "isActive": { "type": "boolean" + }, + "sourceMissing": { + "type": "boolean" + }, + "lastSeenAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "createdAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" } }, "required": [ @@ -14478,6 +15579,7 @@ "category", "department", "organizer", + "organizerId", "status", "registrationStatus", "location", @@ -14489,11 +15591,93 @@ "endAt", "applyStartAt", "applyEndAt", - "isActive" + "isActive", + "sourceMissing", + "lastSeenAt", + "createdAt" ], "additionalProperties": false } }, + "pagination": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "pageSize": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "total": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "totalPages": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "page", + "pageSize", + "total", + "totalPages" + ], + "additionalProperties": false + }, + "unknownDateCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "source": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "fresh", + "stale", + "unknown" + ] + }, + "lastSyncedAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + } + }, + "required": [ + "status", + "lastSyncedAt" + ], + "additionalProperties": false + } + }, + "required": [ + "data", + "pagination", + "unknownDateCount", + "source" + ], + "additionalProperties": false + }, + "paginatedYoungOrganizerResponseSchema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/youngOrganizerSummarySchema" + } + }, "pagination": { "type": "object", "properties": { @@ -14682,6 +15866,16 @@ "nullable": true, "type": "string" }, + "youngEventId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "youngId": { + "nullable": true, + "type": "string" + }, "sectionTeacherSectionId": { "nullable": true, "type": "integer", @@ -14755,6 +15949,10 @@ "teacherName": { "nullable": true, "type": "string" + }, + "youngEventName": { + "nullable": true, + "type": "string" } }, "required": [ @@ -14765,6 +15963,8 @@ "teacherId", "sectionTeacherId", "homeworkId", + "youngEventId", + "youngId", "sectionTeacherSectionId", "sectionTeacherTeacherId", "sectionTeacherSectionJwId", @@ -14779,7 +15979,8 @@ "sectionCode", "courseJwId", "courseName", - "teacherName" + "teacherName", + "youngEventName" ], "additionalProperties": false } @@ -14809,7 +16010,8 @@ "course", "teacher", "section-teacher", - "homework" + "homework", + "young-event" ] }, "targetId": { @@ -14822,6 +16024,10 @@ } ] }, + "youngId": { + "type": "string", + "minLength": 1 + }, "sectionId": { "anyOf": [ { @@ -21767,99 +22973,479 @@ "totalPages" ], "additionalProperties": false - }, - "meta": { - "type": "object", - "properties": { - "maxFileSizeBytes": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "quotaBytes": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "usedBytes": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - } - }, - "required": [ - "maxFileSizeBytes", - "quotaBytes", - "usedBytes" - ], - "additionalProperties": false + }, + "meta": { + "type": "object", + "properties": { + "maxFileSizeBytes": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "quotaBytes": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "usedBytes": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "maxFileSizeBytes", + "quotaBytes", + "usedBytes" + ], + "additionalProperties": false + } + }, + "required": [ + "data", + "pagination", + "meta" + ], + "additionalProperties": false + }, + "uploadCreateRequestSchema": { + "type": "object", + "properties": { + "filename": { + "type": "string", + "minLength": 1 + }, + "contentType": { + "type": "string" + }, + "size": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "filename", + "size" + ], + "additionalProperties": false + }, + "uploadCreateResponseSchema": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "url": { + "type": "string" + }, + "maxFileSizeBytes": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "quotaBytes": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "usedBytes": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "key", + "url", + "maxFileSizeBytes", + "quotaBytes", + "usedBytes" + ], + "additionalProperties": false + }, + "youngEventSubscriptionListSchema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "youngId": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "remindSignup": { + "type": "boolean" + }, + "remindDeadline": { + "type": "boolean" + }, + "remindStart": { + "type": "boolean" + }, + "event": { + "type": "object", + "properties": { + "youngId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "category": { + "nullable": true, + "type": "string" + }, + "department": { + "nullable": true, + "type": "string" + }, + "organizer": { + "nullable": true, + "type": "string" + }, + "organizerId": { + "nullable": true, + "type": "string" + }, + "status": { + "nullable": true, + "type": "string" + }, + "registrationStatus": { + "nullable": true, + "type": "string" + }, + "location": { + "nullable": true, + "type": "string" + }, + "imageUrl": { + "nullable": true, + "type": "string" + }, + "hours": { + "nullable": true, + "type": "number" + }, + "capacity": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "appliedCount": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "startAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "endAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "applyStartAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "applyEndAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "isActive": { + "type": "boolean" + }, + "sourceMissing": { + "type": "boolean" + }, + "lastSeenAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "createdAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + } + }, + "required": [ + "youngId", + "name", + "category", + "department", + "organizer", + "organizerId", + "status", + "registrationStatus", + "location", + "imageUrl", + "hours", + "capacity", + "appliedCount", + "startAt", + "endAt", + "applyStartAt", + "applyEndAt", + "isActive", + "sourceMissing", + "lastSeenAt", + "createdAt" + ], + "additionalProperties": false + } + }, + "required": [ + "youngId", + "createdAt", + "remindSignup", + "remindDeadline", + "remindStart", + "event" + ], + "additionalProperties": false + } + }, + "pagination": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "pageSize": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "total": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "totalPages": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "page", + "pageSize", + "total", + "totalPages" + ], + "additionalProperties": false + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + }, + "youngNotificationListSchema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "youngId": { + "nullable": true, + "type": "string" + }, + "organizerId": { + "nullable": true, + "type": "string" + }, + "kind": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "readAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "expiresAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + } + }, + "required": [ + "id", + "youngId", + "organizerId", + "kind", + "title", + "body", + "createdAt", + "readAt", + "expiresAt" + ], + "additionalProperties": false + } + }, + "pagination": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "pageSize": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "total": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "totalPages": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "page", + "pageSize", + "total", + "totalPages" + ], + "additionalProperties": false + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + }, + "youngOrganizerSubscriptionListSchema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "organizerId": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "organizer": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + } + }, + "required": [ + "organizerId", + "createdAt", + "organizer" + ], + "additionalProperties": false + } + }, + "pagination": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "pageSize": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "total": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "totalPages": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "page", + "pageSize", + "total", + "totalPages" + ], + "additionalProperties": false } }, "required": [ "data", - "pagination", - "meta" - ], - "additionalProperties": false - }, - "uploadCreateRequestSchema": { - "type": "object", - "properties": { - "filename": { - "type": "string", - "minLength": 1 - }, - "contentType": { - "type": "string" - }, - "size": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - } - }, - "required": [ - "filename", - "size" - ], - "additionalProperties": false - }, - "uploadCreateResponseSchema": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "url": { - "type": "string" - }, - "maxFileSizeBytes": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "quotaBytes": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "usedBytes": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - } - }, - "required": [ - "key", - "url", - "maxFileSizeBytes", - "quotaBytes", - "usedBytes" + "pagination" ], "additionalProperties": false }, @@ -21987,6 +23573,12 @@ "homeworkId": { "nullable": true, "type": "string" + }, + "youngEventId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 } }, "required": [ @@ -22009,7 +23601,8 @@ "courseId", "teacherId", "sectionTeacherId", - "homeworkId" + "homeworkId", + "youngEventId" ], "additionalProperties": false } @@ -26837,6 +28430,10 @@ "nullable": true, "type": "string" }, + "organizerId": { + "nullable": true, + "type": "string" + }, "status": { "nullable": true, "type": "string" @@ -26896,6 +28493,21 @@ "isActive": { "type": "boolean" }, + "sourceMissing": { + "type": "boolean" + }, + "lastSeenAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "createdAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, "rawJson": {} }, "required": [ @@ -26904,6 +28516,7 @@ "category", "department", "organizer", + "organizerId", "status", "registrationStatus", "location", @@ -26916,6 +28529,9 @@ "applyStartAt", "applyEndAt", "isActive", + "sourceMissing", + "lastSeenAt", + "createdAt", "rawJson" ], "additionalProperties": false @@ -27051,6 +28667,16 @@ "nullable": true, "type": "string" }, + "youngEventId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "youngId": { + "nullable": true, + "type": "string" + }, "homeworkTitle": { "nullable": true, "type": "string" @@ -27088,6 +28714,10 @@ "teacherName": { "nullable": true, "type": "string" + }, + "youngEventName": { + "nullable": true, + "type": "string" } }, "required": [ @@ -27103,6 +28733,8 @@ "sectionTeacherCourseJwId", "sectionTeacherCourseName", "homeworkId", + "youngEventId", + "youngId", "homeworkTitle", "homeworkSectionJwId", "homeworkSectionCode", @@ -27110,7 +28742,8 @@ "sectionCode", "courseJwId", "courseName", - "teacherName" + "teacherName", + "youngEventName" ], "additionalProperties": false } @@ -29144,6 +30777,33 @@ }, "error": { "type": "string" + }, + "objectsNeedingUpload": { + "type": "array", + "items": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "body_html", + "body_markdown", + "media", + "asset", + "raw_page" + ] + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + } + }, + "required": [ + "kind", + "sha256" + ], + "additionalProperties": false + } } }, "required": [ @@ -29166,6 +30826,106 @@ ], "additionalProperties": false }, + "personalCalendarPageSchema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "schedule", + "exam", + "homework_due", + "todo_due", + "young_event" + ] + }, + "at": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "endsAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "title": { + "type": "string" + }, + "location": { + "nullable": true, + "type": "string" + }, + "url": { + "type": "string" + }, + "youngId": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "type", + "at", + "endsAt", + "title", + "location", + "url", + "youngId" + ], + "additionalProperties": false + } + }, + "pagination": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "pageSize": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "total": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "totalPages": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "page", + "pageSize", + "total", + "totalPages" + ], + "additionalProperties": false + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + }, "homeworkCompletionBatchRequestSchema": { "type": "object", "properties": { @@ -35592,6 +37352,83 @@ ], "additionalProperties": false }, + "youngEventSubscriptionStateSchema": { + "type": "object", + "properties": { + "youngId": { + "type": "string" + }, + "subscribed": { + "type": "boolean" + }, + "remindSignup": { + "type": "boolean" + }, + "remindDeadline": { + "type": "boolean" + }, + "remindStart": { + "type": "boolean" + } + }, + "required": [ + "youngId", + "subscribed", + "remindSignup", + "remindDeadline", + "remindStart" + ], + "additionalProperties": false + }, + "youngEventSubscriptionRequestSchema": { + "type": "object", + "properties": { + "subscribed": { + "type": "boolean" + }, + "remindSignup": { + "type": "boolean" + }, + "remindDeadline": { + "type": "boolean" + }, + "remindStart": { + "type": "boolean" + } + }, + "required": [ + "subscribed" + ], + "additionalProperties": false + }, + "youngOrganizerSubscriptionStateSchema": { + "type": "object", + "properties": { + "organizerId": { + "type": "string" + }, + "subscribed": { + "type": "boolean" + } + }, + "required": [ + "organizerId", + "subscribed" + ], + "additionalProperties": false + }, + "youngOrganizerSubscriptionRequestSchema": { + "type": "object", + "properties": { + "subscribed": { + "type": "boolean" + } + }, + "required": [ + "subscribed" + ], + "additionalProperties": false + }, "roomMapResponseSchema": { "type": "object", "properties": { @@ -35873,6 +37710,22 @@ ], "additionalProperties": false }, + "youngNotificationReadSchema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "success": { + "type": "boolean" + } + }, + "required": [ + "id", + "success" + ], + "additionalProperties": false + }, "publicationObjectUploadResponseSchema": { "type": "object", "properties": { diff --git a/api/openapi.provenance.json b/api/openapi.provenance.json index 65288f9..a6ac822 100644 --- a/api/openapi.provenance.json +++ b/api/openapi.provenance.json @@ -1,5 +1,5 @@ { "repository": "Life-USTC/server", - "commit": "afb7b2ebcbf7e3895dda25392bb7a20fb499c85a", - "sha256": "3c603b0fc10b2eeb65ae4222372f4a32d51e9f98acc3c811cb0f15e29c8b6090" + "commit": "fea7bb21ead65fa4da1d51d8ef36ef914a647783", + "sha256": "7f3235f943f580ae108870278999743ce6622336f8eb3e7f77a276ed92a275ed" } diff --git a/internal/cmd/apicmd/api_paths_gen.go b/internal/cmd/apicmd/api_paths_gen.go index 111817e..74e2f90 100644 --- a/internal/cmd/apicmd/api_paths_gen.go +++ b/internal/cmd/apicmd/api_paths_gen.go @@ -53,6 +53,8 @@ var generatedAPIPaths = []string{ "/api/catalog/young-events", "/api/catalog/young-events/{youngId}", "/api/catalog/young-events/{youngId}/image", + "/api/catalog/young-organizers", + "/api/catalog/young-organizers/{organizerId}", "/api/community/comments", "/api/community/comments/batch", "/api/community/comments/{id}", @@ -76,6 +78,7 @@ var generatedAPIPaths = []string{ "/api/publications/{id}", "/api/search", "/api/workspace/bus-preferences", + "/api/workspace/calendar/events", "/api/workspace/homeworks", "/api/workspace/homeworks/completions", "/api/workspace/homeworks/{id}/completion", @@ -97,4 +100,10 @@ var generatedAPIPaths = []string{ "/api/workspace/uploads/object", "/api/workspace/uploads/{id}", "/api/workspace/uploads/{id}/download", + "/api/workspace/young-event-subscriptions", + "/api/workspace/young-event-subscriptions/{youngId}", + "/api/workspace/young-notifications", + "/api/workspace/young-notifications/{id}/read", + "/api/workspace/young-organizer-subscriptions", + "/api/workspace/young-organizer-subscriptions/{organizerId}", } diff --git a/internal/openapi/client.gen.go b/internal/openapi/client.gen.go index fbe3fd8..aa9098b 100644 --- a/internal/openapi/client.gen.go +++ b/internal/openapi/client.gen.go @@ -657,6 +657,7 @@ const ( CommentCreateRequestSchemaTargetTypeSection CommentCreateRequestSchemaTargetType = "section" CommentCreateRequestSchemaTargetTypeSectionTeacher CommentCreateRequestSchemaTargetType = "section-teacher" CommentCreateRequestSchemaTargetTypeTeacher CommentCreateRequestSchemaTargetType = "teacher" + CommentCreateRequestSchemaTargetTypeYoungEvent CommentCreateRequestSchemaTargetType = "young-event" ) // Valid indicates whether the value is a known member of the CommentCreateRequestSchemaTargetType enum. @@ -672,6 +673,8 @@ func (e CommentCreateRequestSchemaTargetType) Valid() bool { return true case CommentCreateRequestSchemaTargetTypeTeacher: return true + case CommentCreateRequestSchemaTargetTypeYoungEvent: + return true default: return false } @@ -1169,6 +1172,54 @@ func (e OauthTokenResponseSchemaTokenType) Valid() bool { } } +// Defines values for PaginatedYoungEventResponseSchemaSourceStatus. +const ( + Fresh PaginatedYoungEventResponseSchemaSourceStatus = "fresh" + Stale PaginatedYoungEventResponseSchemaSourceStatus = "stale" + Unknown PaginatedYoungEventResponseSchemaSourceStatus = "unknown" +) + +// Valid indicates whether the value is a known member of the PaginatedYoungEventResponseSchemaSourceStatus enum. +func (e PaginatedYoungEventResponseSchemaSourceStatus) Valid() bool { + switch e { + case Fresh: + return true + case Stale: + return true + case Unknown: + return true + default: + return false + } +} + +// Defines values for PersonalCalendarPageSchemaDataType. +const ( + Exam PersonalCalendarPageSchemaDataType = "exam" + HomeworkDue PersonalCalendarPageSchemaDataType = "homework_due" + Schedule PersonalCalendarPageSchemaDataType = "schedule" + TodoDue PersonalCalendarPageSchemaDataType = "todo_due" + YoungEvent PersonalCalendarPageSchemaDataType = "young_event" +) + +// Valid indicates whether the value is a known member of the PersonalCalendarPageSchemaDataType enum. +func (e PersonalCalendarPageSchemaDataType) Valid() bool { + switch e { + case Exam: + return true + case HomeworkDue: + return true + case Schedule: + return true + case TodoDue: + return true + case YoungEvent: + return true + default: + return false + } +} + // Defines values for PublicPublicationDetailSchemaPublicationType. const ( PublicPublicationDetailSchemaPublicationTypeNews PublicPublicationDetailSchemaPublicationType = "news" @@ -1388,6 +1439,33 @@ func (e PublicationIngestionBatchRequestSchemaProtocolVersion) Valid() bool { } } +// Defines values for PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind. +const ( + PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindAsset PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind = "asset" + PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindBodyHtml PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind = "body_html" + PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindBodyMarkdown PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind = "body_markdown" + PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindMedia PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind = "media" + PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindRawPage PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind = "raw_page" +) + +// Valid indicates whether the value is a known member of the PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind enum. +func (e PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind) Valid() bool { + switch e { + case PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindAsset: + return true + case PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindBodyHtml: + return true + case PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindBodyMarkdown: + return true + case PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindMedia: + return true + case PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKindRawPage: + return true + default: + return false + } +} + // Defines values for PublicationIngestionBatchResponseSchemaResultsStatus. const ( PublicationIngestionBatchResponseSchemaResultsStatusCreated PublicationIngestionBatchResponseSchemaResultsStatus = "created" @@ -1486,25 +1564,25 @@ func (e PublicationObjectPlanResponseSchemaObjectsStatus) Valid() bool { // Defines values for PublicationObjectUploadResponseSchemaKind. const ( - PublicationObjectUploadResponseSchemaKindAsset PublicationObjectUploadResponseSchemaKind = "asset" - PublicationObjectUploadResponseSchemaKindBodyHtml PublicationObjectUploadResponseSchemaKind = "body_html" - PublicationObjectUploadResponseSchemaKindBodyMarkdown PublicationObjectUploadResponseSchemaKind = "body_markdown" - PublicationObjectUploadResponseSchemaKindMedia PublicationObjectUploadResponseSchemaKind = "media" - PublicationObjectUploadResponseSchemaKindRawPage PublicationObjectUploadResponseSchemaKind = "raw_page" + Asset PublicationObjectUploadResponseSchemaKind = "asset" + BodyHtml PublicationObjectUploadResponseSchemaKind = "body_html" + BodyMarkdown PublicationObjectUploadResponseSchemaKind = "body_markdown" + Media PublicationObjectUploadResponseSchemaKind = "media" + RawPage PublicationObjectUploadResponseSchemaKind = "raw_page" ) // Valid indicates whether the value is a known member of the PublicationObjectUploadResponseSchemaKind enum. func (e PublicationObjectUploadResponseSchemaKind) Valid() bool { switch e { - case PublicationObjectUploadResponseSchemaKindAsset: + case Asset: return true - case PublicationObjectUploadResponseSchemaKindBodyHtml: + case BodyHtml: return true - case PublicationObjectUploadResponseSchemaKindBodyMarkdown: + case BodyMarkdown: return true - case PublicationObjectUploadResponseSchemaKindMedia: + case Media: return true - case PublicationObjectUploadResponseSchemaKindRawPage: + case RawPage: return true default: return false @@ -2300,6 +2378,24 @@ func (e CatalogWeatherGetParamsLocationKey) Valid() bool { } } +// Defines values for GetApiCatalogYoungEventsParamsDateUnknown. +const ( + GetApiCatalogYoungEventsParamsDateUnknownFalse GetApiCatalogYoungEventsParamsDateUnknown = "false" + GetApiCatalogYoungEventsParamsDateUnknownTrue GetApiCatalogYoungEventsParamsDateUnknown = "true" +) + +// Valid indicates whether the value is a known member of the GetApiCatalogYoungEventsParamsDateUnknown enum. +func (e GetApiCatalogYoungEventsParamsDateUnknown) Valid() bool { + switch e { + case GetApiCatalogYoungEventsParamsDateUnknownFalse: + return true + case GetApiCatalogYoungEventsParamsDateUnknownTrue: + return true + default: + return false + } +} + // Defines values for GetApiCatalogYoungEventsParamsActive. const ( GetApiCatalogYoungEventsParamsActiveFalse GetApiCatalogYoungEventsParamsActive = "false" @@ -2318,6 +2414,24 @@ func (e GetApiCatalogYoungEventsParamsActive) Valid() bool { } } +// Defines values for GetApiCatalogYoungEventsParamsTimeBasis. +const ( + Activity GetApiCatalogYoungEventsParamsTimeBasis = "activity" + Registration GetApiCatalogYoungEventsParamsTimeBasis = "registration" +) + +// Valid indicates whether the value is a known member of the GetApiCatalogYoungEventsParamsTimeBasis enum. +func (e GetApiCatalogYoungEventsParamsTimeBasis) Valid() bool { + switch e { + case Activity: + return true + case Registration: + return true + default: + return false + } +} + // Defines values for ListCommentsParamsTargetType. const ( ListCommentsParamsTargetTypeCourse ListCommentsParamsTargetType = "course" @@ -2325,6 +2439,7 @@ const ( ListCommentsParamsTargetTypeSection ListCommentsParamsTargetType = "section" ListCommentsParamsTargetTypeSectionTeacher ListCommentsParamsTargetType = "section-teacher" ListCommentsParamsTargetTypeTeacher ListCommentsParamsTargetType = "teacher" + ListCommentsParamsTargetTypeYoungEvent ListCommentsParamsTargetType = "young-event" ) // Valid indicates whether the value is a known member of the ListCommentsParamsTargetType enum. @@ -2340,6 +2455,8 @@ func (e ListCommentsParamsTargetType) Valid() bool { return true case ListCommentsParamsTargetTypeTeacher: return true + case ListCommentsParamsTargetTypeYoungEvent: + return true default: return false } @@ -2461,16 +2578,16 @@ func (e WorkspaceScheduleListParamsLocale) Valid() bool { // Defines values for ListTodosParamsCompleted. const ( - False ListTodosParamsCompleted = "false" - True ListTodosParamsCompleted = "true" + ListTodosParamsCompletedFalse ListTodosParamsCompleted = "false" + ListTodosParamsCompletedTrue ListTodosParamsCompleted = "true" ) // Valid indicates whether the value is a known member of the ListTodosParamsCompleted enum. func (e ListTodosParamsCompleted) Valid() bool { switch e { - case False: + case ListTodosParamsCompletedFalse: return true - case True: + case ListTodosParamsCompletedTrue: return true default: return false @@ -2498,6 +2615,60 @@ func (e ListTodosParamsPriority) Valid() bool { } } +// Defines values for GetApiWorkspaceYoungEventSubscriptionsParamsUnread. +const ( + GetApiWorkspaceYoungEventSubscriptionsParamsUnreadFalse GetApiWorkspaceYoungEventSubscriptionsParamsUnread = "false" + GetApiWorkspaceYoungEventSubscriptionsParamsUnreadTrue GetApiWorkspaceYoungEventSubscriptionsParamsUnread = "true" +) + +// Valid indicates whether the value is a known member of the GetApiWorkspaceYoungEventSubscriptionsParamsUnread enum. +func (e GetApiWorkspaceYoungEventSubscriptionsParamsUnread) Valid() bool { + switch e { + case GetApiWorkspaceYoungEventSubscriptionsParamsUnreadFalse: + return true + case GetApiWorkspaceYoungEventSubscriptionsParamsUnreadTrue: + return true + default: + return false + } +} + +// Defines values for GetApiWorkspaceYoungNotificationsParamsUnread. +const ( + GetApiWorkspaceYoungNotificationsParamsUnreadFalse GetApiWorkspaceYoungNotificationsParamsUnread = "false" + GetApiWorkspaceYoungNotificationsParamsUnreadTrue GetApiWorkspaceYoungNotificationsParamsUnread = "true" +) + +// Valid indicates whether the value is a known member of the GetApiWorkspaceYoungNotificationsParamsUnread enum. +func (e GetApiWorkspaceYoungNotificationsParamsUnread) Valid() bool { + switch e { + case GetApiWorkspaceYoungNotificationsParamsUnreadFalse: + return true + case GetApiWorkspaceYoungNotificationsParamsUnreadTrue: + return true + default: + return false + } +} + +// Defines values for GetApiWorkspaceYoungOrganizerSubscriptionsParamsUnread. +const ( + False GetApiWorkspaceYoungOrganizerSubscriptionsParamsUnread = "false" + True GetApiWorkspaceYoungOrganizerSubscriptionsParamsUnread = "true" +) + +// Valid indicates whether the value is a known member of the GetApiWorkspaceYoungOrganizerSubscriptionsParamsUnread enum. +func (e GetApiWorkspaceYoungOrganizerSubscriptionsParamsUnread) Valid() bool { + switch e { + case False: + return true + case True: + return true + default: + return false + } +} + // UnderscoreUnderscoreSchema0 defines model for __schema0. type UnderscoreUnderscoreSchema0 struct { Attachments []struct { @@ -2672,6 +2843,12 @@ type AdminCommentsResponseSchema struct { } `json:"user"` UserId *string `json:"userId"` Visibility AdminCommentsResponseSchemaDataVisibility `json:"visibility"` + YoungEvent *struct { + Id int `json:"id"` + Name string `json:"name"` + YoungId string `json:"youngId"` + } `json:"youngEvent"` + YoungEventId *int `json:"youngEventId"` } `json:"data"` Pagination struct { Page int `json:"page"` @@ -2848,6 +3025,7 @@ type AdminModeratedCommentResponseSchema struct { UpdatedAt time.Time `json:"updatedAt"` UserId *string `json:"userId"` Visibility AdminModeratedCommentResponseSchemaCommentVisibility `json:"visibility"` + YoungEventId *int `json:"youngEventId"` } `json:"comment"` } @@ -4634,6 +4812,7 @@ type CommentCreateRequestSchema struct { TargetType CommentCreateRequestSchemaTargetType `json:"targetType"` TeacherId *CommentCreateRequestSchema_TeacherId `json:"teacherId,omitempty"` Visibility *CommentCreateRequestSchemaVisibility `json:"visibility,omitempty"` + YoungId *string `json:"youngId,omitempty"` } // CommentCreateRequestSchemaCourseJwId0 defines model for . @@ -4758,6 +4937,9 @@ type CommentThreadResponseSchema struct { SectionTeacherTeacherName *string `json:"sectionTeacherTeacherName"` TeacherId *int `json:"teacherId"` TeacherName *string `json:"teacherName"` + YoungEventId *int `json:"youngEventId"` + YoungEventName *string `json:"youngEventName"` + YoungId *string `json:"youngId"` } `json:"target"` Thread []UnderscoreUnderscoreSchema1 `json:"thread"` Viewer struct { @@ -4817,6 +4999,9 @@ type CommentsListResponseSchema struct { TeacherId *int `json:"teacherId"` TeacherName *string `json:"teacherName"` Type string `json:"type"` + YoungEventId *int `json:"youngEventId"` + YoungEventName *string `json:"youngEventName"` + YoungId *string `json:"youngId"` } `json:"target"` Viewer struct { Image *string `json:"image"` @@ -6992,15 +7177,19 @@ type PaginatedYoungEventResponseSchema struct { ApplyStartAt *time.Time `json:"applyStartAt"` Capacity *int `json:"capacity"` Category *string `json:"category"` + CreatedAt *time.Time `json:"createdAt"` Department *string `json:"department"` EndAt *time.Time `json:"endAt"` Hours *float32 `json:"hours"` ImageUrl *string `json:"imageUrl"` IsActive bool `json:"isActive"` + LastSeenAt *time.Time `json:"lastSeenAt"` Location *string `json:"location"` Name string `json:"name"` Organizer *string `json:"organizer"` + OrganizerId *string `json:"organizerId"` RegistrationStatus *string `json:"registrationStatus"` + SourceMissing bool `json:"sourceMissing"` StartAt *time.Time `json:"startAt"` Status *string `json:"status"` YoungId string `json:"youngId"` @@ -7011,8 +7200,50 @@ type PaginatedYoungEventResponseSchema struct { Total int `json:"total"` TotalPages int `json:"totalPages"` } `json:"pagination"` + Source struct { + LastSyncedAt *time.Time `json:"lastSyncedAt"` + Status PaginatedYoungEventResponseSchemaSourceStatus `json:"status"` + } `json:"source"` + UnknownDateCount int `json:"unknownDateCount"` +} + +// PaginatedYoungEventResponseSchemaSourceStatus defines model for PaginatedYoungEventResponseSchema.Source.Status. +type PaginatedYoungEventResponseSchemaSourceStatus string + +// PaginatedYoungOrganizerResponseSchema defines model for paginatedYoungOrganizerResponseSchema. +type PaginatedYoungOrganizerResponseSchema struct { + Data []YoungOrganizerSummarySchema `json:"data"` + Pagination struct { + Page int `json:"page"` + PageSize int `json:"pageSize"` + Total int `json:"total"` + TotalPages int `json:"totalPages"` + } `json:"pagination"` +} + +// PersonalCalendarPageSchema defines model for personalCalendarPageSchema. +type PersonalCalendarPageSchema struct { + Data []struct { + At *time.Time `json:"at"` + EndsAt *time.Time `json:"endsAt"` + Id string `json:"id"` + Location *string `json:"location"` + Title string `json:"title"` + Type PersonalCalendarPageSchemaDataType `json:"type"` + Url string `json:"url"` + YoungId *string `json:"youngId"` + } `json:"data"` + Pagination struct { + Page int `json:"page"` + PageSize int `json:"pageSize"` + Total int `json:"total"` + TotalPages int `json:"totalPages"` + } `json:"pagination"` } +// PersonalCalendarPageSchemaDataType defines model for PersonalCalendarPageSchema.Data.Type. +type PersonalCalendarPageSchemaDataType string + // PublicPublicationDetailSchema defines model for publicPublicationDetailSchema. type PublicPublicationDetailSchema struct { CanonicalUrl string `json:"canonicalUrl"` @@ -7218,8 +7449,12 @@ type PublicationIngestionBatchResponseSchema struct { ClientRunId string `json:"clientRunId"` PayloadDigest string `json:"payloadDigest"` Results []struct { - CanonicalUrl string `json:"canonicalUrl"` - Error *string `json:"error,omitempty"` + CanonicalUrl string `json:"canonicalUrl"` + Error *string `json:"error,omitempty"` + ObjectsNeedingUpload *[]struct { + Kind PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind `json:"kind"` + Sha256 string `json:"sha256"` + } `json:"objectsNeedingUpload,omitempty"` PublicationId *string `json:"publicationId"` RevisionHash string `json:"revisionHash"` RevisionId *string `json:"revisionId"` @@ -7228,6 +7463,9 @@ type PublicationIngestionBatchResponseSchema struct { } `json:"results"` } +// PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind defines model for PublicationIngestionBatchResponseSchema.Results.ObjectsNeedingUpload.Kind. +type PublicationIngestionBatchResponseSchemaResultsObjectsNeedingUploadKind string + // PublicationIngestionBatchResponseSchemaResultsStatus defines model for PublicationIngestionBatchResponseSchema.Results.Status. type PublicationIngestionBatchResponseSchemaResultsStatus string @@ -8366,21 +8604,149 @@ type YoungEventDetailSchema struct { ApplyStartAt *time.Time `json:"applyStartAt"` Capacity *int `json:"capacity"` Category *string `json:"category"` + CreatedAt *time.Time `json:"createdAt"` Department *string `json:"department"` EndAt *time.Time `json:"endAt"` Hours *float32 `json:"hours"` ImageUrl *string `json:"imageUrl"` IsActive bool `json:"isActive"` + LastSeenAt *time.Time `json:"lastSeenAt"` Location *string `json:"location"` Name string `json:"name"` Organizer *string `json:"organizer"` + OrganizerId *string `json:"organizerId"` RawJson interface{} `json:"rawJson"` RegistrationStatus *string `json:"registrationStatus"` + SourceMissing bool `json:"sourceMissing"` StartAt *time.Time `json:"startAt"` Status *string `json:"status"` YoungId string `json:"youngId"` } +// YoungEventSubscriptionListSchema defines model for youngEventSubscriptionListSchema. +type YoungEventSubscriptionListSchema struct { + Data []struct { + CreatedAt time.Time `json:"createdAt"` + Event struct { + AppliedCount *int `json:"appliedCount"` + ApplyEndAt *time.Time `json:"applyEndAt"` + ApplyStartAt *time.Time `json:"applyStartAt"` + Capacity *int `json:"capacity"` + Category *string `json:"category"` + CreatedAt *time.Time `json:"createdAt"` + Department *string `json:"department"` + EndAt *time.Time `json:"endAt"` + Hours *float32 `json:"hours"` + ImageUrl *string `json:"imageUrl"` + IsActive bool `json:"isActive"` + LastSeenAt *time.Time `json:"lastSeenAt"` + Location *string `json:"location"` + Name string `json:"name"` + Organizer *string `json:"organizer"` + OrganizerId *string `json:"organizerId"` + RegistrationStatus *string `json:"registrationStatus"` + SourceMissing bool `json:"sourceMissing"` + StartAt *time.Time `json:"startAt"` + Status *string `json:"status"` + YoungId string `json:"youngId"` + } `json:"event"` + RemindDeadline bool `json:"remindDeadline"` + RemindSignup bool `json:"remindSignup"` + RemindStart bool `json:"remindStart"` + YoungId string `json:"youngId"` + } `json:"data"` + Pagination struct { + Page int `json:"page"` + PageSize int `json:"pageSize"` + Total int `json:"total"` + TotalPages int `json:"totalPages"` + } `json:"pagination"` +} + +// YoungEventSubscriptionRequestSchema defines model for youngEventSubscriptionRequestSchema. +type YoungEventSubscriptionRequestSchema struct { + RemindDeadline *bool `json:"remindDeadline,omitempty"` + RemindSignup *bool `json:"remindSignup,omitempty"` + RemindStart *bool `json:"remindStart,omitempty"` + Subscribed bool `json:"subscribed"` +} + +// YoungEventSubscriptionStateSchema defines model for youngEventSubscriptionStateSchema. +type YoungEventSubscriptionStateSchema struct { + RemindDeadline bool `json:"remindDeadline"` + RemindSignup bool `json:"remindSignup"` + RemindStart bool `json:"remindStart"` + Subscribed bool `json:"subscribed"` + YoungId string `json:"youngId"` +} + +// YoungNotificationListSchema defines model for youngNotificationListSchema. +type YoungNotificationListSchema struct { + Data []struct { + Body string `json:"body"` + CreatedAt time.Time `json:"createdAt"` + ExpiresAt *time.Time `json:"expiresAt"` + Id string `json:"id"` + Kind string `json:"kind"` + OrganizerId *string `json:"organizerId"` + ReadAt *time.Time `json:"readAt"` + Title string `json:"title"` + YoungId *string `json:"youngId"` + } `json:"data"` + Pagination struct { + Page int `json:"page"` + PageSize int `json:"pageSize"` + Total int `json:"total"` + TotalPages int `json:"totalPages"` + } `json:"pagination"` +} + +// YoungNotificationReadSchema defines model for youngNotificationReadSchema. +type YoungNotificationReadSchema struct { + Id string `json:"id"` + Success bool `json:"success"` +} + +// YoungOrganizerSubscriptionListSchema defines model for youngOrganizerSubscriptionListSchema. +type YoungOrganizerSubscriptionListSchema struct { + Data []struct { + CreatedAt time.Time `json:"createdAt"` + Organizer struct { + Id string `json:"id"` + Name string `json:"name"` + } `json:"organizer"` + OrganizerId string `json:"organizerId"` + } `json:"data"` + Pagination struct { + Page int `json:"page"` + PageSize int `json:"pageSize"` + Total int `json:"total"` + TotalPages int `json:"totalPages"` + } `json:"pagination"` +} + +// YoungOrganizerSubscriptionRequestSchema defines model for youngOrganizerSubscriptionRequestSchema. +type YoungOrganizerSubscriptionRequestSchema struct { + Subscribed bool `json:"subscribed"` +} + +// YoungOrganizerSubscriptionStateSchema defines model for youngOrganizerSubscriptionStateSchema. +type YoungOrganizerSubscriptionStateSchema struct { + OrganizerId string `json:"organizerId"` + Subscribed bool `json:"subscribed"` +} + +// YoungOrganizerSummarySchema defines model for youngOrganizerSummarySchema. +type YoungOrganizerSummarySchema struct { + ActiveCount int `json:"activeCount"` + HistoryCount int `json:"historyCount"` + Id string `json:"id"` + Name string `json:"name"` + NormalizedName string `json:"normalizedName"` + TotalCount int `json:"totalCount"` + UpcomingCount int `json:"upcomingCount"` +} + // AccountClientActivityListParams defines parameters for AccountClientActivityList. type AccountClientActivityListParams struct { Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"` @@ -8661,6 +9027,9 @@ type CatalogWeatherGetParamsLocationKey string // GetApiCatalogYoungEventsParams defines parameters for GetApiCatalogYoungEvents. type GetApiCatalogYoungEventsParams struct { + // DateUnknown Filter activities missing the selected time basis start; incompatible with date bounds. + DateUnknown *GetApiCatalogYoungEventsParamsDateUnknown `form:"dateUnknown,omitempty" json:"dateUnknown,omitempty"` + // Active Filter by signup-open (active) events. Active *GetApiCatalogYoungEventsParamsActive `form:"active,omitempty" json:"active,omitempty"` @@ -8669,7 +9038,19 @@ type GetApiCatalogYoungEventsParams struct { // Search Case-insensitive substring match on the event name. Search *string `form:"search,omitempty" json:"search,omitempty"` - Page *int64 `form:"page,omitempty" json:"page,omitempty"` + + // OrganizerId Stable local Young organizer ID. + OrganizerId *string `form:"organizerId,omitempty" json:"organizerId,omitempty"` + + // DateFrom Inclusive Shanghai date/time range start. + DateFrom *string `form:"dateFrom,omitempty" json:"dateFrom,omitempty"` + + // DateTo Inclusive Shanghai date/time range end. + DateTo *string `form:"dateTo,omitempty" json:"dateTo,omitempty"` + + // TimeBasis Date fields to use for range overlap filtering. + TimeBasis *GetApiCatalogYoungEventsParamsTimeBasis `form:"timeBasis,omitempty" json:"timeBasis,omitempty"` + Page *int64 `form:"page,omitempty" json:"page,omitempty"` // PageSize Number of items per page. PageSize *int64 `form:"pageSize,omitempty" json:"pageSize,omitempty"` @@ -8678,13 +9059,32 @@ type GetApiCatalogYoungEventsParams struct { Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } +// GetApiCatalogYoungEventsParamsDateUnknown defines parameters for GetApiCatalogYoungEvents. +type GetApiCatalogYoungEventsParamsDateUnknown string + // GetApiCatalogYoungEventsParamsActive defines parameters for GetApiCatalogYoungEvents. type GetApiCatalogYoungEventsParamsActive string +// GetApiCatalogYoungEventsParamsTimeBasis defines parameters for GetApiCatalogYoungEvents. +type GetApiCatalogYoungEventsParamsTimeBasis string + +// GetApiCatalogYoungOrganizersParams defines parameters for GetApiCatalogYoungOrganizers. +type GetApiCatalogYoungOrganizersParams struct { + Search *string `form:"search,omitempty" json:"search,omitempty"` + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + + // PageSize Number of items per page. + PageSize *int64 `form:"pageSize,omitempty" json:"pageSize,omitempty"` + + // Limit Deprecated alias for pageSize. pageSize takes precedence when both are supplied. + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` +} + // ListCommentsParams defines parameters for ListComments. type ListCommentsParams struct { TargetType ListCommentsParamsTargetType `form:"targetType" json:"targetType"` TargetId *string `form:"targetId,omitempty" json:"targetId,omitempty"` + YoungId *string `form:"youngId,omitempty" json:"youngId,omitempty"` SectionId *int64 `form:"sectionId,omitempty" json:"sectionId,omitempty"` SectionJwId *int64 `form:"sectionJwId,omitempty" json:"sectionJwId,omitempty"` CourseJwId *int64 `form:"courseJwId,omitempty" json:"courseJwId,omitempty"` @@ -8754,6 +9154,14 @@ type GetApiCommunitySectionHomeworksAuditParams struct { SectionJwId *int64 `form:"sectionJwId,omitempty" json:"sectionJwId,omitempty"` } +// GetApiWorkspaceCalendarEventsParams defines parameters for GetApiWorkspaceCalendarEvents. +type GetApiWorkspaceCalendarEventsParams struct { + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + PageSize *int64 `form:"pageSize,omitempty" json:"pageSize,omitempty"` + DateFrom *string `form:"dateFrom,omitempty" json:"dateFrom,omitempty"` + DateTo *string `form:"dateTo,omitempty" json:"dateTo,omitempty"` +} + // GetSubscribedHomeworksParams defines parameters for GetSubscribedHomeworks. type GetSubscribedHomeworksParams struct { Page *int64 `form:"page,omitempty" json:"page,omitempty"` @@ -8816,6 +9224,36 @@ type PutApiUploadsObjectParams struct { Key string `form:"key" json:"key"` } +// GetApiWorkspaceYoungEventSubscriptionsParams defines parameters for GetApiWorkspaceYoungEventSubscriptions. +type GetApiWorkspaceYoungEventSubscriptionsParams struct { + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + PageSize *int64 `form:"pageSize,omitempty" json:"pageSize,omitempty"` + Unread *GetApiWorkspaceYoungEventSubscriptionsParamsUnread `form:"unread,omitempty" json:"unread,omitempty"` +} + +// GetApiWorkspaceYoungEventSubscriptionsParamsUnread defines parameters for GetApiWorkspaceYoungEventSubscriptions. +type GetApiWorkspaceYoungEventSubscriptionsParamsUnread string + +// GetApiWorkspaceYoungNotificationsParams defines parameters for GetApiWorkspaceYoungNotifications. +type GetApiWorkspaceYoungNotificationsParams struct { + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + PageSize *int64 `form:"pageSize,omitempty" json:"pageSize,omitempty"` + Unread *GetApiWorkspaceYoungNotificationsParamsUnread `form:"unread,omitempty" json:"unread,omitempty"` +} + +// GetApiWorkspaceYoungNotificationsParamsUnread defines parameters for GetApiWorkspaceYoungNotifications. +type GetApiWorkspaceYoungNotificationsParamsUnread string + +// GetApiWorkspaceYoungOrganizerSubscriptionsParams defines parameters for GetApiWorkspaceYoungOrganizerSubscriptions. +type GetApiWorkspaceYoungOrganizerSubscriptionsParams struct { + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + PageSize *int64 `form:"pageSize,omitempty" json:"pageSize,omitempty"` + Unread *GetApiWorkspaceYoungOrganizerSubscriptionsParamsUnread `form:"unread,omitempty" json:"unread,omitempty"` +} + +// GetApiWorkspaceYoungOrganizerSubscriptionsParamsUnread defines parameters for GetApiWorkspaceYoungOrganizerSubscriptions. +type GetApiWorkspaceYoungOrganizerSubscriptionsParamsUnread string + // SetLocaleJSONRequestBody defines body for SetLocale for application/json ContentType. type SetLocaleJSONRequestBody = LocaleUpdateRequestSchema @@ -8909,6 +9347,12 @@ type CompleteUploadJSONRequestBody = UploadCompleteRequestSchema // UpdateUploadJSONRequestBody defines body for UpdateUpload for application/json ContentType. type UpdateUploadJSONRequestBody = UploadRenameRequestSchema +// PutApiWorkspaceYoungEventSubscriptionsYoungIdJSONRequestBody defines body for PutApiWorkspaceYoungEventSubscriptionsYoungId for application/json ContentType. +type PutApiWorkspaceYoungEventSubscriptionsYoungIdJSONRequestBody = YoungEventSubscriptionRequestSchema + +// PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdJSONRequestBody defines body for PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerId for application/json ContentType. +type PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdJSONRequestBody = YoungOrganizerSubscriptionRequestSchema + // AsAdminCreateSuspensionRequestSchemaExpiresAt0 returns the union data inside the AdminCreateSuspensionRequestSchema_ExpiresAt as a AdminCreateSuspensionRequestSchemaExpiresAt0 func (t AdminCreateSuspensionRequestSchema_ExpiresAt) AsAdminCreateSuspensionRequestSchemaExpiresAt0() (AdminCreateSuspensionRequestSchemaExpiresAt0, error) { var body AdminCreateSuspensionRequestSchemaExpiresAt0 @@ -11936,6 +12380,12 @@ type ClientInterface interface { // GetApiCatalogYoungEventsYoungIdImage request GetApiCatalogYoungEventsYoungIdImage(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetApiCatalogYoungOrganizers request + GetApiCatalogYoungOrganizers(ctx context.Context, params *GetApiCatalogYoungOrganizersParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetApiCatalogYoungOrganizersOrganizerId request + GetApiCatalogYoungOrganizersOrganizerId(ctx context.Context, organizerId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListComments request ListComments(ctx context.Context, params *ListCommentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -12015,6 +12465,9 @@ type ClientInterface interface { WorkspaceBusPreferencesSet(ctx context.Context, body WorkspaceBusPreferencesSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetApiWorkspaceCalendarEvents request + GetApiWorkspaceCalendarEvents(ctx context.Context, params *GetApiWorkspaceCalendarEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetSubscribedHomeworks request GetSubscribedHomeworks(ctx context.Context, params *GetSubscribedHomeworksParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -12132,6 +12585,34 @@ type ClientInterface interface { // DownloadUpload request DownloadUpload(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetApiWorkspaceYoungEventSubscriptions request + GetApiWorkspaceYoungEventSubscriptions(ctx context.Context, params *GetApiWorkspaceYoungEventSubscriptionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetApiWorkspaceYoungEventSubscriptionsYoungId request + GetApiWorkspaceYoungEventSubscriptionsYoungId(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutApiWorkspaceYoungEventSubscriptionsYoungIdWithBody request with any body + PutApiWorkspaceYoungEventSubscriptionsYoungIdWithBody(ctx context.Context, youngId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutApiWorkspaceYoungEventSubscriptionsYoungId(ctx context.Context, youngId string, body PutApiWorkspaceYoungEventSubscriptionsYoungIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetApiWorkspaceYoungNotifications request + GetApiWorkspaceYoungNotifications(ctx context.Context, params *GetApiWorkspaceYoungNotificationsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostApiWorkspaceYoungNotificationsIdRead request + PostApiWorkspaceYoungNotificationsIdRead(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetApiWorkspaceYoungOrganizerSubscriptions request + GetApiWorkspaceYoungOrganizerSubscriptions(ctx context.Context, params *GetApiWorkspaceYoungOrganizerSubscriptionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerId request + GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerId(ctx context.Context, organizerId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithBody request with any body + PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithBody(ctx context.Context, organizerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerId(ctx context.Context, organizerId string, body PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } func (c *Client) AccountClientActivityList(ctx context.Context, params *AccountClientActivityListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -12686,6 +13167,30 @@ func (c *Client) GetApiCatalogYoungEventsYoungIdImage(ctx context.Context, young return c.Client.Do(req) } +func (c *Client) GetApiCatalogYoungOrganizers(ctx context.Context, params *GetApiCatalogYoungOrganizersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiCatalogYoungOrganizersRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetApiCatalogYoungOrganizersOrganizerId(ctx context.Context, organizerId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiCatalogYoungOrganizersOrganizerIdRequest(c.Server, organizerId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ListComments(ctx context.Context, params *ListCommentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListCommentsRequest(c.Server, params) if err != nil { @@ -13034,6 +13539,18 @@ func (c *Client) WorkspaceBusPreferencesSet(ctx context.Context, body WorkspaceB return c.Client.Do(req) } +func (c *Client) GetApiWorkspaceCalendarEvents(ctx context.Context, params *GetApiWorkspaceCalendarEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiWorkspaceCalendarEventsRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetSubscribedHomeworks(ctx context.Context, params *GetSubscribedHomeworksParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSubscribedHomeworksRequest(c.Server, params) if err != nil { @@ -13574,20 +14091,140 @@ func (c *Client) DownloadUpload(ctx context.Context, id string, reqEditors ...Re return c.Client.Do(req) } -// NewAccountClientActivityListRequest generates requests for AccountClientActivityList -func NewAccountClientActivityListRequest(server string, params *AccountClientActivityListParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +func (c *Client) GetApiWorkspaceYoungEventSubscriptions(ctx context.Context, params *GetApiWorkspaceYoungEventSubscriptionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiWorkspaceYoungEventSubscriptionsRequest(c.Server, params) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetApiWorkspaceYoungEventSubscriptionsYoungId(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiWorkspaceYoungEventSubscriptionsYoungIdRequest(c.Server, youngId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutApiWorkspaceYoungEventSubscriptionsYoungIdWithBody(ctx context.Context, youngId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutApiWorkspaceYoungEventSubscriptionsYoungIdRequestWithBody(c.Server, youngId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutApiWorkspaceYoungEventSubscriptionsYoungId(ctx context.Context, youngId string, body PutApiWorkspaceYoungEventSubscriptionsYoungIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutApiWorkspaceYoungEventSubscriptionsYoungIdRequest(c.Server, youngId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetApiWorkspaceYoungNotifications(ctx context.Context, params *GetApiWorkspaceYoungNotificationsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiWorkspaceYoungNotificationsRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostApiWorkspaceYoungNotificationsIdRead(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostApiWorkspaceYoungNotificationsIdReadRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetApiWorkspaceYoungOrganizerSubscriptions(ctx context.Context, params *GetApiWorkspaceYoungOrganizerSubscriptionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiWorkspaceYoungOrganizerSubscriptionsRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerId(ctx context.Context, organizerId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequest(c.Server, organizerId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithBody(ctx context.Context, organizerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequestWithBody(c.Server, organizerId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerId(ctx context.Context, organizerId string, body PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequest(c.Server, organizerId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewAccountClientActivityListRequest generates requests for AccountClientActivityList +func NewAccountClientActivityListRequest(server string, params *AccountClientActivityListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/account/client-activity") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - operationPath := fmt.Sprintf("/api/account/client-activity") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err @@ -16378,6 +17015,22 @@ func NewGetApiCatalogYoungEventsRequest(server string, params *GetApiCatalogYoun if params != nil { queryValues := queryURL.Query() + if params.DateUnknown != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "dateUnknown", *params.DateUnknown, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.Active != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "active", *params.Active, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { @@ -16426,6 +17079,70 @@ func NewGetApiCatalogYoungEventsRequest(server string, params *GetApiCatalogYoun } + if params.OrganizerId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "organizerId", *params.OrganizerId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.DateFrom != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "dateFrom", *params.DateFrom, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.DateTo != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "dateTo", *params.DateTo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.TimeBasis != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "timeBasis", *params.TimeBasis, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.Page != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { @@ -16553,8 +17270,8 @@ func NewGetApiCatalogYoungEventsYoungIdImageRequest(server string, youngId strin return req, nil } -// NewListCommentsRequest generates requests for ListComments -func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Request, error) { +// NewGetApiCatalogYoungOrganizersRequest generates requests for GetApiCatalogYoungOrganizers +func NewGetApiCatalogYoungOrganizersRequest(server string, params *GetApiCatalogYoungOrganizersParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -16562,7 +17279,7 @@ func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Re return nil, err } - operationPath := fmt.Sprintf("/api/community/comments") + operationPath := fmt.Sprintf("/api/catalog/young-organizers") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -16575,21 +17292,9 @@ func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Re if params != nil { queryValues := queryURL.Query() - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "targetType", params.TargetType, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if params.TargetId != nil { + if params.Search != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "targetId", *params.TargetId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "search", *params.Search, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -16603,9 +17308,9 @@ func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Re } - if params.SectionId != nil { + if params.Page != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionId", *params.SectionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -16619,9 +17324,9 @@ func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Re } - if params.SectionJwId != nil { + if params.PageSize != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionJwId", *params.SectionJwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -16635,9 +17340,9 @@ func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Re } - if params.CourseJwId != nil { + if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "courseJwId", *params.CourseJwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -16651,39 +17356,198 @@ func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Re } - if params.TeacherId != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "teacherId", *params.TeacherId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + queryURL.RawQuery = queryValues.Encode() + } - } + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - if params.HomeworkId != nil { + return req, nil +} - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "homeworkId", *params.HomeworkId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } +// NewGetApiCatalogYoungOrganizersOrganizerIdRequest generates requests for GetApiCatalogYoungOrganizersOrganizerId +func NewGetApiCatalogYoungOrganizersOrganizerIdRequest(server string, organizerId string) (*http.Request, error) { + var err error - } + var pathParam0 string - if params.SectionTeacherId != nil { + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "organizerId", organizerId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/catalog/young-organizers/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListCommentsRequest generates requests for ListComments +func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/community/comments") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "targetType", params.TargetType, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.TargetId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "targetId", *params.TargetId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.YoungId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "youngId", *params.YoungId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SectionId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionId", *params.SectionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SectionJwId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionJwId", *params.SectionJwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CourseJwId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "courseJwId", *params.CourseJwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.TeacherId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "teacherId", *params.TeacherId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.HomeworkId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "homeworkId", *params.HomeworkId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SectionTeacherId != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionTeacherId", *params.SectionTeacherId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { return nil, err @@ -17782,8 +18646,8 @@ func NewWorkspaceBusPreferencesSetRequestWithBody(server string, contentType str return req, nil } -// NewGetSubscribedHomeworksRequest generates requests for GetSubscribedHomeworks -func NewGetSubscribedHomeworksRequest(server string, params *GetSubscribedHomeworksParams) (*http.Request, error) { +// NewGetApiWorkspaceCalendarEventsRequest generates requests for GetApiWorkspaceCalendarEvents +func NewGetApiWorkspaceCalendarEventsRequest(server string, params *GetApiWorkspaceCalendarEventsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -17791,7 +18655,7 @@ func NewGetSubscribedHomeworksRequest(server string, params *GetSubscribedHomewo return nil, err } - operationPath := fmt.Sprintf("/api/workspace/homeworks") + operationPath := fmt.Sprintf("/api/workspace/calendar/events") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -17836,6 +18700,38 @@ func NewGetSubscribedHomeworksRequest(server string, params *GetSubscribedHomewo } + if params.DateFrom != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "dateFrom", *params.DateFrom, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.DateTo != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "dateTo", *params.DateTo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } @@ -17847,19 +18743,8 @@ func NewGetSubscribedHomeworksRequest(server string, params *GetSubscribedHomewo return req, nil } -// NewPutApiHomeworksCompletionsRequest calls the generic PutApiHomeworksCompletions builder with application/json body -func NewPutApiHomeworksCompletionsRequest(server string, body PutApiHomeworksCompletionsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPutApiHomeworksCompletionsRequestWithBody(server, "application/json", bodyReader) -} - -// NewPutApiHomeworksCompletionsRequestWithBody generates requests for PutApiHomeworksCompletions with any type of body -func NewPutApiHomeworksCompletionsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewGetSubscribedHomeworksRequest generates requests for GetSubscribedHomeworks +func NewGetSubscribedHomeworksRequest(server string, params *GetSubscribedHomeworksParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -17867,7 +18752,7 @@ func NewPutApiHomeworksCompletionsRequestWithBody(server string, contentType str return nil, err } - operationPath := fmt.Sprintf("/api/workspace/homeworks/completions") + operationPath := fmt.Sprintf("/api/workspace/homeworks") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -17877,30 +18762,106 @@ func NewPutApiHomeworksCompletionsRequestWithBody(server string, contentType str return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } + if params != nil { + queryValues := queryURL.Query() - req.Header.Add("Content-Type", contentType) + if params.Page != nil { - return req, nil -} + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } -// NewSetHomeworkCompletionRequest calls the generic SetHomeworkCompletion builder with application/json body -func NewSetHomeworkCompletionRequest(server string, id string, body SetHomeworkCompletionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewSetHomeworkCompletionRequestWithBody(server, id, "application/json", bodyReader) -} + } -// NewSetHomeworkCompletionRequestWithBody generates requests for SetHomeworkCompletion with any type of body -func NewSetHomeworkCompletionRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { - var err error + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPutApiHomeworksCompletionsRequest calls the generic PutApiHomeworksCompletions builder with application/json body +func NewPutApiHomeworksCompletionsRequest(server string, body PutApiHomeworksCompletionsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutApiHomeworksCompletionsRequestWithBody(server, "application/json", bodyReader) +} + +// NewPutApiHomeworksCompletionsRequestWithBody generates requests for PutApiHomeworksCompletions with any type of body +func NewPutApiHomeworksCompletionsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/workspace/homeworks/completions") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewSetHomeworkCompletionRequest calls the generic SetHomeworkCompletion builder with application/json body +func NewSetHomeworkCompletionRequest(server string, id string, body SetHomeworkCompletionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSetHomeworkCompletionRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewSetHomeworkCompletionRequestWithBody generates requests for SetHomeworkCompletion with any type of body +func NewSetHomeworkCompletionRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error var pathParam0 string @@ -19162,124 +20123,563 @@ func NewDownloadUploadRequest(server string, id string) (*http.Request, error) { return req, nil } -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} - -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} +// NewGetApiWorkspaceYoungEventSubscriptionsRequest generates requests for GetApiWorkspaceYoungEventSubscriptions +func NewGetApiWorkspaceYoungEventSubscriptionsRequest(server string, params *GetApiWorkspaceYoungEventSubscriptionsParams) (*http.Request, error) { + var err error -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) + serverURL, err := url.Parse(server) if err != nil { return nil, err } - return &ClientWithResponses{client}, nil -} -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil + operationPath := fmt.Sprintf("/api/workspace/young-event-subscriptions") + if operationPath[0] == '/' { + operationPath = "." + operationPath } -} -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // AccountClientActivityListWithResponse request - AccountClientActivityListWithResponse(ctx context.Context, params *AccountClientActivityListParams, reqEditors ...RequestEditorFn) (*AccountClientActivityListResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // SetLocaleWithBodyWithResponse request with any body - SetLocaleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLocaleResponse, error) + if params != nil { + queryValues := queryURL.Query() - SetLocaleWithResponse(ctx context.Context, body SetLocaleJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLocaleResponse, error) + if params.Page != nil { - // AccountProfileGetWithResponse request - AccountProfileGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AccountProfileGetResponse, error) + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ListAdminCommentsWithResponse request - ListAdminCommentsWithResponse(ctx context.Context, params *ListAdminCommentsParams, reqEditors ...RequestEditorFn) (*ListAdminCommentsResponse, error) + } - // ModerateAdminCommentWithBodyWithResponse request with any body - ModerateAdminCommentWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ModerateAdminCommentResponse, error) + if params.PageSize != nil { - ModerateAdminCommentWithResponse(ctx context.Context, id string, body ModerateAdminCommentJSONRequestBody, reqEditors ...RequestEditorFn) (*ModerateAdminCommentResponse, error) + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ListAdminDescriptionsWithResponse request - ListAdminDescriptionsWithResponse(ctx context.Context, params *ListAdminDescriptionsParams, reqEditors ...RequestEditorFn) (*ListAdminDescriptionsResponse, error) + } - // UpdateAdminDescriptionWithBodyWithResponse request with any body - UpdateAdminDescriptionWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAdminDescriptionResponse, error) + if params.Unread != nil { - UpdateAdminDescriptionWithResponse(ctx context.Context, id string, body UpdateAdminDescriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAdminDescriptionResponse, error) + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "unread", *params.Unread, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ListAdminHomeworksWithResponse request - ListAdminHomeworksWithResponse(ctx context.Context, params *ListAdminHomeworksParams, reqEditors ...RequestEditorFn) (*ListAdminHomeworksResponse, error) + } - // DeleteAdminHomeworkWithResponse request - DeleteAdminHomeworkWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteAdminHomeworkResponse, error) + queryURL.RawQuery = queryValues.Encode() + } - // ListAdminSuspensionsWithResponse request - ListAdminSuspensionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAdminSuspensionsResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - // CreateAdminSuspensionWithBodyWithResponse request with any body - CreateAdminSuspensionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAdminSuspensionResponse, error) + return req, nil +} - CreateAdminSuspensionWithResponse(ctx context.Context, body CreateAdminSuspensionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAdminSuspensionResponse, error) +// NewGetApiWorkspaceYoungEventSubscriptionsYoungIdRequest generates requests for GetApiWorkspaceYoungEventSubscriptionsYoungId +func NewGetApiWorkspaceYoungEventSubscriptionsYoungIdRequest(server string, youngId string) (*http.Request, error) { + var err error - // UpdateAdminSuspensionWithResponse request - UpdateAdminSuspensionWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*UpdateAdminSuspensionResponse, error) + var pathParam0 string - // ListAdminUsersWithResponse request - ListAdminUsersWithResponse(ctx context.Context, params *ListAdminUsersParams, reqEditors ...RequestEditorFn) (*ListAdminUsersResponse, error) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "youngId", youngId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } - // UpdateAdminUserWithBodyWithResponse request with any body - UpdateAdminUserWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAdminUserResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - UpdateAdminUserWithResponse(ctx context.Context, id string, body UpdateAdminUserJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAdminUserResponse, error) + operationPath := fmt.Sprintf("/api/workspace/young-event-subscriptions/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // WorkspaceCalendarFeedExportWithResponse request - WorkspaceCalendarFeedExportWithResponse(ctx context.Context, credential string, reqEditors ...RequestEditorFn) (*WorkspaceCalendarFeedExportResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // CatalogBusTimetableGetWithResponse request - CatalogBusTimetableGetWithResponse(ctx context.Context, params *CatalogBusTimetableGetParams, reqEditors ...RequestEditorFn) (*CatalogBusTimetableGetResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - // CatalogBusDepartureNextWithResponse request - CatalogBusDepartureNextWithResponse(ctx context.Context, params *CatalogBusDepartureNextParams, reqEditors ...RequestEditorFn) (*CatalogBusDepartureNextResponse, error) + return req, nil +} - // CatalogBusRouteSearchWithResponse request - CatalogBusRouteSearchWithResponse(ctx context.Context, params *CatalogBusRouteSearchParams, reqEditors ...RequestEditorFn) (*CatalogBusRouteSearchResponse, error) +// NewPutApiWorkspaceYoungEventSubscriptionsYoungIdRequest calls the generic PutApiWorkspaceYoungEventSubscriptionsYoungId builder with application/json body +func NewPutApiWorkspaceYoungEventSubscriptionsYoungIdRequest(server string, youngId string, body PutApiWorkspaceYoungEventSubscriptionsYoungIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutApiWorkspaceYoungEventSubscriptionsYoungIdRequestWithBody(server, youngId, "application/json", bodyReader) +} - // ListCoursesWithResponse request - ListCoursesWithResponse(ctx context.Context, params *ListCoursesParams, reqEditors ...RequestEditorFn) (*ListCoursesResponse, error) +// NewPutApiWorkspaceYoungEventSubscriptionsYoungIdRequestWithBody generates requests for PutApiWorkspaceYoungEventSubscriptionsYoungId with any type of body +func NewPutApiWorkspaceYoungEventSubscriptionsYoungIdRequestWithBody(server string, youngId string, contentType string, body io.Reader) (*http.Request, error) { + var err error - // GetCourseWithResponse request - GetCourseWithResponse(ctx context.Context, jwId int64, params *GetCourseParams, reqEditors ...RequestEditorFn) (*GetCourseResponse, error) + var pathParam0 string - // CatalogLinkListWithResponse request - CatalogLinkListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CatalogLinkListResponse, error) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "youngId", youngId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } - // CatalogLinkResolveWithResponse request - CatalogLinkResolveWithResponse(ctx context.Context, params *CatalogLinkResolveParams, reqEditors ...RequestEditorFn) (*CatalogLinkResolveResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/workspace/young-event-subscriptions/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetApiWorkspaceYoungNotificationsRequest generates requests for GetApiWorkspaceYoungNotifications +func NewGetApiWorkspaceYoungNotificationsRequest(server string, params *GetApiWorkspaceYoungNotificationsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/workspace/young-notifications") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Unread != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "unread", *params.Unread, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostApiWorkspaceYoungNotificationsIdReadRequest generates requests for PostApiWorkspaceYoungNotificationsIdRead +func NewPostApiWorkspaceYoungNotificationsIdReadRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/workspace/young-notifications/%s/read", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetApiWorkspaceYoungOrganizerSubscriptionsRequest generates requests for GetApiWorkspaceYoungOrganizerSubscriptions +func NewGetApiWorkspaceYoungOrganizerSubscriptionsRequest(server string, params *GetApiWorkspaceYoungOrganizerSubscriptionsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/workspace/young-organizer-subscriptions") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Unread != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "unread", *params.Unread, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequest generates requests for GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerId +func NewGetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequest(server string, organizerId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "organizerId", organizerId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/workspace/young-organizer-subscriptions/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequest calls the generic PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerId builder with application/json body +func NewPutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequest(server string, organizerId string, body PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequestWithBody(server, organizerId, "application/json", bodyReader) +} + +// NewPutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequestWithBody generates requests for PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerId with any type of body +func NewPutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdRequestWithBody(server string, organizerId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "organizerId", organizerId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/workspace/young-organizer-subscriptions/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // AccountClientActivityListWithResponse request + AccountClientActivityListWithResponse(ctx context.Context, params *AccountClientActivityListParams, reqEditors ...RequestEditorFn) (*AccountClientActivityListResponse, error) + + // SetLocaleWithBodyWithResponse request with any body + SetLocaleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLocaleResponse, error) + + SetLocaleWithResponse(ctx context.Context, body SetLocaleJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLocaleResponse, error) + + // AccountProfileGetWithResponse request + AccountProfileGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AccountProfileGetResponse, error) + + // ListAdminCommentsWithResponse request + ListAdminCommentsWithResponse(ctx context.Context, params *ListAdminCommentsParams, reqEditors ...RequestEditorFn) (*ListAdminCommentsResponse, error) + + // ModerateAdminCommentWithBodyWithResponse request with any body + ModerateAdminCommentWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ModerateAdminCommentResponse, error) + + ModerateAdminCommentWithResponse(ctx context.Context, id string, body ModerateAdminCommentJSONRequestBody, reqEditors ...RequestEditorFn) (*ModerateAdminCommentResponse, error) + + // ListAdminDescriptionsWithResponse request + ListAdminDescriptionsWithResponse(ctx context.Context, params *ListAdminDescriptionsParams, reqEditors ...RequestEditorFn) (*ListAdminDescriptionsResponse, error) + + // UpdateAdminDescriptionWithBodyWithResponse request with any body + UpdateAdminDescriptionWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAdminDescriptionResponse, error) + + UpdateAdminDescriptionWithResponse(ctx context.Context, id string, body UpdateAdminDescriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAdminDescriptionResponse, error) + + // ListAdminHomeworksWithResponse request + ListAdminHomeworksWithResponse(ctx context.Context, params *ListAdminHomeworksParams, reqEditors ...RequestEditorFn) (*ListAdminHomeworksResponse, error) + + // DeleteAdminHomeworkWithResponse request + DeleteAdminHomeworkWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteAdminHomeworkResponse, error) + + // ListAdminSuspensionsWithResponse request + ListAdminSuspensionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAdminSuspensionsResponse, error) + + // CreateAdminSuspensionWithBodyWithResponse request with any body + CreateAdminSuspensionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAdminSuspensionResponse, error) + + CreateAdminSuspensionWithResponse(ctx context.Context, body CreateAdminSuspensionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAdminSuspensionResponse, error) + + // UpdateAdminSuspensionWithResponse request + UpdateAdminSuspensionWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*UpdateAdminSuspensionResponse, error) + + // ListAdminUsersWithResponse request + ListAdminUsersWithResponse(ctx context.Context, params *ListAdminUsersParams, reqEditors ...RequestEditorFn) (*ListAdminUsersResponse, error) + + // UpdateAdminUserWithBodyWithResponse request with any body + UpdateAdminUserWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAdminUserResponse, error) + + UpdateAdminUserWithResponse(ctx context.Context, id string, body UpdateAdminUserJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAdminUserResponse, error) + + // WorkspaceCalendarFeedExportWithResponse request + WorkspaceCalendarFeedExportWithResponse(ctx context.Context, credential string, reqEditors ...RequestEditorFn) (*WorkspaceCalendarFeedExportResponse, error) + + // CatalogBusTimetableGetWithResponse request + CatalogBusTimetableGetWithResponse(ctx context.Context, params *CatalogBusTimetableGetParams, reqEditors ...RequestEditorFn) (*CatalogBusTimetableGetResponse, error) + + // CatalogBusDepartureNextWithResponse request + CatalogBusDepartureNextWithResponse(ctx context.Context, params *CatalogBusDepartureNextParams, reqEditors ...RequestEditorFn) (*CatalogBusDepartureNextResponse, error) + + // CatalogBusRouteSearchWithResponse request + CatalogBusRouteSearchWithResponse(ctx context.Context, params *CatalogBusRouteSearchParams, reqEditors ...RequestEditorFn) (*CatalogBusRouteSearchResponse, error) + + // ListCoursesWithResponse request + ListCoursesWithResponse(ctx context.Context, params *ListCoursesParams, reqEditors ...RequestEditorFn) (*ListCoursesResponse, error) + + // GetCourseWithResponse request + GetCourseWithResponse(ctx context.Context, jwId int64, params *GetCourseParams, reqEditors ...RequestEditorFn) (*GetCourseResponse, error) + + // CatalogLinkListWithResponse request + CatalogLinkListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CatalogLinkListResponse, error) + + // CatalogLinkResolveWithResponse request + CatalogLinkResolveWithResponse(ctx context.Context, params *CatalogLinkResolveParams, reqEditors ...RequestEditorFn) (*CatalogLinkResolveResponse, error) // GetMetadataWithResponse request GetMetadataWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetadataResponse, error) @@ -19337,6 +20737,12 @@ type ClientWithResponsesInterface interface { // GetApiCatalogYoungEventsYoungIdImageWithResponse request GetApiCatalogYoungEventsYoungIdImageWithResponse(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungEventsYoungIdImageResponse, error) + // GetApiCatalogYoungOrganizersWithResponse request + GetApiCatalogYoungOrganizersWithResponse(ctx context.Context, params *GetApiCatalogYoungOrganizersParams, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungOrganizersResponse, error) + + // GetApiCatalogYoungOrganizersOrganizerIdWithResponse request + GetApiCatalogYoungOrganizersOrganizerIdWithResponse(ctx context.Context, organizerId string, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungOrganizersOrganizerIdResponse, error) + // ListCommentsWithResponse request ListCommentsWithResponse(ctx context.Context, params *ListCommentsParams, reqEditors ...RequestEditorFn) (*ListCommentsResponse, error) @@ -19416,6 +20822,9 @@ type ClientWithResponsesInterface interface { WorkspaceBusPreferencesSetWithResponse(ctx context.Context, body WorkspaceBusPreferencesSetJSONRequestBody, reqEditors ...RequestEditorFn) (*WorkspaceBusPreferencesSetResponse, error) + // GetApiWorkspaceCalendarEventsWithResponse request + GetApiWorkspaceCalendarEventsWithResponse(ctx context.Context, params *GetApiWorkspaceCalendarEventsParams, reqEditors ...RequestEditorFn) (*GetApiWorkspaceCalendarEventsResponse, error) + // GetSubscribedHomeworksWithResponse request GetSubscribedHomeworksWithResponse(ctx context.Context, params *GetSubscribedHomeworksParams, reqEditors ...RequestEditorFn) (*GetSubscribedHomeworksResponse, error) @@ -19533,6 +20942,34 @@ type ClientWithResponsesInterface interface { // DownloadUploadWithResponse request DownloadUploadWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DownloadUploadResponse, error) + + // GetApiWorkspaceYoungEventSubscriptionsWithResponse request + GetApiWorkspaceYoungEventSubscriptionsWithResponse(ctx context.Context, params *GetApiWorkspaceYoungEventSubscriptionsParams, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungEventSubscriptionsResponse, error) + + // GetApiWorkspaceYoungEventSubscriptionsYoungIdWithResponse request + GetApiWorkspaceYoungEventSubscriptionsYoungIdWithResponse(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungEventSubscriptionsYoungIdResponse, error) + + // PutApiWorkspaceYoungEventSubscriptionsYoungIdWithBodyWithResponse request with any body + PutApiWorkspaceYoungEventSubscriptionsYoungIdWithBodyWithResponse(ctx context.Context, youngId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse, error) + + PutApiWorkspaceYoungEventSubscriptionsYoungIdWithResponse(ctx context.Context, youngId string, body PutApiWorkspaceYoungEventSubscriptionsYoungIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse, error) + + // GetApiWorkspaceYoungNotificationsWithResponse request + GetApiWorkspaceYoungNotificationsWithResponse(ctx context.Context, params *GetApiWorkspaceYoungNotificationsParams, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungNotificationsResponse, error) + + // PostApiWorkspaceYoungNotificationsIdReadWithResponse request + PostApiWorkspaceYoungNotificationsIdReadWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*PostApiWorkspaceYoungNotificationsIdReadResponse, error) + + // GetApiWorkspaceYoungOrganizerSubscriptionsWithResponse request + GetApiWorkspaceYoungOrganizerSubscriptionsWithResponse(ctx context.Context, params *GetApiWorkspaceYoungOrganizerSubscriptionsParams, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungOrganizerSubscriptionsResponse, error) + + // GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithResponse request + GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithResponse(ctx context.Context, organizerId string, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse, error) + + // PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithBodyWithResponse request with any body + PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithBodyWithResponse(ctx context.Context, organizerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse, error) + + PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithResponse(ctx context.Context, organizerId string, body PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse, error) } type AccountClientActivityListResponse struct { @@ -20406,6 +21843,7 @@ type CatalogWeatherGetResponse struct { HTTPResponse *http.Response JSON200 *WeatherSnapshotResponseSchema JSON400 *OpenApiErrorSchema + JSON503 *OpenApiErrorSchema } // Status returns HTTPResponse.Status @@ -20496,6 +21934,53 @@ func (r GetApiCatalogYoungEventsYoungIdImageResponse) StatusCode() int { return 0 } +type GetApiCatalogYoungOrganizersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PaginatedYoungOrganizerResponseSchema + JSON400 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiCatalogYoungOrganizersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiCatalogYoungOrganizersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetApiCatalogYoungOrganizersOrganizerIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *YoungOrganizerSummarySchema + JSON400 *OpenApiErrorSchema + JSON404 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiCatalogYoungOrganizersOrganizerIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiCatalogYoungOrganizersOrganizerIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type ListCommentsResponse struct { Body []byte HTTPResponse *http.Response @@ -21035,6 +22520,30 @@ func (r WorkspaceBusPreferencesSetResponse) StatusCode() int { return 0 } +type GetApiWorkspaceCalendarEventsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PersonalCalendarPageSchema + JSON400 *OpenApiErrorSchema + JSON401 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiWorkspaceCalendarEventsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiWorkspaceCalendarEventsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type GetSubscribedHomeworksResponse struct { Body []byte HTTPResponse *http.Response @@ -21684,20 +23193,219 @@ func (r PutApiUploadsObjectResponse) StatusCode() int { return 0 } -type DeleteUploadResponse struct { +type DeleteUploadResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UploadDeleteResponseSchema + JSON401 *OpenApiErrorSchema + JSON403 *OpenApiErrorSchema + JSON404 *OpenApiErrorSchema + JSON429 *OpenApiErrorSchema + JSON502 *OpenApiErrorSchema + JSON503 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r DeleteUploadResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteUploadResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateUploadResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UploadRenameResponseSchema + JSON400 *OpenApiErrorSchema + JSON401 *OpenApiErrorSchema + JSON403 *OpenApiErrorSchema + JSON404 *OpenApiErrorSchema + JSON429 *OpenApiErrorSchema + JSON503 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r UpdateUploadResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateUploadResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DownloadUploadResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *OpenApiErrorSchema + JSON404 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r DownloadUploadResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DownloadUploadResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetApiWorkspaceYoungEventSubscriptionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *YoungEventSubscriptionListSchema + JSON400 *OpenApiErrorSchema + JSON401 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiWorkspaceYoungEventSubscriptionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiWorkspaceYoungEventSubscriptionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetApiWorkspaceYoungEventSubscriptionsYoungIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *YoungEventSubscriptionStateSchema + JSON401 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiWorkspaceYoungEventSubscriptionsYoungIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiWorkspaceYoungEventSubscriptionsYoungIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *YoungEventSubscriptionStateSchema + JSON400 *OpenApiErrorSchema + JSON401 *OpenApiErrorSchema + JSON404 *OpenApiErrorSchema + JSON429 *OpenApiErrorSchema + JSON503 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetApiWorkspaceYoungNotificationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *YoungNotificationListSchema + JSON400 *OpenApiErrorSchema + JSON401 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiWorkspaceYoungNotificationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiWorkspaceYoungNotificationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostApiWorkspaceYoungNotificationsIdReadResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *YoungNotificationReadSchema + JSON401 *OpenApiErrorSchema + JSON404 *OpenApiErrorSchema + JSON429 *OpenApiErrorSchema + JSON503 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r PostApiWorkspaceYoungNotificationsIdReadResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostApiWorkspaceYoungNotificationsIdReadResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetApiWorkspaceYoungOrganizerSubscriptionsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *UploadDeleteResponseSchema + JSON200 *YoungOrganizerSubscriptionListSchema + JSON400 *OpenApiErrorSchema JSON401 *OpenApiErrorSchema - JSON403 *OpenApiErrorSchema - JSON404 *OpenApiErrorSchema - JSON429 *OpenApiErrorSchema - JSON502 *OpenApiErrorSchema - JSON503 *OpenApiErrorSchema } // Status returns HTTPResponse.Status -func (r DeleteUploadResponse) Status() string { +func (r GetApiWorkspaceYoungOrganizerSubscriptionsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -21705,27 +23413,22 @@ func (r DeleteUploadResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteUploadResponse) StatusCode() int { +func (r GetApiWorkspaceYoungOrganizerSubscriptionsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateUploadResponse struct { +type GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *UploadRenameResponseSchema - JSON400 *OpenApiErrorSchema + JSON200 *YoungOrganizerSubscriptionStateSchema JSON401 *OpenApiErrorSchema - JSON403 *OpenApiErrorSchema - JSON404 *OpenApiErrorSchema - JSON429 *OpenApiErrorSchema - JSON503 *OpenApiErrorSchema } // Status returns HTTPResponse.Status -func (r UpdateUploadResponse) Status() string { +func (r GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -21733,22 +23436,26 @@ func (r UpdateUploadResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateUploadResponse) StatusCode() int { +func (r GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DownloadUploadResponse struct { +type PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *YoungOrganizerSubscriptionStateSchema + JSON400 *OpenApiErrorSchema JSON401 *OpenApiErrorSchema JSON404 *OpenApiErrorSchema + JSON429 *OpenApiErrorSchema + JSON503 *OpenApiErrorSchema } // Status returns HTTPResponse.Status -func (r DownloadUploadResponse) Status() string { +func (r PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -21756,7 +23463,7 @@ func (r DownloadUploadResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DownloadUploadResponse) StatusCode() int { +func (r PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -22171,6 +23878,24 @@ func (c *ClientWithResponses) GetApiCatalogYoungEventsYoungIdImageWithResponse(c return ParseGetApiCatalogYoungEventsYoungIdImageResponse(rsp) } +// GetApiCatalogYoungOrganizersWithResponse request returning *GetApiCatalogYoungOrganizersResponse +func (c *ClientWithResponses) GetApiCatalogYoungOrganizersWithResponse(ctx context.Context, params *GetApiCatalogYoungOrganizersParams, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungOrganizersResponse, error) { + rsp, err := c.GetApiCatalogYoungOrganizers(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiCatalogYoungOrganizersResponse(rsp) +} + +// GetApiCatalogYoungOrganizersOrganizerIdWithResponse request returning *GetApiCatalogYoungOrganizersOrganizerIdResponse +func (c *ClientWithResponses) GetApiCatalogYoungOrganizersOrganizerIdWithResponse(ctx context.Context, organizerId string, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungOrganizersOrganizerIdResponse, error) { + rsp, err := c.GetApiCatalogYoungOrganizersOrganizerId(ctx, organizerId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiCatalogYoungOrganizersOrganizerIdResponse(rsp) +} + // ListCommentsWithResponse request returning *ListCommentsResponse func (c *ClientWithResponses) ListCommentsWithResponse(ctx context.Context, params *ListCommentsParams, reqEditors ...RequestEditorFn) (*ListCommentsResponse, error) { rsp, err := c.ListComments(ctx, params, reqEditors...) @@ -22424,6 +24149,15 @@ func (c *ClientWithResponses) WorkspaceBusPreferencesSetWithResponse(ctx context return ParseWorkspaceBusPreferencesSetResponse(rsp) } +// GetApiWorkspaceCalendarEventsWithResponse request returning *GetApiWorkspaceCalendarEventsResponse +func (c *ClientWithResponses) GetApiWorkspaceCalendarEventsWithResponse(ctx context.Context, params *GetApiWorkspaceCalendarEventsParams, reqEditors ...RequestEditorFn) (*GetApiWorkspaceCalendarEventsResponse, error) { + rsp, err := c.GetApiWorkspaceCalendarEvents(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiWorkspaceCalendarEventsResponse(rsp) +} + // GetSubscribedHomeworksWithResponse request returning *GetSubscribedHomeworksResponse func (c *ClientWithResponses) GetSubscribedHomeworksWithResponse(ctx context.Context, params *GetSubscribedHomeworksParams, reqEditors ...RequestEditorFn) (*GetSubscribedHomeworksResponse, error) { rsp, err := c.GetSubscribedHomeworks(ctx, params, reqEditors...) @@ -22576,258 +24310,607 @@ func (c *ClientWithResponses) BatchUpdateCalendarSubscriptionWithResponse(ctx co if err != nil { return nil, err } - return ParseBatchUpdateCalendarSubscriptionResponse(rsp) + return ParseBatchUpdateCalendarSubscriptionResponse(rsp) +} + +// GetCurrentCalendarSubscriptionWithResponse request returning *GetCurrentCalendarSubscriptionResponse +func (c *ClientWithResponses) GetCurrentCalendarSubscriptionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCurrentCalendarSubscriptionResponse, error) { + rsp, err := c.GetCurrentCalendarSubscription(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetCurrentCalendarSubscriptionResponse(rsp) +} + +// PostApiWorkspaceSubscriptionsImportCodesWithBodyWithResponse request with arbitrary body returning *PostApiWorkspaceSubscriptionsImportCodesResponse +func (c *ClientWithResponses) PostApiWorkspaceSubscriptionsImportCodesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiWorkspaceSubscriptionsImportCodesResponse, error) { + rsp, err := c.PostApiWorkspaceSubscriptionsImportCodesWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostApiWorkspaceSubscriptionsImportCodesResponse(rsp) +} + +func (c *ClientWithResponses) PostApiWorkspaceSubscriptionsImportCodesWithResponse(ctx context.Context, body PostApiWorkspaceSubscriptionsImportCodesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiWorkspaceSubscriptionsImportCodesResponse, error) { + rsp, err := c.PostApiWorkspaceSubscriptionsImportCodes(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostApiWorkspaceSubscriptionsImportCodesResponse(rsp) +} + +// QueryCalendarSubscriptionSectionsWithBodyWithResponse request with arbitrary body returning *QueryCalendarSubscriptionSectionsResponse +func (c *ClientWithResponses) QueryCalendarSubscriptionSectionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryCalendarSubscriptionSectionsResponse, error) { + rsp, err := c.QueryCalendarSubscriptionSectionsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseQueryCalendarSubscriptionSectionsResponse(rsp) +} + +func (c *ClientWithResponses) QueryCalendarSubscriptionSectionsWithResponse(ctx context.Context, body QueryCalendarSubscriptionSectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryCalendarSubscriptionSectionsResponse, error) { + rsp, err := c.QueryCalendarSubscriptionSections(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseQueryCalendarSubscriptionSectionsResponse(rsp) +} + +// PatchApiWorkspaceSubscriptionsJwIdWithBodyWithResponse request with arbitrary body returning *PatchApiWorkspaceSubscriptionsJwIdResponse +func (c *ClientWithResponses) PatchApiWorkspaceSubscriptionsJwIdWithBodyWithResponse(ctx context.Context, jwId int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchApiWorkspaceSubscriptionsJwIdResponse, error) { + rsp, err := c.PatchApiWorkspaceSubscriptionsJwIdWithBody(ctx, jwId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchApiWorkspaceSubscriptionsJwIdResponse(rsp) +} + +func (c *ClientWithResponses) PatchApiWorkspaceSubscriptionsJwIdWithResponse(ctx context.Context, jwId int64, body PatchApiWorkspaceSubscriptionsJwIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchApiWorkspaceSubscriptionsJwIdResponse, error) { + rsp, err := c.PatchApiWorkspaceSubscriptionsJwId(ctx, jwId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchApiWorkspaceSubscriptionsJwIdResponse(rsp) +} + +// ListTodosWithResponse request returning *ListTodosResponse +func (c *ClientWithResponses) ListTodosWithResponse(ctx context.Context, params *ListTodosParams, reqEditors ...RequestEditorFn) (*ListTodosResponse, error) { + rsp, err := c.ListTodos(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListTodosResponse(rsp) +} + +// CreateTodoWithBodyWithResponse request with arbitrary body returning *CreateTodoResponse +func (c *ClientWithResponses) CreateTodoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTodoResponse, error) { + rsp, err := c.CreateTodoWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateTodoResponse(rsp) +} + +func (c *ClientWithResponses) CreateTodoWithResponse(ctx context.Context, body CreateTodoJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTodoResponse, error) { + rsp, err := c.CreateTodo(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateTodoResponse(rsp) +} + +// DeleteApiTodosBatchWithBodyWithResponse request with arbitrary body returning *DeleteApiTodosBatchResponse +func (c *ClientWithResponses) DeleteApiTodosBatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteApiTodosBatchResponse, error) { + rsp, err := c.DeleteApiTodosBatchWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteApiTodosBatchResponse(rsp) +} + +func (c *ClientWithResponses) DeleteApiTodosBatchWithResponse(ctx context.Context, body DeleteApiTodosBatchJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteApiTodosBatchResponse, error) { + rsp, err := c.DeleteApiTodosBatch(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteApiTodosBatchResponse(rsp) +} + +// PatchApiTodosBatchWithBodyWithResponse request with arbitrary body returning *PatchApiTodosBatchResponse +func (c *ClientWithResponses) PatchApiTodosBatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchApiTodosBatchResponse, error) { + rsp, err := c.PatchApiTodosBatchWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchApiTodosBatchResponse(rsp) +} + +func (c *ClientWithResponses) PatchApiTodosBatchWithResponse(ctx context.Context, body PatchApiTodosBatchJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchApiTodosBatchResponse, error) { + rsp, err := c.PatchApiTodosBatch(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchApiTodosBatchResponse(rsp) +} + +// DeleteTodoWithResponse request returning *DeleteTodoResponse +func (c *ClientWithResponses) DeleteTodoWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteTodoResponse, error) { + rsp, err := c.DeleteTodo(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteTodoResponse(rsp) +} + +// UpdateTodoWithBodyWithResponse request with arbitrary body returning *UpdateTodoResponse +func (c *ClientWithResponses) UpdateTodoWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTodoResponse, error) { + rsp, err := c.UpdateTodoWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateTodoResponse(rsp) +} + +func (c *ClientWithResponses) UpdateTodoWithResponse(ctx context.Context, id string, body UpdateTodoJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTodoResponse, error) { + rsp, err := c.UpdateTodo(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateTodoResponse(rsp) +} + +// ListUploadsWithResponse request returning *ListUploadsResponse +func (c *ClientWithResponses) ListUploadsWithResponse(ctx context.Context, params *ListUploadsParams, reqEditors ...RequestEditorFn) (*ListUploadsResponse, error) { + rsp, err := c.ListUploads(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListUploadsResponse(rsp) +} + +// CreateUploadWithBodyWithResponse request with arbitrary body returning *CreateUploadResponse +func (c *ClientWithResponses) CreateUploadWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUploadResponse, error) { + rsp, err := c.CreateUploadWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateUploadResponse(rsp) +} + +func (c *ClientWithResponses) CreateUploadWithResponse(ctx context.Context, body CreateUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUploadResponse, error) { + rsp, err := c.CreateUpload(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateUploadResponse(rsp) +} + +// CompleteUploadWithBodyWithResponse request with arbitrary body returning *CompleteUploadResponse +func (c *ClientWithResponses) CompleteUploadWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CompleteUploadResponse, error) { + rsp, err := c.CompleteUploadWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCompleteUploadResponse(rsp) +} + +func (c *ClientWithResponses) CompleteUploadWithResponse(ctx context.Context, body CompleteUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*CompleteUploadResponse, error) { + rsp, err := c.CompleteUpload(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCompleteUploadResponse(rsp) +} + +// PutApiUploadsObjectWithBodyWithResponse request with arbitrary body returning *PutApiUploadsObjectResponse +func (c *ClientWithResponses) PutApiUploadsObjectWithBodyWithResponse(ctx context.Context, params *PutApiUploadsObjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutApiUploadsObjectResponse, error) { + rsp, err := c.PutApiUploadsObjectWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutApiUploadsObjectResponse(rsp) +} + +// DeleteUploadWithResponse request returning *DeleteUploadResponse +func (c *ClientWithResponses) DeleteUploadWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteUploadResponse, error) { + rsp, err := c.DeleteUpload(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteUploadResponse(rsp) +} + +// UpdateUploadWithBodyWithResponse request with arbitrary body returning *UpdateUploadResponse +func (c *ClientWithResponses) UpdateUploadWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUploadResponse, error) { + rsp, err := c.UpdateUploadWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateUploadResponse(rsp) } -// GetCurrentCalendarSubscriptionWithResponse request returning *GetCurrentCalendarSubscriptionResponse -func (c *ClientWithResponses) GetCurrentCalendarSubscriptionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCurrentCalendarSubscriptionResponse, error) { - rsp, err := c.GetCurrentCalendarSubscription(ctx, reqEditors...) +func (c *ClientWithResponses) UpdateUploadWithResponse(ctx context.Context, id string, body UpdateUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUploadResponse, error) { + rsp, err := c.UpdateUpload(ctx, id, body, reqEditors...) if err != nil { return nil, err } - return ParseGetCurrentCalendarSubscriptionResponse(rsp) + return ParseUpdateUploadResponse(rsp) } -// PostApiWorkspaceSubscriptionsImportCodesWithBodyWithResponse request with arbitrary body returning *PostApiWorkspaceSubscriptionsImportCodesResponse -func (c *ClientWithResponses) PostApiWorkspaceSubscriptionsImportCodesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiWorkspaceSubscriptionsImportCodesResponse, error) { - rsp, err := c.PostApiWorkspaceSubscriptionsImportCodesWithBody(ctx, contentType, body, reqEditors...) +// DownloadUploadWithResponse request returning *DownloadUploadResponse +func (c *ClientWithResponses) DownloadUploadWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DownloadUploadResponse, error) { + rsp, err := c.DownloadUpload(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParsePostApiWorkspaceSubscriptionsImportCodesResponse(rsp) + return ParseDownloadUploadResponse(rsp) } -func (c *ClientWithResponses) PostApiWorkspaceSubscriptionsImportCodesWithResponse(ctx context.Context, body PostApiWorkspaceSubscriptionsImportCodesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiWorkspaceSubscriptionsImportCodesResponse, error) { - rsp, err := c.PostApiWorkspaceSubscriptionsImportCodes(ctx, body, reqEditors...) +// GetApiWorkspaceYoungEventSubscriptionsWithResponse request returning *GetApiWorkspaceYoungEventSubscriptionsResponse +func (c *ClientWithResponses) GetApiWorkspaceYoungEventSubscriptionsWithResponse(ctx context.Context, params *GetApiWorkspaceYoungEventSubscriptionsParams, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungEventSubscriptionsResponse, error) { + rsp, err := c.GetApiWorkspaceYoungEventSubscriptions(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParsePostApiWorkspaceSubscriptionsImportCodesResponse(rsp) + return ParseGetApiWorkspaceYoungEventSubscriptionsResponse(rsp) } -// QueryCalendarSubscriptionSectionsWithBodyWithResponse request with arbitrary body returning *QueryCalendarSubscriptionSectionsResponse -func (c *ClientWithResponses) QueryCalendarSubscriptionSectionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryCalendarSubscriptionSectionsResponse, error) { - rsp, err := c.QueryCalendarSubscriptionSectionsWithBody(ctx, contentType, body, reqEditors...) +// GetApiWorkspaceYoungEventSubscriptionsYoungIdWithResponse request returning *GetApiWorkspaceYoungEventSubscriptionsYoungIdResponse +func (c *ClientWithResponses) GetApiWorkspaceYoungEventSubscriptionsYoungIdWithResponse(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungEventSubscriptionsYoungIdResponse, error) { + rsp, err := c.GetApiWorkspaceYoungEventSubscriptionsYoungId(ctx, youngId, reqEditors...) if err != nil { return nil, err } - return ParseQueryCalendarSubscriptionSectionsResponse(rsp) + return ParseGetApiWorkspaceYoungEventSubscriptionsYoungIdResponse(rsp) } -func (c *ClientWithResponses) QueryCalendarSubscriptionSectionsWithResponse(ctx context.Context, body QueryCalendarSubscriptionSectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryCalendarSubscriptionSectionsResponse, error) { - rsp, err := c.QueryCalendarSubscriptionSections(ctx, body, reqEditors...) +// PutApiWorkspaceYoungEventSubscriptionsYoungIdWithBodyWithResponse request with arbitrary body returning *PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse +func (c *ClientWithResponses) PutApiWorkspaceYoungEventSubscriptionsYoungIdWithBodyWithResponse(ctx context.Context, youngId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse, error) { + rsp, err := c.PutApiWorkspaceYoungEventSubscriptionsYoungIdWithBody(ctx, youngId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseQueryCalendarSubscriptionSectionsResponse(rsp) + return ParsePutApiWorkspaceYoungEventSubscriptionsYoungIdResponse(rsp) } -// PatchApiWorkspaceSubscriptionsJwIdWithBodyWithResponse request with arbitrary body returning *PatchApiWorkspaceSubscriptionsJwIdResponse -func (c *ClientWithResponses) PatchApiWorkspaceSubscriptionsJwIdWithBodyWithResponse(ctx context.Context, jwId int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchApiWorkspaceSubscriptionsJwIdResponse, error) { - rsp, err := c.PatchApiWorkspaceSubscriptionsJwIdWithBody(ctx, jwId, contentType, body, reqEditors...) +func (c *ClientWithResponses) PutApiWorkspaceYoungEventSubscriptionsYoungIdWithResponse(ctx context.Context, youngId string, body PutApiWorkspaceYoungEventSubscriptionsYoungIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse, error) { + rsp, err := c.PutApiWorkspaceYoungEventSubscriptionsYoungId(ctx, youngId, body, reqEditors...) if err != nil { return nil, err } - return ParsePatchApiWorkspaceSubscriptionsJwIdResponse(rsp) + return ParsePutApiWorkspaceYoungEventSubscriptionsYoungIdResponse(rsp) } -func (c *ClientWithResponses) PatchApiWorkspaceSubscriptionsJwIdWithResponse(ctx context.Context, jwId int64, body PatchApiWorkspaceSubscriptionsJwIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchApiWorkspaceSubscriptionsJwIdResponse, error) { - rsp, err := c.PatchApiWorkspaceSubscriptionsJwId(ctx, jwId, body, reqEditors...) +// GetApiWorkspaceYoungNotificationsWithResponse request returning *GetApiWorkspaceYoungNotificationsResponse +func (c *ClientWithResponses) GetApiWorkspaceYoungNotificationsWithResponse(ctx context.Context, params *GetApiWorkspaceYoungNotificationsParams, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungNotificationsResponse, error) { + rsp, err := c.GetApiWorkspaceYoungNotifications(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParsePatchApiWorkspaceSubscriptionsJwIdResponse(rsp) + return ParseGetApiWorkspaceYoungNotificationsResponse(rsp) } -// ListTodosWithResponse request returning *ListTodosResponse -func (c *ClientWithResponses) ListTodosWithResponse(ctx context.Context, params *ListTodosParams, reqEditors ...RequestEditorFn) (*ListTodosResponse, error) { - rsp, err := c.ListTodos(ctx, params, reqEditors...) +// PostApiWorkspaceYoungNotificationsIdReadWithResponse request returning *PostApiWorkspaceYoungNotificationsIdReadResponse +func (c *ClientWithResponses) PostApiWorkspaceYoungNotificationsIdReadWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*PostApiWorkspaceYoungNotificationsIdReadResponse, error) { + rsp, err := c.PostApiWorkspaceYoungNotificationsIdRead(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseListTodosResponse(rsp) + return ParsePostApiWorkspaceYoungNotificationsIdReadResponse(rsp) } -// CreateTodoWithBodyWithResponse request with arbitrary body returning *CreateTodoResponse -func (c *ClientWithResponses) CreateTodoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTodoResponse, error) { - rsp, err := c.CreateTodoWithBody(ctx, contentType, body, reqEditors...) +// GetApiWorkspaceYoungOrganizerSubscriptionsWithResponse request returning *GetApiWorkspaceYoungOrganizerSubscriptionsResponse +func (c *ClientWithResponses) GetApiWorkspaceYoungOrganizerSubscriptionsWithResponse(ctx context.Context, params *GetApiWorkspaceYoungOrganizerSubscriptionsParams, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungOrganizerSubscriptionsResponse, error) { + rsp, err := c.GetApiWorkspaceYoungOrganizerSubscriptions(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseCreateTodoResponse(rsp) + return ParseGetApiWorkspaceYoungOrganizerSubscriptionsResponse(rsp) } -func (c *ClientWithResponses) CreateTodoWithResponse(ctx context.Context, body CreateTodoJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTodoResponse, error) { - rsp, err := c.CreateTodo(ctx, body, reqEditors...) +// GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithResponse request returning *GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse +func (c *ClientWithResponses) GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithResponse(ctx context.Context, organizerId string, reqEditors ...RequestEditorFn) (*GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse, error) { + rsp, err := c.GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerId(ctx, organizerId, reqEditors...) if err != nil { return nil, err } - return ParseCreateTodoResponse(rsp) + return ParseGetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse(rsp) } -// DeleteApiTodosBatchWithBodyWithResponse request with arbitrary body returning *DeleteApiTodosBatchResponse -func (c *ClientWithResponses) DeleteApiTodosBatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteApiTodosBatchResponse, error) { - rsp, err := c.DeleteApiTodosBatchWithBody(ctx, contentType, body, reqEditors...) +// PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithBodyWithResponse request with arbitrary body returning *PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse +func (c *ClientWithResponses) PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithBodyWithResponse(ctx context.Context, organizerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse, error) { + rsp, err := c.PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithBody(ctx, organizerId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteApiTodosBatchResponse(rsp) + return ParsePutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse(rsp) } -func (c *ClientWithResponses) DeleteApiTodosBatchWithResponse(ctx context.Context, body DeleteApiTodosBatchJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteApiTodosBatchResponse, error) { - rsp, err := c.DeleteApiTodosBatch(ctx, body, reqEditors...) +func (c *ClientWithResponses) PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithResponse(ctx context.Context, organizerId string, body PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse, error) { + rsp, err := c.PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerId(ctx, organizerId, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteApiTodosBatchResponse(rsp) + return ParsePutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse(rsp) } -// PatchApiTodosBatchWithBodyWithResponse request with arbitrary body returning *PatchApiTodosBatchResponse -func (c *ClientWithResponses) PatchApiTodosBatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchApiTodosBatchResponse, error) { - rsp, err := c.PatchApiTodosBatchWithBody(ctx, contentType, body, reqEditors...) +// ParseAccountClientActivityListResponse parses an HTTP response from a AccountClientActivityListWithResponse call +func ParseAccountClientActivityListResponse(rsp *http.Response) (*AccountClientActivityListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParsePatchApiTodosBatchResponse(rsp) + + response := &AccountClientActivityListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AccountClientActivityResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) PatchApiTodosBatchWithResponse(ctx context.Context, body PatchApiTodosBatchJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchApiTodosBatchResponse, error) { - rsp, err := c.PatchApiTodosBatch(ctx, body, reqEditors...) +// ParseSetLocaleResponse parses an HTTP response from a SetLocaleWithResponse call +func ParseSetLocaleResponse(rsp *http.Response) (*SetLocaleResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParsePatchApiTodosBatchResponse(rsp) + + response := &SetLocaleResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SuccessResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil } -// DeleteTodoWithResponse request returning *DeleteTodoResponse -func (c *ClientWithResponses) DeleteTodoWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteTodoResponse, error) { - rsp, err := c.DeleteTodo(ctx, id, reqEditors...) +// ParseAccountProfileGetResponse parses an HTTP response from a AccountProfileGetWithResponse call +func ParseAccountProfileGetResponse(rsp *http.Response) (*AccountProfileGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseDeleteTodoResponse(rsp) + + response := &AccountProfileGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest MeResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil } -// UpdateTodoWithBodyWithResponse request with arbitrary body returning *UpdateTodoResponse -func (c *ClientWithResponses) UpdateTodoWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTodoResponse, error) { - rsp, err := c.UpdateTodoWithBody(ctx, id, contentType, body, reqEditors...) +// ParseListAdminCommentsResponse parses an HTTP response from a ListAdminCommentsWithResponse call +func ParseListAdminCommentsResponse(rsp *http.Response) (*ListAdminCommentsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateTodoResponse(rsp) + + response := &ListAdminCommentsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AdminCommentsResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) UpdateTodoWithResponse(ctx context.Context, id string, body UpdateTodoJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTodoResponse, error) { - rsp, err := c.UpdateTodo(ctx, id, body, reqEditors...) +// ParseModerateAdminCommentResponse parses an HTTP response from a ModerateAdminCommentWithResponse call +func ParseModerateAdminCommentResponse(rsp *http.Response) (*ModerateAdminCommentResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateTodoResponse(rsp) -} -// ListUploadsWithResponse request returning *ListUploadsResponse -func (c *ClientWithResponses) ListUploadsWithResponse(ctx context.Context, params *ListUploadsParams, reqEditors ...RequestEditorFn) (*ListUploadsResponse, error) { - rsp, err := c.ListUploads(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListUploadsResponse(rsp) -} + response := &ModerateAdminCommentResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AdminModeratedCommentResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest -// CreateUploadWithBodyWithResponse request with arbitrary body returning *CreateUploadResponse -func (c *ClientWithResponses) CreateUploadWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUploadResponse, error) { - rsp, err := c.CreateUploadWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err } - return ParseCreateUploadResponse(rsp) -} -func (c *ClientWithResponses) CreateUploadWithResponse(ctx context.Context, body CreateUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUploadResponse, error) { - rsp, err := c.CreateUpload(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateUploadResponse(rsp) + return response, nil } -// CompleteUploadWithBodyWithResponse request with arbitrary body returning *CompleteUploadResponse -func (c *ClientWithResponses) CompleteUploadWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CompleteUploadResponse, error) { - rsp, err := c.CompleteUploadWithBody(ctx, contentType, body, reqEditors...) +// ParseListAdminDescriptionsResponse parses an HTTP response from a ListAdminDescriptionsWithResponse call +func ParseListAdminDescriptionsResponse(rsp *http.Response) (*ListAdminDescriptionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCompleteUploadResponse(rsp) -} -func (c *ClientWithResponses) CompleteUploadWithResponse(ctx context.Context, body CompleteUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*CompleteUploadResponse, error) { - rsp, err := c.CompleteUpload(ctx, body, reqEditors...) - if err != nil { - return nil, err + response := &ListAdminDescriptionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCompleteUploadResponse(rsp) -} -// PutApiUploadsObjectWithBodyWithResponse request with arbitrary body returning *PutApiUploadsObjectResponse -func (c *ClientWithResponses) PutApiUploadsObjectWithBodyWithResponse(ctx context.Context, params *PutApiUploadsObjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutApiUploadsObjectResponse, error) { - rsp, err := c.PutApiUploadsObjectWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutApiUploadsObjectResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AdminDescriptionsResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -// DeleteUploadWithResponse request returning *DeleteUploadResponse -func (c *ClientWithResponses) DeleteUploadWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteUploadResponse, error) { - rsp, err := c.DeleteUpload(ctx, id, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteUploadResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// UpdateUploadWithBodyWithResponse request with arbitrary body returning *UpdateUploadResponse -func (c *ClientWithResponses) UpdateUploadWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUploadResponse, error) { - rsp, err := c.UpdateUploadWithBody(ctx, id, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateUploadResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -func (c *ClientWithResponses) UpdateUploadWithResponse(ctx context.Context, id string, body UpdateUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUploadResponse, error) { - rsp, err := c.UpdateUpload(ctx, id, body, reqEditors...) - if err != nil { - return nil, err } - return ParseUpdateUploadResponse(rsp) -} -// DownloadUploadWithResponse request returning *DownloadUploadResponse -func (c *ClientWithResponses) DownloadUploadWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DownloadUploadResponse, error) { - rsp, err := c.DownloadUpload(ctx, id, reqEditors...) - if err != nil { - return nil, err - } - return ParseDownloadUploadResponse(rsp) + return response, nil } -// ParseAccountClientActivityListResponse parses an HTTP response from a AccountClientActivityListWithResponse call -func ParseAccountClientActivityListResponse(rsp *http.Response) (*AccountClientActivityListResponse, error) { +// ParseUpdateAdminDescriptionResponse parses an HTTP response from a UpdateAdminDescriptionWithResponse call +func ParseUpdateAdminDescriptionResponse(rsp *http.Response) (*UpdateAdminDescriptionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AccountClientActivityListResponse{ + response := &UpdateAdminDescriptionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AccountClientActivityResponseSchema + var dest AdminModeratedDescriptionResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -22847,27 +24930,55 @@ func ParseAccountClientActivityListResponse(rsp *http.Response) (*AccountClientA } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseSetLocaleResponse parses an HTTP response from a SetLocaleWithResponse call -func ParseSetLocaleResponse(rsp *http.Response) (*SetLocaleResponse, error) { +// ParseListAdminHomeworksResponse parses an HTTP response from a ListAdminHomeworksWithResponse call +func ParseListAdminHomeworksResponse(rsp *http.Response) (*ListAdminHomeworksResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &SetLocaleResponse{ + response := &ListAdminHomeworksResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SuccessResponseSchema + var dest AdminHomeworksResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -22880,27 +24991,34 @@ func ParseSetLocaleResponse(rsp *http.Response) (*SetLocaleResponse, error) { } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + } return response, nil } -// ParseAccountProfileGetResponse parses an HTTP response from a AccountProfileGetWithResponse call -func ParseAccountProfileGetResponse(rsp *http.Response) (*AccountProfileGetResponse, error) { +// ParseDeleteAdminHomeworkResponse parses an HTTP response from a DeleteAdminHomeworkWithResponse call +func ParseDeleteAdminHomeworkResponse(rsp *http.Response) (*DeleteAdminHomeworkResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AccountProfileGetResponse{ + response := &DeleteAdminHomeworkResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest MeResponseSchema + var dest SuccessResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -22913,6 +25031,13 @@ func ParseAccountProfileGetResponse(rsp *http.Response) (*AccountProfileGetRespo } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -22920,32 +25045,79 @@ func ParseAccountProfileGetResponse(rsp *http.Response) (*AccountProfileGetRespo } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseListAdminCommentsResponse parses an HTTP response from a ListAdminCommentsWithResponse call -func ParseListAdminCommentsResponse(rsp *http.Response) (*ListAdminCommentsResponse, error) { +// ParseListAdminSuspensionsResponse parses an HTTP response from a ListAdminSuspensionsWithResponse call +func ParseListAdminSuspensionsResponse(rsp *http.Response) (*ListAdminSuspensionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAdminCommentsResponse{ + response := &ListAdminSuspensionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AdminCommentsResponseSchema + var dest AdminSuspensionsResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseCreateAdminSuspensionResponse parses an HTTP response from a CreateAdminSuspensionWithResponse call +func ParseCreateAdminSuspensionResponse(rsp *http.Response) (*CreateAdminSuspensionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateAdminSuspensionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest AdminSuspensionResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -22960,39 +25132,60 @@ func ParseListAdminCommentsResponse(rsp *http.Response) (*ListAdminCommentsRespo } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseModerateAdminCommentResponse parses an HTTP response from a ModerateAdminCommentWithResponse call -func ParseModerateAdminCommentResponse(rsp *http.Response) (*ModerateAdminCommentResponse, error) { +// ParseUpdateAdminSuspensionResponse parses an HTTP response from a UpdateAdminSuspensionWithResponse call +func ParseUpdateAdminSuspensionResponse(rsp *http.Response) (*UpdateAdminSuspensionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ModerateAdminCommentResponse{ + response := &UpdateAdminSuspensionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AdminModeratedCommentResponseSchema + var dest AdminSuspensionResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -23033,22 +25226,22 @@ func ParseModerateAdminCommentResponse(rsp *http.Response) (*ModerateAdminCommen return response, nil } -// ParseListAdminDescriptionsResponse parses an HTTP response from a ListAdminDescriptionsWithResponse call -func ParseListAdminDescriptionsResponse(rsp *http.Response) (*ListAdminDescriptionsResponse, error) { +// ParseListAdminUsersResponse parses an HTTP response from a ListAdminUsersWithResponse call +func ParseListAdminUsersResponse(rsp *http.Response) (*ListAdminUsersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAdminDescriptionsResponse{ + response := &ListAdminUsersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AdminDescriptionsResponseSchema + var dest AdminUsersResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23073,22 +25266,22 @@ func ParseListAdminDescriptionsResponse(rsp *http.Response) (*ListAdminDescripti return response, nil } -// ParseUpdateAdminDescriptionResponse parses an HTTP response from a UpdateAdminDescriptionWithResponse call -func ParseUpdateAdminDescriptionResponse(rsp *http.Response) (*UpdateAdminDescriptionResponse, error) { +// ParseUpdateAdminUserResponse parses an HTTP response from a UpdateAdminUserWithResponse call +func ParseUpdateAdminUserResponse(rsp *http.Response) (*UpdateAdminUserResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAdminDescriptionResponse{ + response := &UpdateAdminUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AdminModeratedDescriptionResponseSchema + var dest AdminUserResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23141,67 +25334,20 @@ func ParseUpdateAdminDescriptionResponse(rsp *http.Response) (*UpdateAdminDescri return response, nil } -// ParseListAdminHomeworksResponse parses an HTTP response from a ListAdminHomeworksWithResponse call -func ParseListAdminHomeworksResponse(rsp *http.Response) (*ListAdminHomeworksResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListAdminHomeworksResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AdminHomeworksResponseSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseDeleteAdminHomeworkResponse parses an HTTP response from a DeleteAdminHomeworkWithResponse call -func ParseDeleteAdminHomeworkResponse(rsp *http.Response) (*DeleteAdminHomeworkResponse, error) { +// ParseWorkspaceCalendarFeedExportResponse parses an HTTP response from a WorkspaceCalendarFeedExportWithResponse call +func ParseWorkspaceCalendarFeedExportResponse(rsp *http.Response) (*WorkspaceCalendarFeedExportResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteAdminHomeworkResponse{ + response := &WorkspaceCalendarFeedExportResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SuccessResponseSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -23223,78 +25369,71 @@ func ParseDeleteAdminHomeworkResponse(rsp *http.Response) (*DeleteAdminHomeworkR } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 410: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.JSON410 = &dest } return response, nil } -// ParseListAdminSuspensionsResponse parses an HTTP response from a ListAdminSuspensionsWithResponse call -func ParseListAdminSuspensionsResponse(rsp *http.Response) (*ListAdminSuspensionsResponse, error) { +// ParseCatalogBusTimetableGetResponse parses an HTTP response from a CatalogBusTimetableGetWithResponse call +func ParseCatalogBusTimetableGetResponse(rsp *http.Response) (*CatalogBusTimetableGetResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAdminSuspensionsResponse{ + response := &CatalogBusTimetableGetResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AdminSuspensionsResponseSchema + var dest BusQueryResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON400 = &dest } return response, nil } -// ParseCreateAdminSuspensionResponse parses an HTTP response from a CreateAdminSuspensionWithResponse call -func ParseCreateAdminSuspensionResponse(rsp *http.Response) (*CreateAdminSuspensionResponse, error) { +// ParseCatalogBusDepartureNextResponse parses an HTTP response from a CatalogBusDepartureNextWithResponse call +func ParseCatalogBusDepartureNextResponse(rsp *http.Response) (*CatalogBusDepartureNextResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateAdminSuspensionResponse{ + response := &CatalogBusDepartureNextResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest AdminSuspensionResponseSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BusNextDeparturesResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema @@ -23303,20 +25442,6 @@ func ParseCreateAdminSuspensionResponse(rsp *http.Response) (*CreateAdminSuspens } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -23324,59 +25449,38 @@ func ParseCreateAdminSuspensionResponse(rsp *http.Response) (*CreateAdminSuspens } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON503 = &dest - } return response, nil } -// ParseUpdateAdminSuspensionResponse parses an HTTP response from a UpdateAdminSuspensionWithResponse call -func ParseUpdateAdminSuspensionResponse(rsp *http.Response) (*UpdateAdminSuspensionResponse, error) { +// ParseCatalogBusRouteSearchResponse parses an HTTP response from a CatalogBusRouteSearchWithResponse call +func ParseCatalogBusRouteSearchResponse(rsp *http.Response) (*CatalogBusRouteSearchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAdminSuspensionResponse{ + response := &CatalogBusRouteSearchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AdminSuspensionResponseSchema + var dest BusRouteSearchResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema @@ -23385,41 +25489,60 @@ func ParseUpdateAdminSuspensionResponse(rsp *http.Response) (*UpdateAdminSuspens } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema + } + + return response, nil +} + +// ParseListCoursesResponse parses an HTTP response from a ListCoursesWithResponse call +func ParseListCoursesResponse(rsp *http.Response) (*ListCoursesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListCoursesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PaginatedCourseResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.JSON400 = &dest } return response, nil } -// ParseListAdminUsersResponse parses an HTTP response from a ListAdminUsersWithResponse call -func ParseListAdminUsersResponse(rsp *http.Response) (*ListAdminUsersResponse, error) { +// ParseGetCourseResponse parses an HTTP response from a GetCourseWithResponse call +func ParseGetCourseResponse(rsp *http.Response) (*GetCourseResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAdminUsersResponse{ + response := &GetCourseResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AdminUsersResponseSchema + var dest CourseDetailSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23432,34 +25555,34 @@ func ParseListAdminUsersResponse(rsp *http.Response) (*ListAdminUsersResponse, e } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON404 = &dest } return response, nil } -// ParseUpdateAdminUserResponse parses an HTTP response from a UpdateAdminUserWithResponse call -func ParseUpdateAdminUserResponse(rsp *http.Response) (*UpdateAdminUserResponse, error) { +// ParseCatalogLinkListResponse parses an HTTP response from a CatalogLinkListWithResponse call +func ParseCatalogLinkListResponse(rsp *http.Response) (*CatalogLinkListResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAdminUserResponse{ + response := &CatalogLinkListResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AdminUserResponseSchema + var dest CatalogLinkListResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23472,109 +25595,69 @@ func ParseUpdateAdminUserResponse(rsp *http.Response) (*UpdateAdminUserResponse, } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest + } - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest + return response, nil +} - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON503 = &dest +// ParseCatalogLinkResolveResponse parses an HTTP response from a CatalogLinkResolveWithResponse call +func ParseCatalogLinkResolveResponse(rsp *http.Response) (*CatalogLinkResolveResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + response := &CatalogLinkResolveResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } return response, nil } -// ParseWorkspaceCalendarFeedExportResponse parses an HTTP response from a WorkspaceCalendarFeedExportWithResponse call -func ParseWorkspaceCalendarFeedExportResponse(rsp *http.Response) (*WorkspaceCalendarFeedExportResponse, error) { +// ParseGetMetadataResponse parses an HTTP response from a GetMetadataWithResponse call +func ParseGetMetadataResponse(rsp *http.Response) (*GetMetadataResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &WorkspaceCalendarFeedExportResponse{ + response := &GetMetadataResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 410: - var dest OpenApiErrorSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest MetadataResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON410 = &dest + response.JSON200 = &dest } return response, nil } -// ParseCatalogBusTimetableGetResponse parses an HTTP response from a CatalogBusTimetableGetWithResponse call -func ParseCatalogBusTimetableGetResponse(rsp *http.Response) (*CatalogBusTimetableGetResponse, error) { +// ParseCatalogRoomsMapResponse parses an HTTP response from a CatalogRoomsMapWithResponse call +func ParseCatalogRoomsMapResponse(rsp *http.Response) (*CatalogRoomsMapResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CatalogBusTimetableGetResponse{ + response := &CatalogRoomsMapResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BusQueryResponseSchema + var dest RoomMapResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23592,22 +25675,22 @@ func ParseCatalogBusTimetableGetResponse(rsp *http.Response) (*CatalogBusTimetab return response, nil } -// ParseCatalogBusDepartureNextResponse parses an HTTP response from a CatalogBusDepartureNextWithResponse call -func ParseCatalogBusDepartureNextResponse(rsp *http.Response) (*CatalogBusDepartureNextResponse, error) { +// ParseListSchedulesResponse parses an HTTP response from a ListSchedulesWithResponse call +func ParseListSchedulesResponse(rsp *http.Response) (*ListSchedulesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CatalogBusDepartureNextResponse{ + response := &ListSchedulesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BusNextDeparturesResponseSchema + var dest PaginatedScheduleResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23620,34 +25703,27 @@ func ParseCatalogBusDepartureNextResponse(rsp *http.Response) (*CatalogBusDepart } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - } return response, nil } -// ParseCatalogBusRouteSearchResponse parses an HTTP response from a CatalogBusRouteSearchWithResponse call -func ParseCatalogBusRouteSearchResponse(rsp *http.Response) (*CatalogBusRouteSearchResponse, error) { +// ParseListSectionsResponse parses an HTTP response from a ListSectionsWithResponse call +func ParseListSectionsResponse(rsp *http.Response) (*ListSectionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CatalogBusRouteSearchResponse{ + response := &ListSectionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BusRouteSearchResponseSchema + var dest PaginatedSectionResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23660,39 +25736,25 @@ func ParseCatalogBusRouteSearchResponse(rsp *http.Response) (*CatalogBusRouteSea } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - } return response, nil } -// ParseListCoursesResponse parses an HTTP response from a ListCoursesWithResponse call -func ParseListCoursesResponse(rsp *http.Response) (*ListCoursesResponse, error) { +// ParseGetSectionsCalendarResponse parses an HTTP response from a GetSectionsCalendarWithResponse call +func ParseGetSectionsCalendarResponse(rsp *http.Response) (*GetSectionsCalendarResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListCoursesResponse{ + response := &GetSectionsCalendarResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PaginatedCourseResponseSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -23705,22 +25767,22 @@ func ParseListCoursesResponse(rsp *http.Response) (*ListCoursesResponse, error) return response, nil } -// ParseGetCourseResponse parses an HTTP response from a GetCourseWithResponse call -func ParseGetCourseResponse(rsp *http.Response) (*GetCourseResponse, error) { +// ParseMatchSectionCodesResponse parses an HTTP response from a MatchSectionCodesWithResponse call +func ParseMatchSectionCodesResponse(rsp *http.Response) (*MatchSectionCodesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetCourseResponse{ + response := &MatchSectionCodesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CourseDetailSchema + var dest MatchSectionCodesResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23745,22 +25807,22 @@ func ParseGetCourseResponse(rsp *http.Response) (*GetCourseResponse, error) { return response, nil } -// ParseCatalogLinkListResponse parses an HTTP response from a CatalogLinkListWithResponse call -func ParseCatalogLinkListResponse(rsp *http.Response) (*CatalogLinkListResponse, error) { +// ParseGetSectionResponse parses an HTTP response from a GetSectionWithResponse call +func ParseGetSectionResponse(rsp *http.Response) (*GetSectionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CatalogLinkListResponse{ + response := &GetSectionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CatalogLinkListResponseSchema + var dest SectionDetailSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23773,69 +25835,93 @@ func ParseCatalogLinkListResponse(rsp *http.Response) (*CatalogLinkListResponse, } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + } return response, nil } -// ParseCatalogLinkResolveResponse parses an HTTP response from a CatalogLinkResolveWithResponse call -func ParseCatalogLinkResolveResponse(rsp *http.Response) (*CatalogLinkResolveResponse, error) { +// ParseGetSectionCalendarResponse parses an HTTP response from a GetSectionCalendarWithResponse call +func ParseGetSectionCalendarResponse(rsp *http.Response) (*GetSectionCalendarResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CatalogLinkResolveResponse{ + response := &GetSectionCalendarResponse{ Body: bodyBytes, HTTPResponse: rsp, } + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + return response, nil } -// ParseGetMetadataResponse parses an HTTP response from a GetMetadataWithResponse call -func ParseGetMetadataResponse(rsp *http.Response) (*GetMetadataResponse, error) { +// ParseGetSectionScheduleGroupsResponse parses an HTTP response from a GetSectionScheduleGroupsWithResponse call +func ParseGetSectionScheduleGroupsResponse(rsp *http.Response) (*GetSectionScheduleGroupsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetMetadataResponse{ + response := &GetSectionScheduleGroupsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest MetadataResponseSchema + var dest []map[string]interface{} if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + } return response, nil } -// ParseCatalogRoomsMapResponse parses an HTTP response from a CatalogRoomsMapWithResponse call -func ParseCatalogRoomsMapResponse(rsp *http.Response) (*CatalogRoomsMapResponse, error) { +// ParseGetSectionSchedulesResponse parses an HTTP response from a GetSectionSchedulesWithResponse call +func ParseGetSectionSchedulesResponse(rsp *http.Response) (*GetSectionSchedulesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CatalogRoomsMapResponse{ + response := &GetSectionSchedulesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest RoomMapResponseSchema + var dest []map[string]interface{} if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23848,27 +25934,34 @@ func ParseCatalogRoomsMapResponse(rsp *http.Response) (*CatalogRoomsMapResponse, } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + } return response, nil } -// ParseListSchedulesResponse parses an HTTP response from a ListSchedulesWithResponse call -func ParseListSchedulesResponse(rsp *http.Response) (*ListSchedulesResponse, error) { +// ParseListSemestersResponse parses an HTTP response from a ListSemestersWithResponse call +func ParseListSemestersResponse(rsp *http.Response) (*ListSemestersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListSchedulesResponse{ + response := &ListSemestersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PaginatedScheduleResponseSchema + var dest PaginatedSemesterResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23886,53 +25979,60 @@ func ParseListSchedulesResponse(rsp *http.Response) (*ListSchedulesResponse, err return response, nil } -// ParseListSectionsResponse parses an HTTP response from a ListSectionsWithResponse call -func ParseListSectionsResponse(rsp *http.Response) (*ListSectionsResponse, error) { +// ParseGetCurrentSemesterResponse parses an HTTP response from a GetCurrentSemesterWithResponse call +func ParseGetCurrentSemesterResponse(rsp *http.Response) (*GetCurrentSemesterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListSectionsResponse{ + response := &GetCurrentSemesterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PaginatedSectionResponseSchema + var dest SemesterSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON404 = &dest } return response, nil } -// ParseGetSectionsCalendarResponse parses an HTTP response from a GetSectionsCalendarWithResponse call -func ParseGetSectionsCalendarResponse(rsp *http.Response) (*GetSectionsCalendarResponse, error) { +// ParseListTeachersResponse parses an HTTP response from a ListTeachersWithResponse call +func ParseListTeachersResponse(rsp *http.Response) (*ListTeachersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSectionsCalendarResponse{ + response := &ListTeachersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PaginatedTeacherResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -23945,22 +26045,22 @@ func ParseGetSectionsCalendarResponse(rsp *http.Response) (*GetSectionsCalendarR return response, nil } -// ParseMatchSectionCodesResponse parses an HTTP response from a MatchSectionCodesWithResponse call -func ParseMatchSectionCodesResponse(rsp *http.Response) (*MatchSectionCodesResponse, error) { +// ParseGetTeacherResponse parses an HTTP response from a GetTeacherWithResponse call +func ParseGetTeacherResponse(rsp *http.Response) (*GetTeacherResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &MatchSectionCodesResponse{ + response := &GetTeacherResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest MatchSectionCodesResponseSchema + var dest TeacherDetailSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -23985,22 +26085,22 @@ func ParseMatchSectionCodesResponse(rsp *http.Response) (*MatchSectionCodesRespo return response, nil } -// ParseGetSectionResponse parses an HTTP response from a GetSectionWithResponse call -func ParseGetSectionResponse(rsp *http.Response) (*GetSectionResponse, error) { +// ParseCatalogWeatherGetResponse parses an HTTP response from a CatalogWeatherGetWithResponse call +func ParseCatalogWeatherGetResponse(rsp *http.Response) (*CatalogWeatherGetResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSectionResponse{ + response := &CatalogWeatherGetResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SectionDetailSchema + var dest WeatherSnapshotResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24013,65 +26113,79 @@ func ParseGetSectionResponse(rsp *http.Response) (*GetSectionResponse, error) { } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON503 = &dest } return response, nil } -// ParseGetSectionCalendarResponse parses an HTTP response from a GetSectionCalendarWithResponse call -func ParseGetSectionCalendarResponse(rsp *http.Response) (*GetSectionCalendarResponse, error) { +// ParseGetApiCatalogYoungEventsResponse parses an HTTP response from a GetApiCatalogYoungEventsWithResponse call +func ParseGetApiCatalogYoungEventsResponse(rsp *http.Response) (*GetApiCatalogYoungEventsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSectionCalendarResponse{ + response := &GetApiCatalogYoungEventsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PaginatedYoungEventResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON400 = &dest } return response, nil } -// ParseGetSectionScheduleGroupsResponse parses an HTTP response from a GetSectionScheduleGroupsWithResponse call -func ParseGetSectionScheduleGroupsResponse(rsp *http.Response) (*GetSectionScheduleGroupsResponse, error) { +// ParseGetApiCatalogYoungEventsYoungIdResponse parses an HTTP response from a GetApiCatalogYoungEventsYoungIdWithResponse call +func ParseGetApiCatalogYoungEventsYoungIdResponse(rsp *http.Response) (*GetApiCatalogYoungEventsYoungIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSectionScheduleGroupsResponse{ + response := &GetApiCatalogYoungEventsYoungIdResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []map[string]interface{} + var dest YoungEventDetailSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -24084,62 +26198,69 @@ func ParseGetSectionScheduleGroupsResponse(rsp *http.Response) (*GetSectionSched return response, nil } -// ParseGetSectionSchedulesResponse parses an HTTP response from a GetSectionSchedulesWithResponse call -func ParseGetSectionSchedulesResponse(rsp *http.Response) (*GetSectionSchedulesResponse, error) { +// ParseGetApiCatalogYoungEventsYoungIdImageResponse parses an HTTP response from a GetApiCatalogYoungEventsYoungIdImageWithResponse call +func ParseGetApiCatalogYoungEventsYoungIdImageResponse(rsp *http.Response) (*GetApiCatalogYoungEventsYoungIdImageResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSectionSchedulesResponse{ + response := &GetApiCatalogYoungEventsYoungIdImageResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []map[string]interface{} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON502 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON503 = &dest } return response, nil } -// ParseListSemestersResponse parses an HTTP response from a ListSemestersWithResponse call -func ParseListSemestersResponse(rsp *http.Response) (*ListSemestersResponse, error) { +// ParseGetApiCatalogYoungOrganizersResponse parses an HTTP response from a GetApiCatalogYoungOrganizersWithResponse call +func ParseGetApiCatalogYoungOrganizersResponse(rsp *http.Response) (*GetApiCatalogYoungOrganizersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListSemestersResponse{ + response := &GetApiCatalogYoungOrganizersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PaginatedSemesterResponseSchema + var dest PaginatedYoungOrganizerResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24157,27 +26278,34 @@ func ParseListSemestersResponse(rsp *http.Response) (*ListSemestersResponse, err return response, nil } -// ParseGetCurrentSemesterResponse parses an HTTP response from a GetCurrentSemesterWithResponse call -func ParseGetCurrentSemesterResponse(rsp *http.Response) (*GetCurrentSemesterResponse, error) { +// ParseGetApiCatalogYoungOrganizersOrganizerIdResponse parses an HTTP response from a GetApiCatalogYoungOrganizersOrganizerIdWithResponse call +func ParseGetApiCatalogYoungOrganizersOrganizerIdResponse(rsp *http.Response) (*GetApiCatalogYoungOrganizersOrganizerIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetCurrentSemesterResponse{ + response := &GetApiCatalogYoungOrganizersOrganizerIdResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SemesterSchema + var dest YoungOrganizerSummarySchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -24190,22 +26318,22 @@ func ParseGetCurrentSemesterResponse(rsp *http.Response) (*GetCurrentSemesterRes return response, nil } -// ParseListTeachersResponse parses an HTTP response from a ListTeachersWithResponse call -func ParseListTeachersResponse(rsp *http.Response) (*ListTeachersResponse, error) { +// ParseListCommentsResponse parses an HTTP response from a ListCommentsWithResponse call +func ParseListCommentsResponse(rsp *http.Response) (*ListCommentsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListTeachersResponse{ + response := &ListCommentsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PaginatedTeacherResponseSchema + var dest CommentsListResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24218,31 +26346,38 @@ func ParseListTeachersResponse(rsp *http.Response) (*ListTeachersResponse, error } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + } return response, nil } -// ParseGetTeacherResponse parses an HTTP response from a GetTeacherWithResponse call -func ParseGetTeacherResponse(rsp *http.Response) (*GetTeacherResponse, error) { +// ParseCreateCommentResponse parses an HTTP response from a CreateCommentWithResponse call +func ParseCreateCommentResponse(rsp *http.Response) (*CreateCommentResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetTeacherResponse{ + response := &CreateCommentResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TeacherDetailSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest IdResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema @@ -24251,6 +26386,20 @@ func ParseGetTeacherResponse(rsp *http.Response) (*GetTeacherResponse, error) { } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -24258,27 +26407,41 @@ func ParseGetTeacherResponse(rsp *http.Response) (*GetTeacherResponse, error) { } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseCatalogWeatherGetResponse parses an HTTP response from a CatalogWeatherGetWithResponse call -func ParseCatalogWeatherGetResponse(rsp *http.Response) (*CatalogWeatherGetResponse, error) { +// ParseDeleteApiCommentsBatchResponse parses an HTTP response from a DeleteApiCommentsBatchWithResponse call +func ParseDeleteApiCommentsBatchResponse(rsp *http.Response) (*DeleteApiCommentsBatchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CatalogWeatherGetResponse{ + response := &DeleteApiCommentsBatchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WeatherSnapshotResponseSchema + var dest CommentBatchDeleteResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24291,71 +26454,73 @@ func ParseCatalogWeatherGetResponse(rsp *http.Response) (*CatalogWeatherGetRespo } response.JSON400 = &dest - } - - return response, nil -} - -// ParseGetApiCatalogYoungEventsResponse parses an HTTP response from a GetApiCatalogYoungEventsWithResponse call -func ParseGetApiCatalogYoungEventsResponse(rsp *http.Response) (*GetApiCatalogYoungEventsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest - response := &GetApiCatalogYoungEventsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PaginatedYoungEventResponseSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON429 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON503 = &dest } return response, nil } -// ParseGetApiCatalogYoungEventsYoungIdResponse parses an HTTP response from a GetApiCatalogYoungEventsYoungIdWithResponse call -func ParseGetApiCatalogYoungEventsYoungIdResponse(rsp *http.Response) (*GetApiCatalogYoungEventsYoungIdResponse, error) { +// ParseDeleteCommentResponse parses an HTTP response from a DeleteCommentWithResponse call +func ParseDeleteCommentResponse(rsp *http.Response) (*DeleteCommentResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetApiCatalogYoungEventsYoungIdResponse{ + response := &DeleteCommentResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest YoungEventDetailSchema + var dest SuccessResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema @@ -24364,74 +26529,81 @@ func ParseGetApiCatalogYoungEventsYoungIdResponse(rsp *http.Response) (*GetApiCa } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseGetApiCatalogYoungEventsYoungIdImageResponse parses an HTTP response from a GetApiCatalogYoungEventsYoungIdImageWithResponse call -func ParseGetApiCatalogYoungEventsYoungIdImageResponse(rsp *http.Response) (*GetApiCatalogYoungEventsYoungIdImageResponse, error) { +// ParseGetCommentResponse parses an HTTP response from a GetCommentWithResponse call +func ParseGetCommentResponse(rsp *http.Response) (*GetCommentResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetApiCatalogYoungEventsYoungIdImageResponse{ + response := &GetCommentResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest OpenApiErrorSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CommentThreadResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON502 = &dest + response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.JSON404 = &dest } return response, nil } -// ParseListCommentsResponse parses an HTTP response from a ListCommentsWithResponse call -func ParseListCommentsResponse(rsp *http.Response) (*ListCommentsResponse, error) { +// ParseUpdateCommentResponse parses an HTTP response from a UpdateCommentWithResponse call +func ParseUpdateCommentResponse(rsp *http.Response) (*UpdateCommentResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListCommentsResponse{ + response := &UpdateCommentResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CommentsListResponseSchema + var dest CommentUpdateResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24444,6 +26616,20 @@ func ParseListCommentsResponse(rsp *http.Response) (*ListCommentsResponse, error } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -24451,31 +26637,45 @@ func ParseListCommentsResponse(rsp *http.Response) (*ListCommentsResponse, error } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseCreateCommentResponse parses an HTTP response from a CreateCommentWithResponse call -func ParseCreateCommentResponse(rsp *http.Response) (*CreateCommentResponse, error) { +// ParseRemoveCommentReactionResponse parses an HTTP response from a RemoveCommentReactionWithResponse call +func ParseRemoveCommentReactionResponse(rsp *http.Response) (*RemoveCommentReactionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateCommentResponse{ + response := &RemoveCommentReactionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest IdResponseSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SuccessResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema @@ -24498,13 +26698,6 @@ func ParseCreateCommentResponse(rsp *http.Response) (*CreateCommentResponse, err } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -24524,22 +26717,22 @@ func ParseCreateCommentResponse(rsp *http.Response) (*CreateCommentResponse, err return response, nil } -// ParseDeleteApiCommentsBatchResponse parses an HTTP response from a DeleteApiCommentsBatchWithResponse call -func ParseDeleteApiCommentsBatchResponse(rsp *http.Response) (*DeleteApiCommentsBatchResponse, error) { +// ParseAddCommentReactionResponse parses an HTTP response from a AddCommentReactionWithResponse call +func ParseAddCommentReactionResponse(rsp *http.Response) (*AddCommentReactionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteApiCommentsBatchResponse{ + response := &AddCommentReactionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CommentBatchDeleteResponseSchema + var dest SuccessResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24564,7 +26757,14 @@ func ParseDeleteApiCommentsBatchResponse(rsp *http.Response) (*DeleteApiComments if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema @@ -24585,33 +26785,33 @@ func ParseDeleteApiCommentsBatchResponse(rsp *http.Response) (*DeleteApiComments return response, nil } -// ParseDeleteCommentResponse parses an HTTP response from a DeleteCommentWithResponse call -func ParseDeleteCommentResponse(rsp *http.Response) (*DeleteCommentResponse, error) { +// ParseGetApiCommunityCommentsIdRepliesResponse parses an HTTP response from a GetApiCommunityCommentsIdRepliesWithResponse call +func ParseGetApiCommunityCommentsIdRepliesResponse(rsp *http.Response) (*GetApiCommunityCommentsIdRepliesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteCommentResponse{ + response := &GetApiCommunityCommentsIdRepliesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SuccessResponseSchema + var dest CommentRepliesResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest OpenApiErrorSchema @@ -24627,52 +26827,38 @@ func ParseDeleteCommentResponse(rsp *http.Response) (*DeleteCommentResponse, err } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON503 = &dest - } return response, nil } -// ParseGetCommentResponse parses an HTTP response from a GetCommentWithResponse call -func ParseGetCommentResponse(rsp *http.Response) (*GetCommentResponse, error) { +// ParseGetDescriptionResponse parses an HTTP response from a GetDescriptionWithResponse call +func ParseGetDescriptionResponse(rsp *http.Response) (*GetDescriptionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetCommentResponse{ + response := &GetDescriptionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CommentThreadResponseSchema + var dest DescriptionsResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema @@ -24686,22 +26872,22 @@ func ParseGetCommentResponse(rsp *http.Response) (*GetCommentResponse, error) { return response, nil } -// ParseUpdateCommentResponse parses an HTTP response from a UpdateCommentWithResponse call -func ParseUpdateCommentResponse(rsp *http.Response) (*UpdateCommentResponse, error) { +// ParseUpsertDescriptionResponse parses an HTTP response from a UpsertDescriptionWithResponse call +func ParseUpsertDescriptionResponse(rsp *http.Response) (*UpsertDescriptionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateCommentResponse{ + response := &UpsertDescriptionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CommentUpdateResponseSchema + var dest DescriptionUpsertResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24754,22 +26940,22 @@ func ParseUpdateCommentResponse(rsp *http.Response) (*UpdateCommentResponse, err return response, nil } -// ParseRemoveCommentReactionResponse parses an HTTP response from a RemoveCommentReactionWithResponse call -func ParseRemoveCommentReactionResponse(rsp *http.Response) (*RemoveCommentReactionResponse, error) { +// ParseCommunitySectionHomeworkListResponse parses an HTTP response from a CommunitySectionHomeworkListWithResponse call +func ParseCommunitySectionHomeworkListResponse(rsp *http.Response) (*CommunitySectionHomeworkListResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &RemoveCommentReactionResponse{ + response := &CommunitySectionHomeworkListResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SuccessResponseSchema + var dest HomeworksListResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24782,59 +26968,38 @@ func ParseRemoveCommentReactionResponse(rsp *http.Response) (*RemoveCommentReact } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.JSON404 = &dest } return response, nil } -// ParseAddCommentReactionResponse parses an HTTP response from a AddCommentReactionWithResponse call -func ParseAddCommentReactionResponse(rsp *http.Response) (*AddCommentReactionResponse, error) { +// ParseCommunitySectionHomeworkCreateResponse parses an HTTP response from a CommunitySectionHomeworkCreateWithResponse call +func ParseCommunitySectionHomeworkCreateResponse(rsp *http.Response) (*CommunitySectionHomeworkCreateResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AddCommentReactionResponse{ + response := &CommunitySectionHomeworkCreateResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SuccessResponseSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest HomeworkCreateResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema @@ -24883,22 +27048,22 @@ func ParseAddCommentReactionResponse(rsp *http.Response) (*AddCommentReactionRes return response, nil } -// ParseGetApiCommunityCommentsIdRepliesResponse parses an HTTP response from a GetApiCommunityCommentsIdRepliesWithResponse call -func ParseGetApiCommunityCommentsIdRepliesResponse(rsp *http.Response) (*GetApiCommunityCommentsIdRepliesResponse, error) { +// ParseGetApiCommunitySectionHomeworksAuditResponse parses an HTTP response from a GetApiCommunitySectionHomeworksAuditWithResponse call +func ParseGetApiCommunitySectionHomeworksAuditResponse(rsp *http.Response) (*GetApiCommunitySectionHomeworksAuditResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetApiCommunityCommentsIdRepliesResponse{ + response := &GetApiCommunitySectionHomeworksAuditResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CommentRepliesResponseSchema + var dest HomeworkAuditListResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24911,6 +27076,46 @@ func ParseGetApiCommunityCommentsIdRepliesResponse(rsp *http.Response) (*GetApiC } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseCommunitySectionHomeworkDeleteResponse parses an HTTP response from a CommunitySectionHomeworkDeleteWithResponse call +func ParseCommunitySectionHomeworkDeleteResponse(rsp *http.Response) (*CommunitySectionHomeworkDeleteResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CommunitySectionHomeworkDeleteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SuccessResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -24925,27 +27130,41 @@ func ParseGetApiCommunityCommentsIdRepliesResponse(rsp *http.Response) (*GetApiC } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseGetDescriptionResponse parses an HTTP response from a GetDescriptionWithResponse call -func ParseGetDescriptionResponse(rsp *http.Response) (*GetDescriptionResponse, error) { +// ParseGetApiCommunitySectionHomeworksIdResponse parses an HTTP response from a GetApiCommunitySectionHomeworksIdWithResponse call +func ParseGetApiCommunitySectionHomeworksIdResponse(rsp *http.Response) (*GetApiCommunitySectionHomeworksIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetDescriptionResponse{ + response := &GetApiCommunitySectionHomeworksIdResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DescriptionsResponseSchema + var dest HomeworkDetailResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -24970,22 +27189,22 @@ func ParseGetDescriptionResponse(rsp *http.Response) (*GetDescriptionResponse, e return response, nil } -// ParseUpsertDescriptionResponse parses an HTTP response from a UpsertDescriptionWithResponse call -func ParseUpsertDescriptionResponse(rsp *http.Response) (*UpsertDescriptionResponse, error) { +// ParseCommunitySectionHomeworkUpdateResponse parses an HTTP response from a CommunitySectionHomeworkUpdateWithResponse call +func ParseCommunitySectionHomeworkUpdateResponse(rsp *http.Response) (*CommunitySectionHomeworkUpdateResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpsertDescriptionResponse{ + response := &CommunitySectionHomeworkUpdateResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DescriptionUpsertResponseSchema + var dest HomeworkUpdateResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25038,34 +27257,27 @@ func ParseUpsertDescriptionResponse(rsp *http.Response) (*UpsertDescriptionRespo return response, nil } -// ParseCommunitySectionHomeworkListResponse parses an HTTP response from a CommunitySectionHomeworkListWithResponse call -func ParseCommunitySectionHomeworkListResponse(rsp *http.Response) (*CommunitySectionHomeworkListResponse, error) { +// ParseCommunityUserGetResponse parses an HTTP response from a CommunityUserGetWithResponse call +func ParseCommunityUserGetResponse(rsp *http.Response) (*CommunityUserGetResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CommunitySectionHomeworkListResponse{ + response := &CommunityUserGetResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest HomeworksListResponseSchema + var dest PublicUserProfileResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -25078,33 +27290,52 @@ func ParseCommunitySectionHomeworkListResponse(rsp *http.Response) (*CommunitySe return response, nil } -// ParseCommunitySectionHomeworkCreateResponse parses an HTTP response from a CommunitySectionHomeworkCreateWithResponse call -func ParseCommunitySectionHomeworkCreateResponse(rsp *http.Response) (*CommunitySectionHomeworkCreateResponse, error) { +// ParseGetOpenApiSpecResponse parses an HTTP response from a GetOpenApiSpecWithResponse call +func ParseGetOpenApiSpecResponse(rsp *http.Response) (*GetOpenApiSpecResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CommunitySectionHomeworkCreateResponse{ + response := &GetOpenApiSpecResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest HomeworkCreateResponseSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OpenApiDocumentResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest OpenApiErrorSchema + } + + return response, nil +} + +// ParseWorkspaceBusPreferencesGetResponse parses an HTTP response from a WorkspaceBusPreferencesGetWithResponse call +func ParseWorkspaceBusPreferencesGetResponse(rsp *http.Response) (*WorkspaceBusPreferencesGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &WorkspaceBusPreferencesGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BusPreferenceResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema @@ -25113,19 +27344,45 @@ func ParseCommunitySectionHomeworkCreateResponse(rsp *http.Response) (*Community } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + } + + return response, nil +} + +// ParseWorkspaceBusPreferencesSetResponse parses an HTTP response from a WorkspaceBusPreferencesSetWithResponse call +func ParseWorkspaceBusPreferencesSetResponse(rsp *http.Response) (*WorkspaceBusPreferencesSetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &WorkspaceBusPreferencesSetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BusPreferenceResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON401 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema @@ -25146,22 +27403,22 @@ func ParseCommunitySectionHomeworkCreateResponse(rsp *http.Response) (*Community return response, nil } -// ParseGetApiCommunitySectionHomeworksAuditResponse parses an HTTP response from a GetApiCommunitySectionHomeworksAuditWithResponse call -func ParseGetApiCommunitySectionHomeworksAuditResponse(rsp *http.Response) (*GetApiCommunitySectionHomeworksAuditResponse, error) { +// ParseGetApiWorkspaceCalendarEventsResponse parses an HTTP response from a GetApiWorkspaceCalendarEventsWithResponse call +func ParseGetApiWorkspaceCalendarEventsResponse(rsp *http.Response) (*GetApiWorkspaceCalendarEventsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetApiCommunitySectionHomeworksAuditResponse{ + response := &GetApiWorkspaceCalendarEventsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest HomeworkAuditListResponseSchema + var dest PersonalCalendarPageSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25174,95 +27431,74 @@ func ParseGetApiCommunitySectionHomeworksAuditResponse(rsp *http.Response) (*Get } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON401 = &dest } return response, nil } -// ParseCommunitySectionHomeworkDeleteResponse parses an HTTP response from a CommunitySectionHomeworkDeleteWithResponse call -func ParseCommunitySectionHomeworkDeleteResponse(rsp *http.Response) (*CommunitySectionHomeworkDeleteResponse, error) { +// ParseGetSubscribedHomeworksResponse parses an HTTP response from a GetSubscribedHomeworksWithResponse call +func ParseGetSubscribedHomeworksResponse(rsp *http.Response) (*GetSubscribedHomeworksResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CommunitySectionHomeworkDeleteResponse{ + response := &GetSubscribedHomeworksResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SuccessResponseSchema + var dest SubscribedHomeworksResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.JSON401 = &dest } return response, nil } -// ParseGetApiCommunitySectionHomeworksIdResponse parses an HTTP response from a GetApiCommunitySectionHomeworksIdWithResponse call -func ParseGetApiCommunitySectionHomeworksIdResponse(rsp *http.Response) (*GetApiCommunitySectionHomeworksIdResponse, error) { +// ParsePutApiHomeworksCompletionsResponse parses an HTTP response from a PutApiHomeworksCompletionsWithResponse call +func ParsePutApiHomeworksCompletionsResponse(rsp *http.Response) (*PutApiHomeworksCompletionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetApiCommunitySectionHomeworksIdResponse{ + response := &PutApiHomeworksCompletionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest HomeworkDetailResponseSchema + var dest HomeworkCompletionBatchResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25275,34 +27511,48 @@ func ParseGetApiCommunitySectionHomeworksIdResponse(rsp *http.Response) (*GetApi } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest } return response, nil } -// ParseCommunitySectionHomeworkUpdateResponse parses an HTTP response from a CommunitySectionHomeworkUpdateWithResponse call -func ParseCommunitySectionHomeworkUpdateResponse(rsp *http.Response) (*CommunitySectionHomeworkUpdateResponse, error) { +// ParseSetHomeworkCompletionResponse parses an HTTP response from a SetHomeworkCompletionWithResponse call +func ParseSetHomeworkCompletionResponse(rsp *http.Response) (*SetHomeworkCompletionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CommunitySectionHomeworkUpdateResponse{ + response := &SetHomeworkCompletionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest HomeworkUpdateResponseSchema + var dest HomeworkCompletionResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25322,13 +27572,6 @@ func ParseCommunitySectionHomeworkUpdateResponse(rsp *http.Response) (*Community } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -25355,114 +27598,116 @@ func ParseCommunitySectionHomeworkUpdateResponse(rsp *http.Response) (*Community return response, nil } -// ParseCommunityUserGetResponse parses an HTTP response from a CommunityUserGetWithResponse call -func ParseCommunityUserGetResponse(rsp *http.Response) (*CommunityUserGetResponse, error) { +// ParseWorkspaceLinkPinListResponse parses an HTTP response from a WorkspaceLinkPinListWithResponse call +func ParseWorkspaceLinkPinListResponse(rsp *http.Response) (*WorkspaceLinkPinListResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CommunityUserGetResponse{ + response := &WorkspaceLinkPinListResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PublicUserProfileResponseSchema + var dest WorkspaceLinkPinResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON401 = &dest } return response, nil } -// ParseGetOpenApiSpecResponse parses an HTTP response from a GetOpenApiSpecWithResponse call -func ParseGetOpenApiSpecResponse(rsp *http.Response) (*GetOpenApiSpecResponse, error) { +// ParseWorkspaceLinkPinSetResponse parses an HTTP response from a WorkspaceLinkPinSetWithResponse call +func ParseWorkspaceLinkPinSetResponse(rsp *http.Response) (*WorkspaceLinkPinSetResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetOpenApiSpecResponse{ + response := &WorkspaceLinkPinSetResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest OpenApiDocumentResponseSchema + var dest WorkspaceLinkPinResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - } - - return response, nil -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// ParseWorkspaceBusPreferencesGetResponse parses an HTTP response from a WorkspaceBusPreferencesGetWithResponse call -func ParseWorkspaceBusPreferencesGetResponse(rsp *http.Response) (*WorkspaceBusPreferencesGetResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest - response := &WorkspaceBusPreferencesGetResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BusPreferenceResponseSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON500 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON503 = &dest } return response, nil } -// ParseWorkspaceBusPreferencesSetResponse parses an HTTP response from a WorkspaceBusPreferencesSetWithResponse call -func ParseWorkspaceBusPreferencesSetResponse(rsp *http.Response) (*WorkspaceBusPreferencesSetResponse, error) { +// ParseWorkspaceLinkPinBatchSetResponse parses an HTTP response from a WorkspaceLinkPinBatchSetWithResponse call +func ParseWorkspaceLinkPinBatchSetResponse(rsp *http.Response) (*WorkspaceLinkPinBatchSetResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &WorkspaceBusPreferencesSetResponse{ + response := &WorkspaceLinkPinBatchSetResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BusPreferenceResponseSchema + var dest WorkspaceLinkPinResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25489,6 +27734,13 @@ func ParseWorkspaceBusPreferencesSetResponse(rsp *http.Response) (*WorkspaceBusP } response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -25501,22 +27753,22 @@ func ParseWorkspaceBusPreferencesSetResponse(rsp *http.Response) (*WorkspaceBusP return response, nil } -// ParseGetSubscribedHomeworksResponse parses an HTTP response from a GetSubscribedHomeworksWithResponse call -func ParseGetSubscribedHomeworksResponse(rsp *http.Response) (*GetSubscribedHomeworksResponse, error) { +// ParseWorkspaceOverviewGetResponse parses an HTTP response from a WorkspaceOverviewGetWithResponse call +func ParseWorkspaceOverviewGetResponse(rsp *http.Response) (*WorkspaceOverviewGetResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSubscribedHomeworksResponse{ + response := &WorkspaceOverviewGetResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SubscribedHomeworksResponseSchema + var dest CompactOverviewResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25541,22 +27793,22 @@ func ParseGetSubscribedHomeworksResponse(rsp *http.Response) (*GetSubscribedHome return response, nil } -// ParsePutApiHomeworksCompletionsResponse parses an HTTP response from a PutApiHomeworksCompletionsWithResponse call -func ParsePutApiHomeworksCompletionsResponse(rsp *http.Response) (*PutApiHomeworksCompletionsResponse, error) { +// ParseWorkspaceScheduleListResponse parses an HTTP response from a WorkspaceScheduleListWithResponse call +func ParseWorkspaceScheduleListResponse(rsp *http.Response) (*WorkspaceScheduleListResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PutApiHomeworksCompletionsResponse{ + response := &WorkspaceScheduleListResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest HomeworkCompletionBatchResponseSchema + var dest SubscribedSchedulesResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25576,41 +27828,27 @@ func ParsePutApiHomeworksCompletionsResponse(rsp *http.Response) (*PutApiHomewor } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON503 = &dest - } return response, nil } -// ParseSetHomeworkCompletionResponse parses an HTTP response from a SetHomeworkCompletionWithResponse call -func ParseSetHomeworkCompletionResponse(rsp *http.Response) (*SetHomeworkCompletionResponse, error) { +// ParseDeleteApiWorkspaceSubscriptionsResponse parses an HTTP response from a DeleteApiWorkspaceSubscriptionsWithResponse call +func ParseDeleteApiWorkspaceSubscriptionsResponse(rsp *http.Response) (*DeleteApiWorkspaceSubscriptionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &SetHomeworkCompletionResponse{ + response := &DeleteApiWorkspaceSubscriptionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest HomeworkCompletionResponseSchema + var dest CalendarSubscriptionRemoveResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25656,55 +27894,22 @@ func ParseSetHomeworkCompletionResponse(rsp *http.Response) (*SetHomeworkComplet return response, nil } -// ParseWorkspaceLinkPinListResponse parses an HTTP response from a WorkspaceLinkPinListWithResponse call -func ParseWorkspaceLinkPinListResponse(rsp *http.Response) (*WorkspaceLinkPinListResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &WorkspaceLinkPinListResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WorkspaceLinkPinResponseSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - } - - return response, nil -} - -// ParseWorkspaceLinkPinSetResponse parses an HTTP response from a WorkspaceLinkPinSetWithResponse call -func ParseWorkspaceLinkPinSetResponse(rsp *http.Response) (*WorkspaceLinkPinSetResponse, error) { +// ParseAppendCalendarSubscriptionSectionsResponse parses an HTTP response from a AppendCalendarSubscriptionSectionsWithResponse call +func ParseAppendCalendarSubscriptionSectionsResponse(rsp *http.Response) (*AppendCalendarSubscriptionSectionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &WorkspaceLinkPinSetResponse{ + response := &AppendCalendarSubscriptionSectionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WorkspaceLinkPinResponseSchema + var dest CalendarSubscriptionAppendResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25724,19 +27929,19 @@ func ParseWorkspaceLinkPinSetResponse(rsp *http.Response) (*WorkspaceLinkPinSetR } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest + response.JSON429 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest OpenApiErrorSchema @@ -25749,23 +27954,23 @@ func ParseWorkspaceLinkPinSetResponse(rsp *http.Response) (*WorkspaceLinkPinSetR return response, nil } - -// ParseWorkspaceLinkPinBatchSetResponse parses an HTTP response from a WorkspaceLinkPinBatchSetWithResponse call -func ParseWorkspaceLinkPinBatchSetResponse(rsp *http.Response) (*WorkspaceLinkPinBatchSetResponse, error) { + +// ParseBatchUpdateCalendarSubscriptionResponse parses an HTTP response from a BatchUpdateCalendarSubscriptionWithResponse call +func ParseBatchUpdateCalendarSubscriptionResponse(rsp *http.Response) (*BatchUpdateCalendarSubscriptionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &WorkspaceLinkPinBatchSetResponse{ + response := &BatchUpdateCalendarSubscriptionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WorkspaceLinkPinResponseSchema + var dest CalendarSubscriptionBatchResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25785,19 +27990,19 @@ func ParseWorkspaceLinkPinBatchSetResponse(rsp *http.Response) (*WorkspaceLinkPi } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest + response.JSON429 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest OpenApiErrorSchema @@ -25811,34 +28016,27 @@ func ParseWorkspaceLinkPinBatchSetResponse(rsp *http.Response) (*WorkspaceLinkPi return response, nil } -// ParseWorkspaceOverviewGetResponse parses an HTTP response from a WorkspaceOverviewGetWithResponse call -func ParseWorkspaceOverviewGetResponse(rsp *http.Response) (*WorkspaceOverviewGetResponse, error) { +// ParseGetCurrentCalendarSubscriptionResponse parses an HTTP response from a GetCurrentCalendarSubscriptionWithResponse call +func ParseGetCurrentCalendarSubscriptionResponse(rsp *http.Response) (*GetCurrentCalendarSubscriptionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &WorkspaceOverviewGetResponse{ + response := &GetCurrentCalendarSubscriptionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CompactOverviewResponseSchema + var dest CurrentCalendarSubscriptionResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -25851,22 +28049,22 @@ func ParseWorkspaceOverviewGetResponse(rsp *http.Response) (*WorkspaceOverviewGe return response, nil } -// ParseWorkspaceScheduleListResponse parses an HTTP response from a WorkspaceScheduleListWithResponse call -func ParseWorkspaceScheduleListResponse(rsp *http.Response) (*WorkspaceScheduleListResponse, error) { +// ParsePostApiWorkspaceSubscriptionsImportCodesResponse parses an HTTP response from a PostApiWorkspaceSubscriptionsImportCodesWithResponse call +func ParsePostApiWorkspaceSubscriptionsImportCodesResponse(rsp *http.Response) (*PostApiWorkspaceSubscriptionsImportCodesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &WorkspaceScheduleListResponse{ + response := &PostApiWorkspaceSubscriptionsImportCodesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SubscribedSchedulesResponseSchema + var dest CalendarSubscriptionImportResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25886,27 +28084,48 @@ func ParseWorkspaceScheduleListResponse(rsp *http.Response) (*WorkspaceScheduleL } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseDeleteApiWorkspaceSubscriptionsResponse parses an HTTP response from a DeleteApiWorkspaceSubscriptionsWithResponse call -func ParseDeleteApiWorkspaceSubscriptionsResponse(rsp *http.Response) (*DeleteApiWorkspaceSubscriptionsResponse, error) { +// ParseQueryCalendarSubscriptionSectionsResponse parses an HTTP response from a QueryCalendarSubscriptionSectionsWithResponse call +func ParseQueryCalendarSubscriptionSectionsResponse(rsp *http.Response) (*QueryCalendarSubscriptionSectionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteApiWorkspaceSubscriptionsResponse{ + response := &QueryCalendarSubscriptionSectionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CalendarSubscriptionRemoveResponseSchema + var dest CalendarSubscriptionQueryResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -25933,41 +28152,27 @@ func ParseDeleteApiWorkspaceSubscriptionsResponse(rsp *http.Response) (*DeleteAp } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON503 = &dest - } return response, nil } -// ParseAppendCalendarSubscriptionSectionsResponse parses an HTTP response from a AppendCalendarSubscriptionSectionsWithResponse call -func ParseAppendCalendarSubscriptionSectionsResponse(rsp *http.Response) (*AppendCalendarSubscriptionSectionsResponse, error) { +// ParsePatchApiWorkspaceSubscriptionsJwIdResponse parses an HTTP response from a PatchApiWorkspaceSubscriptionsJwIdWithResponse call +func ParsePatchApiWorkspaceSubscriptionsJwIdResponse(rsp *http.Response) (*PatchApiWorkspaceSubscriptionsJwIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AppendCalendarSubscriptionSectionsResponse{ + response := &PatchApiWorkspaceSubscriptionsJwIdResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CalendarSubscriptionAppendResponseSchema + var dest SubscriptionKindUpdateResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26013,22 +28218,22 @@ func ParseAppendCalendarSubscriptionSectionsResponse(rsp *http.Response) (*Appen return response, nil } -// ParseBatchUpdateCalendarSubscriptionResponse parses an HTTP response from a BatchUpdateCalendarSubscriptionWithResponse call -func ParseBatchUpdateCalendarSubscriptionResponse(rsp *http.Response) (*BatchUpdateCalendarSubscriptionResponse, error) { +// ParseListTodosResponse parses an HTTP response from a ListTodosWithResponse call +func ParseListTodosResponse(rsp *http.Response) (*ListTodosResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &BatchUpdateCalendarSubscriptionResponse{ + response := &ListTodosResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CalendarSubscriptionBatchResponseSchema + var dest TodosListResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26048,12 +28253,45 @@ func ParseBatchUpdateCalendarSubscriptionResponse(rsp *http.Response) (*BatchUpd } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + } + + return response, nil +} + +// ParseCreateTodoResponse parses an HTTP response from a CreateTodoWithResponse call +func ParseCreateTodoResponse(rsp *http.Response) (*CreateTodoResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateTodoResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest IdResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema @@ -26074,27 +28312,34 @@ func ParseBatchUpdateCalendarSubscriptionResponse(rsp *http.Response) (*BatchUpd return response, nil } -// ParseGetCurrentCalendarSubscriptionResponse parses an HTTP response from a GetCurrentCalendarSubscriptionWithResponse call -func ParseGetCurrentCalendarSubscriptionResponse(rsp *http.Response) (*GetCurrentCalendarSubscriptionResponse, error) { +// ParseDeleteApiTodosBatchResponse parses an HTTP response from a DeleteApiTodosBatchWithResponse call +func ParseDeleteApiTodosBatchResponse(rsp *http.Response) (*DeleteApiTodosBatchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetCurrentCalendarSubscriptionResponse{ + response := &DeleteApiTodosBatchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CurrentCalendarSubscriptionResponseSchema + var dest TodoBatchDeleteResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -26102,27 +28347,41 @@ func ParseGetCurrentCalendarSubscriptionResponse(rsp *http.Response) (*GetCurren } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParsePostApiWorkspaceSubscriptionsImportCodesResponse parses an HTTP response from a PostApiWorkspaceSubscriptionsImportCodesWithResponse call -func ParsePostApiWorkspaceSubscriptionsImportCodesResponse(rsp *http.Response) (*PostApiWorkspaceSubscriptionsImportCodesResponse, error) { +// ParsePatchApiTodosBatchResponse parses an HTTP response from a PatchApiTodosBatchWithResponse call +func ParsePatchApiTodosBatchResponse(rsp *http.Response) (*PatchApiTodosBatchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostApiWorkspaceSubscriptionsImportCodesResponse{ + response := &PatchApiTodosBatchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CalendarSubscriptionImportResponseSchema + var dest TodoCompletionBatchResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26142,13 +28401,6 @@ func ParsePostApiWorkspaceSubscriptionsImportCodesResponse(rsp *http.Response) ( } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -26168,40 +28420,40 @@ func ParsePostApiWorkspaceSubscriptionsImportCodesResponse(rsp *http.Response) ( return response, nil } -// ParseQueryCalendarSubscriptionSectionsResponse parses an HTTP response from a QueryCalendarSubscriptionSectionsWithResponse call -func ParseQueryCalendarSubscriptionSectionsResponse(rsp *http.Response) (*QueryCalendarSubscriptionSectionsResponse, error) { +// ParseDeleteTodoResponse parses an HTTP response from a DeleteTodoWithResponse call +func ParseDeleteTodoResponse(rsp *http.Response) (*DeleteTodoResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &QueryCalendarSubscriptionSectionsResponse{ + response := &DeleteTodoResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CalendarSubscriptionQueryResponseSchema + var dest SuccessResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON403 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema @@ -26210,27 +28462,41 @@ func ParseQueryCalendarSubscriptionSectionsResponse(rsp *http.Response) (*QueryC } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParsePatchApiWorkspaceSubscriptionsJwIdResponse parses an HTTP response from a PatchApiWorkspaceSubscriptionsJwIdWithResponse call -func ParsePatchApiWorkspaceSubscriptionsJwIdResponse(rsp *http.Response) (*PatchApiWorkspaceSubscriptionsJwIdResponse, error) { +// ParseUpdateTodoResponse parses an HTTP response from a UpdateTodoWithResponse call +func ParseUpdateTodoResponse(rsp *http.Response) (*UpdateTodoResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PatchApiWorkspaceSubscriptionsJwIdResponse{ + response := &UpdateTodoResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SubscriptionKindUpdateResponseSchema + var dest TodoUpdateResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26250,6 +28516,13 @@ func ParsePatchApiWorkspaceSubscriptionsJwIdResponse(rsp *http.Response) (*Patch } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -26276,22 +28549,22 @@ func ParsePatchApiWorkspaceSubscriptionsJwIdResponse(rsp *http.Response) (*Patch return response, nil } -// ParseListTodosResponse parses an HTTP response from a ListTodosWithResponse call -func ParseListTodosResponse(rsp *http.Response) (*ListTodosResponse, error) { +// ParseListUploadsResponse parses an HTTP response from a ListUploadsWithResponse call +func ParseListUploadsResponse(rsp *http.Response) (*ListUploadsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListTodosResponse{ + response := &ListUploadsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TodosListResponseSchema + var dest UploadsListResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26316,40 +28589,54 @@ func ParseListTodosResponse(rsp *http.Response) (*ListTodosResponse, error) { return response, nil } -// ParseCreateTodoResponse parses an HTTP response from a CreateTodoWithResponse call -func ParseCreateTodoResponse(rsp *http.Response) (*CreateTodoResponse, error) { +// ParseCreateUploadResponse parses an HTTP response from a CreateUploadWithResponse call +func ParseCreateUploadResponse(rsp *http.Response) (*CreateUploadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateTodoResponse{ + response := &CreateUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest IdResponseSchema + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UploadCreateResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 413: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON413 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema @@ -26370,22 +28657,22 @@ func ParseCreateTodoResponse(rsp *http.Response) (*CreateTodoResponse, error) { return response, nil } -// ParseDeleteApiTodosBatchResponse parses an HTTP response from a DeleteApiTodosBatchWithResponse call -func ParseDeleteApiTodosBatchResponse(rsp *http.Response) (*DeleteApiTodosBatchResponse, error) { +// ParseCompleteUploadResponse parses an HTTP response from a CompleteUploadWithResponse call +func ParseCompleteUploadResponse(rsp *http.Response) (*CompleteUploadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteApiTodosBatchResponse{ + response := &CompleteUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TodoBatchDeleteResponseSchema + var dest UploadCompleteResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26405,6 +28692,13 @@ func ParseDeleteApiTodosBatchResponse(rsp *http.Response) (*DeleteApiTodosBatchR } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -26424,22 +28718,22 @@ func ParseDeleteApiTodosBatchResponse(rsp *http.Response) (*DeleteApiTodosBatchR return response, nil } -// ParsePatchApiTodosBatchResponse parses an HTTP response from a PatchApiTodosBatchWithResponse call -func ParsePatchApiTodosBatchResponse(rsp *http.Response) (*PatchApiTodosBatchResponse, error) { +// ParsePutApiUploadsObjectResponse parses an HTTP response from a PutApiUploadsObjectWithResponse call +func ParsePutApiUploadsObjectResponse(rsp *http.Response) (*PutApiUploadsObjectResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PatchApiTodosBatchResponse{ + response := &PutApiUploadsObjectResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TodoCompletionBatchResponseSchema + var dest SuccessResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26459,6 +28753,20 @@ func ParsePatchApiTodosBatchResponse(rsp *http.Response) (*PatchApiTodosBatchRes } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 413: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON413 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -26478,22 +28786,22 @@ func ParsePatchApiTodosBatchResponse(rsp *http.Response) (*PatchApiTodosBatchRes return response, nil } -// ParseDeleteTodoResponse parses an HTTP response from a DeleteTodoWithResponse call -func ParseDeleteTodoResponse(rsp *http.Response) (*DeleteTodoResponse, error) { +// ParseDeleteUploadResponse parses an HTTP response from a DeleteUploadWithResponse call +func ParseDeleteUploadResponse(rsp *http.Response) (*DeleteUploadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteTodoResponse{ + response := &DeleteUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SuccessResponseSchema + var dest UploadDeleteResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26527,6 +28835,13 @@ func ParseDeleteTodoResponse(rsp *http.Response) (*DeleteTodoResponse, error) { } response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -26539,22 +28854,22 @@ func ParseDeleteTodoResponse(rsp *http.Response) (*DeleteTodoResponse, error) { return response, nil } -// ParseUpdateTodoResponse parses an HTTP response from a UpdateTodoWithResponse call -func ParseUpdateTodoResponse(rsp *http.Response) (*UpdateTodoResponse, error) { +// ParseUpdateUploadResponse parses an HTTP response from a UpdateUploadWithResponse call +func ParseUpdateUploadResponse(rsp *http.Response) (*UpdateUploadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateTodoResponse{ + response := &UpdateUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TodoUpdateResponseSchema + var dest UploadRenameResponseSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26607,62 +28922,55 @@ func ParseUpdateTodoResponse(rsp *http.Response) (*UpdateTodoResponse, error) { return response, nil } -// ParseListUploadsResponse parses an HTTP response from a ListUploadsWithResponse call -func ParseListUploadsResponse(rsp *http.Response) (*ListUploadsResponse, error) { +// ParseDownloadUploadResponse parses an HTTP response from a DownloadUploadWithResponse call +func ParseDownloadUploadResponse(rsp *http.Response) (*DownloadUploadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListUploadsResponse{ + response := &DownloadUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UploadsListResponseSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON404 = &dest } return response, nil } -// ParseCreateUploadResponse parses an HTTP response from a CreateUploadWithResponse call -func ParseCreateUploadResponse(rsp *http.Response) (*CreateUploadResponse, error) { +// ParseGetApiWorkspaceYoungEventSubscriptionsResponse parses an HTTP response from a GetApiWorkspaceYoungEventSubscriptionsWithResponse call +func ParseGetApiWorkspaceYoungEventSubscriptionsResponse(rsp *http.Response) (*GetApiWorkspaceYoungEventSubscriptionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateUploadResponse{ + response := &GetApiWorkspaceYoungEventSubscriptionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UploadCreateResponseSchema + var dest YoungEventSubscriptionListSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26682,55 +28990,60 @@ func ParseCreateUploadResponse(rsp *http.Response) (*CreateUploadResponse, error } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest + } - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 413: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON413 = &dest + return response, nil +} - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema +// ParseGetApiWorkspaceYoungEventSubscriptionsYoungIdResponse parses an HTTP response from a GetApiWorkspaceYoungEventSubscriptionsYoungIdWithResponse call +func ParseGetApiWorkspaceYoungEventSubscriptionsYoungIdResponse(rsp *http.Response) (*GetApiWorkspaceYoungEventSubscriptionsYoungIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetApiWorkspaceYoungEventSubscriptionsYoungIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest YoungEventSubscriptionStateSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.JSON401 = &dest } return response, nil } -// ParseCompleteUploadResponse parses an HTTP response from a CompleteUploadWithResponse call -func ParseCompleteUploadResponse(rsp *http.Response) (*CompleteUploadResponse, error) { +// ParsePutApiWorkspaceYoungEventSubscriptionsYoungIdResponse parses an HTTP response from a PutApiWorkspaceYoungEventSubscriptionsYoungIdWithResponse call +func ParsePutApiWorkspaceYoungEventSubscriptionsYoungIdResponse(rsp *http.Response) (*PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CompleteUploadResponse{ + response := &PutApiWorkspaceYoungEventSubscriptionsYoungIdResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UploadCompleteResponseSchema + var dest YoungEventSubscriptionStateSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26750,12 +29063,12 @@ func ParseCompleteUploadResponse(rsp *http.Response) (*CompleteUploadResponse, e } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: var dest OpenApiErrorSchema @@ -26776,22 +29089,22 @@ func ParseCompleteUploadResponse(rsp *http.Response) (*CompleteUploadResponse, e return response, nil } -// ParsePutApiUploadsObjectResponse parses an HTTP response from a PutApiUploadsObjectWithResponse call -func ParsePutApiUploadsObjectResponse(rsp *http.Response) (*PutApiUploadsObjectResponse, error) { +// ParseGetApiWorkspaceYoungNotificationsResponse parses an HTTP response from a GetApiWorkspaceYoungNotificationsWithResponse call +func ParseGetApiWorkspaceYoungNotificationsResponse(rsp *http.Response) (*GetApiWorkspaceYoungNotificationsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PutApiUploadsObjectResponse{ + response := &GetApiWorkspaceYoungNotificationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SuccessResponseSchema + var dest YoungNotificationListSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26811,55 +29124,27 @@ func ParsePutApiUploadsObjectResponse(rsp *http.Response) (*PutApiUploadsObjectR } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 413: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON413 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON503 = &dest - } return response, nil } -// ParseDeleteUploadResponse parses an HTTP response from a DeleteUploadWithResponse call -func ParseDeleteUploadResponse(rsp *http.Response) (*DeleteUploadResponse, error) { +// ParsePostApiWorkspaceYoungNotificationsIdReadResponse parses an HTTP response from a PostApiWorkspaceYoungNotificationsIdReadWithResponse call +func ParsePostApiWorkspaceYoungNotificationsIdReadResponse(rsp *http.Response) (*PostApiWorkspaceYoungNotificationsIdReadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteUploadResponse{ + response := &PostApiWorkspaceYoungNotificationsIdReadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UploadDeleteResponseSchema + var dest YoungNotificationReadSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26872,13 +29157,6 @@ func ParseDeleteUploadResponse(rsp *http.Response) (*DeleteUploadResponse, error } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -26893,13 +29171,6 @@ func ParseDeleteUploadResponse(rsp *http.Response) (*DeleteUploadResponse, error } response.JSON429 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON502 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -26912,22 +29183,22 @@ func ParseDeleteUploadResponse(rsp *http.Response) (*DeleteUploadResponse, error return response, nil } -// ParseUpdateUploadResponse parses an HTTP response from a UpdateUploadWithResponse call -func ParseUpdateUploadResponse(rsp *http.Response) (*UpdateUploadResponse, error) { +// ParseGetApiWorkspaceYoungOrganizerSubscriptionsResponse parses an HTTP response from a GetApiWorkspaceYoungOrganizerSubscriptionsWithResponse call +func ParseGetApiWorkspaceYoungOrganizerSubscriptionsResponse(rsp *http.Response) (*GetApiWorkspaceYoungOrganizerSubscriptionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateUploadResponse{ + response := &GetApiWorkspaceYoungOrganizerSubscriptionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UploadRenameResponseSchema + var dest YoungOrganizerSubscriptionListSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -26947,53 +29218,72 @@ func ParseUpdateUploadResponse(rsp *http.Response) (*UpdateUploadResponse, error } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest + } - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest OpenApiErrorSchema - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest + return response, nil +} - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest OpenApiErrorSchema +// ParseGetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse parses an HTTP response from a GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithResponse call +func ParseGetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse(rsp *http.Response) (*GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest YoungOrganizerSubscriptionStateSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.JSON401 = &dest } return response, nil } -// ParseDownloadUploadResponse parses an HTTP response from a DownloadUploadWithResponse call -func ParseDownloadUploadResponse(rsp *http.Response) (*DownloadUploadResponse, error) { +// ParsePutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse parses an HTTP response from a PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdWithResponse call +func ParsePutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse(rsp *http.Response) (*PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DownloadUploadResponse{ + response := &PutApiWorkspaceYoungOrganizerSubscriptionsOrganizerIdResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest YoungOrganizerSubscriptionStateSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OpenApiErrorSchema if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -27008,6 +29298,20 @@ func ParseDownloadUploadResponse(rsp *http.Response) (*DownloadUploadResponse, e } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil From b479e3fc7a40e8135922435bd47e443005ea6073 Mon Sep 17 00:00:00 2001 From: Tiankai Ma Date: Tue, 15 Sep 2026 17:11:46 +0800 Subject: [PATCH 4/4] fix: preserve comment threads and calendar metadata in CLI output --- internal/cmd/comment/comment.go | 113 ++++++++++++++++++------ internal/cmd/comment/comment_test.go | 21 +++++ internal/cmd/young_event/young_event.go | 9 ++ 3 files changed, 117 insertions(+), 26 deletions(-) diff --git a/internal/cmd/comment/comment.go b/internal/cmd/comment/comment.go index ec81c95..b77d2fc 100644 --- a/internal/cmd/comment/comment.go +++ b/internal/cmd/comment/comment.go @@ -31,7 +31,7 @@ type commentTarget struct { func validVisibility(visibility string) bool { switch visibility { - case "public", "logged_in_only", "anonymous": + case "public", "logged_in_only": return true default: return false @@ -92,6 +92,8 @@ func normalizeTarget(target commentTarget) commentTarget { func listCommentColumns() []output.Column { return []output.Column{ {Header: "ID", Key: "id"}, + {Header: "Parent ID", Key: "parentId"}, + {Header: "More replies cursor", Key: "repliesNextCursor"}, {Header: "Body", Key: "body"}, {Header: "Visibility", Key: "visibility"}, {Header: "Created", Key: "createdAt"}, @@ -124,7 +126,7 @@ func runCommentList(cmd *cobra.Command, target commentTarget) error { return err } list := cmdutil.NewListResult(data, "data") - return output.OutputList(list.Raw, list.Rows, listCommentColumns(), list.Total, list.Page) + return output.OutputList(list.Raw, flattenComments(list.Rows), listCommentColumns(), list.Total, list.Page) } func commentListParams(cmd *cobra.Command, target commentTarget) (url.Values, error) { @@ -168,7 +170,7 @@ func commandIntFlag(cmd *cobra.Command, name string) int { func runCommentCreate(cmd *cobra.Command, target commentTarget, body, visibility, parentID string, anonymous bool) error { target = normalizeTarget(target) if !validVisibility(visibility) { - return fmt.Errorf("invalid --visibility %q (use public, logged_in_only, or anonymous)", visibility) + return fmt.Errorf("invalid --visibility %q (use public or logged_in_only)", visibility) } if err := validateTarget(target, true); err != nil { return err @@ -255,6 +257,7 @@ func NewCmdComment() *cobra.Command { } cmd.AddCommand(newCmdList()) cmd.AddCommand(newCmdView()) + cmd.AddCommand(newCmdReplies()) cmd.AddCommand(newCmdCreate()) cmd.AddCommand(newCmdUpdate()) cmd.AddCommand(newCmdDelete()) @@ -272,6 +275,7 @@ func NewCmdCommentFor(targetType string) *cobra.Command { } cmd.AddCommand(newCmdListFor(targetType)) cmd.AddCommand(newCmdView()) + cmd.AddCommand(newCmdReplies()) cmd.AddCommand(newCmdCreateFor(targetType)) cmd.AddCommand(newCmdUpdate()) cmd.AddCommand(newCmdDelete()) @@ -324,7 +328,7 @@ func newCmdCreateFor(targetType string) *cobra.Command { }, } cmd.Flags().StringVarP(&body, "body", "b", "", "Comment body") - cmd.Flags().StringVar(&visibility, "visibility", "public", "Visibility (public, logged_in_only, anonymous)") + cmd.Flags().StringVar(&visibility, "visibility", "public", "Visibility (public, logged_in_only)") cmd.Flags().BoolVar(&anonymous, "anonymous", false, "Post anonymously") cmd.Flags().StringVar(&parentID, "parent-id", "", "Reply to comment ID") return cmd @@ -387,24 +391,11 @@ func newCmdView() *cobra.Command { } m := cmdutil.AsMap(data) output.KVWithTitle([]output.KVPair{ - {Key: "ID", Value: output.Resolve(m, "id")}, - {Key: "Body", Value: output.Resolve(m, "body")}, - {Key: "Visibility", Value: output.Resolve(m, "visibility")}, - {Key: "Anonymous", Value: output.Resolve(m, "isAnonymous")}, - {Key: "Created", Value: output.Resolve(m, "createdAt")}, - {Key: "Updated", Value: output.Resolve(m, "updatedAt")}, - }, "Comment") - - if replies, ok := m["replies"].([]any); ok && len(replies) > 0 { - fmt.Println() - output.Bold(" Replies") - rows := cmdutil.RowsFromAny(replies) - output.Table(rows, []output.Column{ - {Header: "ID", Key: "id"}, - {Header: "Body", Key: "body"}, - {Header: "Created", Key: "createdAt"}, - }) - } + {Key: "Focus ID", Value: output.Resolve(m, "focusId")}, + {Key: "Hidden comments", Value: output.Resolve(m, "hiddenCount")}, + }, "Comment thread") + thread, _ := m["thread"].([]any) + output.Table(flattenComments(cmdutil.RowsFromAny(thread)), listCommentColumns()) return nil }, } @@ -467,7 +458,7 @@ func newCmdCreate() *cobra.Command { cmd.Flags().StringVar(§ionID, "section-id", "", "Section ID") cmd.Flags().StringVar(&teacherID, "teacher-id", "", "Teacher ID") cmd.Flags().StringVarP(&body, "body", "b", "", "Comment body") - cmd.Flags().StringVar(&visibility, "visibility", "public", "Visibility (public, logged_in_only, anonymous)") + cmd.Flags().StringVar(&visibility, "visibility", "public", "Visibility (public, logged_in_only)") cmd.Flags().BoolVar(&anonymous, "anonymous", false, "Post anonymously") cmd.Flags().StringVar(&parentID, "parent-id", "", "Reply to comment ID") return cmd @@ -482,11 +473,15 @@ func newCmdUpdate() *cobra.Command { Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { if visibility != "" && !validVisibility(visibility) { - return fmt.Errorf("invalid --visibility %q (use public, logged_in_only, or anonymous)", visibility) + return fmt.Errorf("invalid --visibility %q (use public or logged_in_only)", visibility) } id := "" if len(args) == 1 { - id = strings.TrimSpace(args[0]) + var err error + id, err = youngutil.RequireID(args[0], "") + if err != nil { + return err + } } if id == "" { if !cmdutil.IsInteractive() { @@ -504,6 +499,9 @@ func newCmdUpdate() *cobra.Command { body = cmdutil.PromptText("New body") } } + if strings.TrimSpace(body) == "" { + return fmt.Errorf("--body is required to update a comment") + } c, err := api.NewTypedClient(cmdutil.ServerFromCmd(cmd), true) if err != nil { return err @@ -541,7 +539,7 @@ func newCmdDelete() *cobra.Command { Aliases: []string{"rm"}, Short: "Delete comment(s)", Long: "Delete one or more comments. When run interactively without IDs, shows your recent comments and lets you pick one.", - Args: cobra.ArbitraryArgs, + Args: cobra.MaximumNArgs(50), RunE: func(cmd *cobra.Command, args []string) error { var ids []string var rows []map[string]any @@ -745,3 +743,66 @@ func commentLabelFromRow(row map[string]any) string { } return "this comment" } + +// Preserve nested reply identities in human-readable output; JSON stays untouched. +func flattenComments(roots []map[string]any) []map[string]any { + var rows []map[string]any + var visit func(map[string]any, string) + visit = func(node map[string]any, parent string) { + row := make(map[string]any, len(node)+1) + for key, value := range node { + row[key] = value + } + if parent != "" { + row["parentId"] = parent + } + if status, _ := node["status"].(string); status == "deleted" { + row["body"] = "[deleted comment]" + } + rows = append(rows, row) + children, _ := node["replies"].([]any) + id, _ := node["id"].(string) + for _, child := range cmdutil.RowsFromAny(children) { + visit(child, id) + } + } + for _, root := range roots { + visit(root, "") + } + return rows +} + +func newCmdReplies() *cobra.Command { + var cursor string + cmd := &cobra.Command{ + Use: "replies ", Short: "Read a reply page (use --cursor for the next page)", Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + id, err := youngutil.RequireID(args[0], "") + if err != nil { + return err + } + client, err := api.NewClient(cmdutil.ServerFromCmd(cmd), false) + if err != nil { + return err + } + params := url.Values{"pageSize": {"20"}} + if cursor != "" { + params.Set("cursor", cursor) + } + data, err := client.DoJSON(cmd.Context(), http.MethodGet, commentsPath+"/"+url.PathEscape(id)+"/replies", params, nil) + if err != nil { + return err + } + if output.IsJSON() { + return output.JSON(data) + } + m := cmdutil.AsMap(data) + thread, _ := m["thread"].([]any) + output.Table(flattenComments(cmdutil.RowsFromAny(thread)), listCommentColumns()) + output.KVWithTitle([]output.KVPair{{Key: "Next cursor", Value: output.Resolve(m, "nextCursor")}}, "Replies") + return nil + }, + } + cmd.Flags().StringVar(&cursor, "cursor", "", "Reply pagination cursor") + return cmd +} diff --git a/internal/cmd/comment/comment_test.go b/internal/cmd/comment/comment_test.go index cacfd7e..15abc80 100644 --- a/internal/cmd/comment/comment_test.go +++ b/internal/cmd/comment/comment_test.go @@ -155,3 +155,24 @@ func TestCommentBatchLabel(t *testing.T) { t.Errorf("single id label = %q, want %q", got, "this comment") } } + +func TestCommentOutputKeepsReplyIDsAndDeletedPlaceholders(t *testing.T) { + root := map[string]any{"id": "root", "body": "root body", "replies": []any{map[string]any{"id": "reply", "body": "", "status": "deleted"}}} + rows := flattenComments([]map[string]any{root}) + if len(rows) != 2 || rows[1]["id"] != "reply" || rows[1]["parentId"] != "root" || rows[1]["body"] != "[deleted comment]" { + t.Fatalf("rows=%#v", rows) + } + if _, ok := root["parentId"]; ok { + t.Fatal("raw JSON was modified") + } +} + +func TestCommentUpdateRejectsInvalidArgumentsBeforeNetwork(t *testing.T) { + for _, args := range [][]string{{"bad/id", "--body", "text"}, {"id", "--visibility", "public"}, {"id", "--body", "text", "--visibility", "anonymous"}} { + cmd := newCmdUpdate() + cmd.SetArgs(args) + if err := cmd.Execute(); err == nil { + t.Fatalf("accepted %v", args) + } + } +} diff --git a/internal/cmd/young_event/young_event.go b/internal/cmd/young_event/young_event.go index efde7c6..b092628 100644 --- a/internal/cmd/young_event/young_event.go +++ b/internal/cmd/young_event/young_event.go @@ -313,6 +313,15 @@ func runDateView(cmd *cobra.Command, view youngutil.DateView, anchor string, opt if err != nil { return err } + if !output.IsJSON() { + meta := cmdutil.AsMap(data) + output.KVWithTitle([]output.KVPair{ + {Key: "Source", Value: output.Resolve(meta, "source.status")}, + {Key: "Last synced", Value: output.Resolve(meta, "source.lastSyncedAt")}, + {Key: "Unknown dates", Value: output.Resolve(meta, "unknownDateCount")}, + }, "Calendar source") + fmt.Println("Unknown-date activities: young-event list --date-unknown true --time-basis " + opts.timeBasis) + } list := cmdutil.NewListResult(data, "data") return output.OutputList(list.Raw, list.Rows, []output.Column{ {Header: "Name", Key: "name"},