# Generated by oapi-gen 0.1.0. DO NOT EDIT.
# Source SHA256: 7b3381eb8339af725253f04fe07b232aa9922b9cd9a5216c51fec7c10670ab71
from __future__ import annotations

from dataclasses import dataclass
from typing import Annotated, Protocol
from uuid import UUID

from msgspec import Meta

from . import models as _models


class ListCats:
    @dataclass(frozen=True, slots=True, kw_only=True)
    class Request:
        "List cats\n\nlimit: Maximum number of cats"

        limit: Annotated[int, Meta(ge=1, le=100)] | None

    @dataclass(frozen=True, slots=True)
    class Ok:
        "Cat list"

        body: list[_models.Cat]

    @dataclass(slots=True)
    class NotFound(Exception):
        "No cats found"

        body: _models.HttpError

    type Response = Ok


class CreateCat:
    @dataclass(frozen=True, slots=True, kw_only=True)
    class Request:
        "Create a cat\n\nbody: Cat to create"

        body: _models.CatCreate

    @dataclass(frozen=True, slots=True)
    class Created:
        "Cat created"

        pass

    type Response = Created


class ShowCatById:
    @dataclass(frozen=True, slots=True, kw_only=True)
    class Request:
        "Show a cat\n\ncat_id: Cat identifier"

        cat_id: UUID

    @dataclass(frozen=True, slots=True)
    class Ok:
        "Cat"

        body: _models.Cat

    @dataclass(slots=True)
    class NotFound(Exception):
        "Cat not found"

        body: _models.HttpError

    type Response = Ok


class CatsHandler(Protocol):
    async def list_cats(self, request: ListCats.Request) -> ListCats.Response:
        "List cats"
        ...

    async def create_cat(self, request: CreateCat.Request) -> CreateCat.Response:
        "Create a cat"
        ...

    async def show_cat_by_id(self, request: ShowCatById.Request) -> ShowCatById.Response:
        "Show a cat"
        ...


@dataclass(frozen=True, slots=True, kw_only=True)
class Handlers:
    cats: CatsHandler
