{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Payload sent to the API to trigger a drawing read process with a callback URL.\n\nThis class encapsulates the details required for initiating a drawing read request\nand registering a callback URL to receive the results.\n\nAttributes:\n----------\n- asks (List[W24AskUnion]): List of asks specifying the required information.\n- callback_url (HttpUrl): The URL to call once processing is completed.\n- callback_headers (Optional[Dict[str, str]]): Headers to include with the callback\n  request.\n- max_pages (int): Maximum number of pages to process. Defaults to 5.\n- client_version (str): The version of the client making the request.\n- public_key (Optional[str]): Public key for encrypting the callback payload,\n  if applicable.",
  "properties": {
    "asks": {
      "description": "What to extract. See https://v2.docs.werk24.io/concepts/asks/.",
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/AskBalloons"
          },
          {
            "$ref": "#/$defs/AskCustom"
          },
          {
            "$ref": "#/$defs/AskDocumentProfile"
          },
          {
            "$ref": "#/$defs/AskFeatures"
          },
          {
            "$ref": "#/$defs/AskInsights"
          },
          {
            "$ref": "#/$defs/AskMetaData"
          },
          {
            "$ref": "#/$defs/AskPageAssessment"
          },
          {
            "$ref": "#/$defs/AskRedaction"
          },
          {
            "$ref": "#/$defs/AskReferencePositions"
          },
          {
            "$ref": "#/$defs/AskSheetImages"
          },
          {
            "$ref": "#/$defs/AskViewImages"
          }
        ],
        "discriminator": {
          "propertyName": "ask_type",
          "mapping": {
            "BALLOONS": "#/$defs/AskBalloons",
            "CUSTOM": "#/$defs/AskCustom",
            "DOCUMENT_PROFILE": "#/$defs/AskDocumentProfile",
            "FEATURES": "#/$defs/AskFeatures",
            "INSIGHTS": "#/$defs/AskInsights",
            "META_DATA": "#/$defs/AskMetaData",
            "PAGE_ASSESSMENT": "#/$defs/AskPageAssessment",
            "REDACTION": "#/$defs/AskRedaction",
            "REFERENCE_POSITIONS": "#/$defs/AskReferencePositions",
            "SHEET_IMAGES": "#/$defs/AskSheetImages",
            "VIEW_IMAGES": "#/$defs/AskViewImages"
          }
        }
      }
    },
    "callback_url": {
      "description": "The URL to which the API will send the callback request after processing is completed.",
      "format": "uri",
      "maxLength": 2083,
      "minLength": 1,
      "title": "Callback Url",
      "type": "string"
    },
    "callback_headers": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional headers to include in the callback request. Headers must start with 'X-' or be whitelisted.",
      "title": "Callback Headers"
    },
    "max_pages": {
      "description": "Maximum number of pages to process. Must be at least 1.",
      "minimum": 1,
      "title": "Max Pages",
      "type": "integer"
    },
    "client_version": {
      "default": "2.8.0",
      "description": "Version of the client making the request.",
      "title": "Client Version",
      "type": "string"
    },
    "public_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional public key for encrypting the callback payload. Feature availability depends on the service level.",
      "title": "Public Key"
    },
    "priority": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional priority level for the request. Valid values are PRIO1, PRIO2, PRIO3. If not specified, the account's default tier is used.",
      "title": "Priority"
    }
  },
  "required": [
    "callback_url",
    "max_pages"
  ],
  "title": "TechreadWithCallbackPayload",
  "type": "object",
  "$defs": {
    "AskBalloons": {
      "description": "Represents a request for ballooning of a technical drawing.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "BALLOONS",
          "default": "BALLOONS",
          "title": "Ask Type",
          "type": "string"
        }
      },
      "title": "AskBalloons",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "AskCustom": {
      "description": "Represents a request for a custom output from the server.\n\nAttributes:\n----------\n- custom_id (str): The ID of the custom output to request.\n- config (Dict[str, Any]): Configuration options for the custom output.\n- postprocessor_slot (Optional[PostprocessorSlot]): The post-processing system to\n  use for this request.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "CUSTOM",
          "default": "CUSTOM",
          "title": "Ask Type",
          "type": "string"
        },
        "custom_id": {
          "description": "The ID of the custom output to request.",
          "title": "Custom Id",
          "type": "string"
        },
        "config": {
          "additionalProperties": true,
          "default": {},
          "description": "Configuration options for the custom output.",
          "title": "Config",
          "type": "object"
        },
        "postprocessor_slot": {
          "anyOf": [
            {
              "$ref": "#/$defs/PostprocessorSlot"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Select which postprocessing system to use."
        }
      },
      "required": [
        "ask_type",
        "custom_id"
      ],
      "title": "AskCustom",
      "type": "object"
    },
    "AskDocumentProfile": {
      "description": "Represents a request for the document's profile.\n\nFast metadata about the document and how long it is likely to take.\nAnswered from the file's shape before any interpretation begins, so it\narrives almost immediately and costs nothing extra: use it to decide\nwhether to keep waiting and what to show a user.\n\nPage classification is intentionally not part of this ask; request\n`AskPageAssessment` when you need page type and welding presence.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "DOCUMENT_PROFILE",
          "default": "DOCUMENT_PROFILE",
          "title": "Ask Type",
          "type": "string"
        }
      },
      "title": "AskDocumentProfile",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "AskFeatures": {
      "description": "A class that represents a request for vallouts\nfrom the server.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "FEATURES",
          "default": "FEATURES",
          "title": "Ask Type",
          "type": "string"
        }
      },
      "title": "AskFeatures",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "AskInsights": {
      "description": "A class that represents a request for insights\nfrom the server.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "INSIGHTS",
          "default": "INSIGHTS",
          "title": "Ask Type",
          "type": "string"
        }
      },
      "title": "AskInsights",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "AskMetaData": {
      "description": "A class that represents a request for metadata\nfrom the server.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "META_DATA",
          "default": "META_DATA",
          "title": "Ask Type",
          "type": "string"
        }
      },
      "title": "AskMetaData",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "AskPageAssessment": {
      "description": "Represents a request for what the pages of the document are.\n\nOne vision call per page, answering two independent questions: what kind\nof page it is, and whether it carries welding callouts.\n\nKept apart from `AskDocumentProfile` because the two cost completely\ndifferent things. The profile is read off the file and arrives in\nmilliseconds; this waits on a model. Asking for both gets you the profile\nstraight away and this one later, rather than making the cheap answer wait\nfor the expensive one.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "PAGE_ASSESSMENT",
          "default": "PAGE_ASSESSMENT",
          "title": "Ask Type",
          "type": "string"
        }
      },
      "title": "AskPageAssessment",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "AskRedaction": {
      "description": "A class that represents a request for redaction from the server.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "REDACTION",
          "default": "REDACTION",
          "title": "Ask Type",
          "type": "string"
        },
        "redact_logos": {
          "default": true,
          "description": "Whether to redact logos from the drawing.",
          "title": "Redact Logos",
          "type": "boolean"
        },
        "redact_company_data": {
          "default": true,
          "description": "Whether to redact company data.",
          "title": "Redact Company Data",
          "type": "boolean"
        },
        "redact_personal_data": {
          "default": true,
          "description": "Whether to redact personal data.",
          "title": "Redact Personal Data",
          "type": "boolean"
        },
        "redact_keywords": {
          "default": [],
          "description": "A list of keywords to redact from the drawing. Keywords are specified as strings.",
          "items": {
            "$ref": "#/$defs/RedactionKeyword"
          },
          "title": "Redact Keywords",
          "type": "array"
        },
        "output_format": {
          "$ref": "#/$defs/ThumbnailFileFormat",
          "default": "PDF",
          "description": "The desired output format for the redacted drawing"
        },
        "fill_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "#ffffff",
          "description": "The fill color for the redacted areas. If None, only the polygon outlines for redacted areas are returned, and the user can perform the redaction themselves.",
          "title": "Fill Color"
        }
      },
      "title": "AskRedaction",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "AskReferencePositions": {
      "description": "Represents a request for the position of a component in the drawing.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "REFERENCE_POSITIONS",
          "default": "REFERENCE_POSITIONS",
          "title": "Ask Type",
          "type": "string"
        }
      },
      "title": "AskReferencePositions",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "AskSheetImages": {
      "description": "Represents a request for a sheet image from the server.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "SHEET_IMAGES",
          "default": "SHEET_IMAGES",
          "title": "Ask Type",
          "type": "string"
        }
      },
      "title": "AskSheetImages",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "AskViewImages": {
      "description": "Represents a request for a view image from the server.",
      "properties": {
        "ask_version": {
          "const": "v2",
          "default": "v2",
          "title": "Ask Version",
          "type": "string"
        },
        "ask_type": {
          "const": "VIEW_IMAGES",
          "default": "VIEW_IMAGES",
          "title": "Ask Type",
          "type": "string"
        }
      },
      "title": "AskViewImages",
      "type": "object",
      "required": [
        "ask_type"
      ]
    },
    "PostprocessorSlot": {
      "description": "Enumeration for available postprocessor systems.",
      "enum": [
        "GREEN",
        "BLUE"
      ],
      "title": "PostprocessorSlot",
      "type": "string"
    },
    "RedactionKeyword": {
      "description": "A class that represents a keyword to redact from the drawing.",
      "properties": {
        "keyword": {
          "description": "The keyword to redact from the drawing.",
          "title": "Keyword",
          "type": "string"
        }
      },
      "required": [
        "keyword"
      ],
      "title": "RedactionKeyword",
      "type": "object"
    },
    "ThumbnailFileFormat": {
      "description": "The output format of the redacted drawing.",
      "enum": [
        "PDF",
        "PNG"
      ],
      "title": "ThumbnailFileFormat",
      "type": "string"
    }
  }
}