# generated by datamodel-codegen:
#   filename:  api/createType.json
#   timestamp: 2022-10-04T14:49:18+00:00

from __future__ import annotations

from typing import Optional

from pydantic import BaseModel, Extra, Field

from ..entity import type
from ..type import basic


class CreateType(BaseModel):
    class Config:
        extra = Extra.forbid

    name: type.TypeName = Field(..., description='Unique name that identifies a Type.')
    displayName: Optional[str] = Field(
        None, description='Display Name that identifies this Type.'
    )
    description: basic.Markdown = Field(
        ..., description='Optional description of the type.'
    )
    nameSpace: str = Field(
        ..., description='Namespace or group to which this type belongs to.'
    )
    category: Optional[type.Category] = None
    schema_: basic.JsonSchema = Field(
        ...,
        alias='schema',
        description='JSON schema encoded as string. This will be used to validate the type values.',
    )
