# -*- coding: utf-8 -*-

"""
    apimaticcalculatorlatest

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""


class FunctionsRequestToBook(object):

    """Implementation of the 'FunctionsRequestToBook' model.

    Request to book answer model

    Attributes:
        request_to_book_type (RequestToBookTypeEnum): TODO: type description
            here.
        request_to_book_decline_reason_type
            (RequestToBookDeclineReasonTypeEnum): TODO: type description
            here.
        decline_message_to_guest (string): Message to guest
        reservation_id (int): Reservation for request to book

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "request_to_book_type":'requestToBookType',
        "reservation_id":'reservationId',
        "request_to_book_decline_reason_type":'requestToBookDeclineReasonType',
        "decline_message_to_guest":'declineMessageToGuest'
    }

    def __init__(self,
                 request_to_book_type=None,
                 reservation_id=None,
                 request_to_book_decline_reason_type=None,
                 decline_message_to_guest=None):
        """Constructor for the FunctionsRequestToBook class"""

        # Initialize members of the class
        self.request_to_book_type = request_to_book_type
        self.request_to_book_decline_reason_type = request_to_book_decline_reason_type
        self.decline_message_to_guest = decline_message_to_guest
        self.reservation_id = reservation_id


    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object as
            obtained from the deserialization of the server's response. The keys
            MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if dictionary is None:
            return None

        # Extract variables from the dictionary
        request_to_book_type = dictionary.get('requestToBookType')
        reservation_id = dictionary.get('reservationId')
        request_to_book_decline_reason_type = dictionary.get('requestToBookDeclineReasonType')
        decline_message_to_guest = dictionary.get('declineMessageToGuest')

        # Return an object of this model
        return cls(request_to_book_type,
                   reservation_id,
                   request_to_book_decline_reason_type,
                   decline_message_to_guest)


