# coding: utf-8

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

from typing import List, Dict  # noqa: F401

from swagger_server.models.base_model_ import Model
from swagger_server import util


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

    Do not edit the class manually.
    """
    def __init__(self, operation: str=None, origin: str=None):  # noqa: E501
        """BookingOperation - a model defined in Swagger

        :param operation: The operation of this BookingOperation.  # noqa: E501
        :type operation: str
        :param origin: The origin of this BookingOperation.  # noqa: E501
        :type origin: str
        """
        self.swagger_types = {
            'operation': str,
            'origin': str
        }

        self.attribute_map = {
            'operation': 'operation',
            'origin': 'origin'
        }
        self._operation = operation
        self._origin = origin

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

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

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


        :return: The operation of this BookingOperation.
        :rtype: str
        """
        return self._operation

    @operation.setter
    def operation(self, operation: str):
        """Sets the operation of this BookingOperation.


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

        self._operation = operation

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

        This operation can be done on behalf of another party. The MP can act on behalf of the END_USER (cancel this booking for me); to override the default origin. In case this field is missing, it must be assumed that the events the MP is sending, this field should contain \"MP\". And in case the TO is sending, \"TO\".  # noqa: E501

        :return: The origin of this BookingOperation.
        :rtype: str
        """
        return self._origin

    @origin.setter
    def origin(self, origin: str):
        """Sets the origin of this BookingOperation.

        This operation can be done on behalf of another party. The MP can act on behalf of the END_USER (cancel this booking for me); to override the default origin. In case this field is missing, it must be assumed that the events the MP is sending, this field should contain \"MP\". And in case the TO is sending, \"TO\".  # noqa: E501

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

        self._origin = origin
