{
    "schemes": ["http","https"],
    "swagger": "2.0",
    "info": {
        "description": "Nife.io is a backend server for nifectl",
        "title": "NIFE.IO SWAGGER API",
        "contact": {},
        "version": "1.0"
    },
    "host": "localhost:8080",
    "basePath": "",
    "paths": {
        "/api/billing/plan-status": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Returns detailed information about user's current plan, usage, limits, and billing status",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "billing"
                ],
                "summary": "Get User Plan Status",
                "responses": {
                    "200": {
                        "description": "Plan status information",
                        "schema": {
                            "$ref": "#/definitions/billing_api.PlanStatusResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/billing/plan-status/user": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Returns plan status for a specific user (admin only)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "billing"
                ],
                "summary": "Get Plan Status by User ID (Admin)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "userId",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Plan status information",
                        "schema": {
                            "$ref": "#/definitions/billing_api.PlanStatusResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/agents/deploy": {
            "post": {
                "description": "handles HTTP POST requests to deploy via agent",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "agents"
                ],
                "summary": "Deploy an application via an agent",
                "parameters": [
                    {
                        "description": "Deployment Request",
                        "name": "deployment",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/service.DeploymentRequest"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Accepted",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/agents/deployment/status": {
            "get": {
                "description": "handles status updates from agents",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "agents"
                ],
                "summary": "Get the status of a deployment",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Message ID",
                        "name": "message_id",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/agents/status": {
            "get": {
                "description": "Provides a simple HTTP endpoint for agent status",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "agents"
                ],
                "summary": "Get the status of all connected agents",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/credits/apps/{app_id}/cost": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Retrieve current cost breakdown for a specific application",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Credits"
                ],
                "summary": "Get current application cost",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Application ID",
                        "name": "app_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Application cost retrieved successfully",
                        "schema": {
                            "$ref": "#/definitions/service.AppCurrentCostResponse"
                        }
                    },
                    "400": {
                        "description": "Invalid app_id",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "404": {
                        "description": "Application not found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/credits/balance": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Retrieve the current credit balance for the authenticated user",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Credits"
                ],
                "summary": "Get user credit balance",
                "responses": {
                    "200": {
                        "description": "Current credit balance",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/credits/estimate/deployment": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Calculate estimated cost for a new deployment configuration",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Credits"
                ],
                "summary": "Estimate deployment cost",
                "parameters": [
                    {
                        "description": "Deployment Configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/service.DeploymentCostEstimateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cost estimate calculated successfully",
                        "schema": {
                            "$ref": "#/definitions/service.CostEstimateResponse"
                        }
                    },
                    "400": {
                        "description": "Invalid request body",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/credits/estimate/scale": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Calculate additional cost for scaling application to new regions",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Credits"
                ],
                "summary": "Estimate scaling cost",
                "parameters": [
                    {
                        "description": "Scale Configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/service.ScaleCostEstimateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scale cost estimate calculated successfully",
                        "schema": {
                            "$ref": "#/definitions/service.CostEstimateResponse"
                        }
                    },
                    "400": {
                        "description": "Invalid request body",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/credits/estimate/update": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Calculate cost change for updating application resources (CPU, memory, replicas)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Credits"
                ],
                "summary": "Estimate resource update cost",
                "parameters": [
                    {
                        "description": "Update Configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/service.UpdateCostEstimateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Resource update cost estimate calculated successfully",
                        "schema": {
                            "$ref": "#/definitions/service.CostChangeResponse"
                        }
                    },
                    "400": {
                        "description": "Invalid request body",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/credits/usage/summary": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Retrieve overall usage summary including all applications and total costs for a user",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Credits"
                ],
                "summary": "Get usage summary",
                "parameters": [
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "user_id",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Usage summary retrieved successfully",
                        "schema": {
                            "$ref": "#/definitions/service.UsageSummaryResponse"
                        }
                    },
                    "400": {
                        "description": "Invalid user_id",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/dora/deployment/complete": {
            "post": {
                "description": "Records the completion of a deployment for DORA metrics tracking",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "DORA Metrics"
                ],
                "summary": "Track deployment completion",
                "parameters": [
                    {
                        "description": "Deployment completion details",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/service.TrackDeploymentCompleteRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/dora/deployment/start": {
            "post": {
                "description": "Records the start of a deployment for DORA metrics tracking",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "DORA Metrics"
                ],
                "summary": "Track deployment start",
                "parameters": [
                    {
                        "description": "Deployment start details",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/service.TrackDeploymentStartRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/dora/deployment/{deploymentId}": {
            "get": {
                "description": "Returns deployment metrics by deployment ID",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "DORA Metrics"
                ],
                "summary": "Get DORA metrics for a specific deployment",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Deployment ID",
                        "name": "deploymentId",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/service.DORAMetrics"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/dora/incident": {
            "post": {
                "description": "Records an incident for MTTR tracking",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "DORA Metrics"
                ],
                "summary": "Track incident",
                "parameters": [
                    {
                        "description": "Incident details",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/service.TrackIncidentRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/dora/incident/{incidentId}/resolve": {
            "patch": {
                "description": "Marks an incident as resolved",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "DORA Metrics"
                ],
                "summary": "Resolve incident",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Incident ID",
                        "name": "incidentId",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Resolution details",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/service.ResolveIncidentRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/dora/org/{orgId}/aggregated/{period}": {
            "get": {
                "description": "Returns aggregated DORA metrics for the specified period",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "DORA Metrics"
                ],
                "summary": "Get aggregated DORA metrics",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "orgId",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Aggregation period (daily, weekly, monthly)",
                        "name": "period",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Start time (RFC3339)",
                        "name": "start_time",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "End time (RFC3339)",
                        "name": "end_time",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/service.DORAAggregate"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/dora/org/{orgId}/app/{appName}/metrics": {
            "get": {
                "description": "Returns DORA metrics for the specified application",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "DORA Metrics"
                ],
                "summary": "Get DORA metrics for a specific application",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "orgId",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Application Name",
                        "name": "appName",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/service.DORAMetricsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/dora/org/{orgId}/metrics": {
            "get": {
                "description": "Returns DORA metrics for the specified organization (last 30 days by default)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "DORA Metrics"
                ],
                "summary": "Get DORA metrics for organization",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "orgId",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/service.DORAMetricsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/fileUpload/{name}": {
            "post": {
                "description": "Uploads a file (zip, tar, tar.gz, json, yaml) to the configured storage provider (AWS or GCP) and returns its public URL.",
                "consumes": [
                    "application/octet-stream"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "FileUpload"
                ],
                "summary": "Upload a file to AWS or GCP storage",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Application name (used for naming file)",
                        "name": "name",
                        "in": "path",
                        "required": true
                    },
                    {
                        "enum": [
                            "zip",
                            "tar",
                            "tar.gz",
                            "json",
                            "yaml",
                            "yml"
                        ],
                        "type": "string",
                        "description": "File extension",
                        "name": "fileExtension",
                        "in": "query",
                        "required": true
                    },
                    {
                        "description": "Raw binary file data",
                        "name": "file",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Example: {\\\"s3Link\\\": \\\"https://...\\\"}",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Example: {\\\"message\\\": \\\"can't read body\\\"}",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Example: {\\\"message\\\": \\\"Invalid file extension\\\"}",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/finops/gcp/{name}": {
            "post": {
                "description": "Uploads a GCP service account JSON key specifically for FinOps functionality",
                "tags": [
                    "FinOps"
                ],
                "summary": "Upload GCP service account key for FinOps",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Key identifier name",
                        "name": "name",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "JSON key contents",
                        "name": "file",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/instanceKey/{name}": {
            "post": {
                "description": "Uploads a JSON key file for an instance to AWS S3 or GCP storage.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "InstanceKeyUpload"
                ],
                "summary": "Upload an instance key JSON file",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Instance name",
                        "name": "name",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "JSON file contents",
                        "name": "file",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs": {
            "get": {
                "description": "Retrieve logs with optional filtering",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Logs"
                ],
                "summary": "Get logs with filters",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Filter by cluster",
                        "name": "cluster_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by namespace",
                        "name": "namespace",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by pod",
                        "name": "pod_name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by container",
                        "name": "container_name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by app",
                        "name": "app_name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by level",
                        "name": "log_level",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search in message",
                        "name": "search_text",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start time (RFC3339)",
                        "name": "start_time",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "End time (RFC3339)",
                        "name": "end_time",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 100,
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 0,
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/admin/scheduler/restart": {
            "post": {
                "description": "Restart the log collection scheduler (admin only)",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Admin"
                ],
                "summary": "Restart scheduler",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/admin/scheduler/status": {
            "get": {
                "description": "Get current status of the log collection scheduler",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Admin"
                ],
                "summary": "Get scheduler status",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/admin/status": {
            "get": {
                "description": "Retrieve overall system status and metrics",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Admin"
                ],
                "summary": "Get system status",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/analyze-adhoc": {
            "post": {
                "description": "Run cluster, security, cost, and diagnosis analysis against a kubeconfig loaded directly from an S3/HTTPS URL, without registering the cluster in the DB",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Cluster Info"
                ],
                "summary": "Analyze a cluster from an ad-hoc kubeconfig URL",
                "parameters": [
                    {
                        "description": "Kubeconfig URL and cluster name",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.AdhocAnalyzeClusterRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Combined analysis report",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.CombinedClusterReport"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/archive/jobs": {
            "get": {
                "description": "Retrieve archive job history",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Archive"
                ],
                "summary": "Get archive jobs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Filter by status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 50,
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 0,
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/k8s_logs.K8sLogArchiveJob"
                            }
                        }
                    }
                }
            },
            "post": {
                "description": "Manually trigger a log archiving job",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Archive"
                ],
                "summary": "Start archive job",
                "parameters": [
                    {
                        "description": "Archive job parameters",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Accepted",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.K8sLogArchiveJob"
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/archive/jobs/{job_id}": {
            "get": {
                "description": "Retrieve details for a specific archive job",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Archive"
                ],
                "summary": "Get archive job details",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Job ID",
                        "name": "job_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.K8sLogArchiveJob"
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/archive/policies": {
            "get": {
                "description": "Retrieve all archive policies for the organization",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Archive"
                ],
                "summary": "Get archive policies",
                "parameters": [
                    {
                        "type": "boolean",
                        "description": "Filter by active status",
                        "name": "is_active",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 50,
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 0,
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/k8s_logs.K8sLogArchivePolicy"
                            }
                        }
                    }
                }
            },
            "put": {
                "description": "Update an existing log archive policy",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Update archive policy",
                "parameters": [
                    {
                        "description": "Archive policy",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.K8sLogArchivePolicy"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.K8sLogArchivePolicy"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a new log archival policy",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Archive"
                ],
                "summary": "Create archive policy",
                "parameters": [
                    {
                        "description": "Archive policy",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.K8sLogArchivePolicy"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.K8sLogArchivePolicy"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete a log archive policy",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Delete archive policy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Policy ID",
                        "name": "id",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/archive/policies/{policy_id}": {
            "put": {
                "description": "Update an existing archive policy",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Archive"
                ],
                "summary": "Update archive policy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Policy ID",
                        "name": "policy_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.K8sLogArchivePolicy"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete an archive policy",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Archive"
                ],
                "summary": "Delete archive policy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Policy ID",
                        "name": "policy_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/archive/start": {
            "post": {
                "description": "Manually trigger a log archiving job",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Start archive job",
                "parameters": [
                    {
                        "description": "Archive job parameters",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Accepted",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.K8sLogArchiveJob"
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters": {
            "get": {
                "description": "Retrieve all available Kubernetes clusters",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Clusters"
                ],
                "summary": "List available clusters",
                "parameters": [
                    {
                        "type": "integer",
                        "default": 50,
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 0,
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}": {
            "get": {
                "description": "Retrieve detailed information about a cluster",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Clusters"
                ],
                "summary": "Get cluster details",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/analysis": {
            "get": {
                "description": "Retrieve detailed analysis of a Kubernetes cluster including version, node info, pod, and namespace counts",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Cluster Info"
                ],
                "summary": "Get cluster analysis",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cluster analysis report",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.ClusterAnalysis"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/cost-analysis": {
            "get": {
                "description": "Retrieve a cost analysis report for a Kubernetes cluster, detailing resource requests, limits, and cluster capacity",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Cost Analysis"
                ],
                "summary": "Get cost analysis report",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cost analysis report",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.CostAnalysisReport"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/diagnose": {
            "get": {
                "description": "Retrieve a diagnosis report for a Kubernetes cluster, listing problematic resources and suggested solutions (K8sGPT-like data collection)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Diagnosis"
                ],
                "summary": "Get cluster diagnosis report",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Diagnosis report",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.DiagnosisReport"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/health": {
            "get": {
                "description": "Retrieve health status of cluster components",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Clusters"
                ],
                "summary": "Get cluster health",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/metrics": {
            "get": {
                "description": "Retrieve counts of all major resources in a specified Kubernetes cluster.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Clusters"
                ],
                "summary": "Get cluster-wide resource metrics",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/namespaces": {
            "get": {
                "description": "Retrieve all namespaces in a cluster",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Clusters"
                ],
                "summary": "Get cluster namespaces",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "default": 50,
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 0,
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/namespaces/{namespace}/pods/{pod_name}/containers": {
            "get": {
                "description": "List all containers within a specific pod",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Pod Containers"
                ],
                "summary": "List pod containers",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Namespace",
                        "name": "namespace",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Pod name",
                        "name": "pod_name",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of containers with details",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/namespaces/{namespace}/pods/{pod_name}/live-logs": {
            "get": {
                "description": "Fetch a live snapshot of a container's logs directly from the cluster",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Cluster Pods"
                ],
                "summary": "Get live pod logs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Namespace",
                        "name": "namespace",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Pod name",
                        "name": "pod_name",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Container name (defaults to the pod's only/first container)",
                        "name": "container",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 200,
                        "description": "Number of lines to tail",
                        "name": "tail_lines",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Fetch logs from the previous terminated container instance",
                        "name": "previous",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Log snapshot",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/pods": {
            "get": {
                "description": "List all pods in a Kubernetes cluster, optionally filtered by namespace",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Cluster Pods"
                ],
                "summary": "List cluster pods",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Namespace to filter pods (optional)",
                        "name": "namespace",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of pods with details",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/resources": {
            "get": {
                "description": "Retrieve a list of all resources from a specified Kubernetes cluster",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Clusters"
                ],
                "summary": "Get all resources from a cluster",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/clusters/{cluster_id}/security-analysis": {
            "get": {
                "description": "Retrieve a security analysis report for a Kubernetes cluster, identifying common misconfigurations",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Security Analysis"
                ],
                "summary": "Get security analysis report",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Security analysis report",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.SecurityAnalysisReport"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/collect": {
            "post": {
                "description": "Manually trigger log collection from a specific pod",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Start log collection from a pod",
                "parameters": [
                    {
                        "description": "Collection parameters",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.StartLogCollectionRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/collect/bulk": {
            "post": {
                "description": "Collect logs from all pods in specified namespaces",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Bulk log collection",
                "parameters": [
                    {
                        "description": "Bulk collection parameters",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.BulkLogCollectionRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/collect/continuous": {
            "post": {
                "description": "Start continuous log collection with streaming",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Start continuous log streaming",
                "parameters": [
                    {
                        "description": "Collection parameters",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.StartLogCollectionRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/collect/jobs": {
            "get": {
                "description": "Retrieve log collection job history",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Get log collection jobs",
                "parameters": [
                    {
                        "type": "integer",
                        "default": 50,
                        "description": "Maximum number of jobs",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by status",
                        "name": "status",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/k8s_logs.K8sLogCollectionJob"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/config": {
            "get": {
                "description": "Retrieve all collection configurations for the current user",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Collection Config"
                ],
                "summary": "List user's collection configurations",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Filter by cluster",
                        "name": "cluster_id",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Filter by enabled status",
                        "name": "is_enabled",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 50,
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 0,
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "put": {
                "description": "Update user's collection preferences for a cluster",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Collection Config"
                ],
                "summary": "Update collection configuration",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "query",
                        "required": true
                    },
                    {
                        "description": "Update data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "post": {
                "description": "Save user's collection preferences for a specific cluster",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Collection Config"
                ],
                "summary": "Enable log collection for a cluster",
                "parameters": [
                    {
                        "description": "Configuration",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.CollectionConfigRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "delete": {
                "description": "Disable log collection for a specific cluster",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Collection Config"
                ],
                "summary": "Disable collection for a cluster",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/config/bulk-update": {
            "post": {
                "description": "Update multiple collection configurations at once",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Collection Config"
                ],
                "summary": "Bulk update collection configurations",
                "parameters": [
                    {
                        "description": "Bulk update request",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.BulkUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/config/disable": {
            "post": {
                "description": "Disable all log collection for a user",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs Configuration"
                ],
                "summary": "Disable collection for user",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/config/disable/cluster": {
            "post": {
                "description": "Disable log collection for a specific cluster",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs Configuration"
                ],
                "summary": "Disable collection for cluster",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/containers": {
            "get": {
                "description": "List all containers within a specified pod in a given cluster and namespace",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Cluster Info"
                ],
                "summary": "List containers",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "clusterId",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Namespace where the pod is located",
                        "name": "namespace",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Pod name to list containers from",
                        "name": "pod",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of container names",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/export": {
            "post": {
                "description": "Start an async job to export logs in CSV or JSON format",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Export"
                ],
                "summary": "Export logs to file",
                "parameters": [
                    {
                        "description": "Export parameters",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Accepted",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/exports/{export_id}": {
            "get": {
                "description": "Check the status of an export job",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Export"
                ],
                "summary": "Get export status",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Export ID",
                        "name": "export_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/exports/{export_id}/download": {
            "get": {
                "description": "Download the exported log file",
                "produces": [
                    "application/octet-stream"
                ],
                "tags": [
                    "Export"
                ],
                "summary": "Download exported logs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Export ID",
                        "name": "export_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "file"
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/metrics": {
            "get": {
                "description": "Retrieve aggregated log metrics and statistics",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Get log metrics",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.K8sLogMetrics"
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/namespaces": {
            "get": {
                "description": "Retrieve all namespaces from a specific cluster",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "List namespaces from a Kubernetes cluster",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/pods": {
            "get": {
                "description": "List all Kubernetes pods for a given cluster and namespace",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Cluster Info"
                ],
                "summary": "List pods",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID",
                        "name": "clusterId",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Namespace to list pods from",
                        "name": "namespace",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of pod names",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/s3/content": {
            "get": {
                "description": "Download and return full log content from S3 for a specific log file",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs - S3"
                ],
                "summary": "Get full log content from S3",
                "parameters": [
                    {
                        "type": "string",
                        "description": "S3 key of the log file",
                        "name": "s3_key",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.LogBatch"
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/s3/metadata": {
            "get": {
                "description": "Retrieve K8s log metadata when using S3 storage",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs - S3"
                ],
                "summary": "Get Kubernetes log metadata (S3 mode)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Cluster ID filter",
                        "name": "cluster_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Namespace filter",
                        "name": "namespace",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Pod name filter",
                        "name": "pod_name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start time (RFC3339 format)",
                        "name": "start_time",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "End time (RFC3339 format)",
                        "name": "end_time",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "default": 100,
                        "description": "Maximum number of results",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/k8s_logs.LogMetadata"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/s3/stats": {
            "get": {
                "description": "Get statistics about S3-stored K8s logs",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs - S3"
                ],
                "summary": "Get S3 log storage statistics",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.LogMetadataStats"
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/search": {
            "post": {
                "description": "Search logs using LogQL query syntax",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Logs"
                ],
                "summary": "Advanced search with LogQL",
                "parameters": [
                    {
                        "description": "LogQL query",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.LogQLQuery"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/search/logql": {
            "post": {
                "description": "Search logs using Loki-style LogQL syntax",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Search logs using LogQL queries",
                "parameters": [
                    {
                        "description": "LogQL query",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/k8s_logs.LogQLQuery"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/k8s_logs.K8sLogEntry"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/stats": {
            "get": {
                "description": "Retrieve aggregated log statistics",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Statistics"
                ],
                "summary": "Get log statistics",
                "parameters": [
                    {
                        "type": "string",
                        "default": "app",
                        "description": "Group by field",
                        "name": "group_by",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter cluster",
                        "name": "cluster_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter namespace",
                        "name": "namespace",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start time (RFC3339)",
                        "name": "start_time",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "End time (RFC3339)",
                        "name": "end_time",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/storage/info": {
            "get": {
                "description": "Get information about current K8s log storage configuration",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "K8s Logs - S3"
                ],
                "summary": "Get storage information",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/k8s/logs/stream": {
            "get": {
                "description": "Stream logs in real-time using WebSocket",
                "tags": [
                    "K8s Logs"
                ],
                "summary": "Stream logs via WebSocket",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Filter by application ID",
                        "name": "app_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by application ID (alternative)",
                        "name": "appId",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by cluster ID",
                        "name": "cluster_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by namespace",
                        "name": "namespace",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by pod name",
                        "name": "pod_name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by container name",
                        "name": "container_name",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Follow logs (tail) - default true",
                        "name": "follow",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Number of lines to tail - default 50",
                        "name": "tail_lines",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include timestamps - default true",
                        "name": "timestamps",
                        "in": "query"
                    }
                ],
                "responses": {
                    "101": {
                        "description": "WebSocket upgrade",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/api/v1/kubeconfig/{name}": {
            "post": {
                "description": "Uploads a YAML kubeconfig file to storage",
                "consumes": [
                    "multipart/form-data"
                ],
                "tags": [
                    "KubeConfig"
                ],
                "summary": "Upload a Kubernetes config file",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Config name",
                        "name": "name",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "file",
                        "description": "YAML config file",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/login": {
            "post": {
                "description": "Authenticate user to create JWT token",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "login"
                ],
                "summary": "Authenticate user",
                "parameters": [
                    {
                        "description": "Create Token",
                        "name": "dataBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/users.LoginRequestBody"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/users.TokenResponseBody"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    }
                }
            }
        },
        "/api/v1/oauth/callback": {
            "post": {
                "description": "Handle OAuth callback, exchange code for token, and run the full SSO login workflow\n(role checks, Stripe subscription, plan permissions, activity log, refresh token).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "login"
                ],
                "summary": "OAuth Callback Handler",
                "parameters": [
                    {
                        "description": "OAuth Callback Request",
                        "name": "dataBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/users.OAuthCallbackRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    }
                }
            }
        },
        "/api/v1/oauth/init": {
            "post": {
                "description": "Get OAuth authorization URL for a provider",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "login"
                ],
                "summary": "Initialize OAuth Flow",
                "parameters": [
                    {
                        "description": "OAuth Init Request",
                        "name": "dataBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/users.OAuthInitRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/users.OAuthInitResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    }
                }
            }
        },
        "/api/v1/profileImage": {
            "post": {
                "description": "Uploads a profile image to local or cloud storage with security validation.",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Profile"
                ],
                "summary": "Upload a profile image",
                "parameters": [
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "userId",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Type of image (e.g., companylogo)",
                        "name": "type",
                        "in": "query"
                    },
                    {
                        "type": "file",
                        "description": "Profile image (max 5MB, JPEG/PNG/WebP/GIF)",
                        "name": "photo",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "imageLink",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "delete": {
                "description": "Deletes a profile image from storage for a given userId and imageName",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Profile"
                ],
                "summary": "Delete a user's profile image",
                "parameters": [
                    {
                        "description": "User details containing UserId and ImageType",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/fileupload.UserDetails"
                        }
                    },
                    {
                        "type": "string",
                        "description": "Name of the image to delete",
                        "name": "imageName",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/prometheus/clusters": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Get a list of all Bring Your Own Cluster (BYOC) clusters that have Prometheus configured for a specific user",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Prometheus Configuration"
                ],
                "summary": "List BYOC clusters with Prometheus",
                "parameters": [
                    {
                        "type": "string",
                        "example": "\"user-456def\"",
                        "description": "User ID",
                        "name": "user_id",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of BYOC clusters with Prometheus configuration",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/clusterInfo.ClusterInfoUserPrometheus"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing user_id",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/prometheus/config": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Retrieve Prometheus configuration for a cluster or region. Requires either cluster_id or (region_code + user_id) as query parameters.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Prometheus Configuration"
                ],
                "summary": "Get Prometheus configuration",
                "parameters": [
                    {
                        "type": "string",
                        "example": "\"cluster-123abc\"",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "\"us-west-2\"",
                        "description": "Region code",
                        "name": "region_code",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "\"user-456def\"",
                        "description": "User ID (required with region_code)",
                        "name": "user_id",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Prometheus configuration",
                        "schema": {
                            "$ref": "#/definitions/service.PrometheusConfigResponse"
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing required parameters",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Configuration not found",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Configure Prometheus URL and authentication for a cluster or region. Requires either cluster_id or (region_code + user_id).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Prometheus Configuration"
                ],
                "summary": "Set Prometheus configuration",
                "parameters": [
                    {
                        "description": "Prometheus configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.PrometheusConfigRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Configuration saved successfully",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.SuccessMessageResponse"
                        }
                    },
                    "400": {
                        "description": "Bad request - Invalid parameters or missing required fields",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Delete Prometheus configuration for a cluster or region. Requires either cluster_id or (region_code + user_id) as query parameters.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Prometheus Configuration"
                ],
                "summary": "Remove Prometheus configuration",
                "parameters": [
                    {
                        "type": "string",
                        "example": "\"cluster-123abc\"",
                        "description": "Cluster ID",
                        "name": "cluster_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "\"us-west-2\"",
                        "description": "Region code",
                        "name": "region_code",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "\"user-456def\"",
                        "description": "User ID (required with region_code)",
                        "name": "user_id",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Configuration removed successfully",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.SuccessMessageResponse"
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing required parameters",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Configuration not found",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/prometheus/metrics/all": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Fetch a comprehensive set of metrics for a given application and service.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Prometheus Metrics"
                ],
                "summary": "Get all metrics for a service",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Application name",
                        "name": "appName",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Service name",
                        "name": "serviceName",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Time range for metrics (e.g., '5m', '1h', defaults to '5m')",
                        "name": "timeRange",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "All metrics for the service",
                        "schema": {
                            "$ref": "#/definitions/service.DeploymentMetrics"
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing or invalid parameters",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/prometheus/query": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Execute a PromQL query against the default Prometheus instance.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Prometheus Metrics"
                ],
                "summary": "Query Prometheus metrics",
                "parameters": [
                    {
                        "type": "string",
                        "description": "PromQL query",
                        "name": "query",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Prometheus query result",
                        "schema": {
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing query parameter",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/prometheus/query_batch": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Executes up to 20 PromQL queries (instant and/or range) concurrently against the default Prometheus instance and returns results keyed by query id. Replaces many separate /query and /query_range calls.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Prometheus Metrics"
                ],
                "summary": "Run multiple Prometheus queries in one request",
                "parameters": [
                    {
                        "description": "Batch of queries",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.BatchQueryRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Results keyed by query id",
                        "schema": {
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/prometheus/query_range": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Execute a PromQL range query against the default Prometheus instance for time-series data.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Prometheus Metrics"
                ],
                "summary": "Query Prometheus metrics with time range",
                "parameters": [
                    {
                        "type": "string",
                        "description": "PromQL query",
                        "name": "query",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Start timestamp (Unix timestamp or RFC3339)",
                        "name": "start",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "End timestamp (Unix timestamp or RFC3339, defaults to now)",
                        "name": "end",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Step duration (e.g., '15s', '1m', '5m', defaults to '1m')",
                        "name": "step",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Prometheus range query result",
                        "schema": {
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing or invalid parameters",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/prometheus/verify": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Test the connection to Prometheus for a cluster or region to ensure configuration is correct. Requires either cluster_id or (region_code + user_id).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Prometheus Configuration"
                ],
                "summary": "Verify Prometheus connection",
                "parameters": [
                    {
                        "description": "Verification parameters with cluster_id or (region_code + user_id)",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Connection verification result",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string"
                                },
                                "success": {
                                    "type": "boolean"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Invalid parameters or missing required fields",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/prometheus_api.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/refreshToken": {
            "post": {
                "description": "Reauthenticate user by renewing JWT token",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "refreshToken"
                ],
                "summary": "Reauthenticate user using refresh_token",
                "parameters": [
                    {
                        "description": "Refresh Token",
                        "name": "dataBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/users.RefreshTokenRequestBody"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/users.TokenResponseBody"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    }
                }
            }
        },
        "/api/v1/register": {
            "post": {
                "description": "Register a new user with email, password, and company details. Creates a Stripe customer and free subscription.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Authentication"
                ],
                "summary": "Register a new user",
                "parameters": [
                    {
                        "description": "User Registration Details",
                        "name": "dataBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/users.UserRegisterRequestBody"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Returns user_Id and access_token",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request - Invalid input or email already exists",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/ssoLogin": {
            "post": {
                "description": "Sign in user via OAuth providers (Google, GitHub, GitLab, Bitbucket, Azure, AWS)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "login"
                ],
                "summary": "SSO Sign In",
                "parameters": [
                    {
                        "description": "SSO Login Details",
                        "name": "dataBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/users.SsoLoginDetails"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/users.TokenResponseBody"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    }
                }
            }
        },
        "/api/v1/ssoSignUp": {
            "post": {
                "description": "Sign up user via OAuth providers (Google, GitHub, GitLab, Bitbucket, Azure, AWS)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "register"
                ],
                "summary": "SSO Sign Up",
                "parameters": [
                    {
                        "description": "SSO Sign Up Details",
                        "name": "dataBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/users.SsoLoginDetails"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/users.TokenResponseBody"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/users.TokenErrorBody"
                        }
                    }
                }
            }
        },
        "/api/v1/vault/audit": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Retrieve audit logs for vault operations",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Get vault audit logs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "default": 100,
                        "description": "Number of logs to return",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by operation type",
                        "name": "operation",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by vault provider",
                        "name": "vault_provider_id",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Audit logs retrieved successfully",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Organization ID missing",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/vault/health": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Perform health checks on all configured vault providers",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Check vault health",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Health check results",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Organization ID missing",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/vault/providers": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Retrieve all vault providers configured for an organization",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Get vault providers",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of vault providers",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Organization ID missing",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Create a new vault provider configuration for an organization",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Create vault provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "X-User-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Vault Provider Configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/customervault.CreateVaultProviderRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Vault provider created successfully",
                        "schema": {
                            "$ref": "#/definitions/customervault.CustomerVaultProvider"
                        }
                    },
                    "400": {
                        "description": "Invalid request body or missing headers",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/vault/providers/{id}": {
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Update an existing vault provider configuration",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Update vault provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Provider ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "X-User-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Updated Vault Provider Configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/customervault.CreateVaultProviderRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Vault provider updated successfully",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "403": {
                        "description": "Unauthorized",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "404": {
                        "description": "Provider not found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Delete a vault provider configuration",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Delete vault provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Provider ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "X-User-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Vault provider deleted successfully",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "403": {
                        "description": "Unauthorized",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "404": {
                        "description": "Provider not found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "409": {
                        "description": "Provider in use",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/vault/secrets": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Create a new secret with external vault integration",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Create secret with vault",
                "parameters": [
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "X-User-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Secret Configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/customervault.CreateSecretWithVaultRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Secret created successfully",
                        "schema": {
                            "$ref": "#/definitions/customervault.OrganizationSecretWithVault"
                        }
                    },
                    "400": {
                        "description": "Invalid request body",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/vault/secrets/{id}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Retrieve a secret from external vault",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Get secret from vault",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Secret ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "X-User-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Secret retrieved successfully",
                        "schema": {
                            "$ref": "#/definitions/customervault.OrganizationSecretWithVault"
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Update an existing secret in external vault",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Update secret in vault",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Secret ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "X-User-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Updated Secret Configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/customervault.CreateSecretWithVaultRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Secret updated successfully",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Delete a secret from external vault",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Delete secret from vault",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Secret ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "X-User-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Secret deleted successfully",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/vault/sync": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Synchronize secrets between Nife and external vault provider",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Sync secrets with vault",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "X-User-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Sync Configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/customervault.SyncSecretsRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Sync job started successfully",
                        "schema": {
                            "$ref": "#/definitions/customervault.VaultSyncJob"
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/vault/sync/jobs": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Retrieve sync job history for an organization",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Get sync job history",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Organization ID",
                        "name": "X-Organization-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "default": 50,
                        "description": "Number of jobs to return",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Sync job history retrieved successfully",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Organization ID missing",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/vault/sync/jobs/{id}": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Retrieve a specific sync job by ID",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Vault"
                ],
                "summary": "Get a specific sync job",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Job ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Sync job retrieved successfully",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/register": {
            "post": {
                "description": "Register a new user with email, password, company details and additional validations. Includes company name uniqueness check.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Authentication"
                ],
                "summary": "Register a new user with enhanced validation",
                "parameters": [
                    {
                        "description": "User Registration Details",
                        "name": "dataBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/users.UserRegisterRequestBody"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Returns user_Id, access_token, and company details",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request - Validation failed or company name exists",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/userRegister": {
            "post": {
                "description": "Register a new user with pre-filled default values for quick onboarding. Only email and company name required.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Authentication"
                ],
                "summary": "Register user with default onboarding",
                "parameters": [
                    {
                        "description": "Email and CompanyName required",
                        "name": "dataBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Returns user_Id, access_token, and company details",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/paidApps": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    },
                    {
                        "OAuth2": []
                    },
                    {
                        "BasicAuth": []
                    },
                    {
                        "ApiKeyAuthWithPrefix": []
                    },
                    {
                        "BearerAuthWithPrefix": []
                    },
                    {
                        "OAuth2WithPrefix": []
                    },
                    {
                        "BasicAuthWithPrefix": []
                    },
                    {
                        "ApiKeyAuthWithScheme": []
                    },
                    {
                        "BearerAuthWithScheme": []
                    }
                ],
                "description": "Retrieves a list of all paid apps from the database",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "paidApps"
                ],
                "summary": "Get All Paid Apps",
                "responses": {
                    "200": {
                        "description": "List of paid app names",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/stripe": {
            "post": {
                "description": "Processes incoming webhook events from Stripe to update subscription and payment statuses.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Webhooks"
                ],
                "summary": "Handle Stripe webhook events",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Stripe webhook signature",
                        "name": "Stripe-Signature",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Stripe event payload",
                        "name": "event",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "boolean"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "billing_api.AvailablePlan": {
            "type": "object",
            "properties": {
                "benefits": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "features": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "monthlyPrice": {
                    "type": "number"
                },
                "planId": {
                    "type": "string"
                },
                "planName": {
                    "type": "string"
                }
            }
        },
        "billing_api.BillingCycleInfo": {
            "type": "object",
            "properties": {
                "currentCycleEnd": {
                    "type": "string"
                },
                "currentCycleStart": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "totalAmount": {
                    "type": "number"
                }
            }
        },
        "billing_api.CreditsInfo": {
            "type": "object",
            "properties": {
                "expiryDate": {
                    "type": "string"
                },
                "remainingCredits": {
                    "type": "number"
                },
                "totalCredits": {
                    "type": "number"
                },
                "usedCredits": {
                    "type": "number"
                }
            }
        },
        "billing_api.LimitsInfo": {
            "type": "object",
            "properties": {
                "dailySpendingLimit": {
                    "type": "number"
                },
                "maxApps": {
                    "type": "integer"
                },
                "maxCpuCores": {
                    "type": "number"
                },
                "maxMemoryGb": {
                    "type": "number"
                },
                "maxRegions": {
                    "type": "integer"
                },
                "maxReplicas": {
                    "type": "integer"
                },
                "monthlySpendingLimit": {
                    "type": "number"
                }
            }
        },
        "billing_api.PlanDetails": {
            "type": "object",
            "properties": {
                "billingInterval": {
                    "description": "\"monthly\", \"yearly\"",
                    "type": "string"
                },
                "currency": {
                    "type": "string"
                },
                "monthlyPrice": {
                    "type": "number"
                },
                "planId": {
                    "type": "string"
                },
                "planName": {
                    "type": "string"
                },
                "planType": {
                    "description": "\"free\", \"paid\", \"trial\", \"enterprise\"",
                    "type": "string"
                },
                "priceId": {
                    "type": "string"
                }
            }
        },
        "billing_api.PlanStatusResponse": {
            "type": "object",
            "properties": {
                "availableUpgrades": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/billing_api.AvailablePlan"
                    }
                },
                "billingCycle": {
                    "$ref": "#/definitions/billing_api.BillingCycleInfo"
                },
                "credits": {
                    "$ref": "#/definitions/billing_api.CreditsInfo"
                },
                "currentPlan": {
                    "$ref": "#/definitions/billing_api.PlanDetails"
                },
                "limits": {
                    "$ref": "#/definitions/billing_api.LimitsInfo"
                },
                "nextBillingDate": {
                    "type": "string"
                },
                "subscriptionStatus": {
                    "type": "string"
                },
                "usage": {
                    "$ref": "#/definitions/billing_api.UsageInfo"
                },
                "user": {
                    "$ref": "#/definitions/billing_api.UserPlanInfo"
                }
            }
        },
        "billing_api.UsageInfo": {
            "type": "object",
            "properties": {
                "activeApps": {
                    "type": "integer"
                },
                "bandwidthUsedGb": {
                    "type": "number"
                },
                "dailySpending": {
                    "type": "number"
                },
                "monthlySpending": {
                    "type": "number"
                },
                "storageUsedGb": {
                    "type": "number"
                },
                "totalDeployments": {
                    "type": "integer"
                },
                "utilizationPercent": {
                    "type": "number"
                }
            }
        },
        "billing_api.UserPlanInfo": {
            "type": "object",
            "properties": {
                "companyName": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "isFreePlan": {
                    "type": "boolean"
                },
                "isPaidPlan": {
                    "type": "boolean"
                },
                "userId": {
                    "type": "string"
                }
            }
        },
        "clusterInfo.ClusterInfoUserPrometheus": {
            "type": "object",
            "properties": {
                "adminClusterDetails": {
                    "type": "string"
                },
                "clusterConfigURL": {
                    "type": "string"
                },
                "clusterID": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "isActive": {
                    "type": "boolean"
                },
                "lastPrometheusCheck": {
                    "type": "string"
                },
                "locationName": {
                    "type": "string"
                },
                "prometheusAuthType": {
                    "type": "string"
                },
                "prometheusBearerToken": {
                    "description": "Encrypted",
                    "type": "string"
                },
                "prometheusPassword": {
                    "description": "Encrypted",
                    "type": "string"
                },
                "prometheusURL": {
                    "type": "string"
                },
                "prometheusUsername": {
                    "type": "string"
                },
                "regionCode": {
                    "type": "string"
                },
                "userID": {
                    "type": "string"
                }
            }
        },
        "customervault.CreateSecretWithVaultRequest": {
            "type": "object",
            "required": [
                "name",
                "organization_id",
                "registry_type",
                "secret_data"
            ],
            "properties": {
                "auto_sync": {
                    "type": "boolean"
                },
                "encryption_key_id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "organization_id": {
                    "type": "string"
                },
                "registry_type": {
                    "type": "string"
                },
                "secret_data": {
                    "type": "object",
                    "additionalProperties": true
                },
                "vault_path": {
                    "type": "string"
                },
                "vault_provider_id": {
                    "type": "string"
                },
                "vault_type": {
                    "$ref": "#/definitions/customervault.VaultProvider"
                }
            }
        },
        "customervault.CreateVaultProviderRequest": {
            "type": "object",
            "required": [
                "provider_config",
                "provider_name"
            ],
            "properties": {
                "display_name": {
                    "type": "string"
                },
                "is_default": {
                    "type": "boolean"
                },
                "provider_config": {
                    "type": "object",
                    "additionalProperties": true
                },
                "provider_name": {
                    "$ref": "#/definitions/customervault.VaultProvider"
                }
            }
        },
        "customervault.CustomerVaultProvider": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "is_default": {
                    "type": "boolean"
                },
                "organization_id": {
                    "description": "Populated at runtime via JOIN with vault_provider_organizations",
                    "type": "string"
                },
                "provider_config": {
                    "type": "object",
                    "additionalProperties": true
                },
                "provider_name": {
                    "$ref": "#/definitions/customervault.VaultProvider"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "customervault.OrganizationSecretWithVault": {
            "type": "object",
            "properties": {
                "aws_access_key": {
                    "type": "string"
                },
                "aws_region": {
                    "type": "string"
                },
                "aws_secret_access_key": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "string"
                },
                "encryption_key_id": {
                    "type": "string"
                },
                "id": {
                    "description": "Original fields",
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "key_file_content": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "organization_id": {
                    "type": "string"
                },
                "password": {
                    "type": "string"
                },
                "registry_name": {
                    "type": "string"
                },
                "registry_type": {
                    "type": "string"
                },
                "secret_type": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                },
                "username": {
                    "type": "string"
                },
                "vault_config": {
                    "type": "object",
                    "additionalProperties": true
                },
                "vault_metadata": {
                    "type": "object",
                    "additionalProperties": true
                },
                "vault_path": {
                    "type": "string"
                },
                "vault_type": {
                    "description": "New vault fields",
                    "allOf": [
                        {
                            "$ref": "#/definitions/customervault.VaultProvider"
                        }
                    ]
                }
            }
        },
        "customervault.SyncSecretsRequest": {
            "type": "object",
            "required": [
                "vault_provider_id"
            ],
            "properties": {
                "force_sync": {
                    "type": "boolean"
                },
                "secret_ids": {
                    "description": "if empty, sync all",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "sync_type": {
                    "description": "full, incremental",
                    "type": "string"
                },
                "vault_provider_id": {
                    "type": "string"
                }
            }
        },
        "customervault.VaultProvider": {
            "type": "string",
            "enum": [
                "internal",
                "hashicorp_vault",
                "aws_secrets_manager",
                "azure_key_vault",
                "gcp_secret_manager"
            ],
            "x-enum-varnames": [
                "VaultProviderInternal",
                "VaultProviderHashiCorpVault",
                "VaultProviderAWSSecretsManager",
                "VaultProviderAzureKeyVault",
                "VaultProviderGCPSecretManager"
            ]
        },
        "customervault.VaultSyncJob": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "string"
                },
                "end_time": {
                    "type": "string"
                },
                "error_details": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "job_metadata": {
                    "type": "object",
                    "additionalProperties": true
                },
                "organization_id": {
                    "type": "string"
                },
                "secrets_failed": {
                    "type": "integer"
                },
                "secrets_processed": {
                    "type": "integer"
                },
                "secrets_updated": {
                    "type": "integer"
                },
                "start_time": {
                    "type": "string"
                },
                "status": {
                    "description": "pending, running, completed, failed",
                    "type": "string"
                },
                "sync_type": {
                    "description": "full, incremental, single_secret",
                    "type": "string"
                },
                "vault_provider_id": {
                    "type": "string"
                }
            }
        },
        "fileupload.UserDetails": {
            "type": "object",
            "properties": {
                "type": {
                    "type": "string"
                },
                "userId": {
                    "type": "integer"
                }
            }
        },
        "k8s_logs.AdhocAnalyzeClusterRequest": {
            "type": "object",
            "properties": {
                "cluster_name": {
                    "type": "string"
                },
                "kubeconfig_url": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.BulkLogCollectionRequest": {
            "type": "object",
            "required": [
                "cluster_id",
                "namespaces"
            ],
            "properties": {
                "app_filter": {
                    "description": "Optional filter by app name",
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "namespaces": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "since_time": {
                    "description": "Only collect logs after this time (RFC3339)",
                    "type": "string"
                },
                "tail_lines": {
                    "description": "Number of lines to tail per pod (default: 500)",
                    "type": "integer"
                }
            }
        },
        "k8s_logs.BulkUpdateRequest": {
            "type": "object",
            "properties": {
                "action": {
                    "type": "string",
                    "example": "enable"
                },
                "cluster_ids": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "cluster-1",
                        "cluster-2"
                    ]
                },
                "is_enabled": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "k8s_logs.ClusterAnalysis": {
            "type": "object",
            "properties": {
                "namespaceCount": {
                    "type": "integer"
                },
                "nodes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/k8s_logs.NodeInfo"
                    }
                },
                "podCount": {
                    "type": "integer"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.ClusterStats": {
            "type": "object",
            "properties": {
                "file_count": {
                    "type": "integer"
                },
                "line_count": {
                    "type": "integer"
                },
                "size_gb": {
                    "type": "number"
                }
            }
        },
        "k8s_logs.CollectionConfigRequest": {
            "type": "object",
            "properties": {
                "app_filter": {
                    "type": "string",
                    "example": "my-app"
                },
                "cluster_id": {
                    "type": "string",
                    "example": "your-cluster-id"
                },
                "collection_interval": {
                    "description": "In minutes",
                    "type": "integer",
                    "example": 5
                },
                "exclude_namespaces": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "kube-system",
                        "kube-public"
                    ]
                },
                "is_enabled": {
                    "type": "boolean",
                    "example": true
                },
                "log_levels": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "INFO",
                        "WARN",
                        "ERROR"
                    ]
                },
                "max_logs_per_collection": {
                    "description": "Changed to *int",
                    "type": "integer",
                    "example": 1000
                },
                "namespace": {
                    "description": "Assuming single namespace",
                    "type": "string",
                    "example": "default"
                }
            }
        },
        "k8s_logs.CombinedClusterReport": {
            "type": "object",
            "properties": {
                "analysis": {
                    "$ref": "#/definitions/k8s_logs.ClusterAnalysis"
                },
                "clusterId": {
                    "type": "string"
                },
                "clusterName": {
                    "type": "string"
                },
                "cost": {
                    "$ref": "#/definitions/k8s_logs.CostAnalysisReport"
                },
                "diagnosis": {
                    "$ref": "#/definitions/k8s_logs.DiagnosisReport"
                },
                "errors": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "security": {
                    "$ref": "#/definitions/k8s_logs.SecurityAnalysisReport"
                },
                "timestamp": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.CostAnalysisReport": {
            "type": "object",
            "properties": {
                "clusterCpuCapacity": {
                    "type": "string"
                },
                "clusterId": {
                    "type": "string"
                },
                "clusterMemoryCapacity": {
                    "type": "string"
                },
                "podsResourceUsage": {
                    "description": "namespace -\u003e podName -\u003e utilization",
                    "type": "object",
                    "additionalProperties": {
                        "type": "object",
                        "additionalProperties": {
                            "$ref": "#/definitions/k8s_logs.ResourceUtilization"
                        }
                    }
                },
                "timestamp": {
                    "type": "string"
                },
                "totalCpuLimit": {
                    "type": "string"
                },
                "totalCpuRequest": {
                    "type": "string"
                },
                "totalMemoryLimit": {
                    "type": "string"
                },
                "totalMemoryRequest": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.DiagnosisReport": {
            "type": "object",
            "properties": {
                "clusterId": {
                    "type": "string"
                },
                "problems": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/k8s_logs.ProblematicResource"
                    }
                },
                "summary": {
                    "description": "e.g., {\"HighSeverityProblems\": 5}",
                    "type": "object",
                    "additionalProperties": {
                        "type": "integer"
                    }
                },
                "timestamp": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.K8sLogArchiveJob": {
            "type": "object",
            "properties": {
                "app_name_filter": {
                    "type": "string"
                },
                "archive_path": {
                    "type": "string"
                },
                "archive_size": {
                    "type": "integer"
                },
                "cluster_id_filter": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "end_date_filter": {
                    "type": "string"
                },
                "end_time": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "log_level_filter": {
                    "type": "string"
                },
                "logs_processed": {
                    "type": "integer"
                },
                "namespace_filter": {
                    "description": "Kubernetes-specific job details",
                    "type": "string"
                },
                "policy_id": {
                    "type": "string"
                },
                "start_date_filter": {
                    "type": "string"
                },
                "start_time": {
                    "type": "string"
                },
                "status": {
                    "description": "pending, running, completed, failed",
                    "type": "string"
                }
            }
        },
        "k8s_logs.K8sLogArchivePolicy": {
            "type": "object",
            "properties": {
                "app_names": {
                    "description": "Filter by app names",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "archive_after_days": {
                    "type": "integer"
                },
                "cluster_ids": {
                    "description": "Filter by cluster IDs",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "compression_type": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "log_levels": {
                    "description": "Filter by log levels (ERROR, WARN, INFO, DEBUG)",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "namespaces": {
                    "description": "Kubernetes-specific filters",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "policy_name": {
                    "type": "string"
                },
                "retention_days": {
                    "type": "integer"
                },
                "storage_location": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.K8sLogCollectionJob": {
            "type": "object",
            "properties": {
                "app_name": {
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "container_name": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "end_time": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "logs_collected": {
                    "type": "integer"
                },
                "namespace": {
                    "type": "string"
                },
                "pod_name": {
                    "type": "string"
                },
                "s3_key": {
                    "type": "string"
                },
                "s3_upload_time": {
                    "type": "string"
                },
                "start_time": {
                    "type": "string"
                },
                "status": {
                    "description": "pending, collecting, completed, failed",
                    "type": "string"
                }
            }
        },
        "k8s_logs.K8sLogEntry": {
            "type": "object",
            "properties": {
                "app_name": {
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "container_name": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "fingerprint": {
                    "description": "Log fingerprint for deduplication",
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "labels": {
                    "description": "Loki-inspired enhancements",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "line_number": {
                    "type": "integer"
                },
                "log_level": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "namespace": {
                    "type": "string"
                },
                "org_id": {
                    "type": "string"
                },
                "parsed": {
                    "description": "Parsed JSON/structured data",
                    "type": "object",
                    "additionalProperties": true
                },
                "pod_name": {
                    "type": "string"
                },
                "stream": {
                    "description": "stdout/stderr",
                    "type": "string"
                },
                "timestamp": {
                    "type": "string"
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.K8sLogMetrics": {
            "type": "object",
            "properties": {
                "active_pods": {
                    "type": "integer"
                },
                "archives_created": {
                    "type": "integer"
                },
                "avg_log_processing_time": {
                    "description": "Performance metrics",
                    "type": "number"
                },
                "compression_ratio": {
                    "type": "number"
                },
                "error_logs_today": {
                    "description": "Error statistics",
                    "type": "integer"
                },
                "logs_this_week": {
                    "type": "integer"
                },
                "logs_today": {
                    "type": "integer"
                },
                "monitored_namespaces": {
                    "type": "integer"
                },
                "recent_archive_jobs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/k8s_logs.K8sLogArchiveJob"
                    }
                },
                "space_saved": {
                    "type": "string"
                },
                "total_logs": {
                    "type": "integer"
                },
                "warning_logs_today": {
                    "type": "integer"
                }
            }
        },
        "k8s_logs.K8sLogQuery": {
            "type": "object",
            "properties": {
                "app_name": {
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "container_name": {
                    "type": "string"
                },
                "direction": {
                    "description": "forward/backward",
                    "type": "string"
                },
                "end_time": {
                    "type": "string"
                },
                "labels": {
                    "description": "Loki-inspired enhancements",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "log_level": {
                    "type": "string"
                },
                "namespace": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "pod_name": {
                    "type": "string"
                },
                "regex_search": {
                    "description": "Regex pattern search",
                    "type": "string"
                },
                "search_text": {
                    "type": "string"
                },
                "start_time": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.K8sLogSearchRequest": {
            "type": "object",
            "properties": {
                "enable_parsing": {
                    "description": "Enable JSON parsing",
                    "type": "boolean"
                },
                "enable_regex": {
                    "description": "Enable regex search",
                    "type": "boolean"
                },
                "include_archived": {
                    "description": "Whether to search in archived logs too",
                    "type": "boolean"
                },
                "logql_query": {
                    "description": "Loki-inspired enhancements",
                    "allOf": [
                        {
                            "$ref": "#/definitions/k8s_logs.LogQLQuery"
                        }
                    ]
                },
                "query": {
                    "$ref": "#/definitions/k8s_logs.K8sLogQuery"
                }
            }
        },
        "k8s_logs.K8sLogStats": {
            "type": "object",
            "properties": {
                "active_logs": {
                    "type": "integer"
                },
                "app_name": {
                    "type": "string"
                },
                "archive_size": {
                    "type": "string"
                },
                "archived_logs": {
                    "type": "integer"
                },
                "cluster_id": {
                    "description": "Added",
                    "type": "string"
                },
                "compression_ratio": {
                    "type": "number"
                },
                "debug_logs": {
                    "type": "integer"
                },
                "disk_space_saved": {
                    "type": "string"
                },
                "error_logs": {
                    "type": "integer"
                },
                "info_logs": {
                    "type": "integer"
                },
                "namespace": {
                    "type": "string"
                },
                "newest_log_date": {
                    "type": "string"
                },
                "oldest_log_date": {
                    "type": "string"
                },
                "total_logs": {
                    "type": "integer"
                },
                "warning_logs": {
                    "type": "integer"
                }
            }
        },
        "k8s_logs.LogBatch": {
            "type": "object",
            "properties": {
                "app_name": {
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "collection_time": {
                    "type": "string"
                },
                "container_name": {
                    "type": "string"
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "logs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/k8s_logs.LogLine"
                    }
                },
                "namespace": {
                    "type": "string"
                },
                "pod_name": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.LogLine": {
            "type": "object",
            "properties": {
                "labels": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "line_number": {
                    "type": "integer"
                },
                "log_level": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "parsed": {
                    "type": "object",
                    "additionalProperties": true
                },
                "timestamp": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.LogMetadata": {
            "type": "object",
            "properties": {
                "app_name": {
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "compressed_size": {
                    "type": "integer"
                },
                "compression": {
                    "type": "string"
                },
                "container_name": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "end_timestamp": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "line_count": {
                    "type": "integer"
                },
                "log_level": {
                    "type": "string"
                },
                "namespace": {
                    "type": "string"
                },
                "org_id": {
                    "type": "string"
                },
                "pod_name": {
                    "type": "string"
                },
                "s3_bucket": {
                    "type": "string"
                },
                "s3_key": {
                    "type": "string"
                },
                "start_timestamp": {
                    "type": "string"
                },
                "uncompressed_size": {
                    "type": "integer"
                }
            }
        },
        "k8s_logs.LogMetadataStats": {
            "type": "object",
            "properties": {
                "by_cluster": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/k8s_logs.ClusterStats"
                    }
                },
                "collected_at": {
                    "type": "string"
                },
                "files_today": {
                    "type": "integer"
                },
                "lines_today": {
                    "type": "integer"
                },
                "total_compressed_gb": {
                    "type": "number"
                },
                "total_files": {
                    "type": "integer"
                },
                "total_lines": {
                    "type": "integer"
                },
                "total_uncompressed_gb": {
                    "type": "number"
                }
            }
        },
        "k8s_logs.LogQLQuery": {
            "type": "object",
            "properties": {
                "direction": {
                    "description": "forward/backward",
                    "type": "string"
                },
                "end": {
                    "description": "End time",
                    "type": "string"
                },
                "labels": {
                    "description": "Additional label filters",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "limit": {
                    "description": "Result limit",
                    "type": "integer"
                },
                "query": {
                    "description": "LogQL query: {app=\"web\"} |= \"error\"",
                    "type": "string"
                },
                "start": {
                    "description": "Start time",
                    "type": "string"
                },
                "step": {
                    "description": "Step for aggregations",
                    "type": "string"
                }
            }
        },
        "k8s_logs.NodeInfo": {
            "type": "object",
            "properties": {
                "age": {
                    "type": "string"
                },
                "architecture": {
                    "type": "string"
                },
                "cpu": {
                    "type": "string"
                },
                "externalIp": {
                    "type": "string"
                },
                "internalIp": {
                    "type": "string"
                },
                "kubeletVersion": {
                    "type": "string"
                },
                "memory": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "os": {
                    "type": "string"
                },
                "pods": {
                    "type": "string"
                },
                "ready": {
                    "type": "string"
                },
                "roles": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "unschedulable": {
                    "type": "boolean"
                }
            }
        },
        "k8s_logs.ProblematicResource": {
            "type": "object",
            "properties": {
                "events": {
                    "description": "Relevant recent events",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "kind": {
                    "description": "e.g., \"Pod\", \"Deployment\", \"StatefulSet\"",
                    "type": "string"
                },
                "message": {
                    "description": "Detailed message from status or events",
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "namespace": {
                    "type": "string"
                },
                "reason": {
                    "description": "e.g., \"CrashLoopBackOff\", \"ImagePullBackOff\", \"Pending\"",
                    "type": "string"
                },
                "solution": {
                    "description": "A suggested solution (can be AI-generated externally)",
                    "type": "string"
                }
            }
        },
        "k8s_logs.ResourceUtilization": {
            "type": "object",
            "properties": {
                "cpuLimit": {
                    "type": "string"
                },
                "cpuRequest": {
                    "type": "string"
                },
                "memoryLimit": {
                    "type": "string"
                },
                "memoryRequest": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.SecurityAnalysisReport": {
            "type": "object",
            "properties": {
                "clusterId": {
                    "type": "string"
                },
                "findings": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/k8s_logs.SecurityFinding"
                    }
                },
                "summary": {
                    "description": "e.g., {\"Critical\": 5, \"High\": 10}",
                    "type": "object",
                    "additionalProperties": {
                        "type": "integer"
                    }
                },
                "timestamp": {
                    "type": "string"
                }
            }
        },
        "k8s_logs.SecurityFinding": {
            "type": "object",
            "properties": {
                "category": {
                    "description": "e.g., \"Privilege Escalation\", \"Network Policy\", \"Resource Misconfiguration\"",
                    "type": "string"
                },
                "containerName": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "namespace": {
                    "type": "string"
                },
                "podName": {
                    "type": "string"
                },
                "recommendation": {
                    "type": "string"
                },
                "severity": {
                    "description": "e.g., \"Critical\", \"High\", \"Medium\", \"Low\"",
                    "type": "string"
                }
            }
        },
        "k8s_logs.StartLogCollectionRequest": {
            "type": "object",
            "required": [
                "cluster_id",
                "namespace",
                "pod_name"
            ],
            "properties": {
                "app_id": {
                    "description": "Frontend sends app_id; used as fallback for AppName",
                    "type": "string"
                },
                "app_name": {
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "container_name": {
                    "type": "string"
                },
                "follow": {
                    "description": "Whether to follow logs (streaming)",
                    "type": "boolean"
                },
                "log_level": {
                    "description": "Optional filter by log level",
                    "type": "string"
                },
                "namespace": {
                    "type": "string"
                },
                "pod_name": {
                    "type": "string"
                },
                "since": {
                    "description": "Only return logs after this time (RFC3339)",
                    "type": "string"
                },
                "tail_lines": {
                    "description": "Number of lines to tail (default: 1000)",
                    "type": "integer"
                }
            }
        },
        "prometheus_api.BatchQueryItem": {
            "description": "Single PromQL query in a batch. type is \"instant\" (default) or \"range\".",
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "example": "cpu"
                },
                "query": {
                    "type": "string",
                    "example": "sum(rate(container_cpu_usage_seconds_total[5m]))"
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "instant",
                        "range"
                    ],
                    "example": "range"
                }
            }
        },
        "prometheus_api.BatchQueryRequest": {
            "description": "Batch of PromQL queries. start/end/step are shared by all range queries.",
            "type": "object",
            "properties": {
                "end": {
                    "type": "string",
                    "example": "1791295351"
                },
                "queries": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/prometheus_api.BatchQueryItem"
                    }
                },
                "start": {
                    "type": "string",
                    "example": "1791208951"
                },
                "step": {
                    "type": "string",
                    "example": "600"
                }
            }
        },
        "prometheus_api.ErrorResponse": {
            "description": "Standard error response format",
            "type": "object",
            "properties": {
                "code": {
                    "type": "string",
                    "example": "BAD_REQUEST"
                },
                "message": {
                    "type": "string",
                    "example": "Invalid request parameters"
                }
            }
        },
        "prometheus_api.PrometheusConfigRequest": {
            "description": "Request body for setting Prometheus configuration for a cluster or region",
            "type": "object",
            "required": [
                "auth_type",
                "url"
            ],
            "properties": {
                "auth_type": {
                    "type": "string",
                    "enum": [
                        "none",
                        "basic",
                        "bearer"
                    ],
                    "example": "basic"
                },
                "bearer_token": {
                    "type": "string",
                    "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
                },
                "cluster_id": {
                    "type": "string",
                    "example": "cluster-123abc"
                },
                "password": {
                    "type": "string",
                    "example": "secure_password"
                },
                "region_code": {
                    "type": "string",
                    "example": "us-west-2"
                },
                "url": {
                    "type": "string",
                    "example": "https://prometheus.example.com:9090"
                },
                "user_id": {
                    "type": "string",
                    "example": "user-456def"
                },
                "username": {
                    "type": "string",
                    "example": "prometheus_user"
                }
            }
        },
        "prometheus_api.SuccessMessageResponse": {
            "description": "Generic success response with message",
            "type": "object",
            "properties": {
                "message": {
                    "type": "string",
                    "example": "Prometheus configuration saved successfully"
                }
            }
        },
        "service.AppCostSummary": {
            "type": "object",
            "properties": {
                "app_id": {
                    "type": "string"
                },
                "app_name": {
                    "type": "string"
                },
                "cpu": {
                    "type": "string"
                },
                "daily_cost": {
                    "type": "number"
                },
                "hourly_cost": {
                    "type": "number"
                },
                "last_calculated_at": {
                    "type": "string"
                },
                "memory": {
                    "type": "string"
                },
                "monthly_cost": {
                    "type": "number"
                },
                "region_count": {
                    "type": "integer"
                },
                "replicas": {
                    "type": "integer"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "service.AppCurrentCostResponse": {
            "type": "object",
            "properties": {
                "app_id": {
                    "type": "string"
                },
                "app_name": {
                    "type": "string"
                },
                "breakdown": {
                    "$ref": "#/definitions/service.CostBreakdown"
                },
                "currency": {
                    "type": "string"
                },
                "daily_cost": {
                    "type": "number"
                },
                "hourly_cost": {
                    "type": "number"
                },
                "last_calculated_at": {
                    "type": "string"
                },
                "monthly_cost": {
                    "type": "number"
                },
                "resources": {
                    "$ref": "#/definitions/service.AppResources"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "service.AppResources": {
            "type": "object",
            "properties": {
                "cpu": {
                    "type": "string"
                },
                "memory": {
                    "type": "string"
                },
                "region_count": {
                    "type": "integer"
                },
                "regions": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "replicas": {
                    "type": "integer"
                }
            }
        },
        "service.ConfigMapReference": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "items": {
                    "description": "key -\u003e path mapping",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "mount_path": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "service.CostBreakdown": {
            "type": "object",
            "properties": {
                "cpu_cost": {
                    "type": "number"
                },
                "memory_cost": {
                    "type": "number"
                },
                "regions_cost": {
                    "type": "number"
                },
                "total_cost": {
                    "type": "number"
                }
            }
        },
        "service.CostChangeResponse": {
            "type": "object",
            "properties": {
                "calculated_at": {
                    "type": "string"
                },
                "currency": {
                    "type": "string"
                },
                "current_breakdown": {
                    "$ref": "#/definitions/service.CostBreakdown"
                },
                "current_hourly_cost": {
                    "type": "number"
                },
                "difference": {
                    "description": "Positive = increase, Negative = savings",
                    "type": "number"
                },
                "new_breakdown": {
                    "$ref": "#/definitions/service.CostBreakdown"
                },
                "new_hourly_cost": {
                    "type": "number"
                },
                "percent_change": {
                    "type": "number"
                }
            }
        },
        "service.CostEstimateResponse": {
            "type": "object",
            "properties": {
                "breakdown": {
                    "$ref": "#/definitions/service.CostBreakdown"
                },
                "calculated_at": {
                    "type": "string"
                },
                "currency": {
                    "type": "string"
                },
                "daily_cost": {
                    "type": "number"
                },
                "hourly_cost": {
                    "type": "number"
                },
                "monthly_cost": {
                    "type": "number"
                }
            }
        },
        "service.DORAAggregate": {
            "type": "object",
            "properties": {
                "aggregationPeriod": {
                    "type": "string"
                },
                "appName": {
                    "type": "string"
                },
                "changeFailureRate": {
                    "type": "number",
                    "format": "float64"
                },
                "createdAt": {
                    "type": "string"
                },
                "deploymentFrequency": {
                    "type": "number",
                    "format": "float64"
                },
                "failedDeployments": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer",
                    "format": "int64"
                },
                "leadTimeHours": {
                    "type": "number",
                    "format": "float64"
                },
                "meanTimeToRecoveryHours": {
                    "type": "number",
                    "format": "float64"
                },
                "orgID": {
                    "type": "string"
                },
                "periodEnd": {
                    "type": "string"
                },
                "periodStart": {
                    "type": "string"
                },
                "successfulDeployments": {
                    "type": "integer"
                },
                "totalDeployments": {
                    "type": "integer"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
        },
        "service.DORAMetrics": {
            "type": "object",
            "properties": {
                "appName": {
                    "type": "string"
                },
                "changeSource": {
                    "description": "e.g., \"API\", \"UI\", \"CLI\"",
                    "type": "string"
                },
                "changeType": {
                    "description": "e.g., \"new-feature\", \"bug-fix\", \"infrastructure\"",
                    "type": "string"
                },
                "createdAt": {
                    "type": "string"
                },
                "deploymentEnded": {
                    "type": "string"
                },
                "deploymentID": {
                    "type": "string"
                },
                "deploymentStarted": {
                    "type": "string"
                },
                "deploymentStatus": {
                    "description": "true = success, false = failed",
                    "type": "boolean"
                },
                "duration": {
                    "type": "string",
                    "example": "1m30s"
                },
                "errorMessage": {
                    "type": "string"
                },
                "id": {
                    "type": "integer",
                    "format": "int64"
                },
                "namespace": {
                    "type": "string"
                },
                "orgID": {
                    "type": "string"
                },
                "orgSlug": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
        },
        "service.DORAMetricsResponse": {
            "type": "object",
            "properties": {
                "change_failure_rate": {
                    "type": "number"
                },
                "deployment_frequency": {
                    "type": "number"
                },
                "failed_deployments": {
                    "type": "integer"
                },
                "lead_time_for_changes": {
                    "type": "number"
                },
                "mean_time_to_recovery": {
                    "type": "number"
                },
                "successful_deployments": {
                    "type": "integer"
                },
                "time_period_end": {
                    "type": "string"
                },
                "time_period_start": {
                    "type": "string"
                },
                "total_deployments": {
                    "type": "integer"
                }
            }
        },
        "service.DeploymentCostEstimateRequest": {
            "type": "object",
            "properties": {
                "cpu": {
                    "description": "e.g., \"0.5\", \"1\", \"500m\"",
                    "type": "string"
                },
                "memory": {
                    "description": "e.g., \"256Mi\", \"1Gi\"",
                    "type": "string"
                },
                "org_id": {
                    "description": "Organization ID for pricing",
                    "type": "string"
                },
                "regions": {
                    "description": "List of regions",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "replicas": {
                    "description": "Number of replicas",
                    "type": "integer"
                }
            }
        },
        "service.DeploymentMetrics": {
            "type": "object",
            "properties": {
                "app_name": {
                    "type": "string"
                },
                "avg_latency": {
                    "description": "Average response time",
                    "type": "string",
                    "example": "1m30s"
                },
                "cpu_usage": {
                    "description": "0.0 to 1.0 (0% to 100%)",
                    "type": "number"
                },
                "error_rate": {
                    "description": "0.0 to 1.0 (0% to 100%)",
                    "type": "number"
                },
                "memory_usage": {
                    "description": "0.0 to 1.0 (0% to 100%)",
                    "type": "number"
                },
                "service_name": {
                    "type": "string"
                },
                "throughput": {
                    "description": "Requests per second",
                    "type": "number"
                },
                "timestamp": {
                    "type": "string"
                }
            }
        },
        "service.DeploymentRequest": {
            "type": "object",
            "required": [
                "app_id",
                "app_name",
                "cluster_id",
                "image",
                "port",
                "tag"
            ],
            "properties": {
                "annotations": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "app_id": {
                    "type": "string"
                },
                "app_name": {
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "config_maps": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/service.ConfigMapReference"
                    }
                },
                "env": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "health_check": {
                    "$ref": "#/definitions/service.HealthCheckConfig"
                },
                "image": {
                    "type": "string"
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "namespace": {
                    "type": "string"
                },
                "port": {
                    "type": "integer",
                    "maximum": 65535,
                    "minimum": 1
                },
                "replicas": {
                    "type": "integer"
                },
                "resources": {
                    "$ref": "#/definitions/service.ResourceRequirements"
                },
                "secrets": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/service.SecretReference"
                    }
                },
                "strategy": {
                    "$ref": "#/definitions/service.DeploymentStrategy"
                },
                "tag": {
                    "type": "string"
                },
                "volumes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/service.VolumeMount"
                    }
                }
            }
        },
        "service.DeploymentStrategy": {
            "type": "object",
            "properties": {
                "max_surge": {
                    "description": "for RollingUpdate",
                    "type": "string"
                },
                "max_unavailable": {
                    "description": "for RollingUpdate",
                    "type": "string"
                },
                "type": {
                    "description": "RollingUpdate, Recreate, BlueGreen",
                    "type": "string"
                }
            }
        },
        "service.HealthCheckConfig": {
            "type": "object",
            "properties": {
                "command": {
                    "description": "for exec",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "failure_threshold": {
                    "description": "count",
                    "type": "integer"
                },
                "initial_delay": {
                    "description": "seconds",
                    "type": "integer"
                },
                "path": {
                    "description": "for http",
                    "type": "string"
                },
                "period_seconds": {
                    "description": "seconds",
                    "type": "integer"
                },
                "port": {
                    "description": "for http/tcp",
                    "type": "integer"
                },
                "success_threshold": {
                    "description": "count",
                    "type": "integer"
                },
                "timeout_seconds": {
                    "description": "seconds",
                    "type": "integer"
                },
                "type": {
                    "description": "http, tcp, exec",
                    "type": "string"
                }
            }
        },
        "service.PrometheusConfigResponse": {
            "type": "object",
            "properties": {
                "auth_type": {
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "is_configured": {
                    "type": "boolean"
                },
                "last_check": {
                    "type": "string"
                },
                "region_code": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                }
            }
        },
        "service.ResolveIncidentRequest": {
            "type": "object",
            "properties": {
                "resolution_notes": {
                    "type": "string"
                }
            }
        },
        "service.ResourceRequirements": {
            "type": "object",
            "properties": {
                "cpu": {
                    "type": "string"
                },
                "cpu_limit": {
                    "type": "string"
                },
                "mem_limit": {
                    "type": "string"
                },
                "memory": {
                    "type": "string"
                }
            }
        },
        "service.ScaleCostEstimateRequest": {
            "type": "object",
            "properties": {
                "app_id": {
                    "type": "string"
                },
                "new_regions": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "service.SecretReference": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "items": {
                    "description": "key -\u003e path mapping",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "mount_path": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "service.TrackDeploymentCompleteRequest": {
            "type": "object",
            "properties": {
                "deployment_id": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "success": {
                    "type": "boolean"
                }
            }
        },
        "service.TrackDeploymentStartRequest": {
            "type": "object",
            "properties": {
                "app_name": {
                    "type": "string"
                },
                "change_source": {
                    "description": "API, UI, CLI",
                    "type": "string"
                },
                "change_type": {
                    "description": "new-feature, bug-fix, etc",
                    "type": "string"
                },
                "deployment_id": {
                    "type": "string"
                },
                "namespace": {
                    "type": "string"
                },
                "org_id": {
                    "type": "string"
                },
                "org_slug": {
                    "type": "string"
                }
            }
        },
        "service.TrackIncidentRequest": {
            "type": "object",
            "properties": {
                "app_name": {
                    "type": "string"
                },
                "deployment_id": {
                    "type": "string"
                },
                "incident_id": {
                    "type": "string"
                },
                "incident_severity": {
                    "description": "low, medium, high, critical",
                    "type": "string"
                },
                "incident_type": {
                    "type": "string"
                },
                "org_id": {
                    "type": "string"
                }
            }
        },
        "service.UpdateCostEstimateRequest": {
            "type": "object",
            "properties": {
                "app_id": {
                    "type": "string"
                },
                "new_cpu": {
                    "type": "string"
                },
                "new_memory": {
                    "type": "string"
                },
                "new_replicas": {
                    "type": "integer"
                }
            }
        },
        "service.UsageSummaryResponse": {
            "type": "object",
            "properties": {
                "app_costs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/service.AppCostSummary"
                    }
                },
                "auto_recharge_enabled": {
                    "description": "Prepaid only",
                    "type": "boolean"
                },
                "auto_recharge_threshold": {
                    "description": "Prepaid only",
                    "type": "number"
                },
                "billing_mode": {
                    "type": "string"
                },
                "calculated_at": {
                    "type": "string"
                },
                "currency": {
                    "type": "string"
                },
                "current_balance": {
                    "description": "Prepaid only",
                    "type": "number"
                },
                "days_remaining": {
                    "description": "Prepaid only",
                    "type": "number"
                },
                "estimated_daily_cost": {
                    "description": "24h projection",
                    "type": "number"
                },
                "estimated_monthly_cost": {
                    "description": "30d projection",
                    "type": "number"
                },
                "running_apps_count": {
                    "type": "integer"
                },
                "suspended_apps_count": {
                    "type": "integer"
                },
                "total_hourly_cost": {
                    "description": "All running apps",
                    "type": "number"
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "service.VolumeMount": {
            "type": "object",
            "required": [
                "mount_path",
                "name"
            ],
            "properties": {
                "mount_path": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "read_only": {
                    "type": "boolean"
                },
                "size": {
                    "description": "for PVC",
                    "type": "string"
                },
                "source": {
                    "description": "for hostPath or PVC name",
                    "type": "string"
                },
                "sub_path": {
                    "type": "string"
                },
                "type": {
                    "description": "emptyDir, hostPath, persistentVolumeClaim",
                    "type": "string"
                }
            }
        },
        "users.Attributes": {
            "type": "object",
            "required": [
                "email",
                "password"
            ],
            "properties": {
                "email": {
                    "type": "string"
                },
                "password": {
                    "type": "string"
                }
            }
        },
        "users.Data": {
            "type": "object",
            "properties": {
                "attributes": {
                    "$ref": "#/definitions/users.Attributes"
                }
            }
        },
        "users.LoginRequestBody": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/users.Data"
                }
            }
        },
        "users.OAuthCallbackRequest": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "code_verifier": {
                    "description": "For PKCE (Azure)",
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "redirect_uri": {
                    "description": "Must match what was sent in the authorization request",
                    "type": "string"
                },
                "state": {
                    "type": "string"
                }
            }
        },
        "users.OAuthInitRequest": {
            "type": "object",
            "properties": {
                "provider": {
                    "type": "string"
                }
            }
        },
        "users.OAuthInitResponse": {
            "type": "object",
            "properties": {
                "authUrl": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                }
            }
        },
        "users.RefreshTokenRequestBody": {
            "type": "object",
            "properties": {
                "refresh_token": {
                    "type": "string"
                }
            }
        },
        "users.SsoLoginDetails": {
            "type": "object",
            "properties": {
                "accessToken": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "ssoType": {
                    "type": "string"
                }
            }
        },
        "users.TokenAttrib": {
            "type": "object",
            "properties": {
                "access_token": {
                    "type": "string"
                },
                "refresh_token": {
                    "type": "string"
                },
                "userId": {
                    "type": "string"
                }
            }
        },
        "users.TokenAttributes": {
            "type": "object",
            "properties": {
                "attributes": {
                    "$ref": "#/definitions/users.TokenAttrib"
                }
            }
        },
        "users.TokenErrorBody": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string"
                }
            }
        },
        "users.TokenResponseBody": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/users.TokenAttributes"
                }
            }
        },
        "users.UserRegisterRequestBody": {
            "type": "object",
            "required": [
                "email",
                "firstName",
                "lastName",
                "password"
            ],
            "properties": {
                "billingAddress": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "companyName": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "firstName": {
                    "type": "string"
                },
                "industry": {
                    "type": "string"
                },
                "lastName": {
                    "type": "string"
                },
                "line1": {
                    "type": "string"
                },
                "line2": {
                    "type": "string"
                },
                "location": {
                    "type": "string"
                },
                "password": {
                    "type": "string"
                },
                "phoneNumber": {
                    "type": "string"
                },
                "postalcode": {
                    "type": "string"
                },
                "rollId": {
                    "type": "string"
                },
                "sessionId": {
                    "type": "string"
                },
                "ssoType": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                },
                "userName": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "BearerAuth": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    }
}