<reponame>catenax-ng/product-data-integrity-demonstrator<gh_stars>0
# coding: utf-8

from __future__ import annotations
from datetime import date, datetime  # noqa: F401

import re  # noqa: F401
from typing import Any, Dict, List, Optional  # noqa: F401

from pydantic import AnyUrl, BaseModel, EmailStr, validator  # noqa: F401
from pydantic import Field
from .aspect_create import AspectCreate
from .local_identifier_create import LocalIdentifierCreate
from digital_twin_registry.dependencies import MyBaseModel


class DigitalTwinCreate(MyBaseModel):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.

    DigitalTwinCreate - a model defined in OpenAPI

        id: The id of this DigitalTwinCreate [Optional].
        description: The description of this DigitalTwinCreate.
        manufacturer: The manufacturer of this DigitalTwinCreate.
        local_identifiers: The local_identifiers of this DigitalTwinCreate.
        aspects: The aspects of this DigitalTwinCreate.
    """

    id: Optional[str] = None
    description: str
    manufacturer: str
    local_identifiers: Optional[List[LocalIdentifierCreate]] = Field(None, alias='localIdentifiers')
    aspects: Optional[List[AspectCreate]]

    @validator("manufacturer")
    def manufacturer_min_length(cls, value):
        assert len(value) >= 2
        return value

    @validator("manufacturer")
    def manufacturer_max_length(cls, value):
        assert len(value) <= 30
        return value


DigitalTwinCreate.update_forward_refs()

class DigitalTwinCreateList(BaseModel):
    __root__: List[DigitalTwinCreate] = []

DigitalTwinCreateList.update_forward_refs()