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


class OpenAIFile(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, bytes=None, created_at=None, filename=None, object=None, purpose=None, status=None, status_details=None):  # noqa: E501
        """OpenAIFile - a model defined in OpenAPI

        :param id: The id of this OpenAIFile.  # noqa: E501
        :type id: str
        :param bytes: The bytes of this OpenAIFile.  # noqa: E501
        :type bytes: int
        :param created_at: The created_at of this OpenAIFile.  # noqa: E501
        :type created_at: int
        :param filename: The filename of this OpenAIFile.  # noqa: E501
        :type filename: str
        :param object: The object of this OpenAIFile.  # noqa: E501
        :type object: str
        :param purpose: The purpose of this OpenAIFile.  # noqa: E501
        :type purpose: str
        :param status: The status of this OpenAIFile.  # noqa: E501
        :type status: str
        :param status_details: The status_details of this OpenAIFile.  # noqa: E501
        :type status_details: str
        """
        self.openapi_types = {
            'id': str,
            'bytes': int,
            'created_at': int,
            'filename': str,
            'object': str,
            'purpose': str,
            'status': str,
            'status_details': str
        }

        self.attribute_map = {
            'id': 'id',
            'bytes': 'bytes',
            'created_at': 'created_at',
            'filename': 'filename',
            'object': 'object',
            'purpose': 'purpose',
            'status': 'status',
            'status_details': 'status_details'
        }

        self._id = id
        self._bytes = bytes
        self._created_at = created_at
        self._filename = filename
        self._object = object
        self._purpose = purpose
        self._status = status
        self._status_details = status_details

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

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

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

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

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

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

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

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

        self._id = id

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

        The size of the file, in bytes.  # noqa: E501

        :return: The bytes of this OpenAIFile.
        :rtype: int
        """
        return self._bytes

    @bytes.setter
    def bytes(self, bytes: int):
        """Sets the bytes of this OpenAIFile.

        The size of the file, in bytes.  # noqa: E501

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

        self._bytes = bytes

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

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

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

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

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

        :param created_at: The created_at of this OpenAIFile.
        :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 filename(self) -> str:
        """Gets the filename of this OpenAIFile.

        The name of the file.  # noqa: E501

        :return: The filename of this OpenAIFile.
        :rtype: str
        """
        return self._filename

    @filename.setter
    def filename(self, filename: str):
        """Sets the filename of this OpenAIFile.

        The name of the file.  # noqa: E501

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

        self._filename = filename

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

        The object type, which is always `file`.  # noqa: E501

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

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

        The object type, which is always `file`.  # noqa: E501

        :param object: The object of this OpenAIFile.
        :type object: str
        """
        allowed_values = ["file"]  # 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

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

        The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`.  # noqa: E501

        :return: The purpose of this OpenAIFile.
        :rtype: str
        """
        return self._purpose

    @purpose.setter
    def purpose(self, purpose: str):
        """Sets the purpose of this OpenAIFile.

        The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`.  # noqa: E501

        :param purpose: The purpose of this OpenAIFile.
        :type purpose: str
        """
        allowed_values = ["assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision"]  # noqa: E501
        if purpose not in allowed_values:
            raise ValueError(
                "Invalid value for `purpose` ({0}), must be one of {1}"
                .format(purpose, allowed_values)
            )

        self._purpose = purpose

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

        Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.  # noqa: E501

        :return: The status of this OpenAIFile.
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status: str):
        """Sets the status of this OpenAIFile.

        Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.  # noqa: E501

        :param status: The status of this OpenAIFile.
        :type status: str
        """
        allowed_values = ["uploaded", "processed", "error"]  # noqa: E501
        if status not in allowed_values:
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"
                .format(status, allowed_values)
            )

        self._status = status

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

        Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.  # noqa: E501

        :return: The status_details of this OpenAIFile.
        :rtype: str
        """
        return self._status_details

    @status_details.setter
    def status_details(self, status_details: str):
        """Sets the status_details of this OpenAIFile.

        Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.  # noqa: E501

        :param status_details: The status_details of this OpenAIFile.
        :type status_details: str
        """

        self._status_details = status_details
