# Path: moira_client/client.py
# class InvalidJSONError(Exception):
#     def __init__(self, content):
#         """
# 
#         :param content: bytes response content
#         """
#         self.content = content
# 
# Path: moira_client/client.py
# class ResponseStructureError(Exception):
#     def __init__(self, msg, content):
#         """
# 
#         :param msg: str error message
#         :param content: dict response content
#         """
#         self.msg = msg
#         self.content = content
# 
# Path: moira_client/models/base.py
# class Base:
#     @property
#     def id(self):
#         return self._id
# 
#     def __repr__(self):
#         return '({} {})'.format(self.__class__.__name__, self.id)
# 
#     def __unicode__(self):
#         return u'({} {})'.format(self.__class__.__name__, self.id)
# 
#     def __eq__(self, other):
#         return self.id == other.id
# 
#     def __ne__(self, other):
#         return self.id != other.id


from ..client import InvalidJSONError
from ..client import ResponseStructureError
from .base import Base
            contacts.append(Contact(**contact))

        return contacts

    def get_id(self, type, value):
        """
        Returns contact id by type and value
        Returns None if contact doesn't exist

        :param type: str contact type
        :param value: str contact value
        :return: str contact id
        """
        for contact in self.fetch_all():
            if contact.type == type and contact.value == value:
                return contact.id

    def delete(self, contact_id):
        """
        Delete contact by contact id
        If contact id doesn't exist returns True

        :param contact_id: str contact id
        :return: True if ok, False otherwise

        :raises: ResponseStructureError
        """
        try:
            self._client.delete(self._full_path(contact_id))
            return False

# Path: moira_client/client.py
# class InvalidJSONError(Exception):
#     def __init__(self, content):
#         """
# 
#         :param content: bytes response content
#         """
#         self.content = content
# 
# Path: moira_client/client.py
# class ResponseStructureError(Exception):
#     def __init__(self, msg, content):
#         """
# 
#         :param msg: str error message
#         :param content: dict response content
#         """
#         self.msg = msg
#         self.content = content
# 
# Path: moira_client/models/base.py
# class Base:
#     @property
#     def id(self):
#         return self._id
# 
#     def __repr__(self):
#         return '({} {})'.format(self.__class__.__name__, self.id)
# 
#     def __unicode__(self):
#         return u'({} {})'.format(self.__class__.__name__, self.id)
# 
#     def __eq__(self, other):
#         return self.id == other.id
# 
#     def __ne__(self, other):
#         return self.id != other.id


# Path: moira_client/models/contact.py
from ..client import InvalidJSONError
from ..client import ResponseStructureError
from .base import Base

            contacts.append(Contact(**contact))

        return contacts

    def get_id(self, type, value):
        """
        Returns contact id by type and value
        Returns None if contact doesn't exist

        :param type: str contact type
        :param value: str contact value
        :return: str contact id
        """
        for contact in self.fetch_all():
            if contact.type == type and contact.value == value:
                return contact.id

    def delete(self, contact_id):
        """
        Delete contact by contact id
        If contact id doesn't exist returns True

        :param contact_id: str contact id
        :return: True if ok, False otherwise

        :raises: ResponseStructureError
        """
        try:
            self._client.delete(self._full_path(contact_id))
            return False

        except InvalidJSONError as e: