# generated by datamodel-codegen:
#   filename:  serialize_as_any.yaml
#   timestamp: 2019-07-26T00:00:00+00:00

from __future__ import annotations

from pydantic import BaseModel, Field, SerializeAsAny


class User(BaseModel):
    name: str = Field(..., description="User's name")


class AdminUser(User):
    admin_level: int = Field(..., description='Admin permission level')


class Container(BaseModel):
    admin_user_field: AdminUser = Field(
        ..., description='Field that should not use SerializeAsAny'
    )
    user_field: SerializeAsAny[User] = Field(
        ..., description='Field that should use SerializeAsAny'
    )
    user_list: list[SerializeAsAny[User]] = Field(
        ..., description='List of users that should use SerializeAsAny'
    )
