diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75cc1d0..54c1ca8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,10 +15,19 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Checkout server OpenAPI source + uses: actions/checkout@v4 + with: + repository: Life-USTC/server-nextjs + path: server-nextjs + - uses: actions/setup-go@v5 with: go-version-file: go.mod + - name: OpenAPI spec is synced with server + run: make check-openapi-sync OPENAPI_SOURCE=server-nextjs/public/openapi.generated.json + - name: Build run: make build diff --git a/Makefile b/Makefile index 902958b..0652bdb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ VERSION ?= dev +OPENAPI_SOURCE ?= ../server-nextjs/public/openapi.generated.json LDFLAGS := -ldflags "-X github.com/Life-USTC/CLI/internal/cmd/root.version=$(VERSION)" -.PHONY: build clean test lint install generate +.PHONY: build clean test lint install generate sync-openapi check-openapi-sync build: go build $(LDFLAGS) -o life-ustc ./cmd/life-ustc @@ -22,3 +23,9 @@ install: generate: go tool oapi-codegen -config api/oapi-codegen.yaml api/openapi.json go run ./internal/cmd/apicmd/genpaths + +sync-openapi: + cp $(OPENAPI_SOURCE) api/openapi.json + +check-openapi-sync: + cmp -s $(OPENAPI_SOURCE) api/openapi.json diff --git a/api/openapi.json b/api/openapi.json index 2ccfa0c..012853b 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -3,7 +3,7 @@ "info": { "title": "Life@USTC API", "version": "1.0.0", - "description": "OpenAPI document generated from Next.js routes by next-openapi-gen" + "description": "OpenAPI document generated from Next.js route handlers" }, "servers": [ { @@ -14,29 +14,46 @@ "paths": { "/.well-known/oauth-authorization-server": { "get": { - "operationId": "get-.well-known-oauth-authorization-server", - "summary": "", + "operationId": "listOauthAuthorizationServer", + "summary": "Compatibility alias for legacy clients that probe the root well-known path.", "description": "", "tags": [ "Api" ], "parameters": [], "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } } } } } + }, + "options": { + "operationId": "options-.well-known-oauth-authorization-server", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } } }, "/.well-known/oauth-authorization-server/api/auth": { "get": { "operationId": "get-.well-known-oauth-authorization-server-api-auth", - "summary": "", + "summary": "Canonical RFC 8414 authorization server metadata for issuer `/api/auth`.", "description": "", "tags": [ "Api" @@ -44,56 +61,235 @@ "parameters": [], "responses": { "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} + "description": "Response 200" + } + } + }, + "options": { + "operationId": "options-.well-known-oauth-authorization-server-api-auth", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } + } + }, + "/.well-known/oauth-authorization-server/api/mcp": { + "get": { + "operationId": "get-.well-known-oauth-authorization-server-api-mcp", + "summary": "Compatibility alias for clients that probe resource-path authorization-server metadata.", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } } } } } + }, + "options": { + "operationId": "options-.well-known-oauth-authorization-server-api-mcp", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } } }, "/.well-known/oauth-protected-resource": { "get": { - "operationId": "get-.well-known-oauth-protected-resource", - "summary": "", + "operationId": "listOauthProtectedResource", + "summary": "Compatibility alias for clients that probe the resource-origin root path.", "description": "", "tags": [ "Api" ], "parameters": [], "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } } } } } + }, + "options": { + "operationId": "options-.well-known-oauth-protected-resource", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } + } + }, + "/.well-known/oauth-protected-resource/api/mcp": { + "get": { + "operationId": "get-.well-known-oauth-protected-resource-api-mcp", + "summary": "Canonical RFC 9728 protected resource metadata for MCP.", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "200": { + "description": "Response 200" + } + } + }, + "options": { + "operationId": "options-.well-known-oauth-protected-resource-api-mcp", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } } }, "/.well-known/openid-configuration": { "get": { - "operationId": "get-.well-known-openid-configuration", + "operationId": "listOpenidConfiguration", + "summary": "Compatibility alias for clients that look up root OpenID discovery directly.", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } + } + } + } + } + }, + "options": { + "operationId": "options-.well-known-openid-configuration", "summary": "", "description": "", "tags": [ "Api" ], "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } + } + }, + "/.well-known/openid-configuration/api/auth": { + "get": { + "operationId": "get-.well-known-openid-configuration-api-auth", + "summary": "RFC 8414-compatible path form for OpenID provider metadata.", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], "responses": { "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} + "description": "Response 200" + } + } + }, + "options": { + "operationId": "options-.well-known-openid-configuration-api-auth", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } + } + }, + "/.well-known/openid-configuration/api/mcp": { + "get": { + "operationId": "get-.well-known-openid-configuration-api-mcp", + "summary": "Compatibility alias for clients that probe resource-path OIDC metadata.", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } } } } } + }, + "options": { + "operationId": "options-.well-known-openid-configuration-api-mcp", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } } }, "/api/admin/comments": { @@ -123,8 +319,8 @@ "in": "query", "name": "limit", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -255,8 +451,8 @@ "in": "query", "name": "limit", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -319,8 +515,8 @@ "in": "query", "name": "limit", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -521,8 +717,8 @@ "in": "query", "name": "page", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -530,8 +726,8 @@ "in": "query", "name": "limit", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -616,7 +812,7 @@ "/api/auth/.well-known/openid-configuration": { "get": { "operationId": "get-api-auth-.well-known-openid-configuration", - "summary": "Some clients resolve OpenID discovery as `{issuer}/.well-known/openid-configuration`.", + "summary": "Canonical OpenID Connect Discovery metadata for issuer `/api/auth`.", "description": "", "tags": [ "Api" @@ -624,19 +820,28 @@ "parameters": [], "responses": { "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } + "description": "Response 200" + } + } + }, + "options": { + "operationId": "options-api-auth-.well-known-openid-configuration", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" } } } }, - "/api/auth/{nextauth}": { + "/api/auth/{auth}": { "get": { - "operationId": "get-api-auth-nextauth", + "operationId": "getAuth", "summary": "", "description": "", "tags": [ @@ -655,7 +860,7 @@ } }, "post": { - "operationId": "post-api-auth-nextauth", + "operationId": "createAuth", "summary": "", "description": "", "tags": [ @@ -674,7 +879,7 @@ } }, "put": { - "operationId": "put-api-auth-nextauth", + "operationId": "setAuth", "summary": "", "description": "", "tags": [ @@ -693,7 +898,7 @@ } }, "patch": { - "operationId": "patch-api-auth-nextauth", + "operationId": "updateAuth", "summary": "", "description": "", "tags": [ @@ -712,7 +917,7 @@ } }, "delete": { - "operationId": "delete-api-auth-nextauth", + "operationId": "deleteAuth", "summary": "", "description": "", "tags": [ @@ -771,27 +976,6 @@ } } }, - "/api/auth/oauth2/register": { - "post": { - "operationId": "post-api-auth-oauth2-register", - "summary": "", - "description": "", - "tags": [ - "Api" - ], - "parameters": [], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, "/api/auth/oauth2/token": { "get": { "operationId": "get-api-auth-oauth2-token", @@ -832,147 +1016,15 @@ } } }, - "/api/auth/session": { + "/api/bus": { "get": { - "operationId": "get-api-auth-session", - "summary": "Compatibility endpoint for existing tests/tools that still call.", + "operationId": "queryBus", + "summary": "Public shuttle-bus query API.", "description": "", "tags": [ - "Api" - ], - "parameters": [], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/api/auth/webhook/login": { - "post": { - "operationId": "post-api-auth-webhook-login", - "summary": "", - "description": "", - "tags": [ - "Api" - ], - "parameters": [], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/api/bus": { - "get": { - "operationId": "queryBus", - "summary": "Public shuttle-bus query API.", - "description": "", - "tags": [ - "Bus" + "Bus" ], "parameters": [ - { - "in": "query", - "name": "now", - "schema": { - "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))$" - }, - "required": false - }, - { - "in": "query", - "name": "dayType", - "schema": { - "type": "string", - "enum": [ - "auto", - "weekday", - "weekend" - ] - }, - "required": false - }, - { - "in": "query", - "name": "originCampusId", - "schema": { - "type": "string", - "pattern": "^-?\\d+$" - }, - "required": false - }, - { - "in": "query", - "name": "destinationCampusId", - "schema": { - "type": "string", - "pattern": "^-?\\d+$" - }, - "required": false - }, - { - "in": "query", - "name": "favoriteRouteIds", - "schema": { - "type": "string" - }, - "required": false - }, - { - "in": "query", - "name": "favoriteCampusIds", - "schema": { - "type": "string" - }, - "required": false - }, - { - "in": "query", - "name": "showDepartedTrips", - "schema": { - "type": "string", - "enum": [ - "true", - "false" - ] - }, - "required": false - }, - { - "in": "query", - "name": "includeAllTrips", - "schema": { - "type": "string", - "enum": [ - "true", - "false" - ] - }, - "required": false - }, - { - "in": "query", - "name": "limit", - "schema": { - "type": "string", - "pattern": "^-?\\d+$" - }, - "required": false - }, { "in": "query", "name": "versionKey", @@ -1201,8 +1253,8 @@ "in": "query", "name": "sectionId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -1210,8 +1262,8 @@ "in": "query", "name": "teacherId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -1274,8 +1326,8 @@ "in": "query", "name": "sectionId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -1283,8 +1335,8 @@ "in": "query", "name": "teacherId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -1611,8 +1663,8 @@ "in": "query", "name": "educationLevelId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -1620,8 +1672,8 @@ "in": "query", "name": "categoryId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -1629,8 +1681,8 @@ "in": "query", "name": "classTypeId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -1638,8 +1690,8 @@ "in": "query", "name": "page", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -1647,8 +1699,8 @@ "in": "query", "name": "limit", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -1690,8 +1742,8 @@ "in": "path", "name": "jwId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": true, "example": "123" @@ -1965,8 +2017,8 @@ "in": "query", "name": "sectionId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -2027,8 +2079,8 @@ "in": "query", "name": "sectionId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -2298,7 +2350,7 @@ }, "/api/mcp": { "get": { - "operationId": "get-api-mcp", + "operationId": "listMcp", "summary": "", "description": "", "tags": [ @@ -2317,7 +2369,7 @@ } }, "post": { - "operationId": "post-api-mcp", + "operationId": "createMcp", "summary": "", "description": "", "tags": [ @@ -2353,6 +2405,101 @@ } } } + }, + "options": { + "operationId": "options-api-mcp", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/api/mcp/.well-known/oauth-authorization-server": { + "get": { + "operationId": "get-api-mcp-.well-known-oauth-authorization-server", + "summary": "Compatibility alias for clients that probe authorization-server metadata relative to /api/mcp.", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } + } + } + } + } + }, + "options": { + "operationId": "options-api-mcp-.well-known-oauth-authorization-server", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } + } + }, + "/api/mcp/.well-known/openid-configuration": { + "get": { + "operationId": "get-api-mcp-.well-known-openid-configuration", + "summary": "Compatibility alias for clients that probe OIDC metadata relative to /api/mcp.", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } + } + } + } + } + }, + "options": { + "operationId": "options-api-mcp-.well-known-openid-configuration", + "summary": "", + "description": "", + "tags": [ + "Api" + ], + "parameters": [], + "responses": { + "204": { + "description": "Response 204" + } + } } }, "/api/me": { @@ -2479,18 +2626,45 @@ { "in": "query", "name": "sectionId", + "schema": { + "type": "integer", + "format": "int64" + }, + "required": false + }, + { + "in": "query", + "name": "sectionJwId", + "schema": { + "type": "integer", + "format": "int64" + }, + "required": false + }, + { + "in": "query", + "name": "sectionCode", "schema": { "type": "string", - "pattern": "^-?\\d+$" + "minLength": 1 }, "required": false }, { "in": "query", "name": "teacherId", + "schema": { + "type": "integer", + "format": "int64" + }, + "required": false + }, + { + "in": "query", + "name": "teacherCode", "schema": { "type": "string", - "pattern": "^-?\\d+$" + "minLength": 1 }, "required": false }, @@ -2498,8 +2672,17 @@ "in": "query", "name": "roomId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" + }, + "required": false + }, + { + "in": "query", + "name": "roomJwId", + "schema": { + "type": "integer", + "format": "int64" }, "required": false }, @@ -2507,8 +2690,8 @@ "in": "query", "name": "weekday", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -2536,8 +2719,8 @@ "in": "query", "name": "page", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -2545,8 +2728,8 @@ "in": "query", "name": "limit", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -2588,17 +2771,35 @@ "in": "query", "name": "courseId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, { "in": "query", - "name": "semesterId", + "name": "courseJwId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" + }, + "required": false + }, + { + "in": "query", + "name": "semesterId", + "schema": { + "type": "integer", + "format": "int64" + }, + "required": false + }, + { + "in": "query", + "name": "semesterJwId", + "schema": { + "type": "integer", + "format": "int64" }, "required": false }, @@ -2606,8 +2807,8 @@ "in": "query", "name": "campusId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -2615,17 +2816,26 @@ "in": "query", "name": "departmentId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, { "in": "query", "name": "teacherId", + "schema": { + "type": "integer", + "format": "int64" + }, + "required": false + }, + { + "in": "query", + "name": "teacherCode", "schema": { "type": "string", - "pattern": "^-?\\d+$" + "minLength": 1 }, "required": false }, @@ -2645,12 +2855,20 @@ }, "required": false }, + { + "in": "query", + "name": "jwIds", + "schema": { + "type": "string" + }, + "required": false + }, { "in": "query", "name": "page", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -2658,8 +2876,8 @@ "in": "query", "name": "limit", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -2701,8 +2919,8 @@ "in": "path", "name": "jwId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": true, "example": "123" @@ -2745,8 +2963,8 @@ "in": "path", "name": "jwId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": true, "example": "123" @@ -2790,8 +3008,8 @@ "in": "path", "name": "jwId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": true, "example": "123" @@ -2835,8 +3053,8 @@ "in": "path", "name": "jwId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": true, "example": "123" @@ -2966,8 +3184,8 @@ "in": "query", "name": "page", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -2975,8 +3193,8 @@ "in": "query", "name": "limit", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -3051,8 +3269,8 @@ "in": "query", "name": "departmentId", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -3068,8 +3286,8 @@ "in": "query", "name": "page", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false }, @@ -3077,8 +3295,8 @@ "in": "query", "name": "limit", "schema": { - "type": "string", - "pattern": "^-?\\d+$" + "type": "integer", + "format": "int64" }, "required": false } @@ -3505,7 +3723,7 @@ }, "/api/uploads/{id}": { "patch": { - "operationId": "renameUpload", + "operationId": "updateUpload", "summary": "Rename one upload.", "description": "", "tags": [ @@ -4112,11 +4330,34 @@ }, "code": { "type": "string" + }, + "course": { + "type": "object", + "properties": { + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "code": { + "type": "string" + }, + "nameCn": { + "type": "string" + } + }, + "required": [ + "jwId", + "code", + "nameCn" + ], + "additionalProperties": false } }, "required": [ "jwId", - "code" + "code", + "course" ], "additionalProperties": false, "nullable": true @@ -4206,11 +4447,34 @@ }, "code": { "type": "string" + }, + "course": { + "type": "object", + "properties": { + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "code": { + "type": "string" + }, + "nameCn": { + "type": "string" + } + }, + "required": [ + "jwId", + "code", + "nameCn" + ], + "additionalProperties": false } }, "required": [ "jwId", - "code" + "code", + "course" ], "additionalProperties": false }, @@ -4272,106 +4536,10 @@ ], "additionalProperties": false }, - "adminDescriptionsResponseSchema": {}, - "successResponseSchema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - }, - "required": [ - "success" - ], - "additionalProperties": false - }, - "adminHomeworksResponseSchema": {}, - "adminSuspensionResponseSchema": { - "type": "object", - "properties": { - "suspension": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "createdById": { - "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)))$" - }, - "reason": { - "type": "string", - "nullable": true - }, - "note": { - "type": "string", - "nullable": true - }, - "expiresAt": { - "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)))$", - "nullable": true - }, - "liftedAt": { - "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)))$", - "nullable": true - }, - "liftedById": { - "type": "string", - "nullable": true - }, - "user": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string", - "nullable": true - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false, - "nullable": true - } - }, - "required": [ - "id", - "userId", - "createdById", - "createdAt", - "reason", - "note", - "expiresAt", - "liftedAt", - "liftedById" - ], - "additionalProperties": false - } - }, - "required": [ - "suspension" - ], - "additionalProperties": false - }, - "adminSuspensionsResponseSchema": { + "adminDescriptionsResponseSchema": { "type": "object", "properties": { - "suspensions": { + "descriptions": { "type": "array", "items": { "type": "object", @@ -4379,10 +4547,7 @@ "id": { "type": "string" }, - "userId": { - "type": "string" - }, - "createdById": { + "content": { "type": "string" }, "createdAt": { @@ -4390,31 +4555,44 @@ "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)))$" }, - "reason": { - "type": "string", - "nullable": true - }, - "note": { + "updatedAt": { "type": "string", - "nullable": true + "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": { + "lastEditedAt": { "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)))$", "nullable": true }, - "liftedAt": { + "lastEditedById": { "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)))$", "nullable": true }, - "liftedById": { + "sectionId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true + }, + "courseId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true + }, + "teacherId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true + }, + "homeworkId": { "type": "string", "nullable": true }, - "user": { + "lastEditedBy": { "type": "object", "properties": { "id": { @@ -4423,21 +4601,558 @@ "name": { "type": "string", "nullable": true + }, + "username": { + "type": "string", + "nullable": true + }, + "image": { + "type": "string", + "nullable": true } }, "required": [ "id", - "name" + "name", + "username", + "image" ], "additionalProperties": false, "nullable": true - } - }, - "required": [ - "id", - "userId", - "createdById", - "createdAt", + }, + "section": { + "type": "object", + "properties": { + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true + }, + "code": { + "type": "string", + "nullable": true + }, + "course": { + "type": "object", + "properties": { + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "code": { + "type": "string" + }, + "nameCn": { + "type": "string" + } + }, + "required": [ + "jwId", + "code", + "nameCn" + ], + "additionalProperties": false, + "nullable": true + } + }, + "required": [ + "jwId", + "code", + "course" + ], + "additionalProperties": false, + "nullable": true + }, + "course": { + "type": "object", + "properties": { + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "code": { + "type": "string" + }, + "nameCn": { + "type": "string" + } + }, + "required": [ + "jwId", + "code", + "nameCn" + ], + "additionalProperties": false, + "nullable": true + }, + "teacher": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "nameCn": { + "type": "string" + } + }, + "required": [ + "id", + "nameCn" + ], + "additionalProperties": false, + "nullable": true + }, + "homework": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "section": { + "type": "object", + "properties": { + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true + }, + "code": { + "type": "string", + "nullable": true + }, + "course": { + "type": "object", + "properties": { + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "code": { + "type": "string" + }, + "nameCn": { + "type": "string" + } + }, + "required": [ + "jwId", + "code", + "nameCn" + ], + "additionalProperties": false, + "nullable": true + } + }, + "required": [ + "jwId", + "code", + "course" + ], + "additionalProperties": false, + "nullable": true + } + }, + "required": [ + "id", + "title", + "section" + ], + "additionalProperties": false, + "nullable": true + } + }, + "required": [ + "id", + "content", + "createdAt", + "updatedAt", + "lastEditedAt", + "lastEditedById", + "sectionId", + "courseId", + "teacherId", + "homeworkId", + "lastEditedBy", + "section", + "course", + "teacher", + "homework" + ], + "additionalProperties": false + } + } + }, + "required": [ + "descriptions" + ], + "additionalProperties": false + }, + "successResponseSchema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + }, + "required": [ + "success" + ], + "additionalProperties": false + }, + "adminHomeworksResponseSchema": { + "type": "object", + "properties": { + "homeworks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "submissionDueAt": { + "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)))$", + "nullable": true + }, + "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)))$" + }, + "updatedAt": { + "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)))$" + }, + "deletedAt": { + "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)))$", + "nullable": true + }, + "section": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true + }, + "code": { + "type": "string", + "nullable": true + }, + "course": { + "type": "object", + "properties": { + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "code": { + "type": "string" + }, + "nameCn": { + "type": "string" + } + }, + "required": [ + "jwId", + "code", + "nameCn" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "jwId", + "code", + "course" + ], + "additionalProperties": false, + "nullable": true + }, + "createdBy": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "username": { + "type": "string", + "nullable": true + }, + "image": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name", + "username", + "image" + ], + "additionalProperties": false, + "nullable": true + }, + "updatedBy": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "username": { + "type": "string", + "nullable": true + }, + "image": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name", + "username", + "image" + ], + "additionalProperties": false, + "nullable": true + }, + "deletedBy": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "username": { + "type": "string", + "nullable": true + }, + "image": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name", + "username", + "image" + ], + "additionalProperties": false, + "nullable": true + } + }, + "required": [ + "id", + "title", + "submissionDueAt", + "createdAt", + "updatedAt", + "deletedAt", + "section", + "createdBy", + "updatedBy", + "deletedBy" + ], + "additionalProperties": false + } + } + }, + "required": [ + "homeworks" + ], + "additionalProperties": false + }, + "adminSuspensionResponseSchema": { + "type": "object", + "properties": { + "suspension": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "createdById": { + "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)))$" + }, + "reason": { + "type": "string", + "nullable": true + }, + "note": { + "type": "string", + "nullable": true + }, + "expiresAt": { + "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)))$", + "nullable": true + }, + "liftedAt": { + "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)))$", + "nullable": true + }, + "liftedById": { + "type": "string", + "nullable": true + }, + "user": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "nullable": true + } + }, + "required": [ + "id", + "userId", + "createdById", + "createdAt", + "reason", + "note", + "expiresAt", + "liftedAt", + "liftedById" + ], + "additionalProperties": false + } + }, + "required": [ + "suspension" + ], + "additionalProperties": false + }, + "adminSuspensionsResponseSchema": { + "type": "object", + "properties": { + "suspensions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "createdById": { + "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)))$" + }, + "reason": { + "type": "string", + "nullable": true + }, + "note": { + "type": "string", + "nullable": true + }, + "expiresAt": { + "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)))$", + "nullable": true + }, + "liftedAt": { + "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)))$", + "nullable": true + }, + "liftedById": { + "type": "string", + "nullable": true + }, + "user": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "nullable": true + } + }, + "required": [ + "id", + "userId", + "createdById", + "createdAt", "reason", "note", "expiresAt", @@ -4449,231 +5164,688 @@ } }, "required": [ - "suspensions" + "suspensions" + ], + "additionalProperties": false + }, + "adminCreateSuspensionRequestSchema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "minLength": 1 + }, + "reason": { + "type": "string" + }, + "note": { + "type": "string" + }, + "expiresAt": { + "type": "string", + "nullable": true + } + }, + "required": [ + "userId" + ], + "additionalProperties": false + }, + "adminUserResponseSchema": { + "type": "object", + "properties": { + "user": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "username": { + "type": "string", + "nullable": true + }, + "isAdmin": { + "type": "boolean" + }, + "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)))$" + }, + "email": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name", + "username", + "isAdmin", + "createdAt", + "email" + ], + "additionalProperties": false + } + }, + "required": [ + "user" + ], + "additionalProperties": false + }, + "adminUpdateUserRequestSchema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "username": { + "type": "string", + "nullable": true + }, + "isAdmin": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "adminUsersResponseSchema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "username": { + "type": "string", + "nullable": true + }, + "isAdmin": { + "type": "boolean" + }, + "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)))$" + }, + "email": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name", + "username", + "isAdmin", + "createdAt", + "email" + ], + "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 }, - "adminCreateSuspensionRequestSchema": { + "busPreferenceResponseSchema": { "type": "object", "properties": { - "userId": { - "type": "string", - "minLength": 1 - }, - "reason": { - "type": "string" - }, - "note": { - "type": "string" + "preference": { + "type": "object", + "properties": { + "preferredOriginCampusId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true + }, + "preferredDestinationCampusId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true + }, + "showDepartedTrips": { + "type": "boolean" + } + }, + "required": [ + "preferredOriginCampusId", + "preferredDestinationCampusId", + "showDepartedTrips" + ], + "additionalProperties": false + } + }, + "required": [ + "preference" + ], + "additionalProperties": false + }, + "busPreferenceRequestSchema": { + "type": "object", + "properties": { + "preferredOriginCampusId": { + "default": null, + "type": "integer", + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0, + "nullable": true }, - "expiresAt": { - "type": "string", + "preferredDestinationCampusId": { + "default": null, + "type": "integer", + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0, "nullable": true + }, + "showDepartedTrips": { + "type": "boolean" } }, "required": [ - "userId" + "preferredOriginCampusId", + "preferredDestinationCampusId", + "showDepartedTrips" ], "additionalProperties": false }, - "adminUserResponseSchema": { + "busQueryResponseSchema": { "type": "object", "properties": { - "user": { + "locale": { + "type": "string", + "enum": [ + "zh-cn", + "en-us" + ] + }, + "fetchedAt": { + "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)))$" + }, + "version": { "type": "object", "properties": { "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "key": { "type": "string" }, - "name": { + "title": { + "type": "string" + }, + "effectiveFrom": { "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)))$", "nullable": true }, - "username": { + "effectiveUntil": { "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)))$", "nullable": true }, - "isAdmin": { - "type": "boolean" - }, - "createdAt": { + "importedAt": { "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)))$" }, - "email": { - "type": "string", - "nullable": true - } - }, - "required": [ - "id", - "name", - "username", - "isAdmin", - "createdAt", - "email" - ], - "additionalProperties": false - } - }, - "required": [ - "user" - ], - "additionalProperties": false - }, - "adminUpdateUserRequestSchema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "username": { - "type": "string", - "nullable": true + "notice": { + "type": "object", + "properties": { + "message": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "required": [ + "message", + "url" + ], + "additionalProperties": false, + "nullable": true + } + }, + "required": [ + "id", + "key", + "title", + "effectiveFrom", + "effectiveUntil", + "importedAt", + "notice" + ], + "additionalProperties": false, + "nullable": true + }, + "availableVersions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "key": { + "type": "string" + }, + "title": { + "type": "string" + }, + "effectiveFrom": { + "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)))$", + "nullable": true + }, + "effectiveUntil": { + "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)))$", + "nullable": true + }, + "importedAt": { + "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)))$" + }, + "notice": { + "type": "object", + "properties": { + "message": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "required": [ + "message", + "url" + ], + "additionalProperties": false, + "nullable": true + } + }, + "required": [ + "id", + "key", + "title", + "effectiveFrom", + "effectiveUntil", + "importedAt", + "notice" + ], + "additionalProperties": false + } + }, + "campuses": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "nameCn": { + "type": "string" + }, + "nameEn": { + "type": "string", + "nullable": true + }, + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + }, + "namePrimary": { + "type": "string" + }, + "nameSecondary": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "nameCn", + "nameEn", + "latitude", + "longitude", + "namePrimary", + "nameSecondary" + ], + "additionalProperties": false + } + }, + "routes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "nameCn": { + "type": "string" + }, + "nameEn": { + "type": "string", + "nullable": true + }, + "descriptionPrimary": { + "type": "string" + }, + "descriptionSecondary": { + "type": "string", + "nullable": true + }, + "stops": { + "type": "array", + "items": { + "type": "object", + "properties": { + "stopOrder": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "campus": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "nameCn": { + "type": "string" + }, + "nameEn": { + "type": "string", + "nullable": true + }, + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + }, + "namePrimary": { + "type": "string" + }, + "nameSecondary": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "nameCn", + "nameEn", + "latitude", + "longitude", + "namePrimary", + "nameSecondary" + ], + "additionalProperties": false + } + }, + "required": [ + "stopOrder", + "campus" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "nameCn", + "nameEn", + "descriptionPrimary", + "descriptionSecondary", + "stops" + ], + "additionalProperties": false + } }, - "isAdmin": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "adminUsersResponseSchema": { - "type": "object", - "properties": { - "data": { + "trips": { "type": "array", "items": { "type": "object", "properties": { "id": { - "type": "string" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, - "name": { + "routeId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "dayType": { "type": "string", - "nullable": true + "enum": [ + "weekday", + "weekend" + ] }, - "username": { + "position": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "stopTimes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "stopOrder": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "campusId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "campusName": { + "type": "string" + }, + "time": { + "type": "string", + "nullable": true + }, + "minutesSinceMidnight": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true + }, + "isPassThrough": { + "type": "boolean" + } + }, + "required": [ + "stopOrder", + "campusId", + "campusName", + "time", + "minutesSinceMidnight", + "isPassThrough" + ], + "additionalProperties": false + } + }, + "departureTime": { "type": "string", "nullable": true }, - "isAdmin": { - "type": "boolean" + "departureMinutes": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "nullable": true }, - "createdAt": { + "arrivalTime": { "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)))$" + "nullable": true }, - "email": { - "type": "string", + "arrivalMinutes": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true } }, "required": [ "id", - "name", - "username", - "isAdmin", - "createdAt", - "email" + "routeId", + "dayType", + "position", + "stopTimes", + "departureTime", + "departureMinutes", + "arrivalTime", + "arrivalMinutes" ], "additionalProperties": false } }, - "pagination": { + "preferences": { "type": "object", "properties": { - "page": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "pageSize": { + "preferredOriginCampusId": { "type": "integer", "minimum": -9007199254740991, - "maximum": 9007199254740991 + "maximum": 9007199254740991, + "nullable": true }, - "total": { + "preferredDestinationCampusId": { "type": "integer", "minimum": -9007199254740991, - "maximum": 9007199254740991 + "maximum": 9007199254740991, + "nullable": true }, - "totalPages": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 + "showDepartedTrips": { + "type": "boolean" } }, "required": [ - "page", - "pageSize", - "total", - "totalPages" + "preferredOriginCampusId", + "preferredDestinationCampusId", + "showDepartedTrips" ], - "additionalProperties": false - } - }, - "required": [ - "data", - "pagination" - ], - "additionalProperties": false - }, - "busPreferenceResponseSchema": {}, - "busPreferenceRequestSchema": { - "type": "object", - "properties": { - "preferredOriginCampusId": { - "default": null, - "type": "integer", - "exclusiveMinimum": true, - "maximum": 9007199254740991, - "minimum": 0, + "additionalProperties": false, "nullable": true }, - "preferredDestinationCampusId": { - "default": null, - "type": "integer", - "exclusiveMinimum": true, - "maximum": 9007199254740991, - "minimum": 0, + "notice": { + "type": "object", + "properties": { + "message": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "required": [ + "message", + "url" + ], + "additionalProperties": false, "nullable": true - }, - "favoriteCampusIds": { - "type": "array", - "items": { - "type": "integer", - "exclusiveMinimum": true, - "maximum": 9007199254740991, - "minimum": 0 - } - }, - "favoriteRouteIds": { - "default": [], - "type": "array", - "items": { - "type": "integer", - "exclusiveMinimum": true, - "maximum": 9007199254740991, - "minimum": 0 - } - }, - "showDepartedTrips": { - "type": "boolean" } }, "required": [ - "preferredOriginCampusId", - "preferredDestinationCampusId", - "favoriteCampusIds", - "favoriteRouteIds", - "showDepartedTrips" + "locale", + "fetchedAt", + "version", + "availableVersions", + "campuses", + "routes", + "trips", + "preferences", + "notice" ], "additionalProperties": false }, - "busQueryResponseSchema": {}, "currentCalendarSubscriptionResponseSchema": { "type": "object", "properties": { @@ -9010,12 +10182,10 @@ "content": { "type": "string" }, - "createdAt": {}, "updatedAt": { "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)))$", - "nullable": true + "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)))$" }, "lastEditedAt": { "type": "string", @@ -9023,32 +10193,6 @@ "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)))$", "nullable": true }, - "lastEditedById": { - "type": "string", - "nullable": true - }, - "sectionId": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991, - "nullable": true - }, - "courseId": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991, - "nullable": true - }, - "teacherId": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991, - "nullable": true - }, - "homeworkId": { - "type": "string", - "nullable": true - }, "lastEditedBy": { "type": "object", "properties": { @@ -9081,14 +10225,8 @@ "required": [ "id", "content", - "createdAt", "updatedAt", "lastEditedAt", - "lastEditedById", - "sectionId", - "courseId", - "teacherId", - "homeworkId", "lastEditedBy" ], "additionalProperties": false @@ -9101,12 +10239,10 @@ "id": { "type": "string" }, - "descriptionId": { - "type": "string" - }, - "editorId": { + "createdAt": { "type": "string", - "nullable": true + "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)))$" }, "previousContent": { "type": "string", @@ -9115,11 +10251,6 @@ "nextContent": { "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)))$" - }, "editor": { "type": "object", "properties": { @@ -9151,11 +10282,9 @@ }, "required": [ "id", - "descriptionId", - "editorId", + "createdAt", "previousContent", "nextContent", - "createdAt", "editor" ], "additionalProperties": false @@ -16561,7 +17690,7 @@ }, { "name": "Calendar", - "description": "User calendar export" + "description": "Calendar selections and exports" }, { "name": "Bus", diff --git a/internal/cmd/admin/admin.go b/internal/cmd/admin/admin.go index 5cb1f12..0a3273d 100644 --- a/internal/cmd/admin/admin.go +++ b/internal/cmd/admin/admin.go @@ -61,8 +61,8 @@ func newCmdUserList() *cobra.Command { } params := &openapi.ListAdminUsersParams{} params.Search = cmdutil.StringPtrIfSet(search) - params.Page = cmdutil.IntStringPtrIfPositive(page) - params.Limit = cmdutil.IntStringPtrIfPositive(limit) + params.Page = cmdutil.Int64PtrIfPositive(page) + params.Limit = cmdutil.Int64PtrIfPositive(limit) data, err := api.ParseResponseRaw(c.ListAdminUsers(api.Ctx(), params)) if err != nil { return err @@ -258,7 +258,7 @@ func newCmdCommentList() *cobra.Command { s := openapi.ListAdminCommentsParamsStatus(status) params.Status = &s } - params.Limit = cmdutil.IntStringPtrIfPositive(limit) + params.Limit = cmdutil.Int64PtrIfPositive(limit) data, err := api.ParseResponseRaw(c.ListAdminComments(api.Ctx(), params)) if err != nil { return err @@ -340,7 +340,7 @@ func newCmdDescriptionList() *cobra.Command { params.HasContent = &h } params.Search = cmdutil.StringPtrIfSet(search) - params.Limit = cmdutil.IntStringPtrIfPositive(limit) + params.Limit = cmdutil.Int64PtrIfPositive(limit) data, err := api.ParseResponseRaw(c.ListAdminDescriptions(api.Ctx(), params)) if err != nil { return err @@ -390,7 +390,7 @@ func newCmdHomeworkList() *cobra.Command { params.Status = &s } params.Search = cmdutil.StringPtrIfSet(search) - params.Limit = cmdutil.IntStringPtrIfPositive(limit) + params.Limit = cmdutil.Int64PtrIfPositive(limit) data, err := api.ParseResponseRaw(c.ListAdminHomeworks(api.Ctx(), params)) if err != nil { return err diff --git a/internal/cmd/apicmd/api_paths_gen.go b/internal/cmd/apicmd/api_paths_gen.go index be5c5e1..e02c163 100644 --- a/internal/cmd/apicmd/api_paths_gen.go +++ b/internal/cmd/apicmd/api_paths_gen.go @@ -4,8 +4,12 @@ package apicmd var generatedAPIPaths = []string{ "/.well-known/oauth-authorization-server", "/.well-known/oauth-authorization-server/api/auth", + "/.well-known/oauth-authorization-server/api/mcp", "/.well-known/oauth-protected-resource", + "/.well-known/oauth-protected-resource/api/mcp", "/.well-known/openid-configuration", + "/.well-known/openid-configuration/api/auth", + "/.well-known/openid-configuration/api/mcp", "/api/admin/comments", "/api/admin/comments/{id}", "/api/admin/descriptions", @@ -17,11 +21,8 @@ var generatedAPIPaths = []string{ "/api/admin/users/{id}", "/api/auth/.well-known/openid-configuration", "/api/auth/oauth2/device-authorization", - "/api/auth/oauth2/register", "/api/auth/oauth2/token", - "/api/auth/session", - "/api/auth/webhook/login", - "/api/auth/{nextauth}", + "/api/auth/{auth}", "/api/bus", "/api/bus/preferences", "/api/calendar-subscriptions", @@ -39,6 +40,8 @@ var generatedAPIPaths = []string{ "/api/homeworks/{id}/completion", "/api/locale", "/api/mcp", + "/api/mcp/.well-known/oauth-authorization-server", + "/api/mcp/.well-known/openid-configuration", "/api/me", "/api/me/subscriptions/homeworks", "/api/metadata", diff --git a/internal/cmd/bus/bus.go b/internal/cmd/bus/bus.go index 0b23b89..4fda44f 100644 --- a/internal/cmd/bus/bus.go +++ b/internal/cmd/bus/bus.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/json" "fmt" + "strconv" "strings" "time" @@ -65,39 +66,41 @@ func runBusQuery(cmd *cobra.Command, origin, destination, dayType, now string, s return err } params := &openapi.QueryBusParams{} - params.OriginCampusId = cmdutil.StringPtrIfSet(origin) - params.DestinationCampusId = cmdutil.StringPtrIfSet(destination) - if dayType != "" { - dt := openapi.QueryBusParamsDayType(dayType) - params.DayType = &dt - } - if now != "" { - t, err := time.Parse(time.RFC3339, now) - if err != nil { - return fmt.Errorf("invalid time format (expected RFC 3339): %w", err) - } - params.Now = &t - } - if showDeparted { - v := openapi.QueryBusParamsShowDepartedTripsTrue - params.ShowDepartedTrips = &v - } - if includeAll { - v := openapi.QueryBusParamsIncludeAllTripsTrue - params.IncludeAllTrips = &v - } - params.Limit = cmdutil.IntStringPtrIfPositive(limit) data, err := api.ParseResponseRaw(c.QueryBus(api.Ctx(), params)) if err != nil { return err } + dataMap := cmdutil.AsMap(data) + if dataMap != nil { + if err := filterBusData(dataMap, busQueryFilter{ + origin: origin, + destination: destination, + dayType: dayType, + now: now, + showDeparted: showDeparted, + includeAll: includeAll, + limit: limit, + }); err != nil { + return err + } + } if output.IsJSON() { return output.JSON(data) } - renderBus(cmdutil.AsMap(data)) + renderBus(dataMap) return nil } +type busQueryFilter struct { + origin string + destination string + dayType string + now string + showDeparted bool + includeAll bool + limit int +} + func newCmdQuery() *cobra.Command { var ( origin, destination, dayType, now string @@ -124,6 +127,175 @@ func newCmdQuery() *cobra.Command { return cmd } +func filterBusData(data map[string]any, filter busQueryFilter) error { + originID, err := parseOptionalBusCampusID(filter.origin) + if err != nil { + return err + } + destinationID, err := parseOptionalBusCampusID(filter.destination) + if err != nil { + return err + } + resolvedDayType, err := resolveBusQueryDayType(filter.dayType, filter.now) + if err != nil { + return err + } + nowMinutes, err := busNowMinutes(filter.now) + if err != nil { + return err + } + + routeIDs := filteredBusRouteIDs(data["routes"], originID, destinationID) + filteredTrips := make([]any, 0) + for _, item := range anySlice(data["trips"]) { + trip := cmdutil.AsMap(item) + if trip == nil { + continue + } + routeID, ok := intFromAny(trip["routeId"]) + if !ok || !routeIDs[routeID] { + continue + } + if resolvedDayType != "" && trip["dayType"] != resolvedDayType { + continue + } + if !filter.includeAll && !filter.showDeparted { + departure, ok := intFromAny(trip["departureMinutes"]) + if ok && departure < nowMinutes { + continue + } + } + filteredTrips = append(filteredTrips, item) + if filter.limit > 0 && len(filteredTrips) >= filter.limit { + break + } + } + data["trips"] = filteredTrips + return nil +} + +func parseOptionalBusCampusID(value string) (*int, error) { + if value == "" { + return nil, nil + } + parsed, err := strconv.Atoi(value) + if err != nil || parsed <= 0 { + return nil, fmt.Errorf("invalid campus ID %q", value) + } + return &parsed, nil +} + +func resolveBusQueryDayType(value, now string) (string, error) { + switch value { + case "", "all": + return "", nil + case "weekday", "weekend": + return value, nil + case "auto": + t, err := parseBusNow(now) + if err != nil { + return "", err + } + if t.Weekday() == time.Saturday || t.Weekday() == time.Sunday { + return "weekend", nil + } + return "weekday", nil + default: + return "", fmt.Errorf("invalid --day-type %q (use auto, weekday, or weekend)", value) + } +} + +func busNowMinutes(value string) (int, error) { + t, err := parseBusNow(value) + if err != nil { + return 0, err + } + return t.Hour()*60 + t.Minute(), nil +} + +func parseBusNow(value string) (time.Time, error) { + if value == "" { + return time.Now(), nil + } + t, err := time.Parse(time.RFC3339, value) + if err != nil { + return time.Time{}, fmt.Errorf("invalid time format (expected RFC 3339): %w", err) + } + return t, nil +} + +func filteredBusRouteIDs(raw any, originID, destinationID *int) map[int]bool { + out := map[int]bool{} + for _, item := range anySlice(raw) { + route := cmdutil.AsMap(item) + if route == nil { + continue + } + id, ok := intFromAny(route["id"]) + if !ok { + continue + } + if busRouteMatches(route, originID, destinationID) { + out[id] = true + } + } + return out +} + +func busRouteMatches(route map[string]any, originID, destinationID *int) bool { + if originID == nil && destinationID == nil { + return true + } + originOrder := -1 + destinationOrder := -1 + for _, item := range anySlice(route["stops"]) { + stop := cmdutil.AsMap(item) + campus := cmdutil.AsMap(stop["campus"]) + campusID, ok := intFromAny(campus["id"]) + if !ok { + continue + } + order, _ := intFromAny(stop["stopOrder"]) + if originID != nil && campusID == *originID { + originOrder = order + } + if destinationID != nil && campusID == *destinationID { + destinationOrder = order + } + } + if originID != nil && originOrder < 0 { + return false + } + if destinationID != nil && destinationOrder < 0 { + return false + } + if originID != nil && destinationID != nil { + return originOrder < destinationOrder + } + return true +} + +func anySlice(value any) []any { + items, _ := value.([]any) + return items +} + +func intFromAny(value any) (int, bool) { + switch v := value.(type) { + case int: + return v, true + case int64: + return int(v), true + case float64: + return int(v), true + case string: + parsed, err := strconv.Atoi(v) + return parsed, err == nil + default: + return 0, false + } +} + func renderBus(data map[string]any) { if data == nil { output.Dim(" No bus schedules found.") diff --git a/internal/cmd/cmdutil/helpers.go b/internal/cmd/cmdutil/helpers.go index 207af90..582dcc7 100644 --- a/internal/cmd/cmdutil/helpers.go +++ b/internal/cmd/cmdutil/helpers.go @@ -40,6 +40,27 @@ func IntStringPtrIfPositive(value int) *string { return &result } +// Int64PtrIfPositive returns a pointer for positive integer flag values. +func Int64PtrIfPositive(value int) *int64 { + if value <= 0 { + return nil + } + result := int64(value) + return &result +} + +// Int64PtrIfSet parses a non-empty integer flag value. +func Int64PtrIfSet(value string) (*int64, error) { + if value == "" { + return nil, nil + } + parsed, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return nil, fmt.Errorf("invalid integer %q", value) + } + return &parsed, nil +} + // ShouldUseInteractive decides whether a command should open a TUI. // // Default behavior: in a TTY with no explicit list/filter flags set, the TUI diff --git a/internal/cmd/comment/comment.go b/internal/cmd/comment/comment.go index 597157f..dda65ea 100644 --- a/internal/cmd/comment/comment.go +++ b/internal/cmd/comment/comment.go @@ -84,10 +84,16 @@ func runCommentList(cmd *cobra.Command, target commentTarget) error { params.TargetId = &target.targetID } if target.sectionID != "" { - params.SectionId = &target.sectionID + params.SectionId, err = cmdutil.Int64PtrIfSet(target.sectionID) + if err != nil { + return err + } } if target.teacherID != "" { - params.TeacherId = &target.teacherID + params.TeacherId, err = cmdutil.Int64PtrIfSet(target.teacherID) + if err != nil { + return err + } } data, err := api.ParseResponseRaw(c.ListComments(api.Ctx(), params)) if err != nil { @@ -115,10 +121,16 @@ func runCommentCreate(cmd *cobra.Command, target commentTarget, body, visibility params.TargetId = &target.targetID } if target.sectionID != "" { - params.SectionId = &target.sectionID + params.SectionId, err = cmdutil.Int64PtrIfSet(target.sectionID) + if err != nil { + return err + } } if target.teacherID != "" { - params.TeacherId = &target.teacherID + params.TeacherId, err = cmdutil.Int64PtrIfSet(target.teacherID) + if err != nil { + return err + } } vis := openapi.CommentCreateRequestSchemaVisibility(visibility) @@ -535,4 +547,4 @@ func commentLabelFromRow(row map[string]any) string { return "comment " + id } return "this comment" -} \ No newline at end of file +} diff --git a/internal/cmd/course/course.go b/internal/cmd/course/course.go index a48edbc..511fd9d 100644 --- a/internal/cmd/course/course.go +++ b/internal/cmd/course/course.go @@ -101,12 +101,19 @@ func runCourseList(cmd *cobra.Command, opts courseListOpts) error { func fetchCourseList(c *api.TypedClient, opts courseListOpts) (cmdutil.ListResult, error) { params := openapi.ListCoursesParams{} + var err error params.Search = cmdutil.StringPtrIfSet(opts.search) - params.EducationLevelId = cmdutil.StringPtrIfSet(opts.educationLevelID) - params.CategoryId = cmdutil.StringPtrIfSet(opts.categoryID) - params.ClassTypeId = cmdutil.StringPtrIfSet(opts.classTypeID) - params.Page = cmdutil.IntStringPtrIfPositive(opts.page) - params.Limit = cmdutil.IntStringPtrIfPositive(opts.limit) + if params.EducationLevelId, err = cmdutil.Int64PtrIfSet(opts.educationLevelID); err != nil { + return cmdutil.ListResult{}, err + } + if params.CategoryId, err = cmdutil.Int64PtrIfSet(opts.categoryID); err != nil { + return cmdutil.ListResult{}, err + } + if params.ClassTypeId, err = cmdutil.Int64PtrIfSet(opts.classTypeID); err != nil { + return cmdutil.ListResult{}, err + } + params.Page = cmdutil.Int64PtrIfPositive(opts.page) + params.Limit = cmdutil.Int64PtrIfPositive(opts.limit) data, err := api.ParseResponseRaw(c.ListCourses(api.Ctx(), ¶ms)) if err != nil { return cmdutil.ListResult{}, err @@ -158,7 +165,11 @@ func newCmdView() *cobra.Command { if err != nil { return err } - data, err := api.ParseResponseRaw(c.GetCourse(api.Ctx(), args[0])) + jwID, err := cmdutil.Int64PtrIfSet(args[0]) + if err != nil { + return err + } + data, err := api.ParseResponseRaw(c.GetCourse(api.Ctx(), *jwID)) if err != nil { return err } diff --git a/internal/cmd/homework/homework.go b/internal/cmd/homework/homework.go index 77209ce..87bc4f5 100644 --- a/internal/cmd/homework/homework.go +++ b/internal/cmd/homework/homework.go @@ -58,8 +58,12 @@ func newCmdSectionList() *cobra.Command { if includeDeleted { inclDel = openapi.ListHomeworksParamsIncludeDeletedTrue } + sectionID, err := cmdutil.Int64PtrIfSet(args[0]) + if err != nil { + return err + } params := &openapi.ListHomeworksParams{ - SectionId: &args[0], + SectionId: sectionID, IncludeDeleted: &inclDel, } data, err := api.ParseResponseRaw(c.ListHomeworks(api.Ctx(), params)) @@ -353,8 +357,12 @@ func runMyHomeworkList(cmd *cobra.Command, opts myHomeworkListOpts) error { if opts.sectionID != "" { // Single section — use /api/homeworks with sectionId filter + sectionID, err := cmdutil.Int64PtrIfSet(opts.sectionID) + if err != nil { + return err + } params := &openapi.ListHomeworksParams{ - SectionId: &opts.sectionID, + SectionId: sectionID, } data, err = api.ParseResponseRaw(c.ListHomeworks(api.Ctx(), params)) if err != nil { @@ -776,4 +784,4 @@ func setHomeworkCompleted(cmd *cobra.Command, id string, row map[string]any, com output.Success(fmt.Sprintf("Reopened: %s", label)) } return nil -} \ No newline at end of file +} diff --git a/internal/cmd/schedule/schedule.go b/internal/cmd/schedule/schedule.go index 2a9cb5e..30a7928 100644 --- a/internal/cmd/schedule/schedule.go +++ b/internal/cmd/schedule/schedule.go @@ -56,9 +56,15 @@ func runScheduleList(cmd *cobra.Command, opts scheduleListOpts) error { return err } params := openapi.ListSchedulesParams{} - params.SectionId = cmdutil.StringPtrIfSet(opts.sectionID) - params.TeacherId = cmdutil.StringPtrIfSet(opts.teacherID) - params.RoomId = cmdutil.StringPtrIfSet(opts.roomID) + if params.SectionId, err = cmdutil.Int64PtrIfSet(opts.sectionID); err != nil { + return err + } + if params.TeacherId, err = cmdutil.Int64PtrIfSet(opts.teacherID); err != nil { + return err + } + if params.RoomId, err = cmdutil.Int64PtrIfSet(opts.roomID); err != nil { + return err + } if opts.dateFrom != "" { t, err := time.Parse(time.DateOnly, opts.dateFrom) if err != nil { @@ -74,10 +80,10 @@ func runScheduleList(cmd *cobra.Command, opts scheduleListOpts) error { params.DateTo = &t } if opts.weekday > 0 { - params.Weekday = cmdutil.IntStringPtrIfPositive(opts.weekday) + params.Weekday = cmdutil.Int64PtrIfPositive(opts.weekday) } - params.Page = cmdutil.IntStringPtrIfPositive(opts.page) - params.Limit = cmdutil.IntStringPtrIfPositive(opts.limit) + params.Page = cmdutil.Int64PtrIfPositive(opts.page) + params.Limit = cmdutil.Int64PtrIfPositive(opts.limit) data, err := api.ParseResponseRaw(c.ListSchedules(api.Ctx(), ¶ms)) if err != nil { return err diff --git a/internal/cmd/school/school.go b/internal/cmd/school/school.go index 5413135..5ed1e2c 100644 --- a/internal/cmd/school/school.go +++ b/internal/cmd/school/school.go @@ -385,7 +385,7 @@ func newCmdSchoolHomeworkSync() *cobra.Command { if err := withDebugStep("Life@USTC list semesters", func() error { var err error lifeSemesterRaw, err = api.ParseResponseRaw(apiClient.ListSemesters(cmd.Context(), &openapi.ListSemestersParams{ - Limit: stringPtr("200"), + Limit: int64Ptr(200), })) return err }); err != nil { @@ -469,7 +469,7 @@ func newCmdSchoolSync() *cobra.Command { } lifeSemesterRaw, err := api.ParseResponseRaw(apiClient.ListSemesters(cmd.Context(), &openapi.ListSemestersParams{ - Limit: stringPtr("200"), + Limit: int64Ptr(200), })) if err != nil { return err @@ -1215,8 +1215,12 @@ func sectionsByCourseName(curriculum []ustcschool.CurriculumItem, byCode map[str func fetchLifeHomeworksForSection(cmd *cobra.Command, apiClient *api.TypedClient, sectionID string) ([]map[string]any, error) { includeDeleted := openapi.ListHomeworksParamsIncludeDeletedFalse + parsedSectionID, err := cmdutil.Int64PtrIfSet(sectionID) + if err != nil { + return nil, err + } raw, err := api.ParseResponseRaw(apiClient.ListHomeworks(cmd.Context(), &openapi.ListHomeworksParams{ - SectionId: §ionID, + SectionId: parsedSectionID, IncludeDeleted: &includeDeleted, })) if err != nil { @@ -1455,7 +1459,7 @@ func anyString(value any) string { } } -func stringPtr(value string) *string { +func int64Ptr(value int64) *int64 { return &value } diff --git a/internal/cmd/section/section.go b/internal/cmd/section/section.go index ad8f4f0..1aed24d 100644 --- a/internal/cmd/section/section.go +++ b/internal/cmd/section/section.go @@ -123,15 +123,26 @@ func runSectionList(cmd *cobra.Command, opts sectionListOpts) error { func fetchSectionList(c *api.TypedClient, opts sectionListOpts) (cmdutil.ListResult, error) { params := openapi.ListSectionsParams{} - params.CourseId = cmdutil.StringPtrIfSet(opts.courseID) - params.SemesterId = cmdutil.StringPtrIfSet(opts.semesterID) - params.CampusId = cmdutil.StringPtrIfSet(opts.campusID) - params.DepartmentId = cmdutil.StringPtrIfSet(opts.departmentID) - params.TeacherId = cmdutil.StringPtrIfSet(opts.teacherID) + var err error + if params.CourseId, err = cmdutil.Int64PtrIfSet(opts.courseID); err != nil { + return cmdutil.ListResult{}, err + } + if params.SemesterId, err = cmdutil.Int64PtrIfSet(opts.semesterID); err != nil { + return cmdutil.ListResult{}, err + } + if params.CampusId, err = cmdutil.Int64PtrIfSet(opts.campusID); err != nil { + return cmdutil.ListResult{}, err + } + if params.DepartmentId, err = cmdutil.Int64PtrIfSet(opts.departmentID); err != nil { + return cmdutil.ListResult{}, err + } + if params.TeacherId, err = cmdutil.Int64PtrIfSet(opts.teacherID); err != nil { + return cmdutil.ListResult{}, err + } params.Search = cmdutil.StringPtrIfSet(opts.search) params.Ids = cmdutil.StringPtrIfSet(opts.ids) - params.Page = cmdutil.IntStringPtrIfPositive(opts.page) - params.Limit = cmdutil.IntStringPtrIfPositive(opts.limit) + params.Page = cmdutil.Int64PtrIfPositive(opts.page) + params.Limit = cmdutil.Int64PtrIfPositive(opts.limit) data, err := api.ParseResponseRaw(c.ListSections(api.Ctx(), ¶ms)) if err != nil { return cmdutil.ListResult{}, err @@ -187,7 +198,11 @@ func newCmdView() *cobra.Command { if err != nil { return err } - data, err := api.ParseResponseRaw(c.GetSection(api.Ctx(), args[0])) + jwID, err := cmdutil.Int64PtrIfSet(args[0]) + if err != nil { + return err + } + data, err := api.ParseResponseRaw(c.GetSection(api.Ctx(), *jwID)) if err != nil { return err } @@ -245,7 +260,11 @@ func newCmdSchedules() *cobra.Command { if err != nil { return err } - data, err := api.ParseResponseRaw(c.GetSectionSchedules(api.Ctx(), args[0])) + jwID, err := cmdutil.Int64PtrIfSet(args[0]) + if err != nil { + return err + } + data, err := api.ParseResponseRaw(c.GetSectionSchedules(api.Ctx(), *jwID)) if err != nil { return err } @@ -275,7 +294,11 @@ func newCmdCalendar() *cobra.Command { if err != nil { return err } - resp, err := c.GetSectionCalendar(api.Ctx(), args[0]) + jwID, err := cmdutil.Int64PtrIfSet(args[0]) + if err != nil { + return err + } + resp, err := c.GetSectionCalendar(api.Ctx(), *jwID) if err != nil { return err } diff --git a/internal/cmd/semester/semester.go b/internal/cmd/semester/semester.go index 195b482..8ad63f2 100644 --- a/internal/cmd/semester/semester.go +++ b/internal/cmd/semester/semester.go @@ -51,8 +51,8 @@ func runSemesterList(cmd *cobra.Command, opts semesterListOpts) error { return err } params := &openapi.ListSemestersParams{} - params.Page = cmdutil.IntStringPtrIfPositive(opts.page) - params.Limit = cmdutil.IntStringPtrIfPositive(opts.limit) + params.Page = cmdutil.Int64PtrIfPositive(opts.page) + params.Limit = cmdutil.Int64PtrIfPositive(opts.limit) data, err := api.ParseResponseRaw(c.ListSemesters(api.Ctx(), params)) if err != nil { return err diff --git a/internal/cmd/teacher/teacher.go b/internal/cmd/teacher/teacher.go index 9eef63e..58daff1 100644 --- a/internal/cmd/teacher/teacher.go +++ b/internal/cmd/teacher/teacher.go @@ -99,10 +99,13 @@ func runTeacherList(cmd *cobra.Command, opts teacherListOpts) error { func fetchTeacherList(c *api.TypedClient, opts teacherListOpts) (cmdutil.ListResult, error) { params := openapi.ListTeachersParams{} - params.DepartmentId = cmdutil.StringPtrIfSet(opts.departmentID) + var err error + if params.DepartmentId, err = cmdutil.Int64PtrIfSet(opts.departmentID); err != nil { + return cmdutil.ListResult{}, err + } params.Search = cmdutil.StringPtrIfSet(opts.search) - params.Page = cmdutil.IntStringPtrIfPositive(opts.page) - params.Limit = cmdutil.IntStringPtrIfPositive(opts.limit) + params.Page = cmdutil.Int64PtrIfPositive(opts.page) + params.Limit = cmdutil.Int64PtrIfPositive(opts.limit) data, err := api.ParseResponseRaw(c.ListTeachers(api.Ctx(), ¶ms)) if err != nil { return cmdutil.ListResult{}, err diff --git a/internal/cmd/upload/upload.go b/internal/cmd/upload/upload.go index 8982546..e0afa0d 100644 --- a/internal/cmd/upload/upload.go +++ b/internal/cmd/upload/upload.go @@ -175,7 +175,7 @@ func newCmdRename() *cobra.Command { if err != nil { return err } - _, err = api.ParseResponseRaw(c.RenameUpload(api.Ctx(), args[0], openapi.RenameUploadJSONRequestBody{Filename: filename})) + _, err = api.ParseResponseRaw(c.UpdateUpload(api.Ctx(), args[0], openapi.UpdateUploadJSONRequestBody{Filename: filename})) if err != nil { return err } diff --git a/internal/openapi/client.gen.go b/internal/openapi/client.gen.go index a240805..a18d62a 100644 --- a/internal/openapi/client.gen.go +++ b/internal/openapi/client.gen.go @@ -122,6 +122,42 @@ func (e AdminModeratedCommentResponseSchemaCommentVisibility) Valid() bool { } } +// Defines values for BusQueryResponseSchemaLocale. +const ( + BusQueryResponseSchemaLocaleEnUs BusQueryResponseSchemaLocale = "en-us" + BusQueryResponseSchemaLocaleZhCn BusQueryResponseSchemaLocale = "zh-cn" +) + +// Valid indicates whether the value is a known member of the BusQueryResponseSchemaLocale enum. +func (e BusQueryResponseSchemaLocale) Valid() bool { + switch e { + case BusQueryResponseSchemaLocaleEnUs: + return true + case BusQueryResponseSchemaLocaleZhCn: + return true + default: + return false + } +} + +// Defines values for BusQueryResponseSchemaTripsDayType. +const ( + Weekday BusQueryResponseSchemaTripsDayType = "weekday" + Weekend BusQueryResponseSchemaTripsDayType = "weekend" +) + +// Valid indicates whether the value is a known member of the BusQueryResponseSchemaTripsDayType enum. +func (e BusQueryResponseSchemaTripsDayType) Valid() bool { + switch e { + case Weekday: + return true + case Weekend: + return true + default: + return false + } +} + // Defines values for CommentCreateRequestSchemaTargetType. const ( CommentCreateRequestSchemaTargetTypeCourse CommentCreateRequestSchemaTargetType = "course" @@ -289,16 +325,16 @@ func (e HomeworksListResponseSchemaAuditLogsAction) Valid() bool { // Defines values for LocaleUpdateRequestSchemaLocale. const ( - EnUs LocaleUpdateRequestSchemaLocale = "en-us" - ZhCn LocaleUpdateRequestSchemaLocale = "zh-cn" + LocaleUpdateRequestSchemaLocaleEnUs LocaleUpdateRequestSchemaLocale = "en-us" + LocaleUpdateRequestSchemaLocaleZhCn LocaleUpdateRequestSchemaLocale = "zh-cn" ) // Valid indicates whether the value is a known member of the LocaleUpdateRequestSchemaLocale enum. func (e LocaleUpdateRequestSchemaLocale) Valid() bool { switch e { - case EnUs: + case LocaleUpdateRequestSchemaLocaleEnUs: return true - case ZhCn: + case LocaleUpdateRequestSchemaLocaleZhCn: return true default: return false @@ -479,63 +515,6 @@ func (e ListAdminHomeworksParamsStatus) Valid() bool { } } -// Defines values for QueryBusParamsDayType. -const ( - Auto QueryBusParamsDayType = "auto" - Weekday QueryBusParamsDayType = "weekday" - Weekend QueryBusParamsDayType = "weekend" -) - -// Valid indicates whether the value is a known member of the QueryBusParamsDayType enum. -func (e QueryBusParamsDayType) Valid() bool { - switch e { - case Auto: - return true - case Weekday: - return true - case Weekend: - return true - default: - return false - } -} - -// Defines values for QueryBusParamsShowDepartedTrips. -const ( - QueryBusParamsShowDepartedTripsFalse QueryBusParamsShowDepartedTrips = "false" - QueryBusParamsShowDepartedTripsTrue QueryBusParamsShowDepartedTrips = "true" -) - -// Valid indicates whether the value is a known member of the QueryBusParamsShowDepartedTrips enum. -func (e QueryBusParamsShowDepartedTrips) Valid() bool { - switch e { - case QueryBusParamsShowDepartedTripsFalse: - return true - case QueryBusParamsShowDepartedTripsTrue: - return true - default: - return false - } -} - -// Defines values for QueryBusParamsIncludeAllTrips. -const ( - QueryBusParamsIncludeAllTripsFalse QueryBusParamsIncludeAllTrips = "false" - QueryBusParamsIncludeAllTripsTrue QueryBusParamsIncludeAllTrips = "true" -) - -// Valid indicates whether the value is a known member of the QueryBusParamsIncludeAllTrips enum. -func (e QueryBusParamsIncludeAllTrips) Valid() bool { - switch e { - case QueryBusParamsIncludeAllTripsFalse: - return true - case QueryBusParamsIncludeAllTripsTrue: - return true - default: - return false - } -} - // Defines values for ListCommentsParamsTargetType. const ( ListCommentsParamsTargetTypeCourse ListCommentsParamsTargetType = "course" @@ -817,14 +796,24 @@ type AdminCommentsResponseSchema struct { ParentId *string `json:"parentId"` RootId *string `json:"rootId"` Section *struct { - Code string `json:"code"` - JwId int `json:"jwId"` + Code string `json:"code"` + Course struct { + Code string `json:"code"` + JwId int `json:"jwId"` + NameCn string `json:"nameCn"` + } `json:"course"` + JwId int `json:"jwId"` } `json:"section"` SectionId *int `json:"sectionId"` SectionTeacher *struct { Section struct { - Code string `json:"code"` - JwId int `json:"jwId"` + Code string `json:"code"` + Course struct { + Code string `json:"code"` + JwId int `json:"jwId"` + NameCn string `json:"nameCn"` + } `json:"course"` + JwId int `json:"jwId"` } `json:"section"` Teacher struct { NameCn string `json:"nameCn"` @@ -861,10 +850,97 @@ type AdminCreateSuspensionRequestSchema struct { } // AdminDescriptionsResponseSchema defines model for adminDescriptionsResponseSchema. -type AdminDescriptionsResponseSchema = interface{} +type AdminDescriptionsResponseSchema struct { + Descriptions []struct { + Content string `json:"content"` + Course *struct { + Code string `json:"code"` + JwId int `json:"jwId"` + NameCn string `json:"nameCn"` + } `json:"course"` + CourseId *int `json:"courseId"` + CreatedAt time.Time `json:"createdAt"` + Homework *struct { + Id string `json:"id"` + Section *struct { + Code *string `json:"code"` + Course *struct { + Code string `json:"code"` + JwId int `json:"jwId"` + NameCn string `json:"nameCn"` + } `json:"course"` + JwId *int `json:"jwId"` + } `json:"section"` + Title string `json:"title"` + } `json:"homework"` + HomeworkId *string `json:"homeworkId"` + Id string `json:"id"` + LastEditedAt *time.Time `json:"lastEditedAt"` + LastEditedBy *struct { + Id string `json:"id"` + Image *string `json:"image"` + Name *string `json:"name"` + Username *string `json:"username"` + } `json:"lastEditedBy"` + LastEditedById *string `json:"lastEditedById"` + Section *struct { + Code *string `json:"code"` + Course *struct { + Code string `json:"code"` + JwId int `json:"jwId"` + NameCn string `json:"nameCn"` + } `json:"course"` + JwId *int `json:"jwId"` + } `json:"section"` + SectionId *int `json:"sectionId"` + Teacher *struct { + Id int `json:"id"` + NameCn string `json:"nameCn"` + } `json:"teacher"` + TeacherId *int `json:"teacherId"` + UpdatedAt time.Time `json:"updatedAt"` + } `json:"descriptions"` +} // AdminHomeworksResponseSchema defines model for adminHomeworksResponseSchema. -type AdminHomeworksResponseSchema = interface{} +type AdminHomeworksResponseSchema struct { + Homeworks []struct { + CreatedAt time.Time `json:"createdAt"` + CreatedBy *struct { + Id string `json:"id"` + Image *string `json:"image"` + Name *string `json:"name"` + Username *string `json:"username"` + } `json:"createdBy"` + DeletedAt *time.Time `json:"deletedAt"` + DeletedBy *struct { + Id string `json:"id"` + Image *string `json:"image"` + Name *string `json:"name"` + Username *string `json:"username"` + } `json:"deletedBy"` + Id string `json:"id"` + Section *struct { + Code *string `json:"code"` + Course struct { + Code string `json:"code"` + JwId int `json:"jwId"` + NameCn string `json:"nameCn"` + } `json:"course"` + Id int `json:"id"` + JwId *int `json:"jwId"` + } `json:"section"` + SubmissionDueAt *time.Time `json:"submissionDueAt"` + Title string `json:"title"` + UpdatedAt time.Time `json:"updatedAt"` + UpdatedBy *struct { + Id string `json:"id"` + Image *string `json:"image"` + Name *string `json:"name"` + Username *string `json:"username"` + } `json:"updatedBy"` + } `json:"homeworks"` +} // AdminModerateCommentRequestSchema defines model for adminModerateCommentRequestSchema. type AdminModerateCommentRequestSchema struct { @@ -984,18 +1060,110 @@ type AdminUsersResponseSchema struct { // BusPreferenceRequestSchema defines model for busPreferenceRequestSchema. type BusPreferenceRequestSchema struct { - FavoriteCampusIds []int `json:"favoriteCampusIds"` - FavoriteRouteIds []int `json:"favoriteRouteIds"` - PreferredDestinationCampusId *int `json:"preferredDestinationCampusId"` - PreferredOriginCampusId *int `json:"preferredOriginCampusId"` - ShowDepartedTrips bool `json:"showDepartedTrips"` + PreferredDestinationCampusId *int `json:"preferredDestinationCampusId"` + PreferredOriginCampusId *int `json:"preferredOriginCampusId"` + ShowDepartedTrips bool `json:"showDepartedTrips"` } // BusPreferenceResponseSchema defines model for busPreferenceResponseSchema. -type BusPreferenceResponseSchema = interface{} +type BusPreferenceResponseSchema struct { + Preference struct { + PreferredDestinationCampusId *int `json:"preferredDestinationCampusId"` + PreferredOriginCampusId *int `json:"preferredOriginCampusId"` + ShowDepartedTrips bool `json:"showDepartedTrips"` + } `json:"preference"` +} // BusQueryResponseSchema defines model for busQueryResponseSchema. -type BusQueryResponseSchema = interface{} +type BusQueryResponseSchema struct { + AvailableVersions []struct { + EffectiveFrom *time.Time `json:"effectiveFrom"` + EffectiveUntil *time.Time `json:"effectiveUntil"` + Id int `json:"id"` + ImportedAt time.Time `json:"importedAt"` + Key string `json:"key"` + Notice *struct { + Message *string `json:"message"` + Url *string `json:"url"` + } `json:"notice"` + Title string `json:"title"` + } `json:"availableVersions"` + Campuses []struct { + Id int `json:"id"` + Latitude float32 `json:"latitude"` + Longitude float32 `json:"longitude"` + NameCn string `json:"nameCn"` + NameEn *string `json:"nameEn"` + NamePrimary string `json:"namePrimary"` + NameSecondary *string `json:"nameSecondary"` + } `json:"campuses"` + FetchedAt time.Time `json:"fetchedAt"` + Locale BusQueryResponseSchemaLocale `json:"locale"` + Notice *struct { + Message *string `json:"message"` + Url *string `json:"url"` + } `json:"notice"` + Preferences *struct { + PreferredDestinationCampusId *int `json:"preferredDestinationCampusId"` + PreferredOriginCampusId *int `json:"preferredOriginCampusId"` + ShowDepartedTrips bool `json:"showDepartedTrips"` + } `json:"preferences"` + Routes []struct { + DescriptionPrimary string `json:"descriptionPrimary"` + DescriptionSecondary *string `json:"descriptionSecondary"` + Id int `json:"id"` + NameCn string `json:"nameCn"` + NameEn *string `json:"nameEn"` + Stops []struct { + Campus struct { + Id int `json:"id"` + Latitude float32 `json:"latitude"` + Longitude float32 `json:"longitude"` + NameCn string `json:"nameCn"` + NameEn *string `json:"nameEn"` + NamePrimary string `json:"namePrimary"` + NameSecondary *string `json:"nameSecondary"` + } `json:"campus"` + StopOrder int `json:"stopOrder"` + } `json:"stops"` + } `json:"routes"` + Trips []struct { + ArrivalMinutes *int `json:"arrivalMinutes"` + ArrivalTime *string `json:"arrivalTime"` + DayType BusQueryResponseSchemaTripsDayType `json:"dayType"` + DepartureMinutes *int `json:"departureMinutes"` + DepartureTime *string `json:"departureTime"` + Id int `json:"id"` + Position int `json:"position"` + RouteId int `json:"routeId"` + StopTimes []struct { + CampusId int `json:"campusId"` + CampusName string `json:"campusName"` + IsPassThrough bool `json:"isPassThrough"` + MinutesSinceMidnight *int `json:"minutesSinceMidnight"` + StopOrder int `json:"stopOrder"` + Time *string `json:"time"` + } `json:"stopTimes"` + } `json:"trips"` + Version *struct { + EffectiveFrom *time.Time `json:"effectiveFrom"` + EffectiveUntil *time.Time `json:"effectiveUntil"` + Id int `json:"id"` + ImportedAt time.Time `json:"importedAt"` + Key string `json:"key"` + Notice *struct { + Message *string `json:"message"` + Url *string `json:"url"` + } `json:"notice"` + Title string `json:"title"` + } `json:"version"` +} + +// BusQueryResponseSchemaLocale defines model for BusQueryResponseSchema.Locale. +type BusQueryResponseSchemaLocale string + +// BusQueryResponseSchemaTripsDayType defines model for BusQueryResponseSchema.Trips.DayType. +type BusQueryResponseSchemaTripsDayType string // CalendarSubscriptionCreateRequestSchema defines model for calendarSubscriptionCreateRequestSchema. type CalendarSubscriptionCreateRequestSchema struct { @@ -1848,33 +2016,25 @@ type DescriptionUpsertResponseSchema struct { // DescriptionsResponseSchema defines model for descriptionsResponseSchema. type DescriptionsResponseSchema struct { Description struct { - Content string `json:"content"` - CourseId *int `json:"courseId"` - CreatedAt interface{} `json:"createdAt"` - HomeworkId *string `json:"homeworkId"` - Id *string `json:"id"` - LastEditedAt *time.Time `json:"lastEditedAt"` + Content string `json:"content"` + Id *string `json:"id"` + LastEditedAt *time.Time `json:"lastEditedAt"` LastEditedBy *struct { Id string `json:"id"` Image *string `json:"image"` Name *string `json:"name"` Username *string `json:"username"` } `json:"lastEditedBy"` - LastEditedById *string `json:"lastEditedById"` - SectionId *int `json:"sectionId"` - TeacherId *int `json:"teacherId"` - UpdatedAt *time.Time `json:"updatedAt"` + UpdatedAt time.Time `json:"updatedAt"` } `json:"description"` History []struct { - CreatedAt time.Time `json:"createdAt"` - DescriptionId string `json:"descriptionId"` - Editor *struct { + CreatedAt time.Time `json:"createdAt"` + Editor *struct { Id string `json:"id"` Image *string `json:"image"` Name *string `json:"name"` Username *string `json:"username"` } `json:"editor"` - EditorId *string `json:"editorId"` Id string `json:"id"` NextContent string `json:"nextContent"` PreviousContent *string `json:"previousContent"` @@ -3394,7 +3554,7 @@ type UploadsListResponseSchema struct { // ListAdminCommentsParams defines parameters for ListAdminComments. type ListAdminCommentsParams struct { Status *ListAdminCommentsParamsStatus `form:"status,omitempty" json:"status,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // ListAdminCommentsParamsStatus defines parameters for ListAdminComments. @@ -3405,7 +3565,7 @@ type ListAdminDescriptionsParams struct { TargetType *ListAdminDescriptionsParamsTargetType `form:"targetType,omitempty" json:"targetType,omitempty"` HasContent *ListAdminDescriptionsParamsHasContent `form:"hasContent,omitempty" json:"hasContent,omitempty"` Search *string `form:"search,omitempty" json:"search,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // ListAdminDescriptionsParamsTargetType defines parameters for ListAdminDescriptions. @@ -3418,7 +3578,7 @@ type ListAdminDescriptionsParamsHasContent string type ListAdminHomeworksParams struct { Status *ListAdminHomeworksParamsStatus `form:"status,omitempty" json:"status,omitempty"` Search *string `form:"search,omitempty" json:"search,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // ListAdminHomeworksParamsStatus defines parameters for ListAdminHomeworks. @@ -3427,39 +3587,21 @@ type ListAdminHomeworksParamsStatus string // ListAdminUsersParams defines parameters for ListAdminUsers. type ListAdminUsersParams struct { Search *string `form:"search,omitempty" json:"search,omitempty"` - Page *string `form:"page,omitempty" json:"page,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // QueryBusParams defines parameters for QueryBus. type QueryBusParams struct { - Now *time.Time `form:"now,omitempty" json:"now,omitempty"` - DayType *QueryBusParamsDayType `form:"dayType,omitempty" json:"dayType,omitempty"` - OriginCampusId *string `form:"originCampusId,omitempty" json:"originCampusId,omitempty"` - DestinationCampusId *string `form:"destinationCampusId,omitempty" json:"destinationCampusId,omitempty"` - FavoriteRouteIds *string `form:"favoriteRouteIds,omitempty" json:"favoriteRouteIds,omitempty"` - FavoriteCampusIds *string `form:"favoriteCampusIds,omitempty" json:"favoriteCampusIds,omitempty"` - ShowDepartedTrips *QueryBusParamsShowDepartedTrips `form:"showDepartedTrips,omitempty" json:"showDepartedTrips,omitempty"` - IncludeAllTrips *QueryBusParamsIncludeAllTrips `form:"includeAllTrips,omitempty" json:"includeAllTrips,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` - VersionKey *string `form:"versionKey,omitempty" json:"versionKey,omitempty"` + VersionKey *string `form:"versionKey,omitempty" json:"versionKey,omitempty"` } -// QueryBusParamsDayType defines parameters for QueryBus. -type QueryBusParamsDayType string - -// QueryBusParamsShowDepartedTrips defines parameters for QueryBus. -type QueryBusParamsShowDepartedTrips string - -// QueryBusParamsIncludeAllTrips defines parameters for QueryBus. -type QueryBusParamsIncludeAllTrips string - // ListCommentsParams defines parameters for ListComments. type ListCommentsParams struct { TargetType ListCommentsParamsTargetType `form:"targetType" json:"targetType"` TargetId *string `form:"targetId,omitempty" json:"targetId,omitempty"` - SectionId *string `form:"sectionId,omitempty" json:"sectionId,omitempty"` - TeacherId *string `form:"teacherId,omitempty" json:"teacherId,omitempty"` + SectionId *int64 `form:"sectionId,omitempty" json:"sectionId,omitempty"` + TeacherId *int64 `form:"teacherId,omitempty" json:"teacherId,omitempty"` } // ListCommentsParamsTargetType defines parameters for ListComments. @@ -3469,8 +3611,8 @@ type ListCommentsParamsTargetType string type CreateCommentParams struct { TargetType CreateCommentParamsTargetType `form:"targetType" json:"targetType"` TargetId *string `form:"targetId,omitempty" json:"targetId,omitempty"` - SectionId *string `form:"sectionId,omitempty" json:"sectionId,omitempty"` - TeacherId *string `form:"teacherId,omitempty" json:"teacherId,omitempty"` + SectionId *int64 `form:"sectionId,omitempty" json:"sectionId,omitempty"` + TeacherId *int64 `form:"teacherId,omitempty" json:"teacherId,omitempty"` } // CreateCommentParamsTargetType defines parameters for CreateComment. @@ -3487,11 +3629,11 @@ type RemoveCommentReactionParamsType string // ListCoursesParams defines parameters for ListCourses. type ListCoursesParams struct { Search *string `form:"search,omitempty" json:"search,omitempty"` - EducationLevelId *string `form:"educationLevelId,omitempty" json:"educationLevelId,omitempty"` - CategoryId *string `form:"categoryId,omitempty" json:"categoryId,omitempty"` - ClassTypeId *string `form:"classTypeId,omitempty" json:"classTypeId,omitempty"` - Page *string `form:"page,omitempty" json:"page,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` + EducationLevelId *int64 `form:"educationLevelId,omitempty" json:"educationLevelId,omitempty"` + CategoryId *int64 `form:"categoryId,omitempty" json:"categoryId,omitempty"` + ClassTypeId *int64 `form:"classTypeId,omitempty" json:"classTypeId,omitempty"` + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // VisitDashboardLinkParams defines parameters for VisitDashboardLink. @@ -3524,7 +3666,7 @@ type UpsertDescriptionParamsTargetType string // ListHomeworksParams defines parameters for ListHomeworks. type ListHomeworksParams struct { - SectionId *string `form:"sectionId,omitempty" json:"sectionId,omitempty"` + SectionId *int64 `form:"sectionId,omitempty" json:"sectionId,omitempty"` SectionIds *string `form:"sectionIds,omitempty" json:"sectionIds,omitempty"` IncludeDeleted *ListHomeworksParamsIncludeDeleted `form:"includeDeleted,omitempty" json:"includeDeleted,omitempty"` } @@ -3534,7 +3676,7 @@ type ListHomeworksParamsIncludeDeleted string // CreateHomeworkParams defines parameters for CreateHomework. type CreateHomeworkParams struct { - SectionId *string `form:"sectionId,omitempty" json:"sectionId,omitempty"` + SectionId *int64 `form:"sectionId,omitempty" json:"sectionId,omitempty"` SectionIds *string `form:"sectionIds,omitempty" json:"sectionIds,omitempty"` IncludeDeleted *CreateHomeworkParamsIncludeDeleted `form:"includeDeleted,omitempty" json:"includeDeleted,omitempty"` } @@ -3544,27 +3686,35 @@ type CreateHomeworkParamsIncludeDeleted string // ListSchedulesParams defines parameters for ListSchedules. type ListSchedulesParams struct { - SectionId *string `form:"sectionId,omitempty" json:"sectionId,omitempty"` - TeacherId *string `form:"teacherId,omitempty" json:"teacherId,omitempty"` - RoomId *string `form:"roomId,omitempty" json:"roomId,omitempty"` - Weekday *string `form:"weekday,omitempty" json:"weekday,omitempty"` - DateFrom *time.Time `form:"dateFrom,omitempty" json:"dateFrom,omitempty"` - DateTo *time.Time `form:"dateTo,omitempty" json:"dateTo,omitempty"` - Page *string `form:"page,omitempty" json:"page,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` + SectionId *int64 `form:"sectionId,omitempty" json:"sectionId,omitempty"` + SectionJwId *int64 `form:"sectionJwId,omitempty" json:"sectionJwId,omitempty"` + SectionCode *string `form:"sectionCode,omitempty" json:"sectionCode,omitempty"` + TeacherId *int64 `form:"teacherId,omitempty" json:"teacherId,omitempty"` + TeacherCode *string `form:"teacherCode,omitempty" json:"teacherCode,omitempty"` + RoomId *int64 `form:"roomId,omitempty" json:"roomId,omitempty"` + RoomJwId *int64 `form:"roomJwId,omitempty" json:"roomJwId,omitempty"` + Weekday *int64 `form:"weekday,omitempty" json:"weekday,omitempty"` + DateFrom *time.Time `form:"dateFrom,omitempty" json:"dateFrom,omitempty"` + DateTo *time.Time `form:"dateTo,omitempty" json:"dateTo,omitempty"` + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // ListSectionsParams defines parameters for ListSections. type ListSectionsParams struct { - CourseId *string `form:"courseId,omitempty" json:"courseId,omitempty"` - SemesterId *string `form:"semesterId,omitempty" json:"semesterId,omitempty"` - CampusId *string `form:"campusId,omitempty" json:"campusId,omitempty"` - DepartmentId *string `form:"departmentId,omitempty" json:"departmentId,omitempty"` - TeacherId *string `form:"teacherId,omitempty" json:"teacherId,omitempty"` + CourseId *int64 `form:"courseId,omitempty" json:"courseId,omitempty"` + CourseJwId *int64 `form:"courseJwId,omitempty" json:"courseJwId,omitempty"` + SemesterId *int64 `form:"semesterId,omitempty" json:"semesterId,omitempty"` + SemesterJwId *int64 `form:"semesterJwId,omitempty" json:"semesterJwId,omitempty"` + CampusId *int64 `form:"campusId,omitempty" json:"campusId,omitempty"` + DepartmentId *int64 `form:"departmentId,omitempty" json:"departmentId,omitempty"` + TeacherId *int64 `form:"teacherId,omitempty" json:"teacherId,omitempty"` + TeacherCode *string `form:"teacherCode,omitempty" json:"teacherCode,omitempty"` Search *string `form:"search,omitempty" json:"search,omitempty"` Ids *string `form:"ids,omitempty" json:"ids,omitempty"` - Page *string `form:"page,omitempty" json:"page,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` + JwIds *string `form:"jwIds,omitempty" json:"jwIds,omitempty"` + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // GetSectionsCalendarParams defines parameters for GetSectionsCalendar. @@ -3574,16 +3724,16 @@ type GetSectionsCalendarParams struct { // ListSemestersParams defines parameters for ListSemesters. type ListSemestersParams struct { - Page *string `form:"page,omitempty" json:"page,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // ListTeachersParams defines parameters for ListTeachers. type ListTeachersParams struct { - DepartmentId *string `form:"departmentId,omitempty" json:"departmentId,omitempty"` + DepartmentId *int64 `form:"departmentId,omitempty" json:"departmentId,omitempty"` Search *string `form:"search,omitempty" json:"search,omitempty"` - Page *string `form:"page,omitempty" json:"page,omitempty"` - Limit *string `form:"limit,omitempty" json:"limit,omitempty"` + Page *int64 `form:"page,omitempty" json:"page,omitempty"` + Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // ListTodosParams defines parameters for ListTodos. @@ -3689,8 +3839,8 @@ type CompleteUploadJSONRequestBody = UploadCompleteRequestSchema // DeleteUploadJSONRequestBody defines body for DeleteUpload for application/json ContentType. type DeleteUploadJSONRequestBody = UploadRenameRequestSchema -// RenameUploadJSONRequestBody defines body for RenameUpload for application/json ContentType. -type RenameUploadJSONRequestBody = UploadRenameRequestSchema +// UpdateUploadJSONRequestBody defines body for UpdateUpload for application/json ContentType. +type UpdateUploadJSONRequestBody = UploadRenameRequestSchema // RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error @@ -3855,7 +4005,7 @@ type ClientInterface interface { ListCourses(ctx context.Context, params *ListCoursesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetCourse request - GetCourse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetCourse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) // PinDashboardLinkWithBody request with any body PinDashboardLinkWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -3933,16 +4083,16 @@ type ClientInterface interface { MatchSectionCodes(ctx context.Context, body MatchSectionCodesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSection request - GetSection(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetSection(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSectionCalendar request - GetSectionCalendar(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetSectionCalendar(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSectionScheduleGroups request - GetSectionScheduleGroups(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetSectionScheduleGroups(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSectionSchedules request - GetSectionSchedules(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetSectionSchedules(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) // ListSemesters request ListSemesters(ctx context.Context, params *ListSemestersParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -3992,10 +4142,10 @@ type ClientInterface interface { DeleteUpload(ctx context.Context, id string, body DeleteUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // RenameUploadWithBody request with any body - RenameUploadWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // UpdateUploadWithBody request with any body + UpdateUploadWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - RenameUpload(ctx context.Context, id string, body RenameUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateUpload(ctx context.Context, id string, body UpdateUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DownloadUpload request DownloadUpload(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -4400,7 +4550,7 @@ func (c *Client) ListCourses(ctx context.Context, params *ListCoursesParams, req return c.Client.Do(req) } -func (c *Client) GetCourse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) GetCourse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetCourseRequest(c.Server, jwId) if err != nil { return nil, err @@ -4748,7 +4898,7 @@ func (c *Client) MatchSectionCodes(ctx context.Context, body MatchSectionCodesJS return c.Client.Do(req) } -func (c *Client) GetSection(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) GetSection(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSectionRequest(c.Server, jwId) if err != nil { return nil, err @@ -4760,7 +4910,7 @@ func (c *Client) GetSection(ctx context.Context, jwId string, reqEditors ...Requ return c.Client.Do(req) } -func (c *Client) GetSectionCalendar(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) GetSectionCalendar(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSectionCalendarRequest(c.Server, jwId) if err != nil { return nil, err @@ -4772,7 +4922,7 @@ func (c *Client) GetSectionCalendar(ctx context.Context, jwId string, reqEditors return c.Client.Do(req) } -func (c *Client) GetSectionScheduleGroups(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) GetSectionScheduleGroups(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSectionScheduleGroupsRequest(c.Server, jwId) if err != nil { return nil, err @@ -4784,7 +4934,7 @@ func (c *Client) GetSectionScheduleGroups(ctx context.Context, jwId string, reqE return c.Client.Do(req) } -func (c *Client) GetSectionSchedules(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) GetSectionSchedules(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSectionSchedulesRequest(c.Server, jwId) if err != nil { return nil, err @@ -5012,8 +5162,8 @@ func (c *Client) DeleteUpload(ctx context.Context, id string, body DeleteUploadJ return c.Client.Do(req) } -func (c *Client) RenameUploadWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRenameUploadRequestWithBody(c.Server, id, contentType, body) +func (c *Client) UpdateUploadWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateUploadRequestWithBody(c.Server, id, contentType, body) if err != nil { return nil, err } @@ -5024,8 +5174,8 @@ func (c *Client) RenameUploadWithBody(ctx context.Context, id string, contentTyp return c.Client.Do(req) } -func (c *Client) RenameUpload(ctx context.Context, id string, body RenameUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRenameUploadRequest(c.Server, id, body) +func (c *Client) UpdateUpload(ctx context.Context, id string, body UpdateUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateUploadRequest(c.Server, id, body) if err != nil { return nil, err } @@ -5100,7 +5250,7 @@ func NewListAdminCommentsRequest(server string, params *ListAdminCommentsParams) if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -5244,7 +5394,7 @@ func NewListAdminDescriptionsRequest(server string, params *ListAdminDescription if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -5325,7 +5475,7 @@ func NewListAdminHomeworksRequest(server string, params *ListAdminHomeworksParam if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -5525,7 +5675,7 @@ func NewListAdminUsersRequest(server string, params *ListAdminUsersParams) (*htt if params.Page != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -5541,7 +5691,7 @@ func NewListAdminUsersRequest(server string, params *ListAdminUsersParams) (*htt if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -5635,150 +5785,6 @@ func NewQueryBusRequest(server string, params *QueryBusParams) (*http.Request, e if params != nil { queryValues := queryURL.Query() - if params.Now != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "now", *params.Now, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); 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.DayType != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "dayType", *params.DayType, 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.OriginCampusId != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "originCampusId", *params.OriginCampusId, 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.DestinationCampusId != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "destinationCampusId", *params.DestinationCampusId, 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.FavoriteRouteIds != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "favoriteRouteIds", *params.FavoriteRouteIds, 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.FavoriteCampusIds != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "favoriteCampusIds", *params.FavoriteCampusIds, 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.ShowDepartedTrips != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "showDepartedTrips", *params.ShowDepartedTrips, 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.IncludeAllTrips != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeAllTrips", *params.IncludeAllTrips, 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.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, 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.VersionKey != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "versionKey", *params.VersionKey, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { @@ -5992,7 +5998,7 @@ func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Re if params.SectionId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionId", *params.SectionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != 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 @@ -6008,7 +6014,7 @@ 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: "string", Format: ""}); err != 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 @@ -6096,7 +6102,7 @@ func NewCreateCommentRequestWithBody(server string, params *CreateCommentParams, if params.SectionId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionId", *params.SectionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != 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 @@ -6112,7 +6118,7 @@ func NewCreateCommentRequestWithBody(server string, params *CreateCommentParams, if params.TeacherId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "teacherId", *params.TeacherId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != 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 @@ -6419,7 +6425,7 @@ func NewListCoursesRequest(server string, params *ListCoursesParams) (*http.Requ if params.EducationLevelId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "educationLevelId", *params.EducationLevelId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "educationLevelId", *params.EducationLevelId, 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 @@ -6435,7 +6441,7 @@ func NewListCoursesRequest(server string, params *ListCoursesParams) (*http.Requ if params.CategoryId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "categoryId", *params.CategoryId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "categoryId", *params.CategoryId, 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 @@ -6451,7 +6457,7 @@ func NewListCoursesRequest(server string, params *ListCoursesParams) (*http.Requ if params.ClassTypeId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "classTypeId", *params.ClassTypeId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "classTypeId", *params.ClassTypeId, 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 @@ -6467,7 +6473,7 @@ func NewListCoursesRequest(server string, params *ListCoursesParams) (*http.Requ if params.Page != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -6483,7 +6489,7 @@ func NewListCoursesRequest(server string, params *ListCoursesParams) (*http.Requ if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -6509,12 +6515,12 @@ func NewListCoursesRequest(server string, params *ListCoursesParams) (*http.Requ } // NewGetCourseRequest generates requests for GetCourse -func NewGetCourseRequest(server string, jwId string) (*http.Request, error) { +func NewGetCourseRequest(server string, jwId int64) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: "int64"}) if err != nil { return nil, err } @@ -6836,7 +6842,7 @@ func NewListHomeworksRequest(server string, params *ListHomeworksParams) (*http. if params.SectionId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionId", *params.SectionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != 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 @@ -6928,7 +6934,7 @@ func NewCreateHomeworkRequestWithBody(server string, params *CreateHomeworkParam if params.SectionId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionId", *params.SectionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != 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 @@ -7300,7 +7306,39 @@ func NewListSchedulesRequest(server string, params *ListSchedulesParams) (*http. if params.SectionId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionId", *params.SectionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != 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.SectionCode != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionCode", *params.SectionCode, 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 @@ -7316,7 +7354,23 @@ func NewListSchedulesRequest(server string, params *ListSchedulesParams) (*http. if params.TeacherId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "teacherId", *params.TeacherId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != 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.TeacherCode != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "teacherCode", *params.TeacherCode, 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 @@ -7332,7 +7386,23 @@ func NewListSchedulesRequest(server string, params *ListSchedulesParams) (*http. if params.RoomId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "roomId", *params.RoomId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "roomId", *params.RoomId, 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.RoomJwId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "roomJwId", *params.RoomJwId, 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 @@ -7348,7 +7418,7 @@ func NewListSchedulesRequest(server string, params *ListSchedulesParams) (*http. if params.Weekday != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "weekday", *params.Weekday, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "weekday", *params.Weekday, 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 @@ -7396,7 +7466,7 @@ func NewListSchedulesRequest(server string, params *ListSchedulesParams) (*http. if params.Page != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -7412,7 +7482,7 @@ func NewListSchedulesRequest(server string, params *ListSchedulesParams) (*http. if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -7461,7 +7531,23 @@ func NewListSectionsRequest(server string, params *ListSectionsParams) (*http.Re if params.CourseId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "courseId", *params.CourseId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "courseId", *params.CourseId, 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 @@ -7477,7 +7563,23 @@ func NewListSectionsRequest(server string, params *ListSectionsParams) (*http.Re if params.SemesterId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "semesterId", *params.SemesterId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "semesterId", *params.SemesterId, 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.SemesterJwId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "semesterJwId", *params.SemesterJwId, 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 @@ -7493,7 +7595,7 @@ func NewListSectionsRequest(server string, params *ListSectionsParams) (*http.Re if params.CampusId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "campusId", *params.CampusId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "campusId", *params.CampusId, 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 @@ -7509,7 +7611,7 @@ func NewListSectionsRequest(server string, params *ListSectionsParams) (*http.Re if params.DepartmentId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "departmentId", *params.DepartmentId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "departmentId", *params.DepartmentId, 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 @@ -7525,7 +7627,23 @@ func NewListSectionsRequest(server string, params *ListSectionsParams) (*http.Re if params.TeacherId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "teacherId", *params.TeacherId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != 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.TeacherCode != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "teacherCode", *params.TeacherCode, 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 @@ -7571,9 +7689,25 @@ func NewListSectionsRequest(server string, params *ListSectionsParams) (*http.Re } + if params.JwIds != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "jwIds", *params.JwIds, 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: "string", Format: ""}); 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 @@ -7589,7 +7723,7 @@ func NewListSectionsRequest(server string, params *ListSectionsParams) (*http.Re if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -7700,12 +7834,12 @@ func NewMatchSectionCodesRequestWithBody(server string, contentType string, body } // NewGetSectionRequest generates requests for GetSection -func NewGetSectionRequest(server string, jwId string) (*http.Request, error) { +func NewGetSectionRequest(server string, jwId int64) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: "int64"}) if err != nil { return nil, err } @@ -7734,12 +7868,12 @@ func NewGetSectionRequest(server string, jwId string) (*http.Request, error) { } // NewGetSectionCalendarRequest generates requests for GetSectionCalendar -func NewGetSectionCalendarRequest(server string, jwId string) (*http.Request, error) { +func NewGetSectionCalendarRequest(server string, jwId int64) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: "int64"}) if err != nil { return nil, err } @@ -7768,12 +7902,12 @@ func NewGetSectionCalendarRequest(server string, jwId string) (*http.Request, er } // NewGetSectionScheduleGroupsRequest generates requests for GetSectionScheduleGroups -func NewGetSectionScheduleGroupsRequest(server string, jwId string) (*http.Request, error) { +func NewGetSectionScheduleGroupsRequest(server string, jwId int64) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: "int64"}) if err != nil { return nil, err } @@ -7802,12 +7936,12 @@ func NewGetSectionScheduleGroupsRequest(server string, jwId string) (*http.Reque } // NewGetSectionSchedulesRequest generates requests for GetSectionSchedules -func NewGetSectionSchedulesRequest(server string, jwId string) (*http.Request, error) { +func NewGetSectionSchedulesRequest(server string, jwId int64) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "jwId", jwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: "int64"}) if err != nil { return nil, err } @@ -7859,7 +7993,7 @@ func NewListSemestersRequest(server string, params *ListSemestersParams) (*http. if params.Page != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -7875,7 +8009,7 @@ func NewListSemestersRequest(server string, params *ListSemestersParams) (*http. if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -7951,7 +8085,7 @@ func NewListTeachersRequest(server string, params *ListTeachersParams) (*http.Re if params.DepartmentId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "departmentId", *params.DepartmentId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "departmentId", *params.DepartmentId, 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 @@ -7983,7 +8117,7 @@ func NewListTeachersRequest(server string, params *ListTeachersParams) (*http.Re if params.Page != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -7999,7 +8133,7 @@ func NewListTeachersRequest(server string, params *ListTeachersParams) (*http.Re if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); 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 @@ -8513,19 +8647,19 @@ func NewDeleteUploadRequestWithBody(server string, id string, contentType string return req, nil } -// NewRenameUploadRequest calls the generic RenameUpload builder with application/json body -func NewRenameUploadRequest(server string, id string, body RenameUploadJSONRequestBody) (*http.Request, error) { +// NewUpdateUploadRequest calls the generic UpdateUpload builder with application/json body +func NewUpdateUploadRequest(server string, id string, body UpdateUploadJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewRenameUploadRequestWithBody(server, id, "application/json", bodyReader) + return NewUpdateUploadRequestWithBody(server, id, "application/json", bodyReader) } -// NewRenameUploadRequestWithBody generates requests for RenameUpload with any type of body -func NewRenameUploadRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateUploadRequestWithBody generates requests for UpdateUpload with any type of body +func NewUpdateUploadRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -8761,7 +8895,7 @@ type ClientWithResponsesInterface interface { ListCoursesWithResponse(ctx context.Context, params *ListCoursesParams, reqEditors ...RequestEditorFn) (*ListCoursesResponse, error) // GetCourseWithResponse request - GetCourseWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetCourseResponse, error) + GetCourseWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetCourseResponse, error) // PinDashboardLinkWithBodyWithResponse request with any body PinDashboardLinkWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PinDashboardLinkResponse, error) @@ -8839,16 +8973,16 @@ type ClientWithResponsesInterface interface { MatchSectionCodesWithResponse(ctx context.Context, body MatchSectionCodesJSONRequestBody, reqEditors ...RequestEditorFn) (*MatchSectionCodesResponse, error) // GetSectionWithResponse request - GetSectionWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetSectionResponse, error) + GetSectionWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetSectionResponse, error) // GetSectionCalendarWithResponse request - GetSectionCalendarWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetSectionCalendarResponse, error) + GetSectionCalendarWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetSectionCalendarResponse, error) // GetSectionScheduleGroupsWithResponse request - GetSectionScheduleGroupsWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetSectionScheduleGroupsResponse, error) + GetSectionScheduleGroupsWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetSectionScheduleGroupsResponse, error) // GetSectionSchedulesWithResponse request - GetSectionSchedulesWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetSectionSchedulesResponse, error) + GetSectionSchedulesWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetSectionSchedulesResponse, error) // ListSemestersWithResponse request ListSemestersWithResponse(ctx context.Context, params *ListSemestersParams, reqEditors ...RequestEditorFn) (*ListSemestersResponse, error) @@ -8898,10 +9032,10 @@ type ClientWithResponsesInterface interface { DeleteUploadWithResponse(ctx context.Context, id string, body DeleteUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteUploadResponse, error) - // RenameUploadWithBodyWithResponse request with any body - RenameUploadWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameUploadResponse, error) + // UpdateUploadWithBodyWithResponse request with any body + UpdateUploadWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUploadResponse, error) - RenameUploadWithResponse(ctx context.Context, id string, body RenameUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameUploadResponse, error) + UpdateUploadWithResponse(ctx context.Context, id string, body UpdateUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUploadResponse, error) // DownloadUploadWithResponse request DownloadUploadWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DownloadUploadResponse, error) @@ -10261,7 +10395,7 @@ func (r DeleteUploadResponse) StatusCode() int { return 0 } -type RenameUploadResponse struct { +type UpdateUploadResponse struct { Body []byte HTTPResponse *http.Response JSON200 *UploadRenameResponseSchema @@ -10271,7 +10405,7 @@ type RenameUploadResponse struct { } // Status returns HTTPResponse.Status -func (r RenameUploadResponse) Status() string { +func (r UpdateUploadResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10279,7 +10413,7 @@ func (r RenameUploadResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r RenameUploadResponse) StatusCode() int { +func (r UpdateUploadResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -10621,7 +10755,7 @@ func (c *ClientWithResponses) ListCoursesWithResponse(ctx context.Context, param } // GetCourseWithResponse request returning *GetCourseResponse -func (c *ClientWithResponses) GetCourseWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetCourseResponse, error) { +func (c *ClientWithResponses) GetCourseWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetCourseResponse, error) { rsp, err := c.GetCourse(ctx, jwId, reqEditors...) if err != nil { return nil, err @@ -10873,7 +11007,7 @@ func (c *ClientWithResponses) MatchSectionCodesWithResponse(ctx context.Context, } // GetSectionWithResponse request returning *GetSectionResponse -func (c *ClientWithResponses) GetSectionWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetSectionResponse, error) { +func (c *ClientWithResponses) GetSectionWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetSectionResponse, error) { rsp, err := c.GetSection(ctx, jwId, reqEditors...) if err != nil { return nil, err @@ -10882,7 +11016,7 @@ func (c *ClientWithResponses) GetSectionWithResponse(ctx context.Context, jwId s } // GetSectionCalendarWithResponse request returning *GetSectionCalendarResponse -func (c *ClientWithResponses) GetSectionCalendarWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetSectionCalendarResponse, error) { +func (c *ClientWithResponses) GetSectionCalendarWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetSectionCalendarResponse, error) { rsp, err := c.GetSectionCalendar(ctx, jwId, reqEditors...) if err != nil { return nil, err @@ -10891,7 +11025,7 @@ func (c *ClientWithResponses) GetSectionCalendarWithResponse(ctx context.Context } // GetSectionScheduleGroupsWithResponse request returning *GetSectionScheduleGroupsResponse -func (c *ClientWithResponses) GetSectionScheduleGroupsWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetSectionScheduleGroupsResponse, error) { +func (c *ClientWithResponses) GetSectionScheduleGroupsWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetSectionScheduleGroupsResponse, error) { rsp, err := c.GetSectionScheduleGroups(ctx, jwId, reqEditors...) if err != nil { return nil, err @@ -10900,7 +11034,7 @@ func (c *ClientWithResponses) GetSectionScheduleGroupsWithResponse(ctx context.C } // GetSectionSchedulesWithResponse request returning *GetSectionSchedulesResponse -func (c *ClientWithResponses) GetSectionSchedulesWithResponse(ctx context.Context, jwId string, reqEditors ...RequestEditorFn) (*GetSectionSchedulesResponse, error) { +func (c *ClientWithResponses) GetSectionSchedulesWithResponse(ctx context.Context, jwId int64, reqEditors ...RequestEditorFn) (*GetSectionSchedulesResponse, error) { rsp, err := c.GetSectionSchedules(ctx, jwId, reqEditors...) if err != nil { return nil, err @@ -11064,21 +11198,21 @@ func (c *ClientWithResponses) DeleteUploadWithResponse(ctx context.Context, id s return ParseDeleteUploadResponse(rsp) } -// RenameUploadWithBodyWithResponse request with arbitrary body returning *RenameUploadResponse -func (c *ClientWithResponses) RenameUploadWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameUploadResponse, error) { - rsp, err := c.RenameUploadWithBody(ctx, id, contentType, body, reqEditors...) +// 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 ParseRenameUploadResponse(rsp) + return ParseUpdateUploadResponse(rsp) } -func (c *ClientWithResponses) RenameUploadWithResponse(ctx context.Context, id string, body RenameUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameUploadResponse, error) { - rsp, err := c.RenameUpload(ctx, id, body, 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 ParseRenameUploadResponse(rsp) + return ParseUpdateUploadResponse(rsp) } // DownloadUploadWithResponse request returning *DownloadUploadResponse @@ -12995,15 +13129,15 @@ func ParseDeleteUploadResponse(rsp *http.Response) (*DeleteUploadResponse, error return response, nil } -// ParseRenameUploadResponse parses an HTTP response from a RenameUploadWithResponse call -func ParseRenameUploadResponse(rsp *http.Response) (*RenameUploadResponse, 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 := &RenameUploadResponse{ + response := &UpdateUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, }