{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cnpj-ai/json-schema/cnpj-ai-resposta-pagina-fonte-inscricao-pgfn-schema.json",
  "title": "Resposta[PaginaFonte[InscricaoPGFN]]",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cnpj-ai-v2-openapi.yml#/components/schemas/Resposta_PaginaFonte_InscricaoPGFN__",
  "properties": {
    "dados": {
      "$ref": "#/$defs/PaginaFonte_InscricaoPGFN_"
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    }
  },
  "type": "object",
  "required": [
    "dados",
    "meta"
  ],
  "$defs": {
    "InscricaoPGFN": {
      "properties": {
        "cnpj_basico": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj Basico"
        },
        "cnpj_fonte": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj Fonte"
        },
        "tipo_devedor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tipo Devedor"
        },
        "numero_inscricao": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Numero Inscricao"
        },
        "origem": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Origem"
        },
        "tipo_situacao_inscricao": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tipo Situacao Inscricao"
        },
        "situacao_inscricao": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Situacao Inscricao"
        },
        "receita_principal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Receita Principal"
        },
        "data_inscricao": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Inscricao",
          "description": "Data preservada na representação armazenada pela fonte; consulte o catálogo de fontes."
        },
        "indicador_ajuizado": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Indicador Ajuizado"
        },
        "valor_consolidado": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Valor Consolidado"
        },
        "em_cobranca": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Em Cobranca"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "cnpj_basico",
        "cnpj_fonte",
        "tipo_devedor",
        "numero_inscricao",
        "origem",
        "tipo_situacao_inscricao",
        "situacao_inscricao",
        "receita_principal",
        "data_inscricao",
        "indicador_ajuizado",
        "valor_consolidado",
        "em_cobranca"
      ],
      "title": "InscricaoPGFN"
    },
    "Meta": {
      "properties": {
        "versao": {
          "type": "string",
          "const": "v2",
          "title": "Versao",
          "default": "v2"
        },
        "release": {
          "type": "string",
          "const": "2.0.0",
          "title": "Release",
          "default": "2.0.0"
        },
        "recurso": {
          "type": "string",
          "enum": [
            "empresas",
            "estabelecimentos"
          ],
          "title": "Recurso"
        },
        "documento": {
          "type": "string",
          "title": "Documento"
        },
        "competencia_receita": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Competencia Receita"
        },
        "fotografia": {
          "type": "string",
          "title": "Fotografia"
        },
        "requisicao_id": {
          "type": "string",
          "format": "uuid",
          "title": "Requisicao Id"
        },
        "disponibilidade": {
          "type": "string",
          "enum": [
            "completa",
            "parcial"
          ],
          "title": "Disponibilidade",
          "default": "completa"
        }
      },
      "type": "object",
      "required": [
        "recurso",
        "documento",
        "competencia_receita",
        "fotografia",
        "requisicao_id"
      ],
      "title": "Meta"
    },
    "PaginaFonte_InscricaoPGFN_": {
      "properties": {
        "itens": {
          "items": {
            "$ref": "#/$defs/InscricaoPGFN"
          },
          "type": "array",
          "title": "Itens"
        },
        "total": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total"
        },
        "proximo_cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Proximo Cursor"
        },
        "proxima_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Proxima Url"
        },
        "fonte": {
          "type": "string",
          "title": "Fonte"
        },
        "status": {
          "type": "string",
          "enum": [
            "encontrado",
            "sem_ocorrencia",
            "indisponivel",
            "erro"
          ],
          "title": "Status"
        },
        "escopo": {
          "type": "string",
          "enum": [
            "empresa",
            "estabelecimento"
          ],
          "title": "Escopo"
        },
        "documento": {
          "type": "string",
          "title": "Documento"
        },
        "competencia": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Competencia"
        },
        "carregada_em": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Carregada Em"
        },
        "cobertura_inicio": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cobertura Inicio"
        },
        "desatualizada": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Desatualizada"
        },
        "proveniencia": {
          "$ref": "#/$defs/Proveniencia"
        }
      },
      "type": "object",
      "required": [
        "itens",
        "total",
        "fonte",
        "status",
        "escopo",
        "documento",
        "competencia",
        "carregada_em",
        "desatualizada",
        "proveniencia"
      ],
      "title": "PaginaFonte[InscricaoPGFN]"
    },
    "Proveniencia": {
      "properties": {
        "fonte": {
          "type": "string",
          "title": "Fonte"
        },
        "url": {
          "type": "string",
          "title": "Url"
        },
        "nota": {
          "type": "string",
          "title": "Nota"
        },
        "licenca": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Licenca"
        },
        "licenca_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Licenca Url"
        },
        "metodologia_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Metodologia Url"
        }
      },
      "type": "object",
      "required": [
        "fonte",
        "url",
        "nota"
      ],
      "title": "Proveniencia"
    }
  }
}