# -*- coding: utf-8 -*-
from __future__ import annotations

import uuid

import pydantic


class SavesCreateOut(pydantic.BaseModel):
    id: uuid.UUID
    target_uuid: uuid.UUID
    url: pydantic.AnyHttpUrl
    is_netloc_banned: bool

    def to_rpc(self) -> dict:
        return {
            'id': self.id,
            'target_uuid': self.target_uuid,
            'url': str(self.url),
            'is_netloc_banned': self.is_netloc_banned,
        }
