from datetime import date, datetime  # noqa: F401
from typing import Dict, List  # noqa: F401

from timestep.api.openai.v1 import util
from timestep.api.openai.v1.models.base_model import Model
from timestep.api.openai.v1.models.fine_tuning_job_checkpoint_metrics import \
    FineTuningJobCheckpointMetrics  # noqa: E501


class FineTuningJobCheckpoint(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, id=None, created_at=None, fine_tuned_model_checkpoint=None, step_number=None, metrics=None, fine_tuning_job_id=None, object=None):  # noqa: E501
        """FineTuningJobCheckpoint - a model defined in OpenAPI

        :param id: The id of this FineTuningJobCheckpoint.  # noqa: E501
        :type id: str
        :param created_at: The created_at of this FineTuningJobCheckpoint.  # noqa: E501
        :type created_at: int
        :param fine_tuned_model_checkpoint: The fine_tuned_model_checkpoint of this FineTuningJobCheckpoint.  # noqa: E501
        :type fine_tuned_model_checkpoint: str
        :param step_number: The step_number of this FineTuningJobCheckpoint.  # noqa: E501
        :type step_number: int
        :param metrics: The metrics of this FineTuningJobCheckpoint.  # noqa: E501
        :type metrics: FineTuningJobCheckpointMetrics
        :param fine_tuning_job_id: The fine_tuning_job_id of this FineTuningJobCheckpoint.  # noqa: E501
        :type fine_tuning_job_id: str
        :param object: The object of this FineTuningJobCheckpoint.  # noqa: E501
        :type object: str
        """
        self.openapi_types = {
            'id': str,
            'created_at': int,
            'fine_tuned_model_checkpoint': str,
            'step_number': int,
            'metrics': FineTuningJobCheckpointMetrics,
            'fine_tuning_job_id': str,
            'object': str
        }

        self.attribute_map = {
            'id': 'id',
            'created_at': 'created_at',
            'fine_tuned_model_checkpoint': 'fine_tuned_model_checkpoint',
            'step_number': 'step_number',
            'metrics': 'metrics',
            'fine_tuning_job_id': 'fine_tuning_job_id',
            'object': 'object'
        }

        self._id = id
        self._created_at = created_at
        self._fine_tuned_model_checkpoint = fine_tuned_model_checkpoint
        self._step_number = step_number
        self._metrics = metrics
        self._fine_tuning_job_id = fine_tuning_job_id
        self._object = object

    @classmethod
    def from_dict(cls, dikt) -> 'FineTuningJobCheckpoint':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The FineTuningJobCheckpoint of this FineTuningJobCheckpoint.  # noqa: E501
        :rtype: FineTuningJobCheckpoint
        """
        return util.deserialize_model(dikt, cls)

    @property
    def id(self) -> str:
        """Gets the id of this FineTuningJobCheckpoint.

        The checkpoint identifier, which can be referenced in the API endpoints.  # noqa: E501

        :return: The id of this FineTuningJobCheckpoint.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id: str):
        """Sets the id of this FineTuningJobCheckpoint.

        The checkpoint identifier, which can be referenced in the API endpoints.  # noqa: E501

        :param id: The id of this FineTuningJobCheckpoint.
        :type id: str
        """
        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

    @property
    def created_at(self) -> int:
        """Gets the created_at of this FineTuningJobCheckpoint.

        The Unix timestamp (in seconds) for when the checkpoint was created.  # noqa: E501

        :return: The created_at of this FineTuningJobCheckpoint.
        :rtype: int
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at: int):
        """Sets the created_at of this FineTuningJobCheckpoint.

        The Unix timestamp (in seconds) for when the checkpoint was created.  # noqa: E501

        :param created_at: The created_at of this FineTuningJobCheckpoint.
        :type created_at: int
        """
        if created_at is None:
            raise ValueError("Invalid value for `created_at`, must not be `None`")  # noqa: E501

        self._created_at = created_at

    @property
    def fine_tuned_model_checkpoint(self) -> str:
        """Gets the fine_tuned_model_checkpoint of this FineTuningJobCheckpoint.

        The name of the fine-tuned checkpoint model that is created.  # noqa: E501

        :return: The fine_tuned_model_checkpoint of this FineTuningJobCheckpoint.
        :rtype: str
        """
        return self._fine_tuned_model_checkpoint

    @fine_tuned_model_checkpoint.setter
    def fine_tuned_model_checkpoint(self, fine_tuned_model_checkpoint: str):
        """Sets the fine_tuned_model_checkpoint of this FineTuningJobCheckpoint.

        The name of the fine-tuned checkpoint model that is created.  # noqa: E501

        :param fine_tuned_model_checkpoint: The fine_tuned_model_checkpoint of this FineTuningJobCheckpoint.
        :type fine_tuned_model_checkpoint: str
        """
        if fine_tuned_model_checkpoint is None:
            raise ValueError("Invalid value for `fine_tuned_model_checkpoint`, must not be `None`")  # noqa: E501

        self._fine_tuned_model_checkpoint = fine_tuned_model_checkpoint

    @property
    def step_number(self) -> int:
        """Gets the step_number of this FineTuningJobCheckpoint.

        The step number that the checkpoint was created at.  # noqa: E501

        :return: The step_number of this FineTuningJobCheckpoint.
        :rtype: int
        """
        return self._step_number

    @step_number.setter
    def step_number(self, step_number: int):
        """Sets the step_number of this FineTuningJobCheckpoint.

        The step number that the checkpoint was created at.  # noqa: E501

        :param step_number: The step_number of this FineTuningJobCheckpoint.
        :type step_number: int
        """
        if step_number is None:
            raise ValueError("Invalid value for `step_number`, must not be `None`")  # noqa: E501

        self._step_number = step_number

    @property
    def metrics(self) -> FineTuningJobCheckpointMetrics:
        """Gets the metrics of this FineTuningJobCheckpoint.


        :return: The metrics of this FineTuningJobCheckpoint.
        :rtype: FineTuningJobCheckpointMetrics
        """
        return self._metrics

    @metrics.setter
    def metrics(self, metrics: FineTuningJobCheckpointMetrics):
        """Sets the metrics of this FineTuningJobCheckpoint.


        :param metrics: The metrics of this FineTuningJobCheckpoint.
        :type metrics: FineTuningJobCheckpointMetrics
        """
        if metrics is None:
            raise ValueError("Invalid value for `metrics`, must not be `None`")  # noqa: E501

        self._metrics = metrics

    @property
    def fine_tuning_job_id(self) -> str:
        """Gets the fine_tuning_job_id of this FineTuningJobCheckpoint.

        The name of the fine-tuning job that this checkpoint was created from.  # noqa: E501

        :return: The fine_tuning_job_id of this FineTuningJobCheckpoint.
        :rtype: str
        """
        return self._fine_tuning_job_id

    @fine_tuning_job_id.setter
    def fine_tuning_job_id(self, fine_tuning_job_id: str):
        """Sets the fine_tuning_job_id of this FineTuningJobCheckpoint.

        The name of the fine-tuning job that this checkpoint was created from.  # noqa: E501

        :param fine_tuning_job_id: The fine_tuning_job_id of this FineTuningJobCheckpoint.
        :type fine_tuning_job_id: str
        """
        if fine_tuning_job_id is None:
            raise ValueError("Invalid value for `fine_tuning_job_id`, must not be `None`")  # noqa: E501

        self._fine_tuning_job_id = fine_tuning_job_id

    @property
    def object(self) -> str:
        """Gets the object of this FineTuningJobCheckpoint.

        The object type, which is always \"fine_tuning.job.checkpoint\".  # noqa: E501

        :return: The object of this FineTuningJobCheckpoint.
        :rtype: str
        """
        return self._object

    @object.setter
    def object(self, object: str):
        """Sets the object of this FineTuningJobCheckpoint.

        The object type, which is always \"fine_tuning.job.checkpoint\".  # noqa: E501

        :param object: The object of this FineTuningJobCheckpoint.
        :type object: str
        """
        allowed_values = ["fine_tuning.job.checkpoint"]  # noqa: E501
        if object not in allowed_values:
            raise ValueError(
                "Invalid value for `object` ({0}), must be one of {1}"
                .format(object, allowed_values)
            )

        self._object = object
