# generated by datamodel-codegen:
#   filename:  personio-personnel-data-api-oa3.yaml

from __future__ import annotations

from enum import Enum
from typing import Annotated, Any, Dict, List
from uuid import UUID

from pendulum import Date, DateTime
from pydantic import Field, RootModel
from pydantic_extra_types.pendulum_dt import Date, DateTime

from ..v1 import MyPersonnelBaseModel


class Response(MyPersonnelBaseModel):
    success: bool
    data: Dict[str, Any]


class DocumentUploadRequest(MyPersonnelBaseModel):
    title: str
    """
    Title of the document. Maximum length is 255 characters.
    """
    comment: str | None = None
    """
    Optional comment that can be added to the uploaded document.
    """
    employee_id: int
    """
    Employee identifier
    """
    category_id: int
    """
    Document Category identifier
    """
    date: Date | None = None
    """
    Optional date can be added to the uploaded document. Must follow the format: Y-m-d
    """
    file: bytes
    """
    The document that shall be uploaded to an employees profile. Maximum file size is 30MB.
    """


class Error(MyPersonnelBaseModel):
    message: Annotated[
        str | None, Field(examples=["No query results for model [DocumentCategory] 1"])
    ] = None
    code: Annotated[int | None, Field(examples=[0])] = None


class DocumentUploadFailedWithBadDocumentCategoryResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error | None = None


class ErrorData(MyPersonnelBaseModel):
    file: List[str] | None = None


class Error1(MyPersonnelBaseModel):
    message: Annotated[str | None, Field(examples=["The given data was invalid."])] = (
        None
    )
    code: Annotated[int | None, Field(examples=[0])] = None
    error_data: ErrorData | None = None


class DocumentUploadFailedWithUnsupportedFileTypeResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error1 | None = None


class Id(MyPersonnelBaseModel):
    label: Annotated[str | None, Field(examples=["ID"])] = None
    value: Annotated[int | None, Field(examples=[1])] = None
    type: Annotated[str | None, Field(examples=["standard"])] = None
    universal_id: Annotated[str | None, Field(examples=["id"])] = None


class FirstName(MyPersonnelBaseModel):
    label: Annotated[str | None, Field(examples=["First name"])] = None
    value: Annotated[str | None, Field(examples=["Michael"])] = None
    type: Annotated[str | None, Field(examples=["standard"])] = None
    universal_id: Annotated[str | None, Field(examples=["first_name"])] = None


class LastName(MyPersonnelBaseModel):
    label: Annotated[str | None, Field(examples=["Last name"])] = None
    value: Annotated[str | None, Field(examples=["Dou"])] = None
    type: Annotated[str | None, Field(examples=["standard"])] = None
    universal_id: Annotated[str | None, Field(examples=["last_name"])] = None


class Email(MyPersonnelBaseModel):
    label: Annotated[str | None, Field(examples=["Email"])] = None
    value: Annotated[str | None, Field(examples=["michaeldou@demo.de"])] = None
    type: Annotated[str | None, Field(examples=["standard"])] = None
    universal_id: Annotated[str | None, Field(examples=["email"])] = None


class DocumentEmployeeResponseObject(MyPersonnelBaseModel):
    id: Id | None = None
    first_name: FirstName | None = None
    last_name: LastName | None = None
    email: Email | None = None


class Attributes1(MyPersonnelBaseModel):
    name: Annotated[str | None, Field(examples=["Certificates of employment"])] = None


class DocumentCategory(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[1])] = None
    type: Annotated[str | None, Field(examples=["DocumentCategory"])] = None
    attributes: Attributes1 | None = None


class Data1(MyPersonnelBaseModel):
    message: Annotated[
        Any | None, Field(examples=["The absence period was deleted."])
    ] = None


class DeletedAbsenceResponse(MyPersonnelBaseModel):
    success: bool | None = None
    data: Data1 | None = None


class Data2(MyPersonnelBaseModel):
    message: Annotated[
        Any | None, Field(examples=["The attendance period was deleted"])
    ] = None


class DeletedAttendanceResponse(MyPersonnelBaseModel):
    success: bool | None = None
    data: Data2 | None = None


class Data3(MyPersonnelBaseModel):
    message: Annotated[
        Any | None, Field(examples=["The attendance period was updated."])
    ] = None


class UpdatedAttendanceResponse(MyPersonnelBaseModel):
    success: bool | None = None
    data: Data3 | None = None


class Error2(MyPersonnelBaseModel):
    code: Annotated[int | None, Field(examples=[0])] = None
    message: Annotated[Any | None, Field(examples=["Something went wrong"])] = None


class ErrorResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error2 | None = None


class Error3(MyPersonnelBaseModel):
    code: Annotated[int | None, Field(examples=[0])] = None
    message: Annotated[
        Any | None, Field(examples=["The given data failed to pass validation."])
    ] = None


class ErrorCreateAbsenceResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error3 | None = None


class Error4(MyPersonnelBaseModel):
    code: Annotated[int | None, Field(examples=[404])] = None
    message: Annotated[
        Any | None, Field(examples=["The absence period was not found."])
    ] = None


class ErrorAbsenceResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error4 | None = None


class Error5(MyPersonnelBaseModel):
    code: Annotated[int | None, Field(examples=[400])] = None
    message: Annotated[
        Any | None, Field(examples=["Error when trying to insert absence period"])
    ] = None


class ErrorInsertingAbsenceResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error5 | None = None


class DetailedMessageItem(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error_msg: Annotated[
        str | None, Field(examples=["Existing overlapping attendances periods"])
    ] = None
    id: Annotated[int | None, Field(examples=[None])] = None
    employee: Annotated[int | None, Field(examples=[1234])] = None
    date: Annotated[str | None, Field(examples=["2017-01-01"])] = None
    start_time: Annotated[str | None, Field(examples=["09:00"])] = None
    end_time: Annotated[str | None, Field(examples=[1080])] = None
    break_: Annotated[int | None, Field(alias="break", examples=[60])] = None
    comment: Annotated[str | None, Field(examples=["Optional Test Comment"])] = None
    project_id: Annotated[int | None, Field(examples=[None])] = None


class Error6(MyPersonnelBaseModel):
    code: Annotated[int | None, Field(examples=[400])] = None
    message: Annotated[
        str | None,
        Field(examples=["Error when trying to insert Attendances periods rows"]),
    ] = None
    detailed_message: List[DetailedMessageItem] | None = None


class AttendanceCreateUpdate400ErrorResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error6 | None = None


class Error7(MyPersonnelBaseModel):
    code: Annotated[int | None, Field(examples=[400])] = None
    message: Annotated[Any | None, Field(examples=["Bad Request"])] = None


class AttendanceDelete400ErrorResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error7 | None = None


class Error8(MyPersonnelBaseModel):
    code: Annotated[int | None, Field(examples=[404])] = None
    message: Annotated[
        Any | None, Field(examples=["The attendance period was not found."])
    ] = None


class Attendance404ErrorResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error8 | None = None


class Error9(MyPersonnelBaseModel):
    code: Annotated[int | None, Field(examples=[0])] = None
    message: Annotated[
        Any | None, Field(examples=["Es ist ein Problem aufgetreten"])
    ] = None


class Employee404ErrorResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[False])] = None
    error: Error9 | None = None


class Data4(MyPersonnelBaseModel):
    id: Annotated[float | None, Field(examples=[1])] = None
    message: Annotated[str | None, Field(examples=["success"])] = None


class EmployeeCreatedResponse(MyPersonnelBaseModel):
    success: bool | None = None
    data: Data4 | None = None


class Error10(MyPersonnelBaseModel):
    code: Annotated[float | None, Field(examples=[422])] = None
    message: Annotated[
        str | None, Field(examples=["Supervisor with ID 1 not found"])
    ] = None


class EmployeeCreationErrorResponse(MyPersonnelBaseModel):
    success: bool | None = None
    error: Error10 | None = None


class Data5(MyPersonnelBaseModel):
    id: Annotated[float | None, Field(examples=[12345])] = None


class EmployeeUpdatedResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[True])] = None
    data: Data5 | None = None
    meta: List[str] | None = []


class EmployeeUpdateErrorResponse(MyPersonnelBaseModel):
    success: bool | None = None
    error: Error10 | None = None


class Attributes2(MyPersonnelBaseModel):
    name: Annotated[Any | None, Field(examples=["Munich"])] = None


class Value(MyPersonnelBaseModel):
    type: Annotated[str | None, Field(examples=["Office"])] = None
    attributes: Attributes2 | None = None


class Attributes3(MyPersonnelBaseModel):
    id: Annotated[int, Field(examples=[1])]
    name: Annotated[str, Field(examples=["Marketing"])]


class Value1(MyPersonnelBaseModel):
    type: Annotated[str | None, Field(examples=["Department"])] = None
    attributes: Attributes3 | None = None


class Attributes4(MyPersonnelBaseModel):
    name: Annotated[Any | None, Field(examples=["Cost Center One"])] = None
    id: Annotated[float | None, Field(examples=[1])] = None
    percentage: Annotated[float | None, Field(examples=[50])] = None


class ValueItem(MyPersonnelBaseModel):
    type: Annotated[Any | None, Field(examples=["CostCenter"])] = None
    attributes: Attributes4 | None = None


class Attributes5(MyPersonnelBaseModel):
    id: Annotated[float | None, Field(examples=[1])] = None
    name: Annotated[Any | None, Field(examples=["DE (Hamburg) Feiertage"])] = None
    country: Annotated[Any | None, Field(examples=["DE"])] = None
    state: Annotated[Any | None, Field(examples=["Hamburg"])] = None


class Value2(MyPersonnelBaseModel):
    type: Annotated[Any | None, Field(examples=["HolidayCalendar"])] = None
    attributes: Attributes5 | None = None


class Attributes6(MyPersonnelBaseModel):
    id: Annotated[float | None, Field(examples=[1])] = None
    name: Annotated[Any | None, Field(examples=["Standard Hours"])] = None
    monday: Annotated[
        Any | None, Field(examples=["08:30"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    tuesday: Annotated[
        Any | None, Field(examples=["08:30"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    wednesday: Annotated[
        Any | None, Field(examples=["08:30"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    thursday: Annotated[
        Any | None, Field(examples=["08:30"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    friday: Annotated[
        Any | None, Field(examples=["08:30"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    saturday: Annotated[
        Any | None, Field(examples=["00:00"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    sunday: Annotated[
        Any | None, Field(examples=["00:00"], pattern="^\\d\\d:\\d\\d$")
    ] = None


class Value3(MyPersonnelBaseModel):
    type: Annotated[Any | None, Field(examples=["WorkSchedule"])] = None
    attributes: Attributes6 | None = None


class Attributes7(MyPersonnelBaseModel):
    name: Annotated[Any | None, Field(examples=["Management"])] = None


class Value4(MyPersonnelBaseModel):
    type: Annotated[str | None, Field(examples=["Team"])] = None
    attributes: Attributes7 | None = None


class Type(str, Enum):
    TIME_OFF_TYPE = "TimeOffType"


class Attributes8(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[1])] = None
    name: Annotated[Any | None, Field(examples=["Paid Vacation"])] = None
    entitlement: Annotated[Any | None, Field(examples=[30])] = None


class ValueItem1(MyPersonnelBaseModel):
    type: Type | None = None
    attributes: Attributes8 | None = None


class AbsenceEntitlement(MyPersonnelBaseModel):
    label: Annotated[Any, Field(examples=["Absence entitlement"])]
    value: List[ValueItem1]


class Metadata(MyPersonnelBaseModel):
    total_elements: int
    """
    The total number of items matching the query filters.
    """
    total_pages: int
    """
    The total number of pages distributing sets of items matching the query filters.
    """
    current_page: int
    """
    Current page number containing the returned set of items matching with the query filters. The page number range is from 0 to total_pages - 1
    """


class Datum1(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[1234])] = None
    name: Annotated[str | None, Field(examples=["Paid Vacation"])] = None
    category: Annotated[str | None, Field(examples=["custom_absence"])] = None
    balance: Annotated[float | None, Field(examples=[10.5])] = None
    """
    Effective balance, as of request date; not deducting any upcoming absence periods, but only what has been taken. If the absence period is currently ongoing, the effective balance only considers the part of the period until today.

    """
    available_balance: Annotated[float | None, Field(examples=[8.5])] = None
    """
    Available balance is what actually left to be planned (where upcoming absence periods are already deducted).
    """


class EmployeeAbsenceBalance(MyPersonnelBaseModel):
    success: bool | None = None
    data: List[Datum1] | None = None


class Attributes9(MyPersonnelBaseModel):
    name: Annotated[str | None, Field(examples=["Project name"])] = None
    active: Annotated[bool | None, Field(examples=[True])] = None
    """
    Marks the availability of the project. The default value is false.
    """
    created_at: Annotated[str | None, Field(examples=["2022-02-01T12:00:00+0100"])] = (
        None
    )
    updated_at: Annotated[str | None, Field(examples=["2022-02-01T12:00:00+0100"])] = (
        None
    )


class Project(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[1])] = None
    type: Annotated[str | None, Field(examples=["Project"])] = None
    attributes: Attributes9 | None = None


class Attributes10(MyPersonnelBaseModel):
    name: Annotated[str | None, Field(examples=["Project name"])] = None
    active: Annotated[bool | None, Field(examples=[True])] = None
    """
    Marks the availability of the project. When a new project is created, it's set by default to false.
    """


class AttendanceProject(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[1])] = None
    type: Annotated[str | None, Field(examples=["Project"])] = None
    attributes: Attributes10 | None = None


class Status1(str, Enum):
    CONFIRMED = "confirmed"
    PENDING = "pending"
    REJECTED = "rejected"


class Attributes11(MyPersonnelBaseModel):
    name: Annotated[str | None, Field(examples=["A project name"])] = None
    active: Annotated[bool | None, Field(examples=[True])] = None


class Project1(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[5])] = None
    type: Annotated[str | None, Field(examples=["Project"])] = None
    attributes: Attributes11 | None = None


class Attendance(MyPersonnelBaseModel):
    employee: Annotated[int | None, Field(examples=[1])] = None
    date: Date | None = None
    start_time: Annotated[
        str | None, Field(examples=["08:00"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    end_time: Annotated[
        str | None, Field(examples=["17:00"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    break_: Annotated[int | None, Field(alias="break", examples=[60])] = None
    comment: Annotated[str | None, Field(examples=["I was productive as hell"])] = None
    is_holiday: Annotated[bool | None, Field(examples=[False])] = None
    is_on_time_off: Annotated[bool | None, Field(examples=[False])] = None
    status: Status1 | None = None
    project: Project1 | None = None


class Attendance1(MyPersonnelBaseModel):
    employee: Annotated[int, Field(examples=[1], ge=1)]
    date: Date
    start_time: Annotated[str, Field(examples=["08:00"], pattern="^\\d\\d:\\d\\d$")]
    """
    Format: hh:mm
    """
    end_time: Annotated[
        str | None, Field(examples=["17:00"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    """
    Format: hh:mm
    """
    break_: Annotated[int, Field(alias="break", examples=[60], ge=0)]
    comment: Annotated[str | None, Field(examples=["I was productive as hell"])] = None
    project_id: Annotated[int | None, Field(examples=[5])] = None


class AttendanceCreateRequest(MyPersonnelBaseModel):
    attendances: Annotated[List[Attendance1] | None, Field(min_length=1)] = None
    skip_approval: bool | None = None
    """
    Optional, default value is true. If set to false, the approval status of the attendance period will be "pending" if an approval rule is set for the attendances type. The respective approval flow will be triggered.
    """


class AttendanceUpdateRequest(MyPersonnelBaseModel):
    date: Date | None = None
    start_time: Annotated[
        str | None, Field(examples=["08:00"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    """
    Format: hh:mm
    """
    end_time: Annotated[
        str | None, Field(examples=["17:00"], pattern="^\\d\\d:\\d\\d$")
    ] = None
    """
    Format: hh:mm
    """
    break_: Annotated[int | None, Field(alias="break", examples=[60], ge=0)] = None
    comment: Annotated[str | None, Field(examples=["I was productive as hell"])] = None
    project_id: Annotated[int | None, Field(examples=[5])] = None
    skip_approval: bool | None = None
    """
    Optional, default value is true. If set to false, the approval status of the attendance period will be "pending" if an approval rule is set for the attendances type. The respective approval flow will be triggered.
    """


class Datum2(MyPersonnelBaseModel):
    id: Annotated[int, Field(examples=[1])]
    type: Annotated[Any, Field(examples=["AttendancePeriod"])]
    attributes: Attendance


class AttendancePeriodsResponse(Response):
    metadata: Metadata | None = None
    offset: int | None = None
    limit: int | None = None
    data: List[Datum2] | None = None


class NewAttendancePeriodParametersRequest(MyPersonnelBaseModel):
    attendances___employee_: Annotated[int, Field(alias="attendances[][employee]")]
    """
    Employee identifier
    """
    attendances___date_: Annotated[
        Date, Field(alias="attendances[][date]", examples=["2020-01-31"])
    ]
    """
    Attendance date. Format: yyyy-mm-dd
    """
    attendances___start_time_: Annotated[
        str,
        Field(
            alias="attendances[][start_time]",
            examples=["08:00"],
            pattern="^\\d\\d:\\d\\d$",
        ),
    ]
    """
    Start time. Format: hh:mm
    """
    attendances___end_time_: Annotated[
        str | None,
        Field(
            alias="attendances[][end_time]",
            examples=["12:00"],
            pattern="^\\d\\d:\\d\\d$",
        ),
    ] = None
    """
    End time. Format: hh:mm
    """
    attendances__break: Annotated[int, Field(alias="attendances[]break", ge=0)]
    """
    Break in minutes
    """
    attendances___comment_: Annotated[
        str | None, Field(alias="attendances[][comment]")
    ] = None
    """
    Optional comment
    """
    skip_approval: bool | None = None
    """
    Optional, default value is true. If set to false, the approval status of the attendance period will be "pending" if an approval rule is set for the attendances type. The respective approval flow will be triggered.
    """
    project_id: Annotated[int | None, Field(examples=[5])] = None
    """
    The ID of the project
    """


class Data7(MyPersonnelBaseModel):
    id: List[int] | None = None
    message: Annotated[Any | None, Field(examples=["Success"])] = None


class NewAttendancePeriodResponse(Response):
    data: Data7 | None = None


class Category(str, Enum):
    FAMILY_CARE = "family_care"
    MATERNITY_PARENTAL_LEAVE = "maternity_parental_leave"
    CHILD_CARE = "child_care"
    SHORT_TIME_ALLOWANCE = "short_time_allowance"
    QUARANTINE = "quarantine"
    IRREVOCABLE_EXEMPTION = "irrevocable_exemption"
    SICK_LEAVE = "sick_leave"
    STRIKE_AND_LOCKOUT = "strike_and_lockout"
    PUBLIC_DUTY = "public_duty"
    UNPAID_SUSPENSION = "unpaid_suspension"
    PAID_VACATION = "paid_vacation"
    UNPAID_VACATION = "unpaid_vacation"
    UNEXCUSED_ABSENCE = "unexcused_absence"
    OFFSITE_WORK = "offsite_work"
    OTHER = "other"
    UNDEFINED = "undefined"


class Unit(str, Enum):
    DAY = "day"
    HOUR = "hour"


class Attributes12(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[1])] = None
    """
    identifier
    """
    name: Annotated[str | None, Field(examples=["Paid vacation"])] = None
    category: Annotated[Category | None, Field(examples=["offsite_work"])] = None
    unit: Annotated[Unit | None, Field(examples=["day"])] = None
    approval_required: Annotated[bool | None, Field(examples=[True])] = None


class TimeOffTypeResource(MyPersonnelBaseModel):
    type: Type | None = None
    """
    Time-off type resource name
    """
    attributes: Attributes12 | None = None


class CreateTimeOffPeriodRequest(MyPersonnelBaseModel):
    employee_id: int
    """
    Employee identifier
    """
    time_off_type_id: int
    """
    Time-off type identifier
    """
    start_date: Annotated[Date, Field(examples=["2020-01-31"])]
    """
    Absence start date. Format: yyyy-mm-dd
    """
    end_date: Annotated[Date, Field(examples=["2020-01-31"])]
    """
    Absence end date. Format: yyyy-mm-dd
    """
    half_day_start: Annotated[bool, Field(examples=[False])]
    """
    Whether the start date is a half-day off.
    """
    half_day_end: Annotated[bool, Field(examples=[False])]
    """
    Whether the end date is a half-day off.
    """
    comment: Annotated[str | None, Field(examples=["Some Comment"])] = None
    """
    Optional comment
    """
    skip_approval: Annotated[bool | None, Field(examples=[False])] = None
    """
    Optional, default value is true. If set to false, the approval status of the absence request will be "pending" if an approval rule is set for the absence type in Personio. The respective approval flow will be triggered.
    """


class CreateAbsencePeriodRequest(MyPersonnelBaseModel):
    employee_id: Annotated[int, Field(examples=[10735])]
    """
    Employee identifier
    """
    time_off_type_id: Annotated[int, Field(examples=[10735])]
    """
    Time-off type identifier
    """
    start_date: Annotated[Date, Field(examples=["2020-01-31"])]
    """
    Absence start date. Format: yyyy-mm-dd
    """
    end_date: Annotated[Date, Field(examples=["2020-01-31"])]
    """
    Absence end date. Format: yyyy-mm-dd
    """
    start_time: Annotated[Date | None, Field(examples=["03:00"])] = None
    """
    Absence start time. Format: HH:mm (hours and minutes) and only required if the start_date and end_date are the same (partial-day absence)
    """
    end_time: Annotated[Date | None, Field(examples=["15:00"])] = None
    """
    Absence end time. Format: HH:mm (hours and minutes) and only required if the start_date and end_date are the same (partial-day absence)
    """
    half_day_start: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the start date is a half-day off, only considered if the start_date and end_date are not the same (more than one day absence)
    """
    half_day_end: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the end date is a half-day off, only considered if the start_date and end_date are not the same (more than one day absence)
    """
    comment: Annotated[str | None, Field(examples=["Some Comment"])] = None
    """
    Optional comment
    """
    skip_approval: Annotated[bool | None, Field(examples=[False])] = None
    """
    Optional, default value is true. If set to false, the approval status of the absence request will be "pending" if an approval rule is set for the absence type in Personio. The respective approval flow will be triggered.
    """


class MeasurementUnit(str, Enum):
    MINUTES = "minutes"


class Certificate(MyPersonnelBaseModel):
    status: Annotated[str | None, Field(examples=["not-required"])] = None


class Origin(str, Enum):
    WEB = "web"
    API = "api"
    MOBILE = "mobile"
    SLACK = "slack"
    MSTEAMS = "msteams"


class Attributes13(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[1])] = None
    name: Annotated[str | None, Field(examples=["Vacation"])] = None
    category: Annotated[str | None, Field(examples=["offsite_work"])] = None


class TimeOffType(MyPersonnelBaseModel):
    type: Annotated[str | None, Field(examples=["TimeOffType"])] = None
    attributes: Attributes13 | None = None


class AbsenceType(MyPersonnelBaseModel):
    id: Annotated[UUID, Field(examples=["61fe126b-a7b3-449a-b5ee-3865a6fcc546"])]
    name: Annotated[str | None, Field(examples=["Absence Type Name"])] = None
    time_off_type_id: Annotated[int | None, Field(examples=[1])] = None


class AbsencePeriodBreakdown(MyPersonnelBaseModel):
    date: Date
    effective_duration: Annotated[int, Field(examples=[60])]
    """
    Number representing the value of duration in minutes.
    """


class TypeEnum(str, Enum):
    STANDARD = "standard"
    DATE = "date"
    INTEGER = "integer"
    DECIMAL = "decimal"
    LIST = "list"
    LINK = "link"
    TAGS = "tags"
    MULTILINE = "multiline"


class PublicReportMetaData(MyPersonnelBaseModel):
    total_elements: int | None = None
    current_page: int | None = None
    total_pages: int | None = None


class PublicColumnAttributes(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["first_name"])] = None
    human_readable: Annotated[str | None, Field(examples=["First Name"])] = None
    data_type: Annotated[str | None, Field(examples=["TEXT"])] = None


class Type2(str, Enum):
    POINT_IN_TIME = "point_in_time"
    HISTORICAL_DATA = "historical_data"
    TIMEFRAME = "timeframe"


class Status2(str, Enum):
    UP_TO_DATE = "up_to_date"
    UPDATING = "updating"
    UPDATE_FAILED = "update_failed"


class Filter(MyPersonnelBaseModel):
    column: Annotated[str | None, Field(examples=["office_id"])] = None
    comparison: Annotated[str | None, Field(examples=["eq"])] = None
    value: Annotated[str | None, Field(examples=[1])] = None


class PeriodType(str, Enum):
    FIXED = "fixed"
    TODAY = "today"
    LAST_DAY_OF_THIS_MONTH = "last_day_of_this_month"
    THIS_YEAR = "this_year"
    LAST_MONTH = "last_month"
    LAST_THIRTY_DAYS = "last_thirty_days"
    THIS_MONTH = "this_month"
    YEAR_TO_DATE = "year_to_date"


class PublicReportAttributes(MyPersonnelBaseModel):
    id: Annotated[
        str | None, Field(examples=["eb7482f3-2323-43e2-87ed-99d2399e8e22"])
    ] = None
    name: Annotated[str | None, Field(examples=["Employee vacations past month"])] = (
        None
    )
    description: Annotated[
        str | None,
        Field(examples=["Shows vacations of all employees that were taken past month"]),
    ] = None
    author_first_name: Annotated[str | None, Field(examples=["Robert"])] = None
    """
    Report author
    """
    author_last_name: Annotated[str | None, Field(examples=["Sirano"])] = None
    """
    Report author
    """
    type: Annotated[Type2 | None, Field(examples=["point_in_time"])] = None
    status: Annotated[Status2 | None, Field(examples=["up_to_date"])] = None
    start_date: Annotated[Date | None, Field(examples=["2022-09-01"])] = None
    end_date: Annotated[Date | None, Field(examples=["2022-09-30"])] = None
    created_at: Annotated[DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])] = (
        None
    )
    updated_at: Annotated[DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])] = (
        None
    )
    data_refreshed_at: Annotated[
        DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])
    ] = None
    columns: List[str] | None = None
    filters: List[Filter] | None = None
    period_type: Annotated[PeriodType | None, Field(examples=["fixed"])] = None


class Type3(str, Enum):
    POINT_IN_TIME = "point_in_time"


class PeriodType1(str, Enum):
    FIXED = "fixed"
    TODAY = "today"
    YESTERDAY = "yesterday"
    LAST_DAY_OF_THIS_WEEK = "last_day_of_this_week"
    LAST_DAY_OF_LAST_WEEK = "last_day_of_last_week"
    LAST_DAY_OF_THIS_MONTH = "last_day_of_this_month"
    LAST_DAY_OF_LAST_MONTH = "last_day_of_last_month"
    LAST_DAY_OF_THIS_QUARTER = "last_day_of_this_quarter"
    LAST_DAY_OF_LAST_QUARTER = "last_day_of_last_quarter"
    LAST_DAY_OF_THIS_YEAR = "last_day_of_this_year"
    LAST_DAY_OF_LAST_YEAR = "last_day_of_last_year"


class Type4(str, Enum):
    TIMEFRAME = "timeframe"


class PeriodType2(str, Enum):
    FIXED = "fixed"
    TODAY = "today"
    YESTERDAY = "yesterday"
    THIS_WEEK = "this_week"
    LAST_WEEK = "last_week"
    THIS_MONTH = "this_month"
    LAST_MONTH = "last_month"
    LAST_THIRTY_DAYS = "last_thirty_days"
    NEXT_MONTH = "next_month"
    THIS_QUARTER = "this_quarter"
    LAST_QUARTER = "last_quarter"
    THIS_YEAR = "this_year"
    YEAR_TO_DATE = "year_to_date"
    LAST_YEAR = "last_year"
    NEXT_YEAR = "next_year"


class Type5(str, Enum):
    HISTORICAL_DATA = "historical_data"


class DataType(str, Enum):
    TEXT = "TEXT"


class DefaultAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["first_name"])] = None
    data_type: DataType | None = None
    value: Annotated[str | None, Field(examples=["Robert"])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None


class DataType1(str, Enum):
    ENTITY = "ENTITY"


class EntityAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["department"])] = None
    entity_id: Annotated[str | None, Field(examples=[1])] = None
    data_type: DataType1 | None = None
    value: Annotated[str | None, Field(examples=["IT"])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None


class DataType2(str, Enum):
    COST_CENTER = "COST_CENTER"


class CostCenter(MyPersonnelBaseModel):
    cost_center_id: Annotated[str | None, Field(examples=[1])] = None
    value: Annotated[str | None, Field(examples=["Test Center"])] = None
    weight: Annotated[str | None, Field(examples=["100%"])] = None


class DataType3(str, Enum):
    ABSENCE_OVERVIEW = "ABSENCE_OVERVIEW"


class AbsenceOverviewAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["absence_123"])] = None
    data_type: DataType3 | None = None
    start_date: Annotated[Date | None, Field(examples=["2022-03-01"])] = None
    end_date: Annotated[Date | None, Field(examples=["2022-03-03"])] = None
    duration_days: Annotated[str | None, Field(examples=[2])] = None
    duration_hours: Annotated[str | None, Field(examples=[5])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None


class DataType4(str, Enum):
    ABSENCE_PERIOD = "ABSENCE_PERIOD"


class AbsencePeriodAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["absence_123:periods"])] = None
    data_type: DataType4 | None = None
    start_date: Annotated[Date | None, Field(examples=["2022-03-01"])] = None
    end_date: Annotated[Date | None, Field(examples=["2022-03-03"])] = None
    half_day_at_start: bool | None = None
    half_day_at_end: bool | None = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None


class DataType5(str, Enum):
    DURATION = "DURATION"


class DurationAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[
        str | None, Field(examples=["attendance_contractual_target_hours"])
    ] = None
    data_type: DataType5 | None = None
    duration: Annotated[int | None, Field(examples=[10])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None


class DataType6(str, Enum):
    PERFORMANCE_TARGET = "PERFORMANCE_TARGET"


class PerformanceTarget(MyPersonnelBaseModel):
    performance_target_id: Annotated[str | None, Field(examples=[1])] = None
    performance_target_value: Annotated[str | None, Field(examples=[20])] = None


class DataType7(str, Enum):
    PERFORMANCE_KPI = "PERFORMANCE_KPI"


class PerformanceKpiAttribute(MyPersonnelBaseModel):
    attribute_id: str | None = None
    data_type: DataType7 | None = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    performance_target_kpis: List[PerformanceTarget] | None = None


class PerformanceKpi(MyPersonnelBaseModel):
    performance_kpi_id: Annotated[str | None, Field(examples=["kpi_123"])] = None
    performance_kpi_value: Annotated[str | None, Field(examples=[14])] = None


class DataType8(str, Enum):
    SALARY = "SALARY"


class SalaryAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["salary_123"])] = None
    data_type: DataType8 | None = None
    amount: Annotated[str | None, Field(examples=[12.2])] = None
    currency_symbol: Annotated[str | None, Field(examples=["$"])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None


class DataType9(str, Enum):
    COMPENSATION = "COMPENSATION"


class CompensationAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["ABCXXX"])] = None
    data_type: DataType9 | None = None
    amount: Annotated[str | None, Field(examples=[12.2])] = None
    currency_code: Annotated[str | None, Field(examples=["USD"])] = None
    currency_symbol: Annotated[str | None, Field(examples=["$"])] = None
    overtime_hours: Annotated[str | None, Field(examples=[12])] = None
    bonus_type: Annotated[str | None, Field(examples=["MAX"])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None


class DataType10(str, Enum):
    TEXT = "TEXT"


class DefaultHistoricalAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["first_name"])] = None
    data_type: DataType10 | None = None
    value: Annotated[str | None, Field(examples=["Robert"])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    effective_date: Annotated[str | None, Field(examples=["2021-01-01"])] = None


class DataType11(str, Enum):
    DURATION = "DURATION"


class DurationHistoricalAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[
        str | None, Field(examples=["attendance_contractual_target_hours"])
    ] = None
    data_type: DataType11 | None = None
    duration: Annotated[int | None, Field(examples=[10])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    effective_date: Annotated[str | None, Field(examples=["2021-01-01"])] = None


class DataType12(str, Enum):
    ENTITY = "ENTITY"


class EntityHistoricalAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["department"])] = None
    entity_id: Annotated[str | None, Field(examples=[1])] = None
    data_type: DataType12 | None = None
    value: Annotated[str | None, Field(examples=["IT"])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    effective_date: Annotated[str | None, Field(examples=["2021-01-01"])] = None


class DataType13(str, Enum):
    COST_CENTER = "COST_CENTER"


class CostCenterHistoricalAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["cost_center"])] = None
    data_type: DataType13 | None = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    cost_centers: List[CostCenter] | None = None
    effective_date: Annotated[str | None, Field(examples=["2021-01-01"])] = None


class DataType14(str, Enum):
    SALARY = "SALARY"


class SalaryHistoricalAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["salary_123"])] = None
    data_type: DataType14 | None = None
    amount: Annotated[str | None, Field(examples=[12.2])] = None
    currency_symbol: Annotated[str | None, Field(examples=["$"])] = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    effective_date: Annotated[str | None, Field(examples=["2021-01-01"])] = None


class ErrorMeta(MyPersonnelBaseModel):
    field: Annotated[str | None, Field(examples=["ID"])] = None
    description: Annotated[str | None, Field(examples=["Report ID not found"])] = None


class Attributes(MyPersonnelBaseModel):
    title: Annotated[str | None, Field(examples=["Document Title"])] = None
    date: Annotated[str | None, Field(examples=["2022-01-01"])] = None
    comment: Annotated[str | None, Field(examples=["Optional Test Comment"])] = None
    employee: DocumentEmployeeResponseObject | None = None
    category_id: DocumentCategory | None = None


class Data(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[1])] = None
    type: Annotated[str | None, Field(examples=["Document"])] = None
    attributes: Attributes | None = None


class DocumentUploadSuccessResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[True])] = None
    data: Data | None = None


class DocumentCategoriesResponse(MyPersonnelBaseModel):
    success: Annotated[bool | None, Field(examples=[True])] = None
    data: List[DocumentCategory] | None = None


class Office(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Office"])] = None
    value: Value | None = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["office"])] = None


class Department(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Department"])] = None
    value: Value1 | None = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["department"])] = None


