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 CreateBatchRequest(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, input_file_id=None, endpoint=None, completion_window=None, metadata=None):  # noqa: E501
        """CreateBatchRequest - a model defined in OpenAPI

        :param input_file_id: The input_file_id of this CreateBatchRequest.  # noqa: E501
        :type input_file_id: str
        :param endpoint: The endpoint of this CreateBatchRequest.  # noqa: E501
        :type endpoint: str
        :param completion_window: The completion_window of this CreateBatchRequest.  # noqa: E501
        :type completion_window: str
        :param metadata: The metadata of this CreateBatchRequest.  # noqa: E501
        :type metadata: Dict[str, str]
        """
        self.openapi_types = {
            'input_file_id': str,
            'endpoint': str,
            'completion_window': str,
            'metadata': Dict[str, str]
        }

        self.attribute_map = {
            'input_file_id': 'input_file_id',
            'endpoint': 'endpoint',
            'completion_window': 'completion_window',
            'metadata': 'metadata'
        }

        self._input_file_id = input_file_id
        self._endpoint = endpoint
        self._completion_window = completion_window
        self._metadata = metadata

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

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

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

        The ID of an uploaded file that contains requests for the new batch.  See [upload file](/docs/api-reference/files/create) for how to upload a file.  Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/request-input), and must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, and can be up to 100 MB in size.   # noqa: E501

        :return: The input_file_id of this CreateBatchRequest.
        :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 CreateBatchRequest.

        The ID of an uploaded file that contains requests for the new batch.  See [upload file](/docs/api-reference/files/create) for how to upload a file.  Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/request-input), and must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, and can be up to 100 MB in size.   # noqa: E501

        :param input_file_id: The input_file_id of this CreateBatchRequest.
        :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 endpoint(self) -> str:
        """Gets the endpoint of this CreateBatchRequest.

        The endpoint to be used for all requests in the batch. Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. Note that `/v1/embeddings` batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch.  # noqa: E501

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

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

        The endpoint to be used for all requests in the batch. Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. Note that `/v1/embeddings` batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch.  # noqa: E501

        :param endpoint: The endpoint of this CreateBatchRequest.
        :type endpoint: str
        """
        allowed_values = ["/v1/chat/completions", "/v1/embeddings", "/v1/completions"]  # noqa: E501
        if endpoint not in allowed_values:
            raise ValueError(
                "Invalid value for `endpoint` ({0}), must be one of {1}"
                .format(endpoint, allowed_values)
            )

        self._endpoint = endpoint

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

        The time frame within which the batch should be processed. Currently only `24h` is supported.  # noqa: E501

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

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

        The time frame within which the batch should be processed. Currently only `24h` is supported.  # noqa: E501

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

        self._completion_window = completion_window

    @property
    def metadata(self) -> Dict[str, str]:
        """Gets the metadata of this CreateBatchRequest.

        Optional custom metadata for the batch.  # noqa: E501

        :return: The metadata of this CreateBatchRequest.
        :rtype: Dict[str, str]
        """
        return self._metadata

    @metadata.setter
    def metadata(self, metadata: Dict[str, str]):
        """Sets the metadata of this CreateBatchRequest.

        Optional custom metadata for the batch.  # noqa: E501

        :param metadata: The metadata of this CreateBatchRequest.
        :type metadata: Dict[str, str]
        """

        self._metadata = metadata
