{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/swift/json-schema/swift-distribution-schema.json",
  "title": "Distribution",
  "description": "An Alliance Cloud distribution",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/swift-messaging-api-openapi.yml#/components/schemas/Distribution",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "id": {
      "description": "The unique distribution identifier",
      "type": "integer",
      "format": "int64"
    },
    "service": {
      "description": "The service / protocol for the distribution",
      "type": "string",
      "enum": [
        "fin",
        "interAct",
        "fileAct"
      ]
    },
    "type": {
      "description": "The distribution type",
      "type": "string",
      "enum": [
        "message",
        "deliveryReport",
        "deliveryNotification",
        "transmissionReport",
        "archive",
        "export"
      ]
    },
    "distribution_tag": {
      "description": "The tag associated to the distribution",
      "type": "string",
      "maxLength": 256
    },
    "transmission_possible_duplicate": {
      "description": "Whether the distribution has already been tentatively downloaded at least once",
      "type": "boolean",
      "default": false
    },
    "copy": {
      "description": "Whether the distribution is about a copy or an original message",
      "type": "boolean"
    },
    "message_cloud_reference": {
      "description": "The unique identifier of the message linked to the distribution. For deliveryReport and transmissionReport types, it will be the one of the sent message",
      "type": "string",
      "format": "uuid"
    },
    "export_content": {
      "description": "Identifies the contents of the export. Currently only 'message' exports are supported by Alliance Cloud",
      "type": "string",
      "maxLength": 50
    },
    "export_format": {
      "description": "Identifies the format of the export. Currently only 'pdf' format is supported by Alliance Cloud",
      "type": "string",
      "maxLength": 50
    },
    "links": {
      "$ref": "#/$defs/Links"
    }
  },
  "$defs": {
    "Links": {
      "type": "array",
      "items": {
        "description": "A single link describing a possible API action",
        "type": "object",
        "additionalProperties": true,
        "required": [
          "href",
          "rel",
          "type"
        ],
        "properties": {
          "href": {
            "type": "string",
            "maxLength": 256,
            "format": "uri",
            "description": "The URI of the target resource"
          },
          "rel": {
            "type": "string",
            "maxLength": 30,
            "description": "How the current resource is linked to the target resource"
          },
          "type": {
            "type": "string",
            "enum": [
              "POST",
              "GET",
              "PUT",
              "PATCH",
              "HEAD",
              "DELETE"
            ],
            "description": "The HTTP verb to perform the action on the target resource"
          }
        }
      },
      "description": "An array of links describing the possible API actions that can be done for the distribution"
    }
  }
}