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

from __future__ import annotations

from typing import Optional, Union

from pydantic import BaseModel, Extra, Field


class MySchema1(BaseModel):
    class Config:
        extra = Extra.allow

    AddressLine1: str
    AddressLine2: Optional[str] = None
    City: Optional[str] = None
    State: Optional[str] = None
    ZipCode: str


class MySchema2(BaseModel):
    class Config:
        extra = Extra.allow

    AddressLine1: str
    AddressLine2: Optional[str] = None
    City: Optional[str] = None
    County: Optional[str] = None
    PostCode: str


class US(BaseModel):
    County: Optional[str] = None
    PostCode: str


class MySchema3(US):
    class Config:
        extra = Extra.allow

    AddressLine1: str
    AddressLine2: Optional[str] = None
    City: Optional[str] = None


class MySchema(BaseModel):
    class Config:
        extra = Extra.allow

    __root__: Union[MySchema1, MySchema2, MySchema3] = Field(..., title='My schema')
