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

"""
    apimaticcalculatorlatest

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

import apimaticcalculatorlatest.models.payment_policy
import apimaticcalculatorlatest.models.cancellation_policy
import apimaticcalculatorlatest.models.fee_tax_mandatory

class Policies(object):

    """Implementation of the 'Policies' model.

    TODO: type model description here.

    Attributes:
        payment_policy (PaymentPolicy): TODO: type description here.
        cancellation_policy (CancellationPolicy): TODO: type description
            here.
        fee_tax_mandatory (FeeTaxMandatory): TODO: type description here.
        terms (string): Full URL to PM terms and conditions
        check_in_time (string): Time of Check in (HH:MM:SS)
        check_out_time (string): Time of Check out (HH:MM:SS)
        lead_time (int): Minimum number of days before check-in for which
            reservation is allowed to be booked. Allowed values are 0-7.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payment_policy":'paymentPolicy',
        "cancellation_policy":'cancellationPolicy',
        "fee_tax_mandatory":'feeTaxMandatory',
        "terms":'terms',
        "check_in_time":'checkInTime',
        "check_out_time":'checkOutTime',
        "lead_time":'leadTime'
    }

    def __init__(self,
                 payment_policy=None,
                 cancellation_policy=None,
                 fee_tax_mandatory=None,
                 terms=None,
                 check_in_time=None,
                 check_out_time=None,
                 lead_time=None):
        """Constructor for the Policies class"""

        # Initialize members of the class
        self.payment_policy = payment_policy
        self.cancellation_policy = cancellation_policy
        self.fee_tax_mandatory = fee_tax_mandatory
        self.terms = terms
        self.check_in_time = check_in_time
        self.check_out_time = check_out_time
        self.lead_time = lead_time


    @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
        payment_policy = apimaticcalculatorlatest.models.payment_policy.PaymentPolicy.from_dictionary(dictionary.get('paymentPolicy')) if dictionary.get('paymentPolicy') else None
        cancellation_policy = apimaticcalculatorlatest.models.cancellation_policy.CancellationPolicy.from_dictionary(dictionary.get('cancellationPolicy')) if dictionary.get('cancellationPolicy') else None
        fee_tax_mandatory = apimaticcalculatorlatest.models.fee_tax_mandatory.FeeTaxMandatory.from_dictionary(dictionary.get('feeTaxMandatory')) if dictionary.get('feeTaxMandatory') else None
        terms = dictionary.get('terms')
        check_in_time = dictionary.get('checkInTime')
        check_out_time = dictionary.get('checkOutTime')
        lead_time = dictionary.get('leadTime')

        # Return an object of this model
        return cls(payment_policy,
                   cancellation_policy,
                   fee_tax_mandatory,
                   terms,
                   check_in_time,
                   check_out_time,
                   lead_time)


