# Path: mapmyfitness/objects/base.py
# class BaseObject(object):
#     def __init__(self, dict_):
#         self.original_dict = dict_
# 
#         if hasattr(self, 'simple_properties'):
#             for property_key, property_name in self.simple_properties.items():
#                 if property_key in self.original_dict:
#                     if property_name is None:
#                         property_name = property_key
#                     setattr(self, property_name, self.original_dict[property_key])
# 
#         if hasattr(self, 'datetime_properties'):
#             for property_key, property_name in self.datetime_properties.items():
#                 if property_key in self.original_dict:
#                     if property_name is None:
#                         property_name = property_key
#                     setattr(self, property_name, iso_format_to_datetime(self.original_dict[property_key]))
# 
# Path: mapmyfitness/utils.py
# def privacy_enum_to_string(privacy_enum):
#     #
#     # From constants:
#     # PRIVATE = 0
#     # PUBLIC = 3
#     # FRIENDS = 1
#     #
#     privacy_map = {
#         0: 'Private',
#         1: 'Friends',
#         3: 'Public'
#     }
#     return privacy_map[privacy_enum]


from .base import BaseObject
from ..utils import privacy_enum_to_string
                from mapmyfitness import MapMyFitness
                from mapmyfitness import MapMyFitness
            from mapmyfitness import MapMyFitness
                return self._route
            else:
                instance = MapMyFitness.instance()
                route = instance.route.find(self.route_id)
                self._route = route
                return self._route

    @property
    def route_id(self):
        links = self.original_dict['_links']
        if 'route' in links:
            return int(links['route'][0]['id'])

    @property
    def activity_type_id(self):
        return int(self.original_dict['_links']['activity_type'][0]['id'])

    @property
    def activity_type(self):
        if hasattr(self, '_activity_type'):
            return self._activity_type
        else:
            instance = MapMyFitness.instance()
            activity_type = instance.activity_type.find(self.activity_type_id)
            self._activity_type = activity_type
            return self._activity_type

    @property
    def privacy(self):
        privacy_enum = int(self.original_dict['_links']['privacy'][0]['id'])

# Path: mapmyfitness/objects/base.py
# class BaseObject(object):
#     def __init__(self, dict_):
#         self.original_dict = dict_
# 
#         if hasattr(self, 'simple_properties'):
#             for property_key, property_name in self.simple_properties.items():
#                 if property_key in self.original_dict:
#                     if property_name is None:
#                         property_name = property_key
#                     setattr(self, property_name, self.original_dict[property_key])
# 
#         if hasattr(self, 'datetime_properties'):
#             for property_key, property_name in self.datetime_properties.items():
#                 if property_key in self.original_dict:
#                     if property_name is None:
#                         property_name = property_key
#                     setattr(self, property_name, iso_format_to_datetime(self.original_dict[property_key]))
# 
# Path: mapmyfitness/utils.py
# def privacy_enum_to_string(privacy_enum):
#     #
#     # From constants:
#     # PRIVATE = 0
#     # PUBLIC = 3
#     # FRIENDS = 1
#     #
#     privacy_map = {
#         0: 'Private',
#         1: 'Friends',
#         3: 'Public'
#     }
#     return privacy_map[privacy_enum]


# Path: mapmyfitness/objects/workout.py
from .base import BaseObject
from ..utils import privacy_enum_to_string
                from mapmyfitness import MapMyFitness
                from mapmyfitness import MapMyFitness
            from mapmyfitness import MapMyFitness

                return self._route
            else:
                instance = MapMyFitness.instance()
                route = instance.route.find(self.route_id)
                self._route = route
                return self._route

    @property
    def route_id(self):
        links = self.original_dict['_links']
        if 'route' in links:
            return int(links['route'][0]['id'])

    @property
    def activity_type_id(self):
        return int(self.original_dict['_links']['activity_type'][0]['id'])

    @property
    def activity_type(self):
        if hasattr(self, '_activity_type'):
            return self._activity_type
        else:
            instance = MapMyFitness.instance()
            activity_type = instance.activity_type.find(self.activity_type_id)
            self._activity_type = activity_type
            return self._activity_type

    @property
    def privacy(self):
        privacy_enum = int(self.original_dict['_links']['privacy'][0]['id'])

        return privacy_enum_to_string(privacy_enum)