<reponame>Tracardi/tracardi-pushover-webhook<filename>tracardi_pushover_webhook/model/pushover_config.py
from pydantic import BaseModel, validator
from tracardi.domain.named_entity import NamedEntity


class PushOverAuth(BaseModel):
    token: str
    user: str


class PushOverConfiguration(BaseModel):
    source: NamedEntity
    message: str

    @validator("message")
    def name_not_empty(cls, value):
        if len(value) == 0:
            raise ValueError("message can not be empty.")
        return value

from pydantic import BaseModel, validator
from tracardi.domain.named_entity import NamedEntity


class PushOverAuth(BaseModel):
    token: str
    user: str


class PushOverConfiguration(BaseModel):
    source: NamedEntity
    message: str

    @validator("message")
    def name_not_empty(cls, value):
        if len(value) == 0:
            raise ValueError("message can not be empty.")
        return value