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

    Do not edit the class manually.
    """

    def __init__(self, anchor=None, days=None):  # noqa: E501
        """VectorStoreExpirationAfter - a model defined in OpenAPI

        :param anchor: The anchor of this VectorStoreExpirationAfter.  # noqa: E501
        :type anchor: str
        :param days: The days of this VectorStoreExpirationAfter.  # noqa: E501
        :type days: int
        """
        self.openapi_types = {
            'anchor': str,
            'days': int
        }

        self.attribute_map = {
            'anchor': 'anchor',
            'days': 'days'
        }

        self._anchor = anchor
        self._days = days

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

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

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

        Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.  # noqa: E501

        :return: The anchor of this VectorStoreExpirationAfter.
        :rtype: str
        """
        return self._anchor

    @anchor.setter
    def anchor(self, anchor: str):
        """Sets the anchor of this VectorStoreExpirationAfter.

        Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.  # noqa: E501

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

        self._anchor = anchor

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

        The number of days after the anchor time that the vector store will expire.  # noqa: E501

        :return: The days of this VectorStoreExpirationAfter.
        :rtype: int
        """
        return self._days

    @days.setter
    def days(self, days: int):
        """Sets the days of this VectorStoreExpirationAfter.

        The number of days after the anchor time that the vector store will expire.  # noqa: E501

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

        self._days = days
