{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rewio-ru/json-schema/rewio-ru-object-refresh-v3-schema.json",
  "title": "ObjectRefreshV3",
  "description": "Дополнительный сбор отзывов по объекту: можно ли сейчас, а если нельзя – почему и когда снова.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rewio-ru-openapi.json#/components/schemas/ObjectRefreshV3",
  "properties": {
    "object_id": {
      "type": "integer",
      "title": "Object Id",
      "description": "Объект."
    },
    "is_allowed": {
      "type": "boolean",
      "title": "Is Allowed",
      "description": "Запустит ли `POST` сбор прямо сейчас."
    },
    "code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Code",
      "description": "Почему нельзя – тот же код, что вернёт `POST`: `refresh_requires_upgrade`, `refresh_trial_exhausted`, `refresh_in_progress`, `refresh_limited`, `refresh_nothing_to_scrape`. `null`, если можно."
    },
    "mode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mode",
      "description": "Что сделает `POST`: `full` – соберёт все включённые ссылки объекта, `retry` – только не собравшиеся в эти сутки. `null`, если нельзя."
    },
    "is_running": {
      "type": "boolean",
      "title": "Is Running",
      "description": "Идёт ли дополнительный сбор."
    },
    "is_retried": {
      "type": "boolean",
      "title": "Is Retried",
      "description": "Повтор этих суток уже использован."
    },
    "refreshed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Refreshed At",
      "description": "Начало текущих суток объекта – последний сбор всех ссылок, UTC."
    },
    "next_available_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Available At",
      "description": "Когда снова будет доступен сбор всех ссылок, UTC. `null` – уже доступен."
    },
    "retry_link_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Retry Link Ids",
      "description": "Ссылки, не собравшиеся в эти сутки, которым положен один повтор."
    },
    "trial_left": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Trial Left",
      "description": "Сколько дополнительных сборов осталось в пробном периоде (всего 5). `null` – не пробный период."
    },
    "links": {
      "items": {
        "$ref": "#/$defs/RefreshLinkV3"
      },
      "type": "array",
      "title": "Links",
      "description": "Итог дополнительных сборов этих суток по ссылкам; повтор перекрывает первый сбор по своим ссылкам. Пусто вне суток объекта."
    }
  },
  "type": "object",
  "required": [
    "object_id",
    "is_allowed",
    "is_running",
    "is_retried"
  ],
  "$defs": {
    "RefreshLinkV3": {
      "properties": {
        "link_id": {
          "type": "integer",
          "title": "Link Id",
          "description": "Ссылка объекта."
        },
        "status": {
          "type": "string",
          "title": "Status",
          "description": "`running` – собирается, `success` – собрана, `failed` – не собралась."
        }
      },
      "type": "object",
      "required": [
        "link_id",
        "status"
      ],
      "title": "RefreshLinkV3",
      "description": "Итог дополнительных сборов этих суток по одной ссылке."
    }
  }
}