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

    Do not edit the class manually.
    """

    def __init__(self, max_chunk_size_tokens=None, chunk_overlap_tokens=None):  # noqa: E501
        """StaticChunkingStrategyStatic - a model defined in OpenAPI

        :param max_chunk_size_tokens: The max_chunk_size_tokens of this StaticChunkingStrategyStatic.  # noqa: E501
        :type max_chunk_size_tokens: int
        :param chunk_overlap_tokens: The chunk_overlap_tokens of this StaticChunkingStrategyStatic.  # noqa: E501
        :type chunk_overlap_tokens: int
        """
        self.openapi_types = {
            'max_chunk_size_tokens': int,
            'chunk_overlap_tokens': int
        }

        self.attribute_map = {
            'max_chunk_size_tokens': 'max_chunk_size_tokens',
            'chunk_overlap_tokens': 'chunk_overlap_tokens'
        }

        self._max_chunk_size_tokens = max_chunk_size_tokens
        self._chunk_overlap_tokens = chunk_overlap_tokens

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

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

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

        The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.  # noqa: E501

        :return: The max_chunk_size_tokens of this StaticChunkingStrategyStatic.
        :rtype: int
        """
        return self._max_chunk_size_tokens

    @max_chunk_size_tokens.setter
    def max_chunk_size_tokens(self, max_chunk_size_tokens: int):
        """Sets the max_chunk_size_tokens of this StaticChunkingStrategyStatic.

        The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.  # noqa: E501

        :param max_chunk_size_tokens: The max_chunk_size_tokens of this StaticChunkingStrategyStatic.
        :type max_chunk_size_tokens: int
        """
        if max_chunk_size_tokens is None:
            raise ValueError("Invalid value for `max_chunk_size_tokens`, must not be `None`")  # noqa: E501
        if max_chunk_size_tokens is not None and max_chunk_size_tokens > 4096:  # noqa: E501
            raise ValueError("Invalid value for `max_chunk_size_tokens`, must be a value less than or equal to `4096`")  # noqa: E501
        if max_chunk_size_tokens is not None and max_chunk_size_tokens < 100:  # noqa: E501
            raise ValueError("Invalid value for `max_chunk_size_tokens`, must be a value greater than or equal to `100`")  # noqa: E501

        self._max_chunk_size_tokens = max_chunk_size_tokens

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

        The number of tokens that overlap between chunks. The default value is `400`.  Note that the overlap must not exceed half of `max_chunk_size_tokens`.   # noqa: E501

        :return: The chunk_overlap_tokens of this StaticChunkingStrategyStatic.
        :rtype: int
        """
        return self._chunk_overlap_tokens

    @chunk_overlap_tokens.setter
    def chunk_overlap_tokens(self, chunk_overlap_tokens: int):
        """Sets the chunk_overlap_tokens of this StaticChunkingStrategyStatic.

        The number of tokens that overlap between chunks. The default value is `400`.  Note that the overlap must not exceed half of `max_chunk_size_tokens`.   # noqa: E501

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

        self._chunk_overlap_tokens = chunk_overlap_tokens
