# Path: marathon/models/base.py
# class MarathonObject:
#     """Base Marathon object."""
# 
#     def __repr__(self):
#         return "{clazz}::{obj}".format(clazz=self.__class__.__name__, obj=self.to_json(minimal=False))
# 
#     def __eq__(self, other):
#         try:
#             return self.__dict__ == other.__dict__
#         except Exception:
#             return False
# 
#     def __hash__(self):
#         # Technically this class shouldn't be hashable because it often
#         # contains mutable fields, but in practice this class is used more
#         # like a record or namedtuple.
#         return hash(self.to_json())
# 
#     def json_repr(self, minimal=False):
#         """Construct a JSON-friendly representation of the object.
# 
#         :param bool minimal: Construct a minimal representation of the object (ignore nulls and empty collections)
# 
#         :rtype: dict
#         """
#         if minimal:
#             return {to_camel_case(k): v for k, v in vars(self).items() if (v or v is False or v == 0)}
#         else:
#             return {to_camel_case(k): v for k, v in vars(self).items()}
# 
#     @classmethod
#     def from_json(cls, attributes):
#         """Construct an object from a parsed response.
# 
#         :param dict attributes: object attributes from parsed response
#         """
#         return cls(**{to_snake_case(k): v for k, v in attributes.items()})
# 
#     def to_json(self, minimal=True):
#         """Encode an object as a JSON string.
# 
#         :param bool minimal: Construct a minimal representation of the object (ignore nulls and empty collections)
# 
#         :rtype: str
#         """
#         if minimal:
#             return json.dumps(self.json_repr(minimal=True), cls=MarathonMinimalJsonEncoder, sort_keys=True)
#         else:
#             return json.dumps(self.json_repr(), cls=MarathonJsonEncoder, sort_keys=True)
# 
# class MarathonResource(MarathonObject):
# 
#     """Base Marathon resource."""
# 
#     def __repr__(self):
#         if 'id' in list(vars(self).keys()):
#             return f"{self.__class__.__name__}::{self.id}"
#         else:
#             return "{clazz}::{obj}".format(clazz=self.__class__.__name__, obj=self.to_json())
# 
#     def __eq__(self, other):
#         try:
#             return self.__dict__ == other.__dict__
#         except Exception:
#             return False
# 
#     def __hash__(self):
#         # Technically this class shouldn't be hashable because it often
#         # contains mutable fields, but in practice this class is used more
#         # like a record or namedtuple.
#         return hash(self.to_json())
# 
#     def __str__(self):
#         return f"{self.__class__.__name__}::" + str(self.__dict__)


from .base import MarathonObject, MarathonResource
    :type http_config: :class:`marathon.models.info.MarathonHttpConfig` or dict
    :param event_subscriber:
    :type event_subscriber: :class`marathon.models.info.MarathonEventSubscriber` or dict
    :param bool elected:
    :param str buildref:
    """

    def __init__(self, event_subscriber=None, framework_id=None, http_config=None, leader=None, marathon_config=None,
                 name=None, version=None, elected=None, zookeeper_config=None, buildref=None):
        if isinstance(event_subscriber, MarathonEventSubscriber):
            self.event_subscriber = event_subscriber
        elif event_subscriber is not None:
            self.event_subscriber = MarathonEventSubscriber().from_json(
                event_subscriber)
        else:
            self.event_subscriber = None
        self.framework_id = framework_id
        self.http_config = http_config if isinstance(http_config, MarathonHttpConfig) \
            else MarathonHttpConfig().from_json(http_config)
        self.leader = leader
        self.marathon_config = marathon_config if isinstance(marathon_config, MarathonConfig) \
            else MarathonConfig().from_json(marathon_config)
        self.name = name
        self.version = version
        self.elected = elected
        self.zookeeper_config = zookeeper_config if isinstance(zookeeper_config, MarathonZooKeeperConfig) \
            else MarathonZooKeeperConfig().from_json(zookeeper_config)
        self.buildref = buildref



# Path: marathon/models/base.py
# class MarathonObject:
#     """Base Marathon object."""
# 
#     def __repr__(self):
#         return "{clazz}::{obj}".format(clazz=self.__class__.__name__, obj=self.to_json(minimal=False))
# 
#     def __eq__(self, other):
#         try:
#             return self.__dict__ == other.__dict__
#         except Exception:
#             return False
# 
#     def __hash__(self):
#         # Technically this class shouldn't be hashable because it often
#         # contains mutable fields, but in practice this class is used more
#         # like a record or namedtuple.
#         return hash(self.to_json())
# 
#     def json_repr(self, minimal=False):
#         """Construct a JSON-friendly representation of the object.
# 
#         :param bool minimal: Construct a minimal representation of the object (ignore nulls and empty collections)
# 
#         :rtype: dict
#         """
#         if minimal:
#             return {to_camel_case(k): v for k, v in vars(self).items() if (v or v is False or v == 0)}
#         else:
#             return {to_camel_case(k): v for k, v in vars(self).items()}
# 
#     @classmethod
#     def from_json(cls, attributes):
#         """Construct an object from a parsed response.
# 
#         :param dict attributes: object attributes from parsed response
#         """
#         return cls(**{to_snake_case(k): v for k, v in attributes.items()})
# 
#     def to_json(self, minimal=True):
#         """Encode an object as a JSON string.
# 
#         :param bool minimal: Construct a minimal representation of the object (ignore nulls and empty collections)
# 
#         :rtype: str
#         """
#         if minimal:
#             return json.dumps(self.json_repr(minimal=True), cls=MarathonMinimalJsonEncoder, sort_keys=True)
#         else:
#             return json.dumps(self.json_repr(), cls=MarathonJsonEncoder, sort_keys=True)
# 
# class MarathonResource(MarathonObject):
# 
#     """Base Marathon resource."""
# 
#     def __repr__(self):
#         if 'id' in list(vars(self).keys()):
#             return f"{self.__class__.__name__}::{self.id}"
#         else:
#             return "{clazz}::{obj}".format(clazz=self.__class__.__name__, obj=self.to_json())
# 
#     def __eq__(self, other):
#         try:
#             return self.__dict__ == other.__dict__
#         except Exception:
#             return False
# 
#     def __hash__(self):
#         # Technically this class shouldn't be hashable because it often
#         # contains mutable fields, but in practice this class is used more
#         # like a record or namedtuple.
#         return hash(self.to_json())
# 
#     def __str__(self):
#         return f"{self.__class__.__name__}::" + str(self.__dict__)


# Path: marathon/models/info.py
from .base import MarathonObject, MarathonResource

    :type http_config: :class:`marathon.models.info.MarathonHttpConfig` or dict
    :param event_subscriber:
    :type event_subscriber: :class`marathon.models.info.MarathonEventSubscriber` or dict
    :param bool elected:
    :param str buildref:
    """

    def __init__(self, event_subscriber=None, framework_id=None, http_config=None, leader=None, marathon_config=None,
                 name=None, version=None, elected=None, zookeeper_config=None, buildref=None):
        if isinstance(event_subscriber, MarathonEventSubscriber):
            self.event_subscriber = event_subscriber
        elif event_subscriber is not None:
            self.event_subscriber = MarathonEventSubscriber().from_json(
                event_subscriber)
        else:
            self.event_subscriber = None
        self.framework_id = framework_id
        self.http_config = http_config if isinstance(http_config, MarathonHttpConfig) \
            else MarathonHttpConfig().from_json(http_config)
        self.leader = leader
        self.marathon_config = marathon_config if isinstance(marathon_config, MarathonConfig) \
            else MarathonConfig().from_json(marathon_config)
        self.name = name
        self.version = version
        self.elected = elected
        self.zookeeper_config = zookeeper_config if isinstance(zookeeper_config, MarathonZooKeeperConfig) \
            else MarathonZooKeeperConfig().from_json(zookeeper_config)
        self.buildref = buildref



class MarathonConfig(MarathonObject):