From f0ce0602fa1241f50a53be9b19c7f714abfb2226 Mon Sep 17 00:00:00 2001 From: tiankaima <91816094+tiankaima@users.noreply.github.com> Date: Tue, 1 Sep 2026 09:30:13 +0000 Subject: [PATCH] chore: sync OpenAPI contract --- api/openapi.json | 2680 ++++++++++++++++++++++---- api/openapi.provenance.json | 4 +- internal/cmd/apicmd/api_paths_gen.go | 7 + internal/openapi/client.gen.go | 1033 +++++++++- 4 files changed, 3280 insertions(+), 444 deletions(-) diff --git a/api/openapi.json b/api/openapi.json index c8a7243..9261802 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -84,6 +84,10 @@ "name": "catalog.teachers", "description": "catalog.teachers operations" }, + { + "name": "catalog.weather", + "description": "catalog.weather operations" + }, { "name": "community.comments", "description": "community.comments operations" @@ -148,7 +152,8 @@ "catalog.schedule", "catalog.section", "catalog.semesters", - "catalog.teachers" + "catalog.teachers", + "catalog.weather" ] }, { @@ -537,6 +542,87 @@ } } }, + "/api/publications": { + "get": { + "operationId": "get-api-publications", + "summary": "List public USTC news and notices", + "tags": [ + "Api" + ], + "parameters": [ + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "news", + "notice" + ] + } + }, + { + "in": "query", + "name": "source", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^[a-z0-9][a-z0-9._-]*$" + } + }, + { + "in": "query", + "name": "query", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 200 + } + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 50 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicPublicationsResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, "/api/search": { "get": { "operationId": "get-api-search", @@ -2053,6 +2139,51 @@ } } }, + "/api/catalog/weather": { + "get": { + "operationId": "catalog_weather_get", + "summary": "Query weather for a USTC campus", + "tags": [ + "catalog.weather" + ], + "parameters": [ + { + "in": "query", + "name": "locationKey", + "schema": { + "default": "ustc-main", + "type": "string", + "enum": [ + "ustc-main", + "ustc-gaoxin" + ] + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/weatherSnapshotResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, "/api/community/comments": { "get": { "operationId": "listComments", @@ -2754,6 +2885,59 @@ } } }, + "/api/publications/{id}": { + "get": { + "operationId": "get-api-publications-id", + "summary": "Get one public USTC news item or notice", + "tags": [ + "Api" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicPublicationDetailSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, "/api/workspace/bus-preferences": { "get": { "operationId": "workspace_bus_preferences_get", @@ -4988,7 +5172,8 @@ "enum": [ "auto", "weekday", - "weekend" + "saturday", + "sunday" ] } }, @@ -6322,96 +6507,15 @@ } } }, - "/api/mcp/.well-known/oauth-authorization-server": { - "get": { - "operationId": "get-api-mcp-.well-known-oauth-authorization-server", - "summary": "MCP resource-relative authorization server metadata compatibility alias", - "tags": [ - "Api" - ], - "responses": { - "307": { - "description": "Redirect", - "headers": { - "Location": { - "schema": { - "type": "string", - "format": "uri" - } - } - } - } - } - }, - "options": { - "operationId": "options-api-mcp-.well-known-oauth-authorization-server", - "summary": "MCP resource-relative authorization server metadata compatibility alias", - "tags": [ - "Api" - ], - "responses": { - "307": { - "description": "Redirect", - "headers": { - "Location": { - "schema": { - "type": "string", - "format": "uri" - } - } - } - } - } - } - }, - "/api/mcp/.well-known/openid-configuration": { - "get": { - "operationId": "get-api-mcp-.well-known-openid-configuration", - "summary": "MCP resource-relative OpenID discovery compatibility alias", - "tags": [ - "Api" - ], - "responses": { - "307": { - "description": "Redirect", - "headers": { - "Location": { - "schema": { - "type": "string", - "format": "uri" - } - } - } - } - } - }, - "options": { - "operationId": "options-api-mcp-.well-known-openid-configuration", - "summary": "MCP resource-relative OpenID discovery compatibility alias", + "/api/ingestion/publications/batches": { + "post": { + "operationId": "post-api-ingestion-publications-batches", + "summary": "Ingest a crawler publication batch", "tags": [ "Api" ], - "responses": { - "307": { - "description": "Redirect", - "headers": { - "Location": { - "schema": { - "type": "string", - "format": "uri" - } - } - } - } - } - } - }, - "/api/workspace/homeworks/completions": { - "put": { - "operationId": "put-api-homeworks-completions", - "summary": "Update homework completions in a batch", - "tags": [ - "workspace.homework" + "x-oauth-scopes": [ + "publication.ingest:write" ], "security": [ { @@ -6426,7 +6530,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/homeworkCompletionBatchRequestSchema" + "$ref": "#/components/schemas/publicationIngestionBatchRequestSchema" } } } @@ -6437,7 +6541,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/homeworkCompletionBatchResponseSchema" + "$ref": "#/components/schemas/publicationIngestionBatchResponseSchema" } } } @@ -6462,6 +6566,26 @@ } } }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "409": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, "429": { "description": "Error response", "headers": { @@ -6503,12 +6627,96 @@ } } }, - "/api/workspace/link-pins/batch": { - "post": { - "operationId": "workspace_link_pin_batch_set", - "summary": "Set multiple campus link pins", + "/api/mcp/.well-known/oauth-authorization-server": { + "get": { + "operationId": "get-api-mcp-.well-known-oauth-authorization-server", + "summary": "MCP resource-relative authorization server metadata compatibility alias", "tags": [ - "workspace.link-pin" + "Api" + ], + "responses": { + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } + } + } + } + } + }, + "options": { + "operationId": "options-api-mcp-.well-known-oauth-authorization-server", + "summary": "MCP resource-relative authorization server metadata compatibility alias", + "tags": [ + "Api" + ], + "responses": { + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } + } + } + } + } + } + }, + "/api/mcp/.well-known/openid-configuration": { + "get": { + "operationId": "get-api-mcp-.well-known-openid-configuration", + "summary": "MCP resource-relative OpenID discovery compatibility alias", + "tags": [ + "Api" + ], + "responses": { + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } + } + } + } + } + }, + "options": { + "operationId": "options-api-mcp-.well-known-openid-configuration", + "summary": "MCP resource-relative OpenID discovery compatibility alias", + "tags": [ + "Api" + ], + "responses": { + "307": { + "description": "Redirect", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + } + } + } + } + } + } + }, + "/api/workspace/homeworks/completions": { + "put": { + "operationId": "put-api-homeworks-completions", + "summary": "Update homework completions in a batch", + "tags": [ + "workspace.homework" ], "security": [ { @@ -6523,7 +6731,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/workspaceLinkPinBatchRequestSchema" + "$ref": "#/components/schemas/homeworkCompletionBatchRequestSchema" } } } @@ -6534,7 +6742,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/workspaceLinkPinResponseSchema" + "$ref": "#/components/schemas/homeworkCompletionBatchResponseSchema" } } } @@ -6578,16 +6786,6 @@ } } }, - "500": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, "503": { "description": "Error response", "headers": { @@ -6610,12 +6808,12 @@ } } }, - "/api/workspace/subscriptions/batch": { + "/api/workspace/link-pins/batch": { "post": { - "operationId": "batchUpdateCalendarSubscription", - "summary": "Batch update calendar section subscriptions", + "operationId": "workspace_link_pin_batch_set", + "summary": "Set multiple campus link pins", "tags": [ - "workspace.subscription" + "workspace.link-pin" ], "security": [ { @@ -6630,7 +6828,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/calendarSubscriptionBatchRequestSchema" + "$ref": "#/components/schemas/workspaceLinkPinBatchRequestSchema" } } } @@ -6641,7 +6839,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/calendarSubscriptionBatchResponseSchema" + "$ref": "#/components/schemas/workspaceLinkPinResponseSchema" } } } @@ -6666,16 +6864,6 @@ } } }, - "404": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, "429": { "description": "Error response", "headers": { @@ -6695,17 +6883,8 @@ } } }, - "503": { + "500": { "description": "Error response", - "headers": { - "Retry-After": { - "description": "Seconds before retrying the mutation", - "schema": { - "type": "integer", - "minimum": 0 - } - } - }, "content": { "application/json": { "schema": { @@ -6713,42 +6892,18 @@ } } } - } - } - } - }, - "/api/workspace/subscriptions/current": { - "get": { - "operationId": "getCurrentCalendarSubscription", - "summary": "Get section subscriptions", - "tags": [ - "workspace.subscription" - ], - "x-oauth-scopes": [ - "workspace.subscription:read", - "workspace.calendar-feed:read" - ], - "security": [ - { - "bearerAuth": [] }, - { - "sessionCookie": [] - } - ], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", "schema": { - "$ref": "#/components/schemas/currentCalendarSubscriptionResponseSchema" + "type": "integer", + "minimum": 0 } } - } - }, - "401": { - "description": "Error response", + }, "content": { "application/json": { "schema": { @@ -6760,10 +6915,10 @@ } } }, - "/api/workspace/subscriptions/import-codes": { + "/api/workspace/subscriptions/batch": { "post": { - "operationId": "post-api-workspace-subscriptions-import-codes", - "summary": "Import section subscriptions by section codes", + "operationId": "batchUpdateCalendarSubscription", + "summary": "Batch update calendar section subscriptions", "tags": [ "workspace.subscription" ], @@ -6780,7 +6935,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/matchSectionCodesRequestSchema" + "$ref": "#/components/schemas/calendarSubscriptionBatchRequestSchema" } } } @@ -6791,7 +6946,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/calendarSubscriptionImportResponseSchema" + "$ref": "#/components/schemas/calendarSubscriptionBatchResponseSchema" } } } @@ -6867,13 +7022,17 @@ } } }, - "/api/workspace/subscriptions/query": { - "post": { - "operationId": "queryCalendarSubscriptionSections", - "summary": "Query sections for calendar subscription changes", + "/api/workspace/subscriptions/current": { + "get": { + "operationId": "getCurrentCalendarSubscription", + "summary": "Get section subscriptions", "tags": [ "workspace.subscription" ], + "x-oauth-scopes": [ + "workspace.subscription:read", + "workspace.calendar-feed:read" + ], "security": [ { "bearerAuth": [] @@ -6882,33 +7041,13 @@ "sessionCookie": [] } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/calendarSubscriptionQueryRequestSchema" - } - } - } - }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/calendarSubscriptionQueryResponseSchema" - } - } - } - }, - "400": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" + "$ref": "#/components/schemas/currentCalendarSubscriptionResponseSchema" } } } @@ -6922,26 +7061,16 @@ } } } - }, - "404": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } } } } }, - "/api/workspace/todos/{id}": { - "patch": { - "operationId": "updateTodo", - "summary": "Update one todo", + "/api/workspace/subscriptions/import-codes": { + "post": { + "operationId": "post-api-workspace-subscriptions-import-codes", + "summary": "Import section subscriptions by section codes", "tags": [ - "workspace.todo" + "workspace.subscription" ], "security": [ { @@ -6951,23 +7080,12 @@ "sessionCookie": [] } ], - "parameters": [ - { - "in": "path", - "name": "id", - "schema": { - "type": "string", - "minLength": 1 - }, - "required": true - } - ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/todoUpdateRequestSchema" + "$ref": "#/components/schemas/matchSectionCodesRequestSchema" } } } @@ -6978,7 +7096,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/todoUpdateResponseSchema" + "$ref": "#/components/schemas/calendarSubscriptionImportResponseSchema" } } } @@ -7003,16 +7121,6 @@ } } }, - "403": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, "404": { "description": "Error response", "content": { @@ -7062,12 +7170,14 @@ } } } - }, - "delete": { - "operationId": "deleteTodo", - "summary": "Delete one todo", + } + }, + "/api/workspace/subscriptions/query": { + "post": { + "operationId": "queryCalendarSubscriptionSections", + "summary": "Query sections for calendar subscription changes", "tags": [ - "workspace.todo" + "workspace.subscription" ], "security": [ { @@ -7077,29 +7187,28 @@ "sessionCookie": [] } ], - "parameters": [ - { - "in": "path", - "name": "id", - "schema": { - "type": "string", - "minLength": 1 - }, - "required": true + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/calendarSubscriptionQueryRequestSchema" + } + } } - ], + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/successResponseSchema" + "$ref": "#/components/schemas/calendarSubscriptionQueryResponseSchema" } } } }, - "401": { + "400": { "description": "Error response", "content": { "application/json": { @@ -7109,7 +7218,7 @@ } } }, - "403": { + "401": { "description": "Error response", "content": { "application/json": { @@ -7128,52 +7237,14 @@ } } } - }, - "429": { - "description": "Error response", - "headers": { - "Retry-After": { - "description": "Seconds before retrying the mutation", - "schema": { - "type": "integer", - "minimum": 0 - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, - "503": { - "description": "Error response", - "headers": { - "Retry-After": { - "description": "Seconds before retrying the mutation", - "schema": { - "type": "integer", - "minimum": 0 - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } } } } }, - "/api/workspace/todos/batch": { + "/api/workspace/todos/{id}": { "patch": { - "operationId": "patch-api-todos-batch", - "summary": "Update completion state for multiple todos", + "operationId": "updateTodo", + "summary": "Update one todo", "tags": [ "workspace.todo" ], @@ -7185,12 +7256,23 @@ "sessionCookie": [] } ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/todoCompletionBatchRequestSchema" + "$ref": "#/components/schemas/todoUpdateRequestSchema" } } } @@ -7201,7 +7283,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/todoCompletionBatchResponseSchema" + "$ref": "#/components/schemas/todoUpdateResponseSchema" } } } @@ -7226,6 +7308,26 @@ } } }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, "429": { "description": "Error response", "headers": { @@ -7267,8 +7369,8 @@ } }, "delete": { - "operationId": "delete-api-todos-batch", - "summary": "Delete multiple todos by id", + "operationId": "deleteTodo", + "summary": "Delete one todo", "tags": [ "workspace.todo" ], @@ -7280,28 +7382,29 @@ "sessionCookie": [] } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/todoBatchDeleteRequestSchema" - } - } + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true } - }, + ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/todoBatchDeleteResponseSchema" + "$ref": "#/components/schemas/successResponseSchema" } } } }, - "400": { + "401": { "description": "Error response", "content": { "application/json": { @@ -7311,7 +7414,17 @@ } } }, - "401": { + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { "description": "Error response", "content": { "application/json": { @@ -7362,12 +7475,12 @@ } } }, - "/api/workspace/uploads/{id}": { + "/api/workspace/todos/batch": { "patch": { - "operationId": "updateUpload", - "summary": "Rename one upload", + "operationId": "patch-api-todos-batch", + "summary": "Update completion state for multiple todos", "tags": [ - "workspace.upload" + "workspace.todo" ], "security": [ { @@ -7377,23 +7490,12 @@ "sessionCookie": [] } ], - "parameters": [ - { - "in": "path", - "name": "id", - "schema": { - "type": "string", - "minLength": 1 - }, - "required": true - } - ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadRenameRequestSchema" + "$ref": "#/components/schemas/todoCompletionBatchRequestSchema" } } } @@ -7404,7 +7506,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadRenameResponseSchema" + "$ref": "#/components/schemas/todoCompletionBatchResponseSchema" } } } @@ -7429,26 +7531,6 @@ } } }, - "403": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, - "404": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, "429": { "description": "Error response", "headers": { @@ -7490,10 +7572,10 @@ } }, "delete": { - "operationId": "deleteUpload", - "summary": "Delete one upload", + "operationId": "delete-api-todos-batch", + "summary": "Delete multiple todos by id", "tags": [ - "workspace.upload" + "workspace.todo" ], "security": [ { @@ -7503,39 +7585,28 @@ "sessionCookie": [] } ], - "parameters": [ - { - "in": "path", - "name": "id", - "schema": { - "type": "string", - "minLength": 1 - }, - "required": true + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/todoBatchDeleteRequestSchema" + } + } } - ], + }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadDeleteResponseSchema" - } - } - } - }, - "401": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" + "$ref": "#/components/schemas/todoBatchDeleteResponseSchema" } } } }, - "403": { + "400": { "description": "Error response", "content": { "application/json": { @@ -7545,7 +7616,7 @@ } } }, - "404": { + "401": { "description": "Error response", "content": { "application/json": { @@ -7574,16 +7645,6 @@ } } }, - "502": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/openApiErrorSchema" - } - } - } - }, "503": { "description": "Error response", "headers": { @@ -7606,10 +7667,10 @@ } } }, - "/api/workspace/uploads/complete": { - "post": { - "operationId": "completeUpload", - "summary": "Complete upload", + "/api/workspace/uploads/{id}": { + "patch": { + "operationId": "updateUpload", + "summary": "Rename one upload", "tags": [ "workspace.upload" ], @@ -7621,12 +7682,23 @@ "sessionCookie": [] } ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadCompleteRequestSchema" + "$ref": "#/components/schemas/uploadRenameRequestSchema" } } } @@ -7637,7 +7709,240 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/uploadCompleteResponseSchema" + "$ref": "#/components/schemas/uploadRenameResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + }, + "delete": { + "operationId": "deleteUpload", + "summary": "Delete one upload", + "tags": [ + "workspace.upload" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uploadDeleteResponseSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "502": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/workspace/uploads/complete": { + "post": { + "operationId": "completeUpload", + "summary": "Complete upload", + "tags": [ + "workspace.upload" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uploadCompleteRequestSchema" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uploadCompleteResponseSchema" } } } @@ -8369,12 +8674,15 @@ } } }, - "/api/workspace/homeworks/{id}/completion": { - "put": { - "operationId": "setHomeworkCompletion", - "summary": "Update homework completion", + "/api/ingestion/publications/objects/complete": { + "post": { + "operationId": "post-api-ingestion-publications-objects-complete", + "summary": "Verify and link one uploaded publication object", "tags": [ - "workspace.homework" + "Api" + ], + "x-oauth-scopes": [ + "publication.ingest:write" ], "security": [ { @@ -8384,23 +8692,12 @@ "sessionCookie": [] } ], - "parameters": [ - { - "in": "path", - "name": "id", - "schema": { - "type": "string", - "minLength": 1 - }, - "required": true - } - ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/homeworkCompletionRequestSchema" + "$ref": "#/components/schemas/publicationObjectCompleteRequestSchema" } } } @@ -8411,7 +8708,345 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/homeworkCompletionResponseSchema" + "$ref": "#/components/schemas/publicationObjectCompleteResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/ingestion/publications/objects/plan": { + "post": { + "operationId": "post-api-ingestion-publications-objects-plan", + "summary": "Plan content-addressed publication object uploads", + "tags": [ + "Api" + ], + "x-oauth-scopes": [ + "publication.ingest:write" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicationObjectPlanRequestSchema" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicationObjectPlanResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "401": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "429": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/publications/objects/{kind}/{sha256}": { + "get": { + "operationId": "get-api-publications-objects-kind-sha256", + "summary": "Read a verified object linked to a public publication revision", + "tags": [ + "Api" + ], + "parameters": [ + { + "in": "path", + "name": "kind", + "schema": { + "type": "string", + "enum": [ + "body_html", + "body_markdown", + "media", + "asset", + "raw_page" + ] + }, + "required": true + }, + { + "in": "path", + "name": "sha256", + "schema": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Binary response", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "304": { + "description": "Response 304" + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, + "/api/workspace/homeworks/{id}/completion": { + "put": { + "operationId": "setHomeworkCompletion", + "summary": "Update homework completion", + "tags": [ + "workspace.homework" + ], + "security": [ + { + "bearerAuth": [] + }, + { + "sessionCookie": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/homeworkCompletionRequestSchema" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/homeworkCompletionResponseSchema" } } } @@ -9048,6 +9683,223 @@ ], "additionalProperties": false }, + "publicPublicationsResponseSchema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "canonicalUrl": { + "type": "string", + "format": "uri" + }, + "publicationType": { + "type": "string", + "enum": [ + "news", + "notice" + ] + }, + "source": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "organizationLevel": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "organizationLevel" + ], + "additionalProperties": false + }, + "revision": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "revisionHash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "observedAt": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "title": { + "type": "string" + }, + "author": { + "nullable": true, + "type": "string" + }, + "publishedAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "updatedAtSource": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "category": { + "nullable": true, + "type": "string" + }, + "summary": { + "nullable": true, + "type": "string" + }, + "sourcePageUrl": { + "nullable": true, + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "revisionHash", + "observedAt", + "title", + "author", + "publishedAt", + "updatedAtSource", + "category", + "summary", + "sourcePageUrl" + ], + "additionalProperties": false + }, + "objects": { + "type": "array", + "items": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "body_html", + "body_markdown", + "media", + "asset", + "raw_page" + ] + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "size": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "contentType": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "verified", + "linked" + ] + }, + "url": { + "type": "string", + "pattern": "^\\/api\\/publications\\/objects\\/.*" + }, + "sortOrder": { + "nullable": true, + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "altText": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "kind", + "sha256", + "size", + "contentType", + "status", + "url", + "sortOrder", + "altText" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "canonicalUrl", + "publicationType", + "source", + "revision", + "objects" + ], + "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 + }, "accountClientActivityResponseSchema": { "type": "object", "properties": { @@ -10662,7 +11514,8 @@ "type": "string", "enum": [ "weekday", - "weekend" + "saturday", + "sunday" ] }, "position": { @@ -13020,6 +13873,224 @@ ], "additionalProperties": false }, + "weatherSnapshotResponseSchema": { + "type": "object", + "properties": { + "location": { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "ustc-main", + "ustc-gaoxin" + ] + }, + "name": { + "type": "string" + }, + "adcode": { + "type": "string" + } + }, + "required": [ + "key", + "name", + "adcode" + ], + "additionalProperties": false + }, + "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)))$" + }, + "providers": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "amap", + "open-meteo" + ] + } + }, + "current": { + "type": "object", + "properties": { + "temperature": { + "type": "number" + }, + "feelsLike": { + "type": "number" + }, + "humidity": { + "type": "number" + }, + "windDirection": { + "type": "string" + }, + "windSpeed": { + "type": "number" + }, + "pressure": { + "type": "number" + }, + "visibility": { + "type": "number" + }, + "condition": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "icon": { + "type": "string" + } + }, + "required": [ + "text", + "icon" + ], + "additionalProperties": false + } + }, + "required": [ + "temperature", + "condition" + ], + "additionalProperties": false + }, + "hourly": { + "type": "array", + "items": { + "type": "object", + "properties": { + "at": { + "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)))$" + }, + "temperature": { + "type": "number" + }, + "condition": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "icon": { + "type": "string" + } + }, + "required": [ + "text", + "icon" + ], + "additionalProperties": false + }, + "precipitationProbability": { + "type": "number" + }, + "precipitationAmount": { + "type": "number" + } + }, + "required": [ + "at", + "temperature" + ], + "additionalProperties": false + } + }, + "daily": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string" + }, + "temperatureHigh": { + "type": "number" + }, + "temperatureLow": { + "type": "number" + }, + "condition": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "icon": { + "type": "string" + } + }, + "required": [ + "text", + "icon" + ], + "additionalProperties": false + } + }, + "required": [ + "date", + "temperatureHigh", + "temperatureLow" + ], + "additionalProperties": false + } + }, + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "level": { + "type": "string" + }, + "content": { + "type": "string" + }, + "issuedAt": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + } + }, + "required": [ + "title" + ], + "additionalProperties": false + } + }, + "extensions": { + "type": "object", + "properties": { + "amap": {}, + "openMeteo": {} + }, + "additionalProperties": false + } + }, + "required": [ + "location", + "fetchedAt", + "providers", + "current", + "hourly", + "daily", + "alerts", + "extensions" + ], + "additionalProperties": false + }, "commentsListResponseSchema": { "type": "object", "properties": { @@ -14703,6 +15774,193 @@ ], "additionalProperties": false }, + "publicPublicationDetailSchema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "canonicalUrl": { + "type": "string", + "format": "uri" + }, + "publicationType": { + "type": "string", + "enum": [ + "news", + "notice" + ] + }, + "source": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "organizationLevel": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "organizationLevel" + ], + "additionalProperties": false + }, + "revision": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "revisionHash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "observedAt": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "title": { + "type": "string" + }, + "author": { + "nullable": true, + "type": "string" + }, + "publishedAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "updatedAtSource": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "category": { + "nullable": true, + "type": "string" + }, + "summary": { + "nullable": true, + "type": "string" + }, + "sourcePageUrl": { + "nullable": true, + "type": "string", + "format": "uri" + }, + "bodyText": { + "nullable": true, + "type": "string" + }, + "extractionMethod": { + "nullable": true, + "type": "string" + }, + "classifierVersion": { + "nullable": true, + "type": "string" + }, + "objects": { + "type": "array", + "items": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "body_html", + "body_markdown", + "media", + "asset", + "raw_page" + ] + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "size": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "contentType": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "verified", + "linked" + ] + }, + "url": { + "type": "string", + "pattern": "^\\/api\\/publications\\/objects\\/.*" + }, + "sortOrder": { + "nullable": true, + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "altText": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "kind", + "sha256", + "size", + "contentType", + "status", + "url", + "sortOrder", + "altText" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "revisionHash", + "observedAt", + "title", + "author", + "publishedAt", + "updatedAtSource", + "category", + "summary", + "sourcePageUrl", + "bodyText", + "extractionMethod", + "classifierVersion", + "objects" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "canonicalUrl", + "publicationType", + "source", + "revision" + ], + "additionalProperties": false + }, "busPreferenceResponseSchema": { "type": "object", "properties": { @@ -21616,7 +22874,8 @@ "type": "string", "enum": [ "weekday", - "weekend" + "saturday", + "sunday" ] }, "totalRoutes": { @@ -21777,7 +23036,8 @@ "type": "string", "enum": [ "weekday", - "weekend" + "saturday", + "sunday" ] }, "status": { @@ -21957,7 +23217,8 @@ "type": "string", "enum": [ "weekday", - "weekend" + "saturday", + "sunday" ] }, "status": { @@ -22207,7 +23468,12 @@ "minimum": 0, "maximum": 9007199254740991 }, - "weekendTrips": { + "saturdayTrips": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "sundayTrips": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 @@ -22281,7 +23547,8 @@ "destinationCampus", "stopCount", "weekdayTrips", - "weekendTrips", + "saturdayTrips", + "sundayTrips", "stops" ], "additionalProperties": false @@ -27618,6 +28885,399 @@ ], "additionalProperties": false }, + "publicationIngestionBatchRequestSchema": { + "type": "object", + "properties": { + "protocolVersion": { + "type": "string", + "enum": [ + "1" + ] + }, + "producerVersion": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "clientRunId": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "batchId": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "observedAt": { + "type": "string", + "minLength": 1 + }, + "sources": { + "minItems": 1, + "maxItems": 500, + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^[a-z0-9][a-z0-9._-]*$" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "organizationLevel": { + "type": "string", + "minLength": 1, + "maxLength": 80 + }, + "allowedHosts": { + "maxItems": 100, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 253 + } + }, + "blockedHosts": { + "maxItems": 100, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 253 + } + }, + "seedUrls": { + "maxItems": 100, + "type": "array", + "items": { + "type": "string", + "maxLength": 2048, + "format": "uri" + } + }, + "aliases": { + "maxItems": 100, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 200 + } + }, + "discoveryOnly": { + "type": "boolean" + }, + "maxImagesPerPage": { + "nullable": true, + "type": "integer", + "exclusiveMinimum": true, + "maximum": 1000 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + } + }, + "items": { + "minItems": 1, + "maxItems": 500, + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "sourceId": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^[a-z0-9][a-z0-9._-]*$" + }, + "canonicalUrl": { + "type": "string", + "maxLength": 2048, + "format": "uri" + }, + "revisionHash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "observedAt": { + "type": "string", + "minLength": 1 + }, + "tombstone": { + "default": false, + "type": "boolean", + "enum": [ + false + ] + }, + "publicationType": { + "type": "string", + "enum": [ + "news", + "notice", + "other" + ] + }, + "title": { + "type": "string", + "minLength": 1, + "maxLength": 1000 + }, + "author": { + "nullable": true, + "type": "string", + "maxLength": 500 + }, + "publishedAt": { + "nullable": true, + "type": "string", + "minLength": 1 + }, + "updatedAtSource": { + "nullable": true, + "type": "string", + "minLength": 1 + }, + "category": { + "nullable": true, + "type": "string", + "maxLength": 500 + }, + "summary": { + "nullable": true, + "type": "string", + "maxLength": 20000 + }, + "bodyText": { + "nullable": true, + "type": "string", + "maxLength": 5000000 + }, + "sourcePageUrl": { + "nullable": true, + "type": "string", + "maxLength": 2048, + "format": "uri" + }, + "extractionMethod": { + "nullable": true, + "type": "string", + "maxLength": 200 + }, + "classifierVersion": { + "nullable": true, + "type": "string", + "maxLength": 200 + }, + "rawMetadata": { + "nullable": true, + "type": "object", + "additionalProperties": {} + }, + "objects": { + "default": [], + "maxItems": 100, + "type": "array", + "items": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "body_html", + "body_markdown", + "media", + "asset", + "raw_page" + ] + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "size": { + "type": "integer", + "minimum": 0, + "maximum": 33554432 + }, + "contentType": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[^\\s/]+\\/[A-Za-z0-9!#$&^_.+-]+$" + }, + "sortOrder": { + "type": "integer", + "minimum": 0, + "maximum": 10000 + }, + "altText": { + "type": "string", + "maxLength": 1000 + } + }, + "required": [ + "kind", + "sha256", + "size", + "contentType" + ], + "additionalProperties": false + } + } + }, + "required": [ + "sourceId", + "canonicalUrl", + "revisionHash", + "observedAt", + "tombstone", + "publicationType", + "title", + "objects" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "sourceId": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^[a-z0-9][a-z0-9._-]*$" + }, + "canonicalUrl": { + "type": "string", + "maxLength": 2048, + "format": "uri" + }, + "revisionHash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "observedAt": { + "type": "string", + "minLength": 1 + }, + "tombstone": { + "type": "boolean", + "enum": [ + true + ] + } + }, + "required": [ + "sourceId", + "canonicalUrl", + "revisionHash", + "observedAt", + "tombstone" + ], + "additionalProperties": false + } + ] + } + } + }, + "required": [ + "protocolVersion", + "producerVersion", + "clientRunId", + "batchId", + "observedAt", + "sources", + "items" + ], + "additionalProperties": false + }, + "publicationIngestionBatchResponseSchema": { + "type": "object", + "properties": { + "batchId": { + "type": "string", + "minLength": 1 + }, + "clientRunId": { + "type": "string", + "minLength": 1 + }, + "payloadDigest": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "canonicalUrl": { + "type": "string", + "format": "uri" + }, + "sourceId": { + "type": "string", + "minLength": 1 + }, + "revisionHash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "status": { + "type": "string", + "enum": [ + "created", + "updated", + "unchanged", + "rejected" + ] + }, + "publicationId": { + "nullable": true, + "type": "string" + }, + "revisionId": { + "nullable": true, + "type": "string" + }, + "error": { + "type": "string" + } + }, + "required": [ + "canonicalUrl", + "sourceId", + "revisionHash", + "status", + "publicationId", + "revisionId" + ], + "additionalProperties": false + } + } + }, + "required": [ + "batchId", + "clientRunId", + "payloadDigest", + "results" + ], + "additionalProperties": false + }, "homeworkCompletionBatchRequestSchema": { "type": "object", "properties": { @@ -34073,6 +35733,202 @@ ], "additionalProperties": false }, + "publicationObjectCompleteRequestSchema": { + "type": "object", + "properties": { + "batchId": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "kind": { + "type": "string", + "enum": [ + "body_html", + "body_markdown", + "media", + "asset", + "raw_page" + ] + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + } + }, + "required": [ + "batchId", + "kind", + "sha256" + ], + "additionalProperties": false + }, + "publicationObjectCompleteResponseSchema": { + "type": "object", + "properties": { + "batchId": { + "type": "string" + }, + "kind": { + "type": "string", + "enum": [ + "body_html", + "body_markdown", + "media", + "asset", + "raw_page" + ] + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "status": { + "type": "string", + "enum": [ + "verified", + "linked" + ] + } + }, + "required": [ + "batchId", + "kind", + "sha256", + "status" + ], + "additionalProperties": false + }, + "publicationObjectPlanRequestSchema": { + "type": "object", + "properties": { + "batchId": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "objects": { + "minItems": 1, + "maxItems": 500, + "type": "array", + "items": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "body_html", + "body_markdown", + "media", + "asset", + "raw_page" + ] + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + } + }, + "required": [ + "kind", + "sha256" + ], + "additionalProperties": false + } + } + }, + "required": [ + "batchId", + "objects" + ], + "additionalProperties": false + }, + "publicationObjectPlanResponseSchema": { + "type": "object", + "properties": { + "batchId": { + "type": "string" + }, + "objects": { + "type": "array", + "items": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "body_html", + "body_markdown", + "media", + "asset", + "raw_page" + ] + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "r2Key": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "already_present", + "upload_required" + ] + }, + "uploadUrl": { + "nullable": true, + "type": "string", + "format": "uri" + }, + "expiresAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "requiredHeaders": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string" + }, + "x-amz-meta-kind": { + "type": "string" + }, + "x-amz-meta-sha256": { + "type": "string" + } + }, + "required": [ + "Content-Type", + "x-amz-meta-kind", + "x-amz-meta-sha256" + ], + "additionalProperties": false + } + }, + "required": [ + "kind", + "sha256", + "r2Key", + "status", + "uploadUrl", + "expiresAt", + "requiredHeaders" + ], + "additionalProperties": false + } + } + }, + "required": [ + "batchId", + "objects" + ], + "additionalProperties": false + }, "homeworkCompletionRequestSchema": { "type": "object", "properties": { diff --git a/api/openapi.provenance.json b/api/openapi.provenance.json index af7814c..a517ef0 100644 --- a/api/openapi.provenance.json +++ b/api/openapi.provenance.json @@ -1,5 +1,5 @@ { "repository": "Life-USTC/server", - "commit": "bc7fe0e5ce1b353281bc0ba0a82ce46d199a8dbb", - "sha256": "e7aaa80c2ae5a69ba64d3f4ba345151a1cfa11a737f6d21c7d453acddd24d265" + "commit": "91ebaa95e45c9a0c93d052a24a482dafd416ff7e", + "sha256": "9b4203c33a7e0e500d73b9e12e5e69d47c8504ec7d27972b8f16ba65964e4343" } diff --git a/internal/cmd/apicmd/api_paths_gen.go b/internal/cmd/apicmd/api_paths_gen.go index e6d68ee..6b5e94a 100644 --- a/internal/cmd/apicmd/api_paths_gen.go +++ b/internal/cmd/apicmd/api_paths_gen.go @@ -48,6 +48,7 @@ var generatedAPIPaths = []string{ "/api/catalog/semesters/current", "/api/catalog/teachers", "/api/catalog/teachers/{id}", + "/api/catalog/weather", "/api/community/comments", "/api/community/comments/batch", "/api/community/comments/{id}", @@ -59,10 +60,16 @@ var generatedAPIPaths = []string{ "/api/community/section-homeworks/{id}", "/api/community/users/{identifier}", "/api/health", + "/api/ingestion/publications/batches", + "/api/ingestion/publications/objects/complete", + "/api/ingestion/publications/objects/plan", "/api/mcp", "/api/mcp/.well-known/oauth-authorization-server", "/api/mcp/.well-known/openid-configuration", "/api/openapi", + "/api/publications", + "/api/publications/objects/{kind}/{sha256}", + "/api/publications/{id}", "/api/search", "/api/workspace/bus-preferences", "/api/workspace/homeworks", diff --git a/internal/openapi/client.gen.go b/internal/openapi/client.gen.go index 4b867dc..763ba57 100644 --- a/internal/openapi/client.gen.go +++ b/internal/openapi/client.gen.go @@ -223,16 +223,19 @@ func (e AdminUpdateUserRequestSchemaUsername1) Valid() bool { // Defines values for BusNextDeparturesResponseSchemaDayType. const ( - BusNextDeparturesResponseSchemaDayTypeWeekday BusNextDeparturesResponseSchemaDayType = "weekday" - BusNextDeparturesResponseSchemaDayTypeWeekend BusNextDeparturesResponseSchemaDayType = "weekend" + BusNextDeparturesResponseSchemaDayTypeSaturday BusNextDeparturesResponseSchemaDayType = "saturday" + BusNextDeparturesResponseSchemaDayTypeSunday BusNextDeparturesResponseSchemaDayType = "sunday" + BusNextDeparturesResponseSchemaDayTypeWeekday BusNextDeparturesResponseSchemaDayType = "weekday" ) // Valid indicates whether the value is a known member of the BusNextDeparturesResponseSchemaDayType enum. func (e BusNextDeparturesResponseSchemaDayType) Valid() bool { switch e { - case BusNextDeparturesResponseSchemaDayTypeWeekday: + case BusNextDeparturesResponseSchemaDayTypeSaturday: + return true + case BusNextDeparturesResponseSchemaDayTypeSunday: return true - case BusNextDeparturesResponseSchemaDayTypeWeekend: + case BusNextDeparturesResponseSchemaDayTypeWeekday: return true default: return false @@ -241,16 +244,19 @@ func (e BusNextDeparturesResponseSchemaDayType) Valid() bool { // Defines values for BusNextDeparturesResponseSchemaDeparturesDayType. const ( - BusNextDeparturesResponseSchemaDeparturesDayTypeWeekday BusNextDeparturesResponseSchemaDeparturesDayType = "weekday" - BusNextDeparturesResponseSchemaDeparturesDayTypeWeekend BusNextDeparturesResponseSchemaDeparturesDayType = "weekend" + BusNextDeparturesResponseSchemaDeparturesDayTypeSaturday BusNextDeparturesResponseSchemaDeparturesDayType = "saturday" + BusNextDeparturesResponseSchemaDeparturesDayTypeSunday BusNextDeparturesResponseSchemaDeparturesDayType = "sunday" + BusNextDeparturesResponseSchemaDeparturesDayTypeWeekday BusNextDeparturesResponseSchemaDeparturesDayType = "weekday" ) // Valid indicates whether the value is a known member of the BusNextDeparturesResponseSchemaDeparturesDayType enum. func (e BusNextDeparturesResponseSchemaDeparturesDayType) Valid() bool { switch e { - case BusNextDeparturesResponseSchemaDeparturesDayTypeWeekday: + case BusNextDeparturesResponseSchemaDeparturesDayTypeSaturday: return true - case BusNextDeparturesResponseSchemaDeparturesDayTypeWeekend: + case BusNextDeparturesResponseSchemaDeparturesDayTypeSunday: + return true + case BusNextDeparturesResponseSchemaDeparturesDayTypeWeekday: return true default: return false @@ -277,16 +283,19 @@ func (e BusNextDeparturesResponseSchemaDeparturesStatus) Valid() bool { // Defines values for BusNextDeparturesResponseSchemaNextAvailableDepartureDayType. const ( - BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeWeekday BusNextDeparturesResponseSchemaNextAvailableDepartureDayType = "weekday" - BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeWeekend BusNextDeparturesResponseSchemaNextAvailableDepartureDayType = "weekend" + BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeSaturday BusNextDeparturesResponseSchemaNextAvailableDepartureDayType = "saturday" + BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeSunday BusNextDeparturesResponseSchemaNextAvailableDepartureDayType = "sunday" + BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeWeekday BusNextDeparturesResponseSchemaNextAvailableDepartureDayType = "weekday" ) // Valid indicates whether the value is a known member of the BusNextDeparturesResponseSchemaNextAvailableDepartureDayType enum. func (e BusNextDeparturesResponseSchemaNextAvailableDepartureDayType) Valid() bool { switch e { - case BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeWeekday: + case BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeSaturday: return true - case BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeWeekend: + case BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeSunday: + return true + case BusNextDeparturesResponseSchemaNextAvailableDepartureDayTypeWeekday: return true default: return false @@ -331,16 +340,19 @@ func (e BusQueryResponseSchemaLocale) Valid() bool { // Defines values for BusQueryResponseSchemaTripsDayType. const ( - BusQueryResponseSchemaTripsDayTypeWeekday BusQueryResponseSchemaTripsDayType = "weekday" - BusQueryResponseSchemaTripsDayTypeWeekend BusQueryResponseSchemaTripsDayType = "weekend" + BusQueryResponseSchemaTripsDayTypeSaturday BusQueryResponseSchemaTripsDayType = "saturday" + BusQueryResponseSchemaTripsDayTypeSunday BusQueryResponseSchemaTripsDayType = "sunday" + BusQueryResponseSchemaTripsDayTypeWeekday BusQueryResponseSchemaTripsDayType = "weekday" ) // Valid indicates whether the value is a known member of the BusQueryResponseSchemaTripsDayType enum. func (e BusQueryResponseSchemaTripsDayType) Valid() bool { switch e { - case BusQueryResponseSchemaTripsDayTypeWeekday: + case BusQueryResponseSchemaTripsDayTypeSaturday: return true - case BusQueryResponseSchemaTripsDayTypeWeekend: + case BusQueryResponseSchemaTripsDayTypeSunday: + return true + case BusQueryResponseSchemaTripsDayTypeWeekday: return true default: return false @@ -1058,6 +1070,393 @@ func (e OauthTokenResponseSchemaTokenType) Valid() bool { } } +// Defines values for PublicPublicationDetailSchemaPublicationType. +const ( + PublicPublicationDetailSchemaPublicationTypeNews PublicPublicationDetailSchemaPublicationType = "news" + PublicPublicationDetailSchemaPublicationTypeNotice PublicPublicationDetailSchemaPublicationType = "notice" +) + +// Valid indicates whether the value is a known member of the PublicPublicationDetailSchemaPublicationType enum. +func (e PublicPublicationDetailSchemaPublicationType) Valid() bool { + switch e { + case PublicPublicationDetailSchemaPublicationTypeNews: + return true + case PublicPublicationDetailSchemaPublicationTypeNotice: + return true + default: + return false + } +} + +// Defines values for PublicPublicationDetailSchemaRevisionObjectsKind. +const ( + PublicPublicationDetailSchemaRevisionObjectsKindAsset PublicPublicationDetailSchemaRevisionObjectsKind = "asset" + PublicPublicationDetailSchemaRevisionObjectsKindBodyHtml PublicPublicationDetailSchemaRevisionObjectsKind = "body_html" + PublicPublicationDetailSchemaRevisionObjectsKindBodyMarkdown PublicPublicationDetailSchemaRevisionObjectsKind = "body_markdown" + PublicPublicationDetailSchemaRevisionObjectsKindMedia PublicPublicationDetailSchemaRevisionObjectsKind = "media" + PublicPublicationDetailSchemaRevisionObjectsKindRawPage PublicPublicationDetailSchemaRevisionObjectsKind = "raw_page" +) + +// Valid indicates whether the value is a known member of the PublicPublicationDetailSchemaRevisionObjectsKind enum. +func (e PublicPublicationDetailSchemaRevisionObjectsKind) Valid() bool { + switch e { + case PublicPublicationDetailSchemaRevisionObjectsKindAsset: + return true + case PublicPublicationDetailSchemaRevisionObjectsKindBodyHtml: + return true + case PublicPublicationDetailSchemaRevisionObjectsKindBodyMarkdown: + return true + case PublicPublicationDetailSchemaRevisionObjectsKindMedia: + return true + case PublicPublicationDetailSchemaRevisionObjectsKindRawPage: + return true + default: + return false + } +} + +// Defines values for PublicPublicationDetailSchemaRevisionObjectsStatus. +const ( + PublicPublicationDetailSchemaRevisionObjectsStatusLinked PublicPublicationDetailSchemaRevisionObjectsStatus = "linked" + PublicPublicationDetailSchemaRevisionObjectsStatusVerified PublicPublicationDetailSchemaRevisionObjectsStatus = "verified" +) + +// Valid indicates whether the value is a known member of the PublicPublicationDetailSchemaRevisionObjectsStatus enum. +func (e PublicPublicationDetailSchemaRevisionObjectsStatus) Valid() bool { + switch e { + case PublicPublicationDetailSchemaRevisionObjectsStatusLinked: + return true + case PublicPublicationDetailSchemaRevisionObjectsStatusVerified: + return true + default: + return false + } +} + +// Defines values for PublicPublicationsResponseSchemaDataObjectsKind. +const ( + PublicPublicationsResponseSchemaDataObjectsKindAsset PublicPublicationsResponseSchemaDataObjectsKind = "asset" + PublicPublicationsResponseSchemaDataObjectsKindBodyHtml PublicPublicationsResponseSchemaDataObjectsKind = "body_html" + PublicPublicationsResponseSchemaDataObjectsKindBodyMarkdown PublicPublicationsResponseSchemaDataObjectsKind = "body_markdown" + PublicPublicationsResponseSchemaDataObjectsKindMedia PublicPublicationsResponseSchemaDataObjectsKind = "media" + PublicPublicationsResponseSchemaDataObjectsKindRawPage PublicPublicationsResponseSchemaDataObjectsKind = "raw_page" +) + +// Valid indicates whether the value is a known member of the PublicPublicationsResponseSchemaDataObjectsKind enum. +func (e PublicPublicationsResponseSchemaDataObjectsKind) Valid() bool { + switch e { + case PublicPublicationsResponseSchemaDataObjectsKindAsset: + return true + case PublicPublicationsResponseSchemaDataObjectsKindBodyHtml: + return true + case PublicPublicationsResponseSchemaDataObjectsKindBodyMarkdown: + return true + case PublicPublicationsResponseSchemaDataObjectsKindMedia: + return true + case PublicPublicationsResponseSchemaDataObjectsKindRawPage: + return true + default: + return false + } +} + +// Defines values for PublicPublicationsResponseSchemaDataObjectsStatus. +const ( + PublicPublicationsResponseSchemaDataObjectsStatusLinked PublicPublicationsResponseSchemaDataObjectsStatus = "linked" + PublicPublicationsResponseSchemaDataObjectsStatusVerified PublicPublicationsResponseSchemaDataObjectsStatus = "verified" +) + +// Valid indicates whether the value is a known member of the PublicPublicationsResponseSchemaDataObjectsStatus enum. +func (e PublicPublicationsResponseSchemaDataObjectsStatus) Valid() bool { + switch e { + case PublicPublicationsResponseSchemaDataObjectsStatusLinked: + return true + case PublicPublicationsResponseSchemaDataObjectsStatusVerified: + return true + default: + return false + } +} + +// Defines values for PublicPublicationsResponseSchemaDataPublicationType. +const ( + PublicPublicationsResponseSchemaDataPublicationTypeNews PublicPublicationsResponseSchemaDataPublicationType = "news" + PublicPublicationsResponseSchemaDataPublicationTypeNotice PublicPublicationsResponseSchemaDataPublicationType = "notice" +) + +// Valid indicates whether the value is a known member of the PublicPublicationsResponseSchemaDataPublicationType enum. +func (e PublicPublicationsResponseSchemaDataPublicationType) Valid() bool { + switch e { + case PublicPublicationsResponseSchemaDataPublicationTypeNews: + return true + case PublicPublicationsResponseSchemaDataPublicationTypeNotice: + return true + default: + return false + } +} + +// Defines values for PublicationIngestionBatchRequestSchemaItems0ObjectsKind. +const ( + PublicationIngestionBatchRequestSchemaItems0ObjectsKindAsset PublicationIngestionBatchRequestSchemaItems0ObjectsKind = "asset" + PublicationIngestionBatchRequestSchemaItems0ObjectsKindBodyHtml PublicationIngestionBatchRequestSchemaItems0ObjectsKind = "body_html" + PublicationIngestionBatchRequestSchemaItems0ObjectsKindBodyMarkdown PublicationIngestionBatchRequestSchemaItems0ObjectsKind = "body_markdown" + PublicationIngestionBatchRequestSchemaItems0ObjectsKindMedia PublicationIngestionBatchRequestSchemaItems0ObjectsKind = "media" + PublicationIngestionBatchRequestSchemaItems0ObjectsKindRawPage PublicationIngestionBatchRequestSchemaItems0ObjectsKind = "raw_page" +) + +// Valid indicates whether the value is a known member of the PublicationIngestionBatchRequestSchemaItems0ObjectsKind enum. +func (e PublicationIngestionBatchRequestSchemaItems0ObjectsKind) Valid() bool { + switch e { + case PublicationIngestionBatchRequestSchemaItems0ObjectsKindAsset: + return true + case PublicationIngestionBatchRequestSchemaItems0ObjectsKindBodyHtml: + return true + case PublicationIngestionBatchRequestSchemaItems0ObjectsKindBodyMarkdown: + return true + case PublicationIngestionBatchRequestSchemaItems0ObjectsKindMedia: + return true + case PublicationIngestionBatchRequestSchemaItems0ObjectsKindRawPage: + return true + default: + return false + } +} + +// Defines values for PublicationIngestionBatchRequestSchemaItems0PublicationType. +const ( + News PublicationIngestionBatchRequestSchemaItems0PublicationType = "news" + Notice PublicationIngestionBatchRequestSchemaItems0PublicationType = "notice" + Other PublicationIngestionBatchRequestSchemaItems0PublicationType = "other" +) + +// Valid indicates whether the value is a known member of the PublicationIngestionBatchRequestSchemaItems0PublicationType enum. +func (e PublicationIngestionBatchRequestSchemaItems0PublicationType) Valid() bool { + switch e { + case News: + return true + case Notice: + return true + case Other: + return true + default: + return false + } +} + +// Defines values for PublicationIngestionBatchRequestSchemaItems0Tombstone. +const ( + PublicationIngestionBatchRequestSchemaItems0TombstoneFalse PublicationIngestionBatchRequestSchemaItems0Tombstone = false +) + +// Valid indicates whether the value is a known member of the PublicationIngestionBatchRequestSchemaItems0Tombstone enum. +func (e PublicationIngestionBatchRequestSchemaItems0Tombstone) Valid() bool { + switch e { + case PublicationIngestionBatchRequestSchemaItems0TombstoneFalse: + return true + default: + return false + } +} + +// Defines values for PublicationIngestionBatchRequestSchemaItems1Tombstone. +const ( + PublicationIngestionBatchRequestSchemaItems1TombstoneTrue PublicationIngestionBatchRequestSchemaItems1Tombstone = true +) + +// Valid indicates whether the value is a known member of the PublicationIngestionBatchRequestSchemaItems1Tombstone enum. +func (e PublicationIngestionBatchRequestSchemaItems1Tombstone) Valid() bool { + switch e { + case PublicationIngestionBatchRequestSchemaItems1TombstoneTrue: + return true + default: + return false + } +} + +// Defines values for PublicationIngestionBatchRequestSchemaProtocolVersion. +const ( + N1 PublicationIngestionBatchRequestSchemaProtocolVersion = "1" +) + +// Valid indicates whether the value is a known member of the PublicationIngestionBatchRequestSchemaProtocolVersion enum. +func (e PublicationIngestionBatchRequestSchemaProtocolVersion) Valid() bool { + switch e { + case N1: + return true + default: + return false + } +} + +// Defines values for PublicationIngestionBatchResponseSchemaResultsStatus. +const ( + PublicationIngestionBatchResponseSchemaResultsStatusCreated PublicationIngestionBatchResponseSchemaResultsStatus = "created" + PublicationIngestionBatchResponseSchemaResultsStatusRejected PublicationIngestionBatchResponseSchemaResultsStatus = "rejected" + PublicationIngestionBatchResponseSchemaResultsStatusUnchanged PublicationIngestionBatchResponseSchemaResultsStatus = "unchanged" + PublicationIngestionBatchResponseSchemaResultsStatusUpdated PublicationIngestionBatchResponseSchemaResultsStatus = "updated" +) + +// Valid indicates whether the value is a known member of the PublicationIngestionBatchResponseSchemaResultsStatus enum. +func (e PublicationIngestionBatchResponseSchemaResultsStatus) Valid() bool { + switch e { + case PublicationIngestionBatchResponseSchemaResultsStatusCreated: + return true + case PublicationIngestionBatchResponseSchemaResultsStatusRejected: + return true + case PublicationIngestionBatchResponseSchemaResultsStatusUnchanged: + return true + case PublicationIngestionBatchResponseSchemaResultsStatusUpdated: + return true + default: + return false + } +} + +// Defines values for PublicationObjectCompleteRequestSchemaKind. +const ( + PublicationObjectCompleteRequestSchemaKindAsset PublicationObjectCompleteRequestSchemaKind = "asset" + PublicationObjectCompleteRequestSchemaKindBodyHtml PublicationObjectCompleteRequestSchemaKind = "body_html" + PublicationObjectCompleteRequestSchemaKindBodyMarkdown PublicationObjectCompleteRequestSchemaKind = "body_markdown" + PublicationObjectCompleteRequestSchemaKindMedia PublicationObjectCompleteRequestSchemaKind = "media" + PublicationObjectCompleteRequestSchemaKindRawPage PublicationObjectCompleteRequestSchemaKind = "raw_page" +) + +// Valid indicates whether the value is a known member of the PublicationObjectCompleteRequestSchemaKind enum. +func (e PublicationObjectCompleteRequestSchemaKind) Valid() bool { + switch e { + case PublicationObjectCompleteRequestSchemaKindAsset: + return true + case PublicationObjectCompleteRequestSchemaKindBodyHtml: + return true + case PublicationObjectCompleteRequestSchemaKindBodyMarkdown: + return true + case PublicationObjectCompleteRequestSchemaKindMedia: + return true + case PublicationObjectCompleteRequestSchemaKindRawPage: + return true + default: + return false + } +} + +// Defines values for PublicationObjectCompleteResponseSchemaKind. +const ( + PublicationObjectCompleteResponseSchemaKindAsset PublicationObjectCompleteResponseSchemaKind = "asset" + PublicationObjectCompleteResponseSchemaKindBodyHtml PublicationObjectCompleteResponseSchemaKind = "body_html" + PublicationObjectCompleteResponseSchemaKindBodyMarkdown PublicationObjectCompleteResponseSchemaKind = "body_markdown" + PublicationObjectCompleteResponseSchemaKindMedia PublicationObjectCompleteResponseSchemaKind = "media" + PublicationObjectCompleteResponseSchemaKindRawPage PublicationObjectCompleteResponseSchemaKind = "raw_page" +) + +// Valid indicates whether the value is a known member of the PublicationObjectCompleteResponseSchemaKind enum. +func (e PublicationObjectCompleteResponseSchemaKind) Valid() bool { + switch e { + case PublicationObjectCompleteResponseSchemaKindAsset: + return true + case PublicationObjectCompleteResponseSchemaKindBodyHtml: + return true + case PublicationObjectCompleteResponseSchemaKindBodyMarkdown: + return true + case PublicationObjectCompleteResponseSchemaKindMedia: + return true + case PublicationObjectCompleteResponseSchemaKindRawPage: + return true + default: + return false + } +} + +// Defines values for PublicationObjectCompleteResponseSchemaStatus. +const ( + Linked PublicationObjectCompleteResponseSchemaStatus = "linked" + Verified PublicationObjectCompleteResponseSchemaStatus = "verified" +) + +// Valid indicates whether the value is a known member of the PublicationObjectCompleteResponseSchemaStatus enum. +func (e PublicationObjectCompleteResponseSchemaStatus) Valid() bool { + switch e { + case Linked: + return true + case Verified: + return true + default: + return false + } +} + +// Defines values for PublicationObjectPlanRequestSchemaObjectsKind. +const ( + PublicationObjectPlanRequestSchemaObjectsKindAsset PublicationObjectPlanRequestSchemaObjectsKind = "asset" + PublicationObjectPlanRequestSchemaObjectsKindBodyHtml PublicationObjectPlanRequestSchemaObjectsKind = "body_html" + PublicationObjectPlanRequestSchemaObjectsKindBodyMarkdown PublicationObjectPlanRequestSchemaObjectsKind = "body_markdown" + PublicationObjectPlanRequestSchemaObjectsKindMedia PublicationObjectPlanRequestSchemaObjectsKind = "media" + PublicationObjectPlanRequestSchemaObjectsKindRawPage PublicationObjectPlanRequestSchemaObjectsKind = "raw_page" +) + +// Valid indicates whether the value is a known member of the PublicationObjectPlanRequestSchemaObjectsKind enum. +func (e PublicationObjectPlanRequestSchemaObjectsKind) Valid() bool { + switch e { + case PublicationObjectPlanRequestSchemaObjectsKindAsset: + return true + case PublicationObjectPlanRequestSchemaObjectsKindBodyHtml: + return true + case PublicationObjectPlanRequestSchemaObjectsKindBodyMarkdown: + return true + case PublicationObjectPlanRequestSchemaObjectsKindMedia: + return true + case PublicationObjectPlanRequestSchemaObjectsKindRawPage: + return true + default: + return false + } +} + +// Defines values for PublicationObjectPlanResponseSchemaObjectsKind. +const ( + Asset PublicationObjectPlanResponseSchemaObjectsKind = "asset" + BodyHtml PublicationObjectPlanResponseSchemaObjectsKind = "body_html" + BodyMarkdown PublicationObjectPlanResponseSchemaObjectsKind = "body_markdown" + Media PublicationObjectPlanResponseSchemaObjectsKind = "media" + RawPage PublicationObjectPlanResponseSchemaObjectsKind = "raw_page" +) + +// Valid indicates whether the value is a known member of the PublicationObjectPlanResponseSchemaObjectsKind enum. +func (e PublicationObjectPlanResponseSchemaObjectsKind) Valid() bool { + switch e { + case Asset: + return true + case BodyHtml: + return true + case BodyMarkdown: + return true + case Media: + return true + case RawPage: + return true + default: + return false + } +} + +// Defines values for PublicationObjectPlanResponseSchemaObjectsStatus. +const ( + AlreadyPresent PublicationObjectPlanResponseSchemaObjectsStatus = "already_present" + UploadRequired PublicationObjectPlanResponseSchemaObjectsStatus = "upload_required" +) + +// Valid indicates whether the value is a known member of the PublicationObjectPlanResponseSchemaObjectsStatus enum. +func (e PublicationObjectPlanResponseSchemaObjectsStatus) Valid() bool { + switch e { + case AlreadyPresent: + return true + case UploadRequired: + return true + default: + return false + } +} + // Defines values for TodoBatchDeleteResponseSchemaResults0Success. const ( TodoBatchDeleteResponseSchemaResults0SuccessTrue TodoBatchDeleteResponseSchemaResults0Success = true @@ -1289,6 +1688,42 @@ func (e TodosListResponseSchemaTodosPriority) Valid() bool { } } +// Defines values for WeatherSnapshotResponseSchemaLocationKey. +const ( + WeatherSnapshotResponseSchemaLocationKeyUstcGaoxin WeatherSnapshotResponseSchemaLocationKey = "ustc-gaoxin" + WeatherSnapshotResponseSchemaLocationKeyUstcMain WeatherSnapshotResponseSchemaLocationKey = "ustc-main" +) + +// Valid indicates whether the value is a known member of the WeatherSnapshotResponseSchemaLocationKey enum. +func (e WeatherSnapshotResponseSchemaLocationKey) Valid() bool { + switch e { + case WeatherSnapshotResponseSchemaLocationKeyUstcGaoxin: + return true + case WeatherSnapshotResponseSchemaLocationKeyUstcMain: + return true + default: + return false + } +} + +// Defines values for WeatherSnapshotResponseSchemaProviders. +const ( + Amap WeatherSnapshotResponseSchemaProviders = "amap" + OpenMeteo WeatherSnapshotResponseSchemaProviders = "open-meteo" +) + +// Valid indicates whether the value is a known member of the WeatherSnapshotResponseSchemaProviders enum. +func (e WeatherSnapshotResponseSchemaProviders) Valid() bool { + switch e { + case Amap: + return true + case OpenMeteo: + return true + default: + return false + } +} + // Defines values for WorkspaceLinkPinBatchRequestSchemaItemsAction. const ( WorkspaceLinkPinBatchRequestSchemaItemsActionPin WorkspaceLinkPinBatchRequestSchemaItemsAction = "pin" @@ -1402,19 +1837,19 @@ func (e ListAdminDescriptionsParamsHasContent) Valid() bool { // Defines values for ListAdminHomeworksParamsStatus. const ( - ListAdminHomeworksParamsStatusActive ListAdminHomeworksParamsStatus = "active" - ListAdminHomeworksParamsStatusAll ListAdminHomeworksParamsStatus = "all" - ListAdminHomeworksParamsStatusDeleted ListAdminHomeworksParamsStatus = "deleted" + Active ListAdminHomeworksParamsStatus = "active" + All ListAdminHomeworksParamsStatus = "all" + Deleted ListAdminHomeworksParamsStatus = "deleted" ) // Valid indicates whether the value is a known member of the ListAdminHomeworksParamsStatus enum. func (e ListAdminHomeworksParamsStatus) Valid() bool { switch e { - case ListAdminHomeworksParamsStatusActive: + case Active: return true - case ListAdminHomeworksParamsStatusAll: + case All: return true - case ListAdminHomeworksParamsStatusDeleted: + case Deleted: return true default: return false @@ -1423,9 +1858,10 @@ func (e ListAdminHomeworksParamsStatus) Valid() bool { // Defines values for CatalogBusDepartureNextParamsDayType. const ( - Auto CatalogBusDepartureNextParamsDayType = "auto" - Weekday CatalogBusDepartureNextParamsDayType = "weekday" - Weekend CatalogBusDepartureNextParamsDayType = "weekend" + Auto CatalogBusDepartureNextParamsDayType = "auto" + Saturday CatalogBusDepartureNextParamsDayType = "saturday" + Sunday CatalogBusDepartureNextParamsDayType = "sunday" + Weekday CatalogBusDepartureNextParamsDayType = "weekday" ) // Valid indicates whether the value is a known member of the CatalogBusDepartureNextParamsDayType enum. @@ -1433,9 +1869,11 @@ func (e CatalogBusDepartureNextParamsDayType) Valid() bool { switch e { case Auto: return true - case Weekday: + case Saturday: + return true + case Sunday: return true - case Weekend: + case Weekday: return true default: return false @@ -1712,6 +2150,24 @@ func (e GetTeacherParamsLocale) Valid() bool { } } +// Defines values for CatalogWeatherGetParamsLocationKey. +const ( + CatalogWeatherGetParamsLocationKeyUstcGaoxin CatalogWeatherGetParamsLocationKey = "ustc-gaoxin" + CatalogWeatherGetParamsLocationKeyUstcMain CatalogWeatherGetParamsLocationKey = "ustc-main" +) + +// Valid indicates whether the value is a known member of the CatalogWeatherGetParamsLocationKey enum. +func (e CatalogWeatherGetParamsLocationKey) Valid() bool { + switch e { + case CatalogWeatherGetParamsLocationKeyUstcGaoxin: + return true + case CatalogWeatherGetParamsLocationKeyUstcMain: + return true + default: + return false + } +} + // Defines values for ListCommentsParamsTargetType. const ( ListCommentsParamsTargetTypeCourse ListCommentsParamsTargetType = "course" @@ -2665,8 +3121,9 @@ type BusRouteSearchResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` } `json:"originCampus"` - StopCount int `json:"stopCount"` - Stops []struct { + SaturdayTrips int `json:"saturdayTrips"` + StopCount int `json:"stopCount"` + Stops []struct { Campus struct { Id int `json:"id"` Latitude float32 `json:"latitude"` @@ -2678,8 +3135,8 @@ type BusRouteSearchResponseSchema struct { } `json:"campus"` StopOrder int `json:"stopOrder"` } `json:"stops"` + SundayTrips int `json:"sundayTrips"` WeekdayTrips int `json:"weekdayTrips"` - WeekendTrips int `json:"weekendTrips"` } `json:"routes"` Total int `json:"total"` } @@ -6489,6 +6946,103 @@ type PaginatedTeacherResponseSchema struct { } `json:"pagination"` } +// PublicPublicationDetailSchema defines model for publicPublicationDetailSchema. +type PublicPublicationDetailSchema struct { + CanonicalUrl string `json:"canonicalUrl"` + Id string `json:"id"` + PublicationType PublicPublicationDetailSchemaPublicationType `json:"publicationType"` + Revision struct { + Author *string `json:"author"` + BodyText *string `json:"bodyText"` + Category *string `json:"category"` + ClassifierVersion *string `json:"classifierVersion"` + ExtractionMethod *string `json:"extractionMethod"` + Id string `json:"id"` + Objects []struct { + AltText *string `json:"altText"` + ContentType string `json:"contentType"` + Kind PublicPublicationDetailSchemaRevisionObjectsKind `json:"kind"` + Sha256 string `json:"sha256"` + Size int `json:"size"` + SortOrder *int `json:"sortOrder"` + Status PublicPublicationDetailSchemaRevisionObjectsStatus `json:"status"` + Url string `json:"url"` + } `json:"objects"` + ObservedAt time.Time `json:"observedAt"` + PublishedAt *time.Time `json:"publishedAt"` + RevisionHash string `json:"revisionHash"` + SourcePageUrl *string `json:"sourcePageUrl"` + Summary *string `json:"summary"` + Title string `json:"title"` + UpdatedAtSource *time.Time `json:"updatedAtSource"` + } `json:"revision"` + Source struct { + Id string `json:"id"` + Name string `json:"name"` + OrganizationLevel string `json:"organizationLevel"` + } `json:"source"` +} + +// PublicPublicationDetailSchemaPublicationType defines model for PublicPublicationDetailSchema.PublicationType. +type PublicPublicationDetailSchemaPublicationType string + +// PublicPublicationDetailSchemaRevisionObjectsKind defines model for PublicPublicationDetailSchema.Revision.Objects.Kind. +type PublicPublicationDetailSchemaRevisionObjectsKind string + +// PublicPublicationDetailSchemaRevisionObjectsStatus defines model for PublicPublicationDetailSchema.Revision.Objects.Status. +type PublicPublicationDetailSchemaRevisionObjectsStatus string + +// PublicPublicationsResponseSchema defines model for publicPublicationsResponseSchema. +type PublicPublicationsResponseSchema struct { + Data []struct { + CanonicalUrl string `json:"canonicalUrl"` + Id string `json:"id"` + Objects []struct { + AltText *string `json:"altText"` + ContentType string `json:"contentType"` + Kind PublicPublicationsResponseSchemaDataObjectsKind `json:"kind"` + Sha256 string `json:"sha256"` + Size int `json:"size"` + SortOrder *int `json:"sortOrder"` + Status PublicPublicationsResponseSchemaDataObjectsStatus `json:"status"` + Url string `json:"url"` + } `json:"objects"` + PublicationType PublicPublicationsResponseSchemaDataPublicationType `json:"publicationType"` + Revision struct { + Author *string `json:"author"` + Category *string `json:"category"` + Id string `json:"id"` + ObservedAt time.Time `json:"observedAt"` + PublishedAt *time.Time `json:"publishedAt"` + RevisionHash string `json:"revisionHash"` + SourcePageUrl *string `json:"sourcePageUrl"` + Summary *string `json:"summary"` + Title string `json:"title"` + UpdatedAtSource *time.Time `json:"updatedAtSource"` + } `json:"revision"` + Source struct { + Id string `json:"id"` + Name string `json:"name"` + OrganizationLevel string `json:"organizationLevel"` + } `json:"source"` + } `json:"data"` + Pagination struct { + Page int `json:"page"` + PageSize int `json:"pageSize"` + Total int `json:"total"` + TotalPages int `json:"totalPages"` + } `json:"pagination"` +} + +// PublicPublicationsResponseSchemaDataObjectsKind defines model for PublicPublicationsResponseSchema.Data.Objects.Kind. +type PublicPublicationsResponseSchemaDataObjectsKind string + +// PublicPublicationsResponseSchemaDataObjectsStatus defines model for PublicPublicationsResponseSchema.Data.Objects.Status. +type PublicPublicationsResponseSchemaDataObjectsStatus string + +// PublicPublicationsResponseSchemaDataPublicationType defines model for PublicPublicationsResponseSchema.Data.PublicationType. +type PublicPublicationsResponseSchemaDataPublicationType string + // PublicUserProfileResponseSchema defines model for publicUserProfileResponseSchema. type PublicUserProfileResponseSchema struct { SectionCount int `json:"sectionCount"` @@ -6512,6 +7066,164 @@ type PublicUserProfileResponseSchema struct { } `json:"weeks"` } +// PublicationIngestionBatchRequestSchema defines model for publicationIngestionBatchRequestSchema. +type PublicationIngestionBatchRequestSchema struct { + BatchId string `json:"batchId"` + ClientRunId string `json:"clientRunId"` + Items []PublicationIngestionBatchRequestSchema_Items_Item `json:"items"` + ObservedAt string `json:"observedAt"` + ProducerVersion string `json:"producerVersion"` + ProtocolVersion PublicationIngestionBatchRequestSchemaProtocolVersion `json:"protocolVersion"` + Sources []struct { + Aliases *[]string `json:"aliases,omitempty"` + AllowedHosts *[]string `json:"allowedHosts,omitempty"` + BlockedHosts *[]string `json:"blockedHosts,omitempty"` + DiscoveryOnly *bool `json:"discoveryOnly,omitempty"` + Id string `json:"id"` + MaxImagesPerPage *int `json:"maxImagesPerPage,omitempty"` + Name string `json:"name"` + OrganizationLevel *string `json:"organizationLevel,omitempty"` + SeedUrls *[]string `json:"seedUrls,omitempty"` + } `json:"sources"` +} + +// PublicationIngestionBatchRequestSchemaItems0 defines model for . +type PublicationIngestionBatchRequestSchemaItems0 struct { + Author *string `json:"author,omitempty"` + BodyText *string `json:"bodyText,omitempty"` + CanonicalUrl string `json:"canonicalUrl"` + Category *string `json:"category,omitempty"` + ClassifierVersion *string `json:"classifierVersion,omitempty"` + ExtractionMethod *string `json:"extractionMethod,omitempty"` + Objects []struct { + AltText *string `json:"altText,omitempty"` + ContentType string `json:"contentType"` + Kind PublicationIngestionBatchRequestSchemaItems0ObjectsKind `json:"kind"` + Sha256 string `json:"sha256"` + Size int `json:"size"` + SortOrder *int `json:"sortOrder,omitempty"` + } `json:"objects"` + ObservedAt string `json:"observedAt"` + PublicationType PublicationIngestionBatchRequestSchemaItems0PublicationType `json:"publicationType"` + PublishedAt *string `json:"publishedAt,omitempty"` + RawMetadata *map[string]interface{} `json:"rawMetadata,omitempty"` + RevisionHash string `json:"revisionHash"` + SourceId string `json:"sourceId"` + SourcePageUrl *string `json:"sourcePageUrl,omitempty"` + Summary *string `json:"summary,omitempty"` + Title string `json:"title"` + Tombstone PublicationIngestionBatchRequestSchemaItems0Tombstone `json:"tombstone"` + UpdatedAtSource *string `json:"updatedAtSource,omitempty"` +} + +// PublicationIngestionBatchRequestSchemaItems0ObjectsKind defines model for PublicationIngestionBatchRequestSchema.Items.0.Objects.Kind. +type PublicationIngestionBatchRequestSchemaItems0ObjectsKind string + +// PublicationIngestionBatchRequestSchemaItems0PublicationType defines model for PublicationIngestionBatchRequestSchema.Items.0.PublicationType. +type PublicationIngestionBatchRequestSchemaItems0PublicationType string + +// PublicationIngestionBatchRequestSchemaItems0Tombstone defines model for PublicationIngestionBatchRequestSchema.Items.0.Tombstone. +type PublicationIngestionBatchRequestSchemaItems0Tombstone bool + +// PublicationIngestionBatchRequestSchemaItems1 defines model for . +type PublicationIngestionBatchRequestSchemaItems1 struct { + CanonicalUrl string `json:"canonicalUrl"` + ObservedAt string `json:"observedAt"` + RevisionHash string `json:"revisionHash"` + SourceId string `json:"sourceId"` + Tombstone PublicationIngestionBatchRequestSchemaItems1Tombstone `json:"tombstone"` +} + +// PublicationIngestionBatchRequestSchemaItems1Tombstone defines model for PublicationIngestionBatchRequestSchema.Items.1.Tombstone. +type PublicationIngestionBatchRequestSchemaItems1Tombstone bool + +// PublicationIngestionBatchRequestSchema_Items_Item defines model for publicationIngestionBatchRequestSchema.items.Item. +type PublicationIngestionBatchRequestSchema_Items_Item struct { + union json.RawMessage +} + +// PublicationIngestionBatchRequestSchemaProtocolVersion defines model for PublicationIngestionBatchRequestSchema.ProtocolVersion. +type PublicationIngestionBatchRequestSchemaProtocolVersion string + +// PublicationIngestionBatchResponseSchema defines model for publicationIngestionBatchResponseSchema. +type PublicationIngestionBatchResponseSchema struct { + BatchId string `json:"batchId"` + ClientRunId string `json:"clientRunId"` + PayloadDigest string `json:"payloadDigest"` + Results []struct { + CanonicalUrl string `json:"canonicalUrl"` + Error *string `json:"error,omitempty"` + PublicationId *string `json:"publicationId"` + RevisionHash string `json:"revisionHash"` + RevisionId *string `json:"revisionId"` + SourceId string `json:"sourceId"` + Status PublicationIngestionBatchResponseSchemaResultsStatus `json:"status"` + } `json:"results"` +} + +// PublicationIngestionBatchResponseSchemaResultsStatus defines model for PublicationIngestionBatchResponseSchema.Results.Status. +type PublicationIngestionBatchResponseSchemaResultsStatus string + +// PublicationObjectCompleteRequestSchema defines model for publicationObjectCompleteRequestSchema. +type PublicationObjectCompleteRequestSchema struct { + BatchId string `json:"batchId"` + Kind PublicationObjectCompleteRequestSchemaKind `json:"kind"` + Sha256 string `json:"sha256"` +} + +// PublicationObjectCompleteRequestSchemaKind defines model for PublicationObjectCompleteRequestSchema.Kind. +type PublicationObjectCompleteRequestSchemaKind string + +// PublicationObjectCompleteResponseSchema defines model for publicationObjectCompleteResponseSchema. +type PublicationObjectCompleteResponseSchema struct { + BatchId string `json:"batchId"` + Kind PublicationObjectCompleteResponseSchemaKind `json:"kind"` + Sha256 string `json:"sha256"` + Status PublicationObjectCompleteResponseSchemaStatus `json:"status"` +} + +// PublicationObjectCompleteResponseSchemaKind defines model for PublicationObjectCompleteResponseSchema.Kind. +type PublicationObjectCompleteResponseSchemaKind string + +// PublicationObjectCompleteResponseSchemaStatus defines model for PublicationObjectCompleteResponseSchema.Status. +type PublicationObjectCompleteResponseSchemaStatus string + +// PublicationObjectPlanRequestSchema defines model for publicationObjectPlanRequestSchema. +type PublicationObjectPlanRequestSchema struct { + BatchId string `json:"batchId"` + Objects []struct { + Kind PublicationObjectPlanRequestSchemaObjectsKind `json:"kind"` + Sha256 string `json:"sha256"` + } `json:"objects"` +} + +// PublicationObjectPlanRequestSchemaObjectsKind defines model for PublicationObjectPlanRequestSchema.Objects.Kind. +type PublicationObjectPlanRequestSchemaObjectsKind string + +// PublicationObjectPlanResponseSchema defines model for publicationObjectPlanResponseSchema. +type PublicationObjectPlanResponseSchema struct { + BatchId string `json:"batchId"` + Objects []struct { + ExpiresAt *time.Time `json:"expiresAt"` + Kind PublicationObjectPlanResponseSchemaObjectsKind `json:"kind"` + R2Key string `json:"r2Key"` + RequiredHeaders struct { + ContentType string `json:"Content-Type"` + XAmzMetaKind string `json:"x-amz-meta-kind"` + XAmzMetaSha256 string `json:"x-amz-meta-sha256"` + } `json:"requiredHeaders"` + Sha256 string `json:"sha256"` + Status PublicationObjectPlanResponseSchemaObjectsStatus `json:"status"` + UploadUrl *string `json:"uploadUrl"` + } `json:"objects"` +} + +// PublicationObjectPlanResponseSchemaObjectsKind defines model for PublicationObjectPlanResponseSchema.Objects.Kind. +type PublicationObjectPlanResponseSchemaObjectsKind string + +// PublicationObjectPlanResponseSchemaObjectsStatus defines model for PublicationObjectPlanResponseSchema.Objects.Status. +type PublicationObjectPlanResponseSchemaObjectsStatus string + // SectionDetailSchema defines model for sectionDetailSchema. type SectionDetailSchema struct { ActualPeriods *float32 `json:"actualPeriods"` @@ -7475,6 +8187,65 @@ type UploadsListResponseSchema struct { } `json:"pagination"` } +// WeatherSnapshotResponseSchema defines model for weatherSnapshotResponseSchema. +type WeatherSnapshotResponseSchema struct { + Alerts []struct { + Content *string `json:"content,omitempty"` + IssuedAt *time.Time `json:"issuedAt,omitempty"` + Level *string `json:"level,omitempty"` + Title string `json:"title"` + } `json:"alerts"` + Current struct { + Condition struct { + Icon string `json:"icon"` + Text string `json:"text"` + } `json:"condition"` + FeelsLike *float32 `json:"feelsLike,omitempty"` + Humidity *float32 `json:"humidity,omitempty"` + Pressure *float32 `json:"pressure,omitempty"` + Temperature float32 `json:"temperature"` + Visibility *float32 `json:"visibility,omitempty"` + WindDirection *string `json:"windDirection,omitempty"` + WindSpeed *float32 `json:"windSpeed,omitempty"` + } `json:"current"` + Daily []struct { + Condition *struct { + Icon string `json:"icon"` + Text string `json:"text"` + } `json:"condition,omitempty"` + Date string `json:"date"` + TemperatureHigh float32 `json:"temperatureHigh"` + TemperatureLow float32 `json:"temperatureLow"` + } `json:"daily"` + Extensions struct { + Amap interface{} `json:"amap,omitempty"` + OpenMeteo interface{} `json:"openMeteo,omitempty"` + } `json:"extensions"` + FetchedAt time.Time `json:"fetchedAt"` + Hourly []struct { + At time.Time `json:"at"` + Condition *struct { + Icon string `json:"icon"` + Text string `json:"text"` + } `json:"condition,omitempty"` + PrecipitationAmount *float32 `json:"precipitationAmount,omitempty"` + PrecipitationProbability *float32 `json:"precipitationProbability,omitempty"` + Temperature float32 `json:"temperature"` + } `json:"hourly"` + Location struct { + Adcode string `json:"adcode"` + Key WeatherSnapshotResponseSchemaLocationKey `json:"key"` + Name string `json:"name"` + } `json:"location"` + Providers []WeatherSnapshotResponseSchemaProviders `json:"providers"` +} + +// WeatherSnapshotResponseSchemaLocationKey defines model for WeatherSnapshotResponseSchema.Location.Key. +type WeatherSnapshotResponseSchemaLocationKey string + +// WeatherSnapshotResponseSchemaProviders defines model for WeatherSnapshotResponseSchema.Providers. +type WeatherSnapshotResponseSchemaProviders string + // WorkspaceLinkPinBatchRequestSchema defines model for workspaceLinkPinBatchRequestSchema. type WorkspaceLinkPinBatchRequestSchema struct { Items []struct { @@ -7773,6 +8544,14 @@ type GetTeacherParams struct { // GetTeacherParamsLocale defines parameters for GetTeacher. type GetTeacherParamsLocale string +// CatalogWeatherGetParams defines parameters for CatalogWeatherGet. +type CatalogWeatherGetParams struct { + LocationKey *CatalogWeatherGetParamsLocationKey `form:"locationKey,omitempty" json:"locationKey,omitempty"` +} + +// CatalogWeatherGetParamsLocationKey defines parameters for CatalogWeatherGet. +type CatalogWeatherGetParamsLocationKey string + // ListCommentsParams defines parameters for ListComments. type ListCommentsParams struct { TargetType ListCommentsParamsTargetType `form:"targetType" json:"targetType"` @@ -10451,6 +11230,68 @@ func (t *OauthTokenRequestSchema_Resource) UnmarshalJSON(b []byte) error { return err } +// AsPublicationIngestionBatchRequestSchemaItems0 returns the union data inside the PublicationIngestionBatchRequestSchema_Items_Item as a PublicationIngestionBatchRequestSchemaItems0 +func (t PublicationIngestionBatchRequestSchema_Items_Item) AsPublicationIngestionBatchRequestSchemaItems0() (PublicationIngestionBatchRequestSchemaItems0, error) { + var body PublicationIngestionBatchRequestSchemaItems0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPublicationIngestionBatchRequestSchemaItems0 overwrites any union data inside the PublicationIngestionBatchRequestSchema_Items_Item as the provided PublicationIngestionBatchRequestSchemaItems0 +func (t *PublicationIngestionBatchRequestSchema_Items_Item) FromPublicationIngestionBatchRequestSchemaItems0(v PublicationIngestionBatchRequestSchemaItems0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePublicationIngestionBatchRequestSchemaItems0 performs a merge with any union data inside the PublicationIngestionBatchRequestSchema_Items_Item, using the provided PublicationIngestionBatchRequestSchemaItems0 +func (t *PublicationIngestionBatchRequestSchema_Items_Item) MergePublicationIngestionBatchRequestSchemaItems0(v PublicationIngestionBatchRequestSchemaItems0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPublicationIngestionBatchRequestSchemaItems1 returns the union data inside the PublicationIngestionBatchRequestSchema_Items_Item as a PublicationIngestionBatchRequestSchemaItems1 +func (t PublicationIngestionBatchRequestSchema_Items_Item) AsPublicationIngestionBatchRequestSchemaItems1() (PublicationIngestionBatchRequestSchemaItems1, error) { + var body PublicationIngestionBatchRequestSchemaItems1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPublicationIngestionBatchRequestSchemaItems1 overwrites any union data inside the PublicationIngestionBatchRequestSchema_Items_Item as the provided PublicationIngestionBatchRequestSchemaItems1 +func (t *PublicationIngestionBatchRequestSchema_Items_Item) FromPublicationIngestionBatchRequestSchemaItems1(v PublicationIngestionBatchRequestSchemaItems1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePublicationIngestionBatchRequestSchemaItems1 performs a merge with any union data inside the PublicationIngestionBatchRequestSchema_Items_Item, using the provided PublicationIngestionBatchRequestSchemaItems1 +func (t *PublicationIngestionBatchRequestSchema_Items_Item) MergePublicationIngestionBatchRequestSchemaItems1(v PublicationIngestionBatchRequestSchemaItems1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PublicationIngestionBatchRequestSchema_Items_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PublicationIngestionBatchRequestSchema_Items_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + // AsTodoBatchDeleteResponseSchemaResults0 returns the union data inside the TodoBatchDeleteResponseSchema_Results_Item as a TodoBatchDeleteResponseSchemaResults0 func (t TodoBatchDeleteResponseSchema_Results_Item) AsTodoBatchDeleteResponseSchemaResults0() (TodoBatchDeleteResponseSchemaResults0, error) { var body TodoBatchDeleteResponseSchemaResults0 @@ -10951,6 +11792,9 @@ type ClientInterface interface { // GetTeacher request GetTeacher(ctx context.Context, id int64, params *GetTeacherParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // CatalogWeatherGet request + CatalogWeatherGet(ctx context.Context, params *CatalogWeatherGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListComments request ListComments(ctx context.Context, params *ListCommentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -11641,6 +12485,18 @@ func (c *Client) GetTeacher(ctx context.Context, id int64, params *GetTeacherPar return c.Client.Do(req) } +func (c *Client) CatalogWeatherGet(ctx context.Context, params *CatalogWeatherGetParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCatalogWeatherGetRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ListComments(ctx context.Context, params *ListCommentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListCommentsRequest(c.Server, params) if err != nil { @@ -15228,6 +16084,55 @@ func NewGetTeacherRequest(server string, id int64, params *GetTeacherParams) (*h return req, nil } +// NewCatalogWeatherGetRequest generates requests for CatalogWeatherGet +func NewCatalogWeatherGetRequest(server string, params *CatalogWeatherGetParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/catalog/weather") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.LocationKey != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "locationKey", *params.LocationKey, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewListCommentsRequest generates requests for ListComments func NewListCommentsRequest(server string, params *ListCommentsParams) (*http.Request, error) { var err error @@ -17990,6 +18895,9 @@ type ClientWithResponsesInterface interface { // GetTeacherWithResponse request GetTeacherWithResponse(ctx context.Context, id int64, params *GetTeacherParams, reqEditors ...RequestEditorFn) (*GetTeacherResponse, error) + // CatalogWeatherGetWithResponse request + CatalogWeatherGetWithResponse(ctx context.Context, params *CatalogWeatherGetParams, reqEditors ...RequestEditorFn) (*CatalogWeatherGetResponse, error) + // ListCommentsWithResponse request ListCommentsWithResponse(ctx context.Context, params *ListCommentsParams, reqEditors ...RequestEditorFn) (*ListCommentsResponse, error) @@ -19031,6 +19939,29 @@ func (r GetTeacherResponse) StatusCode() int { return 0 } +type CatalogWeatherGetResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *WeatherSnapshotResponseSchema + JSON400 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r CatalogWeatherGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CatalogWeatherGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type ListCommentsResponse struct { Body []byte HTTPResponse *http.Response @@ -20660,6 +21591,15 @@ func (c *ClientWithResponses) GetTeacherWithResponse(ctx context.Context, id int return ParseGetTeacherResponse(rsp) } +// CatalogWeatherGetWithResponse request returning *CatalogWeatherGetResponse +func (c *ClientWithResponses) CatalogWeatherGetWithResponse(ctx context.Context, params *CatalogWeatherGetParams, reqEditors ...RequestEditorFn) (*CatalogWeatherGetResponse, error) { + rsp, err := c.CatalogWeatherGet(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseCatalogWeatherGetResponse(rsp) +} + // ListCommentsWithResponse request returning *ListCommentsResponse func (c *ClientWithResponses) ListCommentsWithResponse(ctx context.Context, params *ListCommentsParams, reqEditors ...RequestEditorFn) (*ListCommentsResponse, error) { rsp, err := c.ListComments(ctx, params, reqEditors...) @@ -22719,6 +23659,39 @@ func ParseGetTeacherResponse(rsp *http.Response) (*GetTeacherResponse, error) { return response, nil } +// ParseCatalogWeatherGetResponse parses an HTTP response from a CatalogWeatherGetWithResponse call +func ParseCatalogWeatherGetResponse(rsp *http.Response) (*CatalogWeatherGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CatalogWeatherGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest WeatherSnapshotResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + // ParseListCommentsResponse parses an HTTP response from a ListCommentsWithResponse call func ParseListCommentsResponse(rsp *http.Response) (*ListCommentsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body)