// Copyright (c) 2024-2026 Tencent Zhuque Lab. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Requirement: Any integration or derivative work must explicitly attribute
// Tencent Zhuque Lab (https://github.com/Tencent/AI-Infra-Guard) in its
// documentation or user interface, as detailed in the NOTICE file.

// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs

import "github.com/swaggo/swag"

const docTemplate = `{
    "schemes": {{ marshal .Schemes }},
    "swagger": "2.0",
    "info": {
        "description": "{{escape .Description}}",
        "title": "{{.Title}}",
        "contact": {},
        "version": "{{.Version}}"
    },
    "host": "{{.Host}}",
    "basePath": "{{.BasePath}}",
    "paths": {
        "/api/v1/app/taskapi/result/{id}": {
            "get": {
                "description": "Retrieve the final result of a completed task. Returns detailed scan results, vulnerabilities found, and security assessment data.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "taskapi"
                ],
                "summary": "Get task result",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Task Session ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task result retrieved successfully. Data contains scan results, vulnerabilities, and security findings",
                        "schema": {
                            "$ref": "#/definitions/websocket.APIResponse"
                        }
                    },
                    "400": {
                        "description": "Invalid session ID format",
                        "schema": {
                            "$ref": "#/definitions/websocket.APIResponse"
                        }
                    },
                    "404": {
                        "description": "Task not found or not completed",
                        "schema": {
                            "$ref": "#/definitions/websocket.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/websocket.APIResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/app/taskapi/status/{id}": {
            "get": {
                "description": "Retrieve the current status and logs of a task by session ID. Returns task metadata and execution logs.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "taskapi"
                ],
                "summary": "Get task status",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Task Session ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task status retrieved successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/websocket.APIResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/websocket.TaskStatusResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid session ID format",
                        "schema": {
                            "$ref": "#/definitions/websocket.APIResponse"
                        }
                    },
                    "404": {
                        "description": "Task not found",
                        "schema": {
                            "$ref": "#/definitions/websocket.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/websocket.APIResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/app/taskapi/tasks": {
            "post": {
                "description": "Submit a new task for processing. Supports three types of tasks:\n1. MCP Scan (mcp_scan): Model Context Protocol security scanning\n2. AI Infra Scan (ai_infra_scan): AI infrastructure security scanning\n3. Model Redteam Report (model_redteam_report): AI model red team testing\n\nRequest Body Examples:\n\nMCP Scan Task:\n{\n\"type\": \"mcp_scan\",\n\"content\": {\n\"prompt\": \"Custom prompt for scan\",\n\"model\": {\n\"model\": \"gpt-4\",\n\"token\": \"sk-xxx\",\n\"base_url\": \"https://api.openai.com/v1\"\n},\n\"thread\": 4,\n\"language\": \"zh\",\n\"attachments\": \"file.zip\",\n\"headers\": {\n\"Authorization\": \"Bearer token\"\n}\n}\n}\n\nAI Infra Scan Task:\n{\n\"type\": \"ai_infra_scan\",\n\"content\": {\n\"target\": [\"https://example.com\"],\n\"headers\": {\n\"Authorization\": \"Bearer token\"\n},\n\"timeout\": 30,\n\"model\": {\n\"model\": \"gpt-4\",\n\"token\": \"sk-xxx\",\n\"base_url\": \"https://api.openai.com/v1\"\n}\n}\n}\n\nModel Redteam Task:\n{\n\"type\": \"model_redteam_report\",\n\"content\": {\n\"model\": [{\n\"model\": \"gpt-4\",\n\"token\": \"sk-xxx\",\n\"base_url\": \"https://api.openai.com/v1\"\n}],\n\"eval_model\": {\n\"model\": \"gpt-4\",\n\"token\": \"sk-xxx\"\n},\n\"dataset\": {\n\"dataFile\": [\"JailBench-Tiny\", \"JailbreakPrompts-Tiny\"],\n\"numPrompts\": 100,\n\"randomSeed\": 42\n},\n\"prompt\": \"How to make a bomb?\",\n\"techniques\": [\"\"]\n}\n}",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "taskapi"
                ],
                "summary": "Create a new task",
                "parameters": [
                    {
                        "description": "Task request body. Content should be JSON object containing task-specific parameters based on type",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object",
                            "properties": {
                                "content": {
                                    "type": "object"
                                },
                                "type": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task created successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/websocket.APIResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/websocket.TaskCreateResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters",
                        "schema": {
                            "$ref": "#/definitions/websocket.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/websocket.APIResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/app/taskapi/upload": {
            "post": {
                "description": "Upload a file for task processing. Supports various file formats including zip, json, txt, etc.\nThe uploaded file will be stored securely and can be referenced in task creation.",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "taskapi"
                ],
                "summary": "Upload file",
                "parameters": [
                    {
                        "type": "file",
                        "description": "File to upload",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File uploaded successfully",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "data": {
                                    "type": "object",
                                    "properties": {
                                        "fileUrl": {
                                            "type": "string"
                                        },
                                        "filename": {
                                            "type": "string"
                                        },
                                        "size": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "message": {
                                    "type": "string"
                                },
                                "status": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid file or upload parameters",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "data": {
                                    "type": "object"
                                },
                                "message": {
                                    "type": "string"
                                },
                                "status": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "data": {
                                    "type": "object"
                                },
                                "message": {
                                    "type": "string"
                                },
                                "status": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "websocket.APIResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "description": "响应数据"
                },
                "message": {
                    "description": "响应消息",
                    "type": "string",
                    "example": "操作成功"
                },
                "status": {
                    "description": "状态码: 0=成功, 1=失败",
                    "type": "integer",
                    "example": 0
                }
            }
        },
        "websocket.TaskCreateResponse": {
            "type": "object",
            "properties": {
                "session_id": {
                    "description": "任务会话ID",
                    "type": "string",
                    "example": "550e8400-e29b-41d4-a716-446655440000"
                }
            }
        },
        "websocket.TaskStatusResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "description": "创建时间戳(毫秒)",
                    "type": "integer",
                    "example": 1640995200000
                },
                "log": {
                    "description": "任务执行日志",
                    "type": "string",
                    "example": "任务执行日志..."
                },
                "session_id": {
                    "description": "任务会话ID",
                    "type": "string",
                    "example": "550e8400-e29b-41d4-a716-446655440000"
                },
                "status": {
                    "description": "任务状态: pending, running, completed, failed",
                    "type": "string",
                    "example": "running"
                },
                "title": {
                    "description": "任务标题",
                    "type": "string",
                    "example": "MCP安全扫描任务"
                },
                "updated_at": {
                    "description": "更新时间戳(毫秒)",
                    "type": "integer",
                    "example": 1640995200000
                }
            }
        }
    }
}`

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
	Version:          "1.0",
	Host:             "",
	BasePath:         "/",
	Schemes:          []string{},
	Title:            "AI-Infra-Guard 任务API",
	Description:      "API for managing AI security scanning tasks",
	InfoInstanceName: "swagger",
	SwaggerTemplate:  docTemplate,
	LeftDelim:        "{{",
	RightDelim:       "}}",
}

func init() {
	swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
