# coding: utf-8

"""
    CATAPA API

    CATAPA HR and workforce management API for payroll, organization, personnel, time management, and related operations.

    The version of the OpenAPI document: 1.0.0
    Contact: support@catapa.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from datetime import date
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional, Union
from uuid import UUID
from typing import Optional, Set
from typing_extensions import Self

class SeverancePaymentPlanResponse(BaseModel):
    """
    SeverancePaymentPlanResponse
    """ # noqa: E501
    id: Optional[UUID] = None
    termination_entry_id: Optional[UUID] = Field(default=None, alias="terminationEntryId")
    termination_entry_code: Optional[StrictStr] = Field(default=None, alias="terminationEntryCode")
    employee_id: Optional[UUID] = Field(default=None, alias="employeeId")
    employee_identification_number: Optional[StrictStr] = Field(default=None, alias="employeeIdentificationNumber")
    employee_name: Optional[StrictStr] = Field(default=None, alias="employeeName")
    termination_reason_id: Optional[UUID] = Field(default=None, alias="terminationReasonId")
    termination_reason_name: Optional[StrictStr] = Field(default=None, alias="terminationReasonName")
    termination_date: Optional[date] = Field(default=None, alias="terminationDate")
    planned_date: Optional[date] = Field(default=None, alias="plannedDate")
    payment_date: Optional[date] = Field(default=None, alias="paymentDate")
    payment_method: Optional[StrictStr] = Field(default=None, alias="paymentMethod")
    payment_option: Optional[StrictStr] = Field(default=None, alias="paymentOption")
    amount: Optional[Union[StrictFloat, StrictInt]] = None
    non_taxable_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="nonTaxableAmount")
    thp_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="thpAmount")
    pph_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="pphAmount")
    tax_allowance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="taxAllowance")
    __properties: ClassVar[List[str]] = ["id", "terminationEntryId", "terminationEntryCode", "employeeId", "employeeIdentificationNumber", "employeeName", "terminationReasonId", "terminationReasonName", "terminationDate", "plannedDate", "paymentDate", "paymentMethod", "paymentOption", "amount", "nonTaxableAmount", "thpAmount", "pphAmount", "taxAllowance"]

    @field_validator('payment_method')
    def payment_method_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['CASH', 'TRANSFER', 'NONE']):
            raise ValueError("must be one of enum values ('CASH', 'TRANSFER', 'NONE')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of SeverancePaymentPlanResponse from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of SeverancePaymentPlanResponse from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "id": obj.get("id"),
            "terminationEntryId": obj.get("terminationEntryId"),
            "terminationEntryCode": obj.get("terminationEntryCode"),
            "employeeId": obj.get("employeeId"),
            "employeeIdentificationNumber": obj.get("employeeIdentificationNumber"),
            "employeeName": obj.get("employeeName"),
            "terminationReasonId": obj.get("terminationReasonId"),
            "terminationReasonName": obj.get("terminationReasonName"),
            "terminationDate": obj.get("terminationDate"),
            "plannedDate": obj.get("plannedDate"),
            "paymentDate": obj.get("paymentDate"),
            "paymentMethod": obj.get("paymentMethod"),
            "paymentOption": obj.get("paymentOption"),
            "amount": obj.get("amount"),
            "nonTaxableAmount": obj.get("nonTaxableAmount"),
            "thpAmount": obj.get("thpAmount"),
            "pphAmount": obj.get("pphAmount"),
            "taxAllowance": obj.get("taxAllowance")
        })
        return _obj


