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

from __future__ import annotations

from typing import Optional

from pydantic import BaseModel, RootModel


class ReadOnlyId(RootModel[int]):
    root: int


class WriteOnlySecret(RootModel[str]):
    root: str


class UserRequest(BaseModel):
    name: str
    secret: Optional[WriteOnlySecret] = None


class UserResponse(BaseModel):
    id: ReadOnlyId
    name: str


class User(BaseModel):
    id: ReadOnlyId
    name: str
    secret: Optional[WriteOnlySecret] = None
