# generated by datamodel-codegen:
#   filename:  root_model_sequence_interface.json

from __future__ import annotations

from collections.abc import Iterator, Sequence
from typing import SupportsIndex, overload

from pydantic import BaseModel, RootModel


class Pet(BaseModel):
    name: str


class Pets(RootModel[list[Pet]], Sequence[Pet]):
    root: list[Pet]

    def __iter__(self) -> Iterator[Pet]:
        return iter(self.root)

    @overload
    def __getitem__(self, index: SupportsIndex) -> Pet:
        pass

    @overload
    def __getitem__(self, index: slice) -> list[Pet]:
        pass

    def __getitem__(self, index: SupportsIndex | slice) -> Pet | list[Pet]:
        return self.root[index]

    def __len__(self) -> int:
        return len(self.root)
