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.batch_errors import \
    BatchErrors  # noqa: E501
from timestep.api.openai.v1.models.batch_request_counts import \
    BatchRequestCounts  # noqa: E501


class Batch(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, object=None, endpoint=None, errors=None, input_file_id=None, completion_window=None, status=None, output_file_id=None, error_file_id=None, created_at=None, in_progress_at=None, expires_at=None, finalizing_at=None, completed_at=None, failed_at=None, expired_at=None, cancelling_at=None, cancelled_at=None, request_counts=None, metadata=None):  # noqa: E501
        """Batch - a model defined in OpenAPI

        :param id: The id of this Batch.  # noqa: E501
        :type id: str
        :param object: The object of this Batch.  # noqa: E501
        :type object: str
        :param endpoint: The endpoint of this Batch.  # noqa: E501
        :type endpoint: str
        :param errors: The errors of this Batch.  # noqa: E501
        :type errors: BatchErrors
        :param input_file_id: The input_file_id of this Batch.  # noqa: E501
        :type input_file_id: str
        :param completion_window: The completion_window of this Batch.  # noqa: E501
        :type completion_window: str
        :param status: The status of this Batch.  # noqa: E501
        :type status: str
        :param output_file_id: The output_file_id of this Batch.  # noqa: E501
        :type output_file_id: str
        :param error_file_id: The error_file_id of this Batch.  # noqa: E501
        :type error_file_id: str
        :param created_at: The created_at of this Batch.  # noqa: E501
        :type created_at: int
        :param in_progress_at: The in_progress_at of this Batch.  # noqa: E501
        :type in_progress_at: int
        :param expires_at: The expires_at of this Batch.  # noqa: E501
        :type expires_at: int
        :param finalizing_at: The finalizing_at of this Batch.  # noqa: E501
        :type finalizing_at: int
        :param completed_at: The completed_at of this Batch.  # noqa: E501
        :type completed_at: int
        :param failed_at: The failed_at of this Batch.  # noqa: E501
        :type failed_at: int
        :param expired_at: The expired_at of this Batch.  # noqa: E501
        :type expired_at: int
        :param cancelling_at: The cancelling_at of this Batch.  # noqa: E501
        :type cancelling_at: int
        :param cancelled_at: The cancelled_at of this Batch.  # noqa: E501
        :type cancelled_at: int
        :param request_counts: The request_counts of this Batch.  # noqa: E501
        :type request_counts: BatchRequestCounts
        :param metadata: The metadata of this Batch.  # noqa: E501
        :type metadata: object
        """
        self.openapi_types = {
            'id': str,
            'object': str,
            'endpoint': str,
            'errors': BatchErrors,
            'input_file_id': str,
            'completion_window': str,
            'status': str,
            'output_file_id': str,
            'error_file_id': str,
            'created_at': int,
            'in_progress_at': int,
            'expires_at': int,
            'finalizing_at': int,
            'completed_at': int,
            'failed_at': int,
            'expired_at': int,
            'cancelling_at': int,
            'cancelled_at': int,
            'request_counts': BatchRequestCounts,
            'metadata': object
        }

        self.attribute_map = {
            'id': 'id',
            'object': 'object',
            'endpoint': 'endpoint',
            'errors': 'errors',
            'input_file_id': 'input_file_id',
            'completion_window': 'completion_window',
            'status': 'status',
            'output_file_id': 'output_file_id',
            'error_file_id': 'error_file_id',
            'created_at': 'created_at',
            'in_progress_at': 'in_progress_at',
            'expires_at': 'expires_at',
            'finalizing_at': 'finalizing_at',
            'completed_at': 'completed_at',
            'failed_at': 'failed_at',
            'expired_at': 'expired_at',
            'cancelling_at': 'cancelling_at',
            'cancelled_at': 'cancelled_at',
            'request_counts': 'request_counts',
            'metadata': 'metadata'
        }

        self._id = id
        self._object = object
        self._endpoint = endpoint
        self._errors = errors
        self._input_file_id = input_file_id
        self._completion_window = completion_window
        self._status = status
        self._output_file_id = output_file_id
        self._error_file_id = error_file_id
        self._created_at = created_at
        self._in_progress_at = in_progress_at
        self._expires_at = expires_at
        self._finalizing_at = finalizing_at
        self._completed_at = completed_at
        self._failed_at = failed_at
        self._expired_at = expired_at
        self._cancelling_at = cancelling_at
        self._cancelled_at = cancelled_at
        self._request_counts = request_counts
        self._metadata = metadata

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

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

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


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

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


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

        self._id = id

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

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

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

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

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

        :param object: The object of this Batch.
        :type object: str
        """
        allowed_values = ["batch"]  # 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 endpoint(self) -> str:
        """Gets the endpoint of this Batch.

        The OpenAI API endpoint used by the batch.  # noqa: E501

        :return: The endpoint of this Batch.
        :rtype: str
        """
        return self._endpoint

    @endpoint.setter
    def endpoint(self, endpoint: str):
        """Sets the endpoint of this Batch.

        The OpenAI API endpoint used by the batch.  # noqa: E501

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

        self._endpoint = endpoint

    @property
    def errors(self) -> BatchErrors:
        """Gets the errors of this Batch.


        :return: The errors of this Batch.
        :rtype: BatchErrors
        """
        return self._errors

    @errors.setter
    def errors(self, errors: BatchErrors):
        """Sets the errors of this Batch.


        :param errors: The errors of this Batch.
        :type errors: BatchErrors
        """

        self._errors = errors

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

        The ID of the input file for the batch.  # noqa: E501

        :return: The input_file_id of this Batch.
        :rtype: str
        """
        return self._input_file_id

    @input_file_id.setter
    def input_file_id(self, input_file_id: str):
        """Sets the input_file_id of this Batch.

        The ID of the input file for the batch.  # noqa: E501

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

        self._input_file_id = input_file_id

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

        The time frame within which the batch should be processed.  # noqa: E501

        :return: The completion_window of this Batch.
        :rtype: str
        """
        return self._completion_window

    @completion_window.setter
    def completion_window(self, completion_window: str):
        """Sets the completion_window of this Batch.

        The time frame within which the batch should be processed.  # noqa: E501

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

        self._completion_window = completion_window

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

        The current status of the batch.  # noqa: E501

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

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

        The current status of the batch.  # noqa: E501

        :param status: The status of this Batch.
        :type status: str
        """
        allowed_values = ["validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled"]  # 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 output_file_id(self) -> str:
        """Gets the output_file_id of this Batch.

        The ID of the file containing the outputs of successfully executed requests.  # noqa: E501

        :return: The output_file_id of this Batch.
        :rtype: str
        """
        return self._output_file_id

    @output_file_id.setter
    def output_file_id(self, output_file_id: str):
        """Sets the output_file_id of this Batch.

        The ID of the file containing the outputs of successfully executed requests.  # noqa: E501

        :param output_file_id: The output_file_id of this Batch.
        :type output_file_id: str
        """

        self._output_file_id = output_file_id

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

        The ID of the file containing the outputs of requests with errors.  # noqa: E501

        :return: The error_file_id of this Batch.
        :rtype: str
        """
        return self._error_file_id

    @error_file_id.setter
    def error_file_id(self, error_file_id: str):
        """Sets the error_file_id of this Batch.

        The ID of the file containing the outputs of requests with errors.  # noqa: E501

        :param error_file_id: The error_file_id of this Batch.
        :type error_file_id: str
        """

        self._error_file_id = error_file_id

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

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

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

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

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

        :param created_at: The created_at of this Batch.
        :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 in_progress_at(self) -> int:
        """Gets the in_progress_at of this Batch.

        The Unix timestamp (in seconds) for when the batch started processing.  # noqa: E501

        :return: The in_progress_at of this Batch.
        :rtype: int
        """
        return self._in_progress_at

    @in_progress_at.setter
    def in_progress_at(self, in_progress_at: int):
        """Sets the in_progress_at of this Batch.

        The Unix timestamp (in seconds) for when the batch started processing.  # noqa: E501

        :param in_progress_at: The in_progress_at of this Batch.
        :type in_progress_at: int
        """

        self._in_progress_at = in_progress_at

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

        The Unix timestamp (in seconds) for when the batch will expire.  # noqa: E501

        :return: The expires_at of this Batch.
        :rtype: int
        """
        return self._expires_at

    @expires_at.setter
    def expires_at(self, expires_at: int):
        """Sets the expires_at of this Batch.

        The Unix timestamp (in seconds) for when the batch will expire.  # noqa: E501

        :param expires_at: The expires_at of this Batch.
        :type expires_at: int
        """

        self._expires_at = expires_at

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

        The Unix timestamp (in seconds) for when the batch started finalizing.  # noqa: E501

        :return: The finalizing_at of this Batch.
        :rtype: int
        """
        return self._finalizing_at

    @finalizing_at.setter
    def finalizing_at(self, finalizing_at: int):
        """Sets the finalizing_at of this Batch.

        The Unix timestamp (in seconds) for when the batch started finalizing.  # noqa: E501

        :param finalizing_at: The finalizing_at of this Batch.
        :type finalizing_at: int
        """

        self._finalizing_at = finalizing_at

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

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

        :return: The completed_at of this Batch.
        :rtype: int
        """
        return self._completed_at

    @completed_at.setter
    def completed_at(self, completed_at: int):
        """Sets the completed_at of this Batch.

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

        :param completed_at: The completed_at of this Batch.
        :type completed_at: int
        """

        self._completed_at = completed_at

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

        The Unix timestamp (in seconds) for when the batch failed.  # noqa: E501

        :return: The failed_at of this Batch.
        :rtype: int
        """
        return self._failed_at

    @failed_at.setter
    def failed_at(self, failed_at: int):
        """Sets the failed_at of this Batch.

        The Unix timestamp (in seconds) for when the batch failed.  # noqa: E501

        :param failed_at: The failed_at of this Batch.
        :type failed_at: int
        """

        self._failed_at = failed_at

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

        The Unix timestamp (in seconds) for when the batch expired.  # noqa: E501

        :return: The expired_at of this Batch.
        :rtype: int
        """
        return self._expired_at

    @expired_at.setter
    def expired_at(self, expired_at: int):
        """Sets the expired_at of this Batch.

        The Unix timestamp (in seconds) for when the batch expired.  # noqa: E501

        :param expired_at: The expired_at of this Batch.
        :type expired_at: int
        """

        self._expired_at = expired_at

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

        The Unix timestamp (in seconds) for when the batch started cancelling.  # noqa: E501

        :return: The cancelling_at of this Batch.
        :rtype: int
        """
        return self._cancelling_at

    @cancelling_at.setter
    def cancelling_at(self, cancelling_at: int):
        """Sets the cancelling_at of this Batch.

        The Unix timestamp (in seconds) for when the batch started cancelling.  # noqa: E501

        :param cancelling_at: The cancelling_at of this Batch.
        :type cancelling_at: int
        """

        self._cancelling_at = cancelling_at

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

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

        :return: The cancelled_at of this Batch.
        :rtype: int
        """
        return self._cancelled_at

    @cancelled_at.setter
    def cancelled_at(self, cancelled_at: int):
        """Sets the cancelled_at of this Batch.

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

        :param cancelled_at: The cancelled_at of this Batch.
        :type cancelled_at: int
        """

        self._cancelled_at = cancelled_at

    @property
    def request_counts(self) -> BatchRequestCounts:
        """Gets the request_counts of this Batch.


        :return: The request_counts of this Batch.
        :rtype: BatchRequestCounts
        """
        return self._request_counts

    @request_counts.setter
    def request_counts(self, request_counts: BatchRequestCounts):
        """Sets the request_counts of this Batch.


        :param request_counts: The request_counts of this Batch.
        :type request_counts: BatchRequestCounts
        """

        self._request_counts = request_counts

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

        Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.   # noqa: E501

        :return: The metadata of this Batch.
        :rtype: object
        """
        return self._metadata

    @metadata.setter
    def metadata(self, metadata: object):
        """Sets the metadata of this Batch.

        Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.   # noqa: E501

        :param metadata: The metadata of this Batch.
        :type metadata: object
        """

        self._metadata = metadata
