{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/obm-com-br/json-schema/obm-com-br-bond-event-list-envelope-schema.json",
  "title": "BondEventListEnvelope",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/obm-com-br-openapi.yml#/components/schemas/BondEventListEnvelope",
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/BondEvent"
      },
      "type": "array",
      "title": "Data",
      "description": "Dados da resposta. Os exemplos são ilustrativos e não representam cotações atuais."
    },
    "reference_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Reference Date",
      "description": "Data do dado no formato AAAA-MM-DD (RFC 3339); null quando não há data verificável. Nunca é a data da chamada."
    },
    "source": {
      "$ref": "#/$defs/Source"
    },
    "meta": {
      "anyOf": [
        {
          "$ref": "#/$defs/Pagination"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "data",
    "reference_date",
    "source"
  ],
  "$defs": {
    "BondEvent": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "interest",
            "amortization",
            "extraordinary_amortization",
            "extraordinary_interest",
            "maturity",
            "early_redemption",
            "acceleration",
            "premium",
            "interest_capitalization",
            "repricing",
            "charge",
            "other"
          ],
          "title": "Type"
        },
        "type_label": {
          "type": "string",
          "title": "Type Label"
        },
        "scheduled_date": {
          "type": "string",
          "format": "date",
          "title": "Scheduled Date"
        },
        "payment_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Payment Date"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "paid",
            "unconfirmed",
            "cancelled"
          ],
          "title": "Status"
        },
        "amount_per_unit_brl": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Amount Per Unit Brl"
        },
        "rate_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rate Ratio"
        },
        "amortization_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Amortization Ratio"
        },
        "source": {
          "type": "string",
          "title": "Source"
        }
      },
      "type": "object",
      "required": [
        "type",
        "type_label",
        "scheduled_date",
        "status",
        "source"
      ],
      "title": "BondEvent"
    },
    "Pagination": {
      "properties": {
        "page": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Page"
        },
        "page_size": {
          "type": "integer",
          "maximum": 200.0,
          "minimum": 1.0,
          "title": "Page Size"
        },
        "total": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Total"
        }
      },
      "type": "object",
      "required": [
        "page",
        "page_size",
        "total"
      ],
      "title": "Pagination"
    },
    "Source": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "url": {
          "type": "string",
          "title": "Url"
        }
      },
      "type": "object",
      "required": [
        "code",
        "name",
        "url"
      ],
      "title": "Source"
    }
  }
}