# This file was auto-generated by Fern from our API Definition.

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Job(UncheckedBaseModel):
    """
    Represents a job that can be assigned to [team members](entity:TeamMember). This object defines the
    job's title and tip eligibility. Compensation is defined in a [job assignment](entity:JobAssignment)
    in a team member's wage setting.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    **Read only** The unique Square-assigned ID of the job. If you need a job ID for an API request,
    call [ListJobs](api-endpoint:Team-ListJobs) or use the ID returned when you created the job.
    You can also get job IDs from a team member's wage setting.
    """

    title: typing.Optional[str] = pydantic.Field(default=None)
    """
    The title of the job.
    """

    is_tip_eligible: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether team members can earn tips for the job.
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp when the job was created, in RFC 3339 format.
    """

    updated_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp when the job was last updated, in RFC 3339 format.
    """

    version: typing.Optional[int] = pydantic.Field(default=None)
    """
    **Read only** The current version of the job. Include this field in `UpdateJob` requests to enable
    [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency)
    control and avoid overwrites from concurrent requests. Requests fail if the provided version doesn't
    match the server version at the time of the request.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
