{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-migration-center/json-schema/google-cloud-migration-center-import-job-schema.json",
  "title": "ImportJob",
  "description": "A resource that represents the background job that imports asset frames.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-migration-center-migrationcenter-projects-api-openapi.yml#/components/schemas/ImportJob",
  "type": "object",
  "properties": {
    "assetSource": {
      "type": "string",
      "description": "Required. Reference to a source."
    },
    "updateTime": {
      "type": "string",
      "format": "google-datetime",
      "readOnly": true,
      "description": "Output only. The timestamp when the import job was last updated."
    },
    "completeTime": {
      "description": "Output only. The timestamp when the import job was completed.",
      "format": "google-datetime",
      "type": "string",
      "readOnly": true
    },
    "state": {
      "description": "Output only. The state of the import job.",
      "readOnly": true,
      "type": "string",
      "enum": [
        "IMPORT_JOB_STATE_UNSPECIFIED",
        "IMPORT_JOB_STATE_PENDING",
        "IMPORT_JOB_STATE_RUNNING",
        "IMPORT_JOB_STATE_COMPLETED",
        "IMPORT_JOB_STATE_FAILED",
        "IMPORT_JOB_STATE_VALIDATING",
        "IMPORT_JOB_STATE_FAILED_VALIDATION",
        "IMPORT_JOB_STATE_READY"
      ]
    },
    "labels": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "description": "Labels as key value pairs."
    },
    "name": {
      "description": "Output only. The full name of the import job.",
      "type": "string",
      "readOnly": true
    },
    "displayName": {
      "type": "string",
      "description": "Optional. User-friendly display name. Maximum length is 256 characters."
    },
    "executionReport": {
      "$ref": "#/$defs/ExecutionReport",
      "description": "Output only. The report with the results of running the import job."
    },
    "createTime": {
      "description": "Output only. The timestamp when the import job was created.",
      "readOnly": true,
      "type": "string",
      "format": "google-datetime"
    },
    "validationReport": {
      "$ref": "#/$defs/ValidationReport",
      "description": "Output only. The report with the validation results of the import job."
    }
  },
  "$defs": {
    "ExecutionReport": {
      "properties": {
        "totalRowsCount": {
          "readOnly": true,
          "type": "integer",
          "format": "int32",
          "description": "Output only. Total number of rows in the import job."
        },
        "executionErrors": {
          "$ref": "#/$defs/ValidationReport",
          "description": "Validation errors encountered during the execution of the import job."
        },
        "framesReported": {
          "format": "int32",
          "description": "Total number of asset frames reported for the import job.",
          "type": "integer"
        }
      },
      "type": "object",
      "description": "A resource that reports result of the import job execution."
    },
    "FileValidationReport": {
      "type": "object",
      "properties": {
        "fileName": {
          "description": "The name of the file.",
          "type": "string"
        },
        "partialReport": {
          "description": "Flag indicating that processing was aborted due to maximum number of errors.",
          "type": "boolean"
        },
        "fileErrors": {
          "description": "List of file level errors.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ImportError"
          }
        },
        "rowErrors": {
          "items": {
            "$ref": "#/$defs/ImportRowError"
          },
          "description": "Partial list of rows that encountered validation error.",
          "type": "array"
        }
      },
      "description": "A resource that aggregates the validation errors found in an import job file."
    },
    "ImportError": {
      "properties": {
        "severity": {
          "enum": [
            "SEVERITY_UNSPECIFIED",
            "ERROR",
            "WARNING",
            "INFO"
          ],
          "type": "string",
          "description": "The severity of the error."
        },
        "errorDetails": {
          "type": "string",
          "description": "The error information."
        }
      },
      "description": "A resource that reports the errors encountered while processing an import job.",
      "type": "object"
    },
    "ImportRowError": {
      "properties": {
        "xlsxError": {
          "$ref": "#/$defs/ImportRowErrorXlsxErrorDetails",
          "description": "Error details for an XLSX file."
        },
        "csvError": {
          "$ref": "#/$defs/ImportRowErrorCsvErrorDetails",
          "description": "Error details for a CSV file."
        },
        "vmName": {
          "description": "The name of the VM in the row.",
          "type": "string"
        },
        "errors": {
          "items": {
            "$ref": "#/$defs/ImportError"
          },
          "type": "array",
          "description": "The list of errors detected in the row."
        },
        "vmUuid": {
          "type": "string",
          "description": "The VM UUID."
        },
        "archiveError": {
          "$ref": "#/$defs/ImportRowErrorArchiveErrorDetails",
          "description": "Error details for an archive file."
        },
        "assetTitle": {
          "type": "string",
          "description": "Output only. The asset title.",
          "readOnly": true
        },
        "rowNumber": {
          "type": "integer",
          "format": "int32",
          "description": "The row number where the error was detected.",
          "deprecated": true
        }
      },
      "type": "object",
      "description": "A resource that reports the import job errors at row level."
    },
    "ImportRowErrorArchiveErrorDetails": {
      "description": "Error details for an archive file.",
      "properties": {
        "csvError": {
          "$ref": "#/$defs/ImportRowErrorCsvErrorDetails",
          "description": "Error details for a CSV file."
        },
        "filePath": {
          "readOnly": true,
          "description": "Output only. The file path inside the archive where the error was detected.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ImportRowErrorCsvErrorDetails": {
      "type": "object",
      "properties": {
        "rowNumber": {
          "description": "The row number where the error was detected.",
          "format": "int32",
          "type": "integer"
        }
      },
      "description": "Error details for a CSV file."
    },
    "ImportRowErrorXlsxErrorDetails": {
      "description": "Error details for an XLSX file.",
      "type": "object",
      "properties": {
        "rowNumber": {
          "format": "int32",
          "type": "integer",
          "description": "The row number where the error was detected."
        },
        "sheet": {
          "description": "The name of the sheet where the error was detected.",
          "type": "string"
        }
      }
    },
    "ValidationReport": {
      "description": "A resource that aggregates errors across import job files.",
      "properties": {
        "jobErrors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ImportError"
          },
          "description": "List of job level errors."
        },
        "fileValidations": {
          "type": "array",
          "description": "List of errors found in files.",
          "items": {
            "$ref": "#/$defs/FileValidationReport"
          }
        }
      },
      "type": "object"
    }
  }
}