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

"""
    apimaticcalculatorlatest

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

import apimaticcalculatorlatest.models.manual_policy

class CancellationPolicy(object):

    """Implementation of the 'CancellationPolicy' model.

    TODO: type model description here.

    Attributes:
        mtype (CancellationPolicyTypeEnum): TODO: type description here.
        manual_policy (ManualPolicy): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "mtype":'type',
        "manual_policy":'manualPolicy'
    }

    def __init__(self,
                 mtype=None,
                 manual_policy=None):
        """Constructor for the CancellationPolicy class"""

        # Initialize members of the class
        self.mtype = mtype
        self.manual_policy = manual_policy


    @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
        mtype = dictionary.get('type')
        manual_policy = apimaticcalculatorlatest.models.manual_policy.ManualPolicy.from_dictionary(dictionary.get('manualPolicy')) if dictionary.get('manualPolicy') else None

        # Return an object of this model
        return cls(mtype,
                   manual_policy)


