from serde import serde
from chris.common.types import ChrisUsername, ChrisPassword
from chris.cube.types import ComputeResourceName, PfconUrl
from dataclasses import dataclass, field


@serde
@dataclass(frozen=True)
class User:
    username: ChrisUsername
    password: <PASSWORD>
    email: str = None

    def __post_init__(self):
        if self.email is None:
            object.__setattr__(
                self, "email", f"<EMAIL>"
            )


@serde
@dataclass(frozen=True)
class ComputeResource:
    name: ComputeResourceName
    url: PfconUrl
    username: str = "pfcon"
    password: str = "<PASSWORD>"
    description: str = ""


@serde
@dataclass(frozen=True)
class Pipeline:
    src: str
    owner: ChrisUsername
    locked: bool = True

from serde import serde
from chris.common.types import ChrisUsername, ChrisPassword
from chris.cube.types import ComputeResourceName, PfconUrl
from dataclasses import dataclass, field


@serde
@dataclass(frozen=True)
class User:
    username: ChrisUsername
    password: <PASSWORD>
    email: str = None

    def __post_init__(self):
        if self.email is None:
            object.__setattr__(
                self, "email", f"<EMAIL>"
            )


@serde
@dataclass(frozen=True)
class ComputeResource:
    name: ComputeResourceName
    url: PfconUrl
    username: str = "pfcon"
    password: str = "<PASSWORD>"
    description: str = ""


@serde
@dataclass(frozen=True)
class Pipeline:
    src: str
    owner: ChrisUsername
    locked: bool = True
