# AUTOGENERATED FILE
# generated by datamodel-codegen:


from __future__ import annotations

from typing import Any, Literal, Optional, Union

from miniappi.core.models.content import BaseMessage
from pydantic import ConfigDict, RootModel


class Root(RootModel[Any]):
    root: Any


class DelRef(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    id: str
    method: Literal['delete'] = 'delete'
    type: Literal['ref'] = 'ref'


class InputMessage(BaseMessage):
    """
    Message interface
    """

    model_config = ConfigDict(
        extra='allow',
    )
    data: Optional[Any] = None
    id: Optional[str] = None
    key: Optional[Union[str, float]] = None
    method: Optional[Literal['put', 'delete', 'push', 'pop']] = None
    type: Literal['root', 'ref']


class PopLeft(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    id: str
    key: Literal[-1] = -1
    method: Literal['pop'] = 'pop'
    type: Literal['ref'] = 'ref'


class PopRef(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    id: str
    key: Union[str, float]
    method: Literal['pop'] = 'pop'
    type: Literal['ref'] = 'ref'


class PopRight(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    id: str
    key: Literal[0] = 0
    method: Literal['pop'] = 'pop'
    type: Literal['ref'] = 'ref'


class PushLeft(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    data: Any
    id: str
    key: Literal[0] = 0
    method: Literal['push'] = 'push'
    type: Literal['ref'] = 'ref'


class PushRef(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    data: Any
    id: str
    key: Optional[Union[str, float]] = None
    method: Literal['push'] = 'push'
    type: Literal['ref'] = 'ref'


class PushRight(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    data: Any
    id: str
    key: Optional[Any] = None
    method: Literal['push'] = 'push'
    type: Literal['ref'] = 'ref'


class PutRef(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    data: Any
    id: str
    method: Literal['put'] = 'put'
    type: Literal['ref'] = 'ref'


class PutRoot(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    data: Any
    method: Literal['put'] = 'put'
    type: Literal['root'] = 'root'


class ShowRef(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    id: str
    method: Literal['show'] = 'show'
    type: Literal['ref'] = 'ref'


class ShowRoot(BaseMessage):
    model_config = ConfigDict(
        extra='allow',
    )
    id: str
    method: Literal['show'] = 'show'
    type: Literal['root'] = 'root'
