"""
Protected module contains job parameter class
"""

from dataclasses import dataclass
from datetime import datetime
from enum import Enum
from typing import TypeVar

# Define a generic type for job values
JobValueT = TypeVar("JobValueT", bool, int, float, datetime, str, bytes)
JobValueTypes = bool | int | float | datetime | str | bytes


class JobParameterTypes(Enum):
    """
    Enum with the possible job parameter types.
    """

    STRING = 1
    INTEGER = 2
    BOOLEAN = 3
    DOUBLE = 4
    DATE_TIME = 5
    BASE64 = 6
    BIGINT = 8
    # DB = 9


@dataclass
class JobParameter:
    """
    Job Parameters for the RPC API

    Args:
        name (str): Name of the Parameter
        value (bool | int | float | datetime | str | bytes): Parameter value
        type (JobParameterTypes): Type of the parameter
    """

    name: str
    value: JobValueTypes
    type: JobParameterTypes
