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

from __future__ import annotations

from typing import Literal

from pydantic import BaseModel, Field


class SignalId(BaseModel):
    domain: str
    source: Literal['catalog']


class SignalId1(BaseModel):
    url: str
    source: Literal['agent']


class FirstThing(BaseModel):
    signal_id: SignalId | SignalId1 | None = Field(
        None, discriminator='source', title='Signal ID'
    )


class SignalId2(SignalId):
    source: Literal['catalog']


class SignalId3(SignalId1):
    source: Literal['agent']


class SecondThing(BaseModel):
    signal_id: SignalId2 | SignalId3 | None = Field(
        None, discriminator='source', title='Signal ID'
    )


class Root(BaseModel):
    first_thing: FirstThing | None = None
    second_thing: SecondThing | None = None
