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

    Do not edit the class manually.
    """

    def __init__(self, reason=None):  # noqa: E501
        """RunObjectIncompleteDetails - a model defined in OpenAPI

        :param reason: The reason of this RunObjectIncompleteDetails.  # noqa: E501
        :type reason: str
        """
        self.openapi_types = {
            'reason': str
        }

        self.attribute_map = {
            'reason': 'reason'
        }

        self._reason = reason

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

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

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

        The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.  # noqa: E501

        :return: The reason of this RunObjectIncompleteDetails.
        :rtype: str
        """
        return self._reason

    @reason.setter
    def reason(self, reason: str):
        """Sets the reason of this RunObjectIncompleteDetails.

        The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.  # noqa: E501

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

        self._reason = reason
