{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-health/json-schema/azure-health-paged-deidentification-job-schema.json",
  "title": "PagedDeidentificationJob",
  "description": "Paged collection of DeidentificationJob items",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-health-jobs-api-openapi.yml#/components/schemas/PagedDeidentificationJob",
  "type": "object",
  "properties": {
    "value": {
      "type": "array",
      "description": "The DeidentificationJob items on this page",
      "items": {
        "$ref": "#/$defs/DeidentificationJob"
      }
    },
    "nextLink": {
      "type": "string",
      "format": "uri",
      "description": "The link to the next page of items"
    }
  },
  "required": [
    "value"
  ],
  "$defs": {
    "Azure.Core.Foundations.Error": {
      "type": "object",
      "description": "The error object.",
      "properties": {
        "code": {
          "type": "string",
          "description": "One of a server-defined set of error codes."
        },
        "message": {
          "type": "string",
          "description": "A human-readable representation of the error."
        },
        "target": {
          "type": "string",
          "description": "The target of the error."
        },
        "details": {
          "type": "array",
          "description": "An array of details about specific errors that led to this reported error.",
          "items": {
            "$ref": "#/$defs/Azure.Core.Foundations.Error"
          }
        },
        "innererror": {
          "$ref": "#/$defs/Azure.Core.Foundations.InnerError",
          "description": "An object containing more specific information than the current object about the error."
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "Azure.Core.Foundations.InnerError": {
      "type": "object",
      "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.",
      "properties": {
        "code": {
          "type": "string",
          "description": "One of a server-defined set of error codes."
        },
        "innererror": {
          "$ref": "#/$defs/Azure.Core.Foundations.InnerError",
          "description": "Inner error."
        }
      }
    },
    "Azure.Core.Foundations.OperationState": {
      "type": "string",
      "description": "Enum describing allowed operation states.",
      "enum": [
        "NotStarted",
        "Running",
        "Succeeded",
        "Failed",
        "Canceled"
      ],
      "x-ms-enum": {
        "name": "OperationState",
        "modelAsString": true,
        "values": [
          {
            "name": "NotStarted",
            "value": "NotStarted",
            "description": "The operation has not started."
          },
          {
            "name": "Running",
            "value": "Running",
            "description": "The operation is in progress."
          },
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "The operation has completed successfully."
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "The operation has failed."
          },
          {
            "name": "Canceled",
            "value": "Canceled",
            "description": "The operation has been canceled by the user."
          }
        ]
      }
    },
    "DeidentificationJob": {
      "type": "object",
      "description": "A job containing a batch of documents to de-identify.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of a job.",
          "minLength": 3,
          "maxLength": 36,
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$",
          "readOnly": true
        },
        "operation": {
          "type": "string",
          "description": "Operation to perform on the input documents.",
          "default": "Surrogate",
          "enum": [
            "Redact",
            "Surrogate",
            "Tag"
          ],
          "x-ms-enum": {
            "name": "DeidentificationOperationType",
            "modelAsString": true,
            "values": [
              {
                "name": "Redact",
                "value": "Redact",
                "description": "Redact Operation will remove all entities of PHI and replace them with a placeholder value."
              },
              {
                "name": "Surrogate",
                "value": "Surrogate",
                "description": "Surrogation Operation will replace all entities of PHI with a surrogate value."
              },
              {
                "name": "Tag",
                "value": "Tag",
                "description": "Tag Operation will detect all entities of PHI, their type, and return their locations in the document."
              }
            ]
          }
        },
        "sourceLocation": {
          "$ref": "#/$defs/SourceStorageLocation",
          "description": "Storage location to perform the operation on."
        },
        "targetLocation": {
          "$ref": "#/$defs/TargetStorageLocation",
          "description": "Target location to store output of operation."
        },
        "customizations": {
          "$ref": "#/$defs/DeidentificationJobCustomizationOptions",
          "description": "Customization parameters to override default service behaviors."
        },
        "status": {
          "$ref": "#/$defs/Azure.Core.Foundations.OperationState",
          "description": "Current status of a job.",
          "readOnly": true
        },
        "error": {
          "$ref": "#/$defs/Azure.Core.Foundations.Error",
          "description": "Error when job fails in it's entirety.",
          "readOnly": true
        },
        "lastUpdatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time when the job was completed.\n\nIf the job is canceled, this is the time when the job was canceled.\n\nIf the job failed, this is the time when the job failed.",
          "readOnly": true
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time when the job was created.",
          "readOnly": true
        },
        "startedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time when the job was started.",
          "readOnly": true
        },
        "summary": {
          "$ref": "#/$defs/DeidentificationJobSummary",
          "description": "Summary of a job. Exists only when the job is completed.",
          "readOnly": true
        }
      },
      "required": [
        "name",
        "sourceLocation",
        "targetLocation",
        "status",
        "lastUpdatedAt",
        "createdAt"
      ]
    },
    "DeidentificationJobCustomizationOptions": {
      "type": "object",
      "description": "Customizations options to override default service behaviors for job usage.",
      "properties": {
        "redactionFormat": {
          "type": "string",
          "description": "Format of the redacted output. Only valid when Operation is Redact. \nPlease refer to https://learn.microsoft.com/azure/healthcare-apis/deidentification/redaction-format for more details.",
          "minLength": 1,
          "maxLength": 16
        },
        "surrogateLocale": {
          "type": "string",
          "description": "Locale in which the output surrogates are written.",
          "default": "en-US"
        }
      }
    },
    "DeidentificationJobSummary": {
      "type": "object",
      "description": "Summary metrics of a job.",
      "properties": {
        "successful": {
          "type": "integer",
          "format": "int32",
          "description": "Number of documents that have completed."
        },
        "failed": {
          "type": "integer",
          "format": "int32",
          "description": "Number of documents that have failed."
        },
        "canceled": {
          "type": "integer",
          "format": "int32",
          "description": "Number of documents that have been canceled."
        },
        "total": {
          "type": "integer",
          "format": "int32",
          "description": "Number of documents total."
        },
        "bytesProcessed": {
          "type": "integer",
          "format": "int64",
          "description": "Number of bytes processed."
        }
      },
      "required": [
        "successful",
        "failed",
        "canceled",
        "total",
        "bytesProcessed"
      ]
    },
    "SourceStorageLocation": {
      "type": "object",
      "description": "Storage location.",
      "properties": {
        "location": {
          "type": "string",
          "format": "uri",
          "description": "URL to storage location."
        },
        "prefix": {
          "type": "string",
          "description": "Prefix to filter path by.",
          "maxLength": 1024
        },
        "extensions": {
          "type": "array",
          "description": "List of extensions to filter path by.",
          "default": [
            "*"
          ],
          "minItems": 1,
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "location",
        "prefix"
      ]
    },
    "TargetStorageLocation": {
      "type": "object",
      "description": "Storage location.",
      "properties": {
        "location": {
          "type": "string",
          "format": "uri",
          "description": "URL to storage location."
        },
        "prefix": {
          "type": "string",
          "description": "Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure.\n\nExample:\nFile full path: documents/user/note.txt\nInput Prefix: \"documents/user/\"\nOutput Prefix: \"output_docs/\"\n\nOutput file: \"output_docs/note.txt\"",
          "maxLength": 1024
        },
        "overwrite": {
          "type": "boolean",
          "description": "When set to true during a job, the service will overwrite the output location if it already exists.",
          "default": false
        }
      },
      "required": [
        "location",
        "prefix"
      ]
    }
  }
}