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

"""
    apimaticcalculatorlatest

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


class NearbyAmenity(object):

    """Implementation of the 'NearbyAmenity' model.

    TODO: type model description here.

    Attributes:
        attribute_id (NearbyAmenitiesEnum): List of allowed Nearby Amenities
            codes
        distance (int): Will be set to 0 by default

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "attribute_id":'attributeId',
        "distance":'distance'
    }

    def __init__(self,
                 attribute_id=None,
                 distance=None):
        """Constructor for the NearbyAmenity class"""

        # Initialize members of the class
        self.attribute_id = attribute_id
        self.distance = distance


    @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
        attribute_id = dictionary.get('attributeId')
        distance = dictionary.get('distance')

        # Return an object of this model
        return cls(attribute_id,
                   distance)


