{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/emporix/json-schema/emporix-import-response-schema.json",
  "title": "ImportResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-import-export-api-openapi.yml#/components/schemas/ImportResponse",
  "allOf": [
    {
      "$ref": "#/$defs/ImportResult"
    },
    {
      "type": "object",
      "properties": {
        "importedAt": {
          "description": "Date of the import process.",
          "type": "string",
          "format": "date-time"
        },
        "jobId": {
          "description": "ID of the job.",
          "type": "string"
        }
      }
    }
  ],
  "$defs": {
    "ImportDetails": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Machine-readable reason code for UI localization.",
          "enum": [
            "MISSING_FUNCTION",
            "MISSING_TOKEN",
            "NOT_IMPORTABLE",
            "ALREADY_EXISTS",
            "AGENT_IMPORTED_DISABLED",
            "IMPORT_FAILED"
          ]
        },
        "objectId": {
          "type": "string",
          "description": "ID of the related object, such as a function ID or token ID."
        },
        "objectName": {
          "type": "string",
          "description": "Display name of the related object, such as a tool name."
        },
        "message": {
          "type": "string",
          "description": "English fallback message when a localized string is not available."
        }
      }
    },
    "ImportResult": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Short summary of the import."
        },
        "summary": {
          "type": "object",
          "description": "Summary of the import.",
          "properties": {
            "agents": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ImportedEntity"
              }
            },
            "tools": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ImportedEntity"
              }
            },
            "mcpServers": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ImportedEntity"
              }
            }
          }
        }
      }
    },
    "ImportedEntity": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "ID of the imported entity."
        },
        "name": {
          "type": "string",
          "description": "Name of the imported entity."
        },
        "state": {
          "type": "string",
          "description": "State of the imported entity.",
          "enum": [
            "TO_CREATE",
            "ENABLED",
            "DISABLED",
            "EXISTS",
            "FAILED"
          ]
        },
        "details": {
          "type": "array",
          "description": "Reasons the entity was skipped, disabled, or failed during import.",
          "items": {
            "$ref": "#/$defs/ImportDetails"
          }
        }
      }
    }
  }
}