# This file was generated by liblab | https://liblab.com/

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .identifier_value import IdentifierValue, IdentifierValueGuard
from .timesheet_status_enum import TimesheetStatusEnum
from .file_attachment_info import FileAttachmentInfo


@JsonMap({"id_": "id"})
class PgoTask(BaseModel):
    """PgoTask

    :param id_: id_
    :type id_: IdentifierValue
    :param amount: Fixed rate for this task.
    :type amount: str
    :param date_submitted: Short date in format ISO-8601 (YYYY-MM-DD). For example: 2022-12-31.
    :type date_submitted: str
    :param description: Task description.
    :type description: str
    :param status: Status of this entry.
    :type status: TimesheetStatusEnum
    :param attachment: This object is used for linking file attachments to your records., defaults to None
    :type attachment: FileAttachmentInfo, optional
    """

    def __init__(
        self,
        id_: IdentifierValue,
        amount: str,
        date_submitted: str,
        description: str,
        status: TimesheetStatusEnum,
        attachment: FileAttachmentInfo = None,
    ):
        self.id_ = IdentifierValueGuard.return_one_of(id_)
        self.amount = amount
        self.date_submitted = date_submitted
        self.description = description
        self.status = self._enum_matching(status, TimesheetStatusEnum.list(), "status")
        if attachment is not None:
            self.attachment = self._define_object(attachment, FileAttachmentInfo)
