{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/modoboa/json-schema/modoboa-migration-schema.json",
  "title": "Migration",
  "description": "Serializer class for Migration.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/modoboa-migrations-api-openapi.yml#/components/schemas/Migration",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "provider": {
      "allOf": [
        {
          "$ref": "#/$defs/Nested"
        }
      ],
      "readOnly": true
    },
    "mailbox": {
      "$ref": "#/$defs/Mailbox"
    },
    "username": {
      "type": "string",
      "maxLength": 254
    }
  },
  "required": [
    "id",
    "mailbox",
    "provider",
    "username"
  ],
  "$defs": {
    "Mailbox": {
      "type": "object",
      "description": "Base mailbox serializer.",
      "properties": {
        "pk": {
          "type": "integer",
          "readOnly": true,
          "title": "ID"
        },
        "full_address": {
          "type": "string",
          "format": "email"
        },
        "use_domain_quota": {
          "type": "boolean"
        },
        "quota": {
          "type": "string"
        },
        "message_limit": {
          "type": [
            "integer",
            "null"
          ],
          "maximum": 9223372036854775807,
          "minimum": 0,
          "format": "int64",
          "title": "Message sending limit",
          "description": "Number of messages this mailbox can send per day"
        },
        "quota_usage": {
          "type": "integer",
          "readOnly": true
        },
        "is_send_only": {
          "type": "boolean"
        },
        "sent_messages_in_percent": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Return number of sent messages as a percentage.",
          "readOnly": true
        }
      },
      "required": [
        "full_address",
        "pk",
        "quota_usage",
        "sent_messages_in_percent"
      ]
    },
    "Nested": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "maxLength": 50
        },
        "address": {
          "type": "string",
          "maxLength": 200
        },
        "port": {
          "type": "integer",
          "maximum": 9223372036854775807,
          "minimum": 0,
          "format": "int64"
        },
        "secured": {
          "type": "boolean"
        }
      },
      "required": [
        "address",
        "id",
        "name"
      ]
    }
  }
}