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

from __future__ import annotations

from pydantic import AnyUrl, BaseModel, Field, RootModel


class Cursors(BaseModel):
    prev: str | None = Field(...)
    next: str = 'last'
    index: float
    tag: str | None = None


class TopLevel(BaseModel):
    cursors: Cursors


class Info(BaseModel):
    name: str


class User(BaseModel):
    info: Info


class Api(BaseModel):
    apiKey: str | None = Field(
        None, description='To be used as a dataset parameter value'
    )
    apiVersionNumber: str | None = Field(
        None, description='To be used as a version parameter value'
    )
    apiUrl: AnyUrl | None = Field(
        None, description="The URL describing the dataset's fields"
    )
    apiDocumentationUrl: AnyUrl | None = Field(
        None, description='A URL to the API console for each API'
    )


class Apis(RootModel[list[Api] | None]):
    root: list[Api] | None = Field(...)


class EmailItem(BaseModel):
    author: str
    address: str = Field(..., description='email address')
    description: str = 'empty'
    tag: str | None = None


class Email(RootModel[list[EmailItem]]):
    root: list[EmailItem]


class Id(RootModel[int]):
    root: int = 1


class Description(RootModel[str | None]):
    root: str | None = 'example'


class Name(RootModel[str | None]):
    root: str | None = None


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


class Notes(BaseModel):
    comments: list[str] = Field(default_factory=list)


class Options(BaseModel):
    comments: list[str | None]
    oneOfComments: list[str | float | None]
    simpleUnion: str | float | None = None