class CostCenters(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Cost center"])] = None
    value: List[ValueItem] | None = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["cost_center"])] = None


class HolidayCalendar(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Holiday Calendar"])] = None
    value: Value2 | None = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["holiday_calendar"])] = None


class WorkSchedule(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["WorkSchedule"])] = None
    value: Value3 | None = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["work_schedule"])] = None


class Team(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Team"])] = None
    value: Value4 | None = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["team"])] = None


class Id1(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["ID"])] = None
    value: Annotated[Any | None, Field(examples=[1])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["id"])] = None


class FirstName1(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["First name"])] = None
    value: Annotated[Any | None, Field(examples=["Michael"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["first_name"])] = None


class LastName1(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Last name"])] = None
    value: Annotated[Any | None, Field(examples=["Dou"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["last_name"])] = None


class PreferredName(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Name (preferred)"])] = None
    value: Annotated[Any | None, Field(examples=["Michael Dou"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["preferred_name"])] = None


class Email1(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Email"])] = None
    value: Annotated[Any | None, Field(examples=["michael.dou@personio.de"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["email"])] = None


class Gender(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Gender"])] = None
    value: Annotated[Any | None, Field(examples=["male"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["gender"])] = None


class Status(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Status"])] = None
    value: Annotated[Any | None, Field(examples=["active"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["status"])] = None


class Position(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Position"])] = None
    value: Annotated[Any | None, Field(examples=["Online Marketing Specialist"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["position"])] = None


class EmploymentType(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Employment type"])] = None
    value: Annotated[Any | None, Field(examples=["internal"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["employment_type"])] = None


class WeeklyWorkingHours(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Weekly hours"])] = None
    value: Annotated[Any | None, Field(examples=[40])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["weekly_working_hours"])] = None


class HireDate(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Hire date"])] = None
    value: Annotated[Any | None, Field(examples=["2012-02-01T00:00:00+0100"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["hire_date"])] = None


class ContractEndDate(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Contact end date"])] = None
    value: Annotated[Any | None, Field(examples=["2020-02-01T00:00:00+0100"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["contract_end_date"])] = None


class TerminationDate(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Termonation date"])] = None
    value: Annotated[Any | None, Field(examples=["2020-02-01T00:00:00+0100"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["termination_date"])] = None


class TerminationType(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Termonation type"])] = None
    value: Annotated[Any | None, Field(examples=[None])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["termination_type"])] = None


class TerminationReason(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Termonation reason"])] = None
    value: Annotated[Any | None, Field(examples=[None])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["termination_reason"])] = None


class ProbationPeriodEnd(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Probation period end"])] = None
    value: Annotated[Any | None, Field(examples=["2020-02-01T00:00:00+0100"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["probation_period_end"])] = None


class CreatedAt(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Created at"])] = None
    value: Annotated[Any | None, Field(examples=["2018-02-01T00:00:00+0100"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["created_at"])] = None


class LastModifiedAt(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Last modified"])] = None
    value: Annotated[Any | None, Field(examples=["2020-11-18T17:33:55+01:00"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["last_modified_at"])] = None


class FixSalary(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Fix salary"])] = None
    value: Annotated[Any | None, Field(examples=[4000])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["fix_salary"])] = None
    currency: Annotated[str | None, Field(examples=["EUR"])] = None


class FixSalaryInterval(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Salary interval"])] = None
    value: Annotated[Any | None, Field(examples=["monthly"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["fix_salary_interval"])] = None


class HourlySalary(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Hourly salary"])] = None
    value: Annotated[Any | None, Field(examples=[0])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["hourly_salary"])] = None
    currency: Annotated[str | None, Field(examples=["EUR"])] = None


class LastWorkingDay(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Last day of work"])] = None
    value: Annotated[Any | None, Field(examples=[None])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["last_working_day"])] = None


class ProfilePicture(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Profile Picture"])] = None
    value: Annotated[
        Any | None,
        Field(
            examples=[
                "http://api.dev.personio.de/v1/company/employees/1/profile-picture"
            ]
        ),
    ] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["profile_picture"])] = None


class Dynamic21827(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["IBAN"])] = None
    value: Annotated[Any | None, Field(examples=["DE98 8989 9898 0000 8989 00"])] = None
    type: TypeEnum | None = None
    """
    The type of the field.
    """
    universal_id: Annotated[Any | None, Field(examples=["iban"])] = None


class Id2(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=[1])] = None
    value: Annotated[Any | None, Field(examples=["id"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["id"])] = None


class FirstName2(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["First Name"])] = None
    value: Annotated[Any | None, Field(examples=["Michael"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["first_name"])] = None


class LastName2(MyPersonnelBaseModel):
    label: Annotated[Any | None, Field(examples=["Last Name"])] = None
    value: Annotated[Any | None, Field(examples=["Dou"])] = None
    type: TypeEnum | None = None
    universal_id: Annotated[Any | None, Field(examples=["last_name"])] = None


class Attributes14(MyPersonnelBaseModel):
    id: Id2 | None = None
    first_name: FirstName2 | None = None
    last_name: LastName2 | None = None
    email: Email1 | None = None


class ShortEmployee(MyPersonnelBaseModel):
    type: Annotated[str | None, Field(examples=["Employee"])] = None
    attributes: Attributes14 | None = None


class PublicReportData(MyPersonnelBaseModel):
    type: Annotated[str | None, Field(examples=["Report"])] = None
    attributes: PublicReportAttributes | None = None


class PublicColumnData(MyPersonnelBaseModel):
    type: Annotated[str | None, Field(examples=["Column"])] = None
    attributes: List[PublicColumnAttributes] | None = None


class Item2(MyPersonnelBaseModel):
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    historical_attributes: (
        List[
            DefaultHistoricalAttribute
            | EntityHistoricalAttribute
            | DurationHistoricalAttribute
            | CostCenterHistoricalAttribute
            | SalaryHistoricalAttribute
        ]
        | None
    ) = None


class PublicHistoricalReportItemsAttributes(MyPersonnelBaseModel):
    id: Annotated[
        str | None, Field(examples=["eb7482f3-2323-43e2-87ed-99d2399e8e22"])
    ] = None
    name: Annotated[
        str | None, Field(examples=["Department changes in the past year"])
    ] = None
    description: Annotated[
        str | None,
        Field(
            examples=["Shows department changes of all employees over the past year"]
        ),
    ] = None
    author_first_name: Annotated[str | None, Field(examples=["Robert"])] = None
    """
    Report author
    """
    author_last_name: Annotated[str | None, Field(examples=["Sirano"])] = None
    """
    Report author
    """
    type: Annotated[Type5 | None, Field(examples=["historical_data"])] = None
    status: Annotated[Status2 | None, Field(examples=["created"])] = None
    start_date: Annotated[DateTime | None, Field(examples=["2022-01-01"])] = None
    end_date: Annotated[DateTime | None, Field(examples=["2022-09-30"])] = None
    created_at: Annotated[DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])] = (
        None
    )
    updated_at: Annotated[DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])] = (
        None
    )
    data_refreshed_at: Annotated[
        DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])
    ] = None
    columns: List[str] | None = None
    filters: List[Filter] | None = None
    period_type: Annotated[PeriodType2 | None, Field(examples=["fixed"])] = None
    items: List[Item2] | None = None


class CostCenterAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["cost_center"])] = None
    data_type: DataType2 | None = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    cost_centers: List[CostCenter] | None = None


class PerformanceTargetAttribute(MyPersonnelBaseModel):
    attribute_id: Annotated[str | None, Field(examples=["performance_target_name"])] = (
        None
    )
    data_type: DataType6 | None = None
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    performance_targets: List[PerformanceTarget] | None = None


class PerformanceTargetKpi(MyPersonnelBaseModel):
    performance_target_id: Annotated[str | None, Field(examples=["id_123"])] = None
    performance_kpis: List[PerformanceKpi] | None = None


class ErrorDetails(MyPersonnelBaseModel):
    title: Annotated[str | None, Field(examples=["Not Found"])] = None
    details: Annotated[str | None, Field(examples=["Report not found"])] = None
    type: Annotated[str | None, Field(examples=["search"])] = None
    field_meta: Annotated[List[ErrorMeta] | None, Field(alias="_meta")] = None


class Supervisor(MyPersonnelBaseModel):
    label: Annotated[str | None, Field(examples=["Supervisor"])] = None
    value: ShortEmployee | None = None


class Employee(MyPersonnelBaseModel):
    id: Id1 | None = None
    first_name: FirstName1 | None = None
    last_name: LastName1 | None = None
    preferred_name: PreferredName | None = None
    email: Email1 | None = None
    gender: Gender | None = None
    status: Status | None = None
    position: Position | None = None
    supervisor: Supervisor | None = None
    employment_type: EmploymentType | None = None
    weekly_working_hours: WeeklyWorkingHours | None = None
    hire_date: HireDate | None = None
    contract_end_date: ContractEndDate | None = None
    termination_date: TerminationDate | None = None
    termination_type: TerminationType | None = None
    termination_reason: TerminationReason | None = None
    probation_period_end: ProbationPeriodEnd | None = None
    created_at: CreatedAt | None = None
    last_modified_at: LastModifiedAt | None = None
    subcompany: Office | None = None
    office: Office | None = None
    department: Department | None = None
    cost_centers: CostCenters | None = None
    holiday_calendar: HolidayCalendar | None = None
    work_schedule: WorkSchedule | None = None
    absence_entitlement: AbsenceEntitlement | None = None
    team: Team | None = None
    fix_salary: FixSalary | None = None
    fix_salary_interval: FixSalaryInterval | None = None
    hourly_salary: HourlySalary | None = None
    last_working_day: LastWorkingDay | None = None
    profile_picture: ProfilePicture | None = None
    dynamic_21827: Dynamic21827 | None = None


class Datum(MyPersonnelBaseModel):
    type: Annotated[Any | None, Field(examples=["Employee"])] = None
    attributes: Employee | None = None


class EmployeesResponse(Response):
    metadata: Metadata | None = None
    offset: int | None = None
    limit: int | None = None
    data: List[Datum] | None = None


class Data6(MyPersonnelBaseModel):
    type: Annotated[Any | None, Field(examples=["Employee"])] = None
    attributes: Employee | None = None


class EmployeeResponse(Response):
    data: Data6 | None = None


class HourlyAbsencePeriodResponseAttributes(MyPersonnelBaseModel):
    id: Annotated[str, Field(examples=["9bba303f-0fbc-4514-9958-0befa21923fb"])]
    measurement_unit: Annotated[MeasurementUnit | None, Field(examples=["minutes"])] = (
        None
    )
    effective_duration: Annotated[int, Field(examples=[60])]
    """
    Period effective duration in minutes
    """
    employee: ShortEmployee
    absence_type_id: AbsenceType
    certificate: Certificate
    start: DateTime
    end: DateTime | None = None
    half_day_start: bool
    half_day_end: bool
    comment: str | None = None
    origin: Annotated[Origin, Field(examples=["web"])]
    status: Annotated[str, Field(examples=["approved"])]
    created_by: Annotated[int, Field(examples=[1])]
    """
    ID of the employee who created the absence period.
    """
    created_at: DateTime
    updated_at: DateTime
    approved_at: DateTime | None = None
    breakdowns: List[AbsencePeriodBreakdown]
    """
    Breakdowns of effective duration by day of absence.
    """


class Absence(MyPersonnelBaseModel):
    id: Annotated[int | None, Field(examples=[1])] = None
    status: Annotated[str | None, Field(examples=["approved"])] = None
    start_date: Annotated[str | None, Field(examples=["2017-12-27T00:00:00+0100"])] = (
        None
    )
    end_date: Annotated[str | None, Field(examples=["2017-12-79T00:00:00+0100"])] = None
    days_count: Annotated[float | None, Field(examples=[3])] = None
    half_day_start: Annotated[bool | None, Field(examples=[False])] = None
    half_day_end: Annotated[bool | None, Field(examples=[False])] = None
    time_off_type: TimeOffType | None = None
    employee: ShortEmployee | None = None
    certificate: Certificate | None = None
    created_at: Annotated[str | None, Field(examples=["2017-01-17T10:32:18+0100"])] = (
        None
    )
    created_by: Annotated[str | None, Field(examples=["API"])] = None
    """
    API if the origin is api, otherwise returns an admin employee's name who's account is used to create the absence
    """
    updated_at: Annotated[str | None, Field(examples=["2017-01-17T10:32:18+0100"])] = (
        None
    )


class HourlyAbsence(MyPersonnelBaseModel):
    id: Annotated[
        UUID | None, Field(examples=["61fe126b-a7b3-449a-b5ee-3865a6fcc546"])
    ] = None
    measurement_unit: Annotated[str | None, Field(examples=["hours"])] = None
    effective_duration: Annotated[int | None, Field(examples=[16])] = None
    """
    Period effective duration in minutes
    """
    employee: ShortEmployee | None = None
    absence_type: AbsenceType | None = None
    certificate: Certificate | None = None
    start: DateTime | None = None
    end: DateTime | None = None
    half_day_start: bool | None = None
    half_day_end: bool | None = None
    comment: str | None = None
    origin: Annotated[str | None, Field(examples=["web"])] = None
    status: Annotated[str | None, Field(examples=["approved"])] = None
    timezone: Annotated[str | None, Field(examples=["Europe/Berlin"])] = None
    created_by: Annotated[int | None, Field(examples=[1])] = None
    """
    ID of the employee who created the absence period.
    """
    created_at: Annotated[str | None, Field(examples=["2017-01-17T10:32:18+0100"])] = (
        None
    )
    updated_at: Annotated[str | None, Field(examples=["2017-01-17T10:32:18+0100"])] = (
        None
    )
    approved_at: DateTime | None = None
    breakdowns: List[AbsencePeriodBreakdown] | None = None
    """
    Breakdowns of effective duration by day of absence.
    """


class PublicListReportsResponse(MyPersonnelBaseModel):
    success: bool | None = None
    metadata: PublicReportMetaData | None = None
    offset: int | None = None
    limit: int | None = None
    data: List[PublicReportData] | None = None


class PublicListColumnsResponse(MyPersonnelBaseModel):
    success: bool | None = None
    metadata: PublicReportMetaData | None = None
    offset: int | None = None
    limit: int | None = None
    data: PublicColumnData | None = None


class Item(MyPersonnelBaseModel):
    employee_id: Annotated[int | None, Field(examples=[17])] = None
    attributes: (
        List[
            DefaultAttribute
            | EntityAttribute
            | DurationAttribute
            | CostCenterAttribute
            | AbsenceOverviewAttribute
            | AbsencePeriodAttribute
            | PerformanceTargetAttribute
            | PerformanceKpiAttribute
            | SalaryAttribute
            | CompensationAttribute
        ]
        | None
    ) = None


class PublicReportItemsAttributes(MyPersonnelBaseModel):
    id: Annotated[
        str | None, Field(examples=["eb7482f3-2323-43e2-87ed-99d2399e8e22"])
    ] = None
    name: Annotated[
        str | None, Field(examples=["Employee vacations at a specific point in time"])
    ] = None
    description: Annotated[
        str | None,
        Field(examples=["Shows vacations of all employees on a specific date"]),
    ] = None
    author_first_name: Annotated[str | None, Field(examples=["Robert"])] = None
    """
    Report author
    """
    author_last_name: Annotated[str | None, Field(examples=["Sirano"])] = None
    """
    Report author
    """
    type: Annotated[Type3 | None, Field(examples=["point_in_time"])] = None
    status: Annotated[Status2 | None, Field(examples=["created"])] = None
    start_date: Annotated[DateTime | None, Field(examples=["2022-04-10"])] = None
    end_date: Annotated[DateTime | None, Field(examples=["2022-04-10"])] = None
    created_at: Annotated[DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])] = (
        None
    )
    updated_at: Annotated[DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])] = (
        None
    )
    data_refreshed_at: Annotated[
        DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])
    ] = None
    columns: List[str] | None = None
    filters: List[Filter] | None = None
    period_type: Annotated[PeriodType1 | None, Field(examples=["fixed"])] = None
    items: List[Item] | None = None


class PublicTimeframeReportItemsAttributes(MyPersonnelBaseModel):
    id: Annotated[
        str | None, Field(examples=["eb7482f3-2323-43e2-87ed-99d2399e8e22"])
    ] = None
    name: Annotated[str | None, Field(examples=["Employee vacations past month"])] = (
        None
    )
    description: Annotated[
        str | None,
        Field(examples=["Shows vacations of all employees that were taken past month"]),
    ] = None
    author_first_name: Annotated[str | None, Field(examples=["Robert"])] = None
    """
    Report author
    """
    author_last_name: Annotated[str | None, Field(examples=["Sirano"])] = None
    """
    Report author
    """
    type: Annotated[Type4 | None, Field(examples=["timeframe"])] = None
    status: Annotated[Status2 | None, Field(examples=["created"])] = None
    start_date: Annotated[DateTime | None, Field(examples=["2022-04-01"])] = None
    end_date: Annotated[DateTime | None, Field(examples=["2022-04-10"])] = None
    created_at: Annotated[DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])] = (
        None
    )
    updated_at: Annotated[DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])] = (
        None
    )
    data_refreshed_at: Annotated[
        DateTime | None, Field(examples=["2022-04-10T17:32:28Z"])
    ] = None
    columns: List[str] | None = None
    filters: List[Filter] | None = None
    period_type: Annotated[PeriodType2 | None, Field(examples=["fixed"])] = None
    items: List[Item] | None = None


class CustomReportsErrorResponse(MyPersonnelBaseModel):
    status: Annotated[int | None, Field(examples=[500])] = None
    trace_id: Annotated[str | None, Field(examples=["ABCXXX"])] = None
    timestamp: Annotated[DateTime | None, Field(examples=["2020-01-01T00:00:00Z"])] = (
        None
    )
    errors: List[ErrorDetails] | None = None


class Datum3(MyPersonnelBaseModel):
    type: Annotated[Any, Field(examples=["TimeOffPeriod"])]
    attributes: Absence


class AbsencePeriodsResponse(Response):
    metadata: Metadata | None = None
    offset: int | None = None
    limit: int | None = None
    data: List[Datum3] | None = None


class Datum4(MyPersonnelBaseModel):
    type: Annotated[Any, Field(examples=["AbsencePeriod"])]
    attributes: HourlyAbsence


class HourlyAbsencePeriodsResponse(Response):
    metadata: Metadata | None = None
    offset: int | None = None
    limit: int | None = None
    data: List[Datum4] | None = None


class Data8(MyPersonnelBaseModel):
    type: Annotated[Any, Field(examples=["TimeOffPeriod"])]
    attributes: Absence


class AbsencePeriodResponse(Response):
    data: Data8 | None = None


class Data9(MyPersonnelBaseModel):
    type: Annotated[Any, Field(examples=["AbsencePeriod"])]
    attributes: HourlyAbsence


class HourlyAbsencePeriodResponse(Response):
    data: Data9 | None = None


class PublicReportItemsData(MyPersonnelBaseModel):
    type: Annotated[str | None, Field(examples=["Report"])] = None
    attributes: (
        PublicReportItemsAttributes
        | PublicTimeframeReportItemsAttributes
        | PublicHistoricalReportItemsAttributes
        | None
    ) = None


class PublicAPIException(RootModel[List[CustomReportsErrorResponse]]):
    root: List[CustomReportsErrorResponse]


class PublicReportResponse(MyPersonnelBaseModel):
    success: bool | None = None
    metadata: PublicReportMetaData | None = None
    offset: int | None = None
    limit: int | None = None
    data: List[PublicReportItemsData] | None = None
