{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hacktron/json-schema/hacktron-create-cost-estimation-dto-schema.json",
  "title": "CreateCostEstimationDto",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hacktron-openapi.json#/components/schemas/CreateCostEstimationDto",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Friendly name for this estimation"
    },
    "repos": {
      "type": "array",
      "description": "Repositories to estimate",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/ConnectedCostEstimationRepoDto"
          },
          {
            "$ref": "#/$defs/PublicCostEstimationRepoDto"
          },
          {
            "$ref": "#/$defs/UploadCostEstimationRepoDto"
          }
        ]
      }
    }
  },
  "required": [
    "repos"
  ],
  "$defs": {
    "ConnectedCostEstimationRepoDto": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "description": "Source type",
          "enum": [
            "connected"
          ],
          "default": "connected"
        },
        "repo_url": {
          "type": "string",
          "description": "Repository URL"
        },
        "branch": {
          "type": "string",
          "description": "Branch name"
        },
        "github_installation_id": {
          "type": "number",
          "description": "GitHub App installation ID. Omitted for PAT-based connections (e.g. GitHub Enterprise), where the installation is resolved from repo_url and the organization instead."
        }
      },
      "required": [
        "source",
        "repo_url",
        "branch"
      ]
    },
    "PublicCostEstimationRepoDto": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "description": "Source type",
          "enum": [
            "public"
          ]
        },
        "repo_url": {
          "type": "string",
          "description": "Repository URL"
        },
        "branch": {
          "type": "string",
          "description": "Branch name"
        }
      },
      "required": [
        "source",
        "repo_url",
        "branch"
      ]
    },
    "UploadCostEstimationRepoDto": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "description": "Source type",
          "enum": [
            "upload"
          ]
        },
        "archive_id": {
          "type": "string",
          "description": "Scan archive ID"
        }
      },
      "required": [
        "source",
        "archive_id"
      ]
    }
  }
}