# coding: utf-8

from __future__ import absolute_import
from datetime import date, datetime  # noqa: F401

from typing import List, Dict  # noqa: F401

from mistk.model.server.models.base_model_ import Model
from mistk.model.server import util


class WatchEvent(Model):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    def __init__(self, payload: object=None, event_type: str=None):  # noqa: E501
        """WatchEvent - a model defined in Swagger

        :param payload: The payload of this WatchEvent.  # noqa: E501
        :type payload: object
        :param event_type: The event_type of this WatchEvent.  # noqa: E501
        :type event_type: str
        """
        self.swagger_types = {
            'payload': object,
            'event_type': str
        }

        self.attribute_map = {
            'payload': 'payload',
            'event_type': 'eventType'
        }

        self._payload = payload
        self._event_type = event_type

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

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

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

        The object/resource which was changed. If the type of the event was *added* or *modified*, then this field is the new state of the resource.  If the field is *deleted* then the value is the state just before deletion.   # noqa: E501

        :return: The payload of this WatchEvent.
        :rtype: object
        """
        return self._payload

    @payload.setter
    def payload(self, payload: object):
        """Sets the payload of this WatchEvent.

        The object/resource which was changed. If the type of the event was *added* or *modified*, then this field is the new state of the resource.  If the field is *deleted* then the value is the state just before deletion.   # noqa: E501

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

        self._payload = payload

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


        :return: The event_type of this WatchEvent.
        :rtype: str
        """
        return self._event_type

    @event_type.setter
    def event_type(self, event_type: str):
        """Sets the event_type of this WatchEvent.


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

        self._event_type = event_type
