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

from __future__ import annotations

from typing import List, Optional

from pydantic import AnyUrl, BaseModel, ConfigDict, Field, RootModel


class Pet(BaseModel):
    model_config = ConfigDict(
        frozen=True,
    )
    id: int
    name: str
    tag: Optional[str] = None


class Pets(RootModel[List[Pet]]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: List[Pet]


class User(BaseModel):
    model_config = ConfigDict(
        frozen=True,
    )
    id: int
    name: str
    tag: Optional[str] = None


class Users(RootModel[List[User]]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: List[User]


class Id(RootModel[str]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: str


class Rules(RootModel[List[str]]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: List[str]


class Error(BaseModel):
    model_config = ConfigDict(
        frozen=True,
    )
    code: int
    message: str


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


class Apis(RootModel[List[Api]]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: List[Api]


class Event(BaseModel):
    model_config = ConfigDict(
        frozen=True,
    )
    name: Optional[str] = None


class Result(BaseModel):
    model_config = ConfigDict(
        frozen=True,
    )
    event: Optional[Event] = None
