'Deserialize a Group from a json-like representation.
Args:
value: a dictionary with keys for the properties of the group.
Raises TypeError if the value doesn\'t have the right keys.'

@staticmethod
def from_json(value):

    if isinstance(value, UserPartition):
        return value
    for key in ('id', 'name', 'description', 'version', 'groups'):
        if (key not in value):
            raise TypeError("UserPartition    dict    {0}    missing    value    key    '{1}'".format(value, key))
    if (value['version'] == 1):
        scheme_id = UserPartition.VERSION_1_SCHEME
    elif (value['version'] >= 2):
        if ('scheme' not in value):
            raise TypeError("UserPartition    dict    {0}    missing    value    key    'scheme'".format(value))
        scheme_id = value['scheme']
    else:
        raise TypeError('UserPartition    dict    {0}    has    unexpected    version'.format(value))
    parameters = value.get('parameters', {})
    active = value.get('active', True)
    groups = [Group.from_json(g) for g in value['groups']]
    scheme = UserPartition.get_scheme(scheme_id)
    if (not scheme):
        raise TypeError('UserPartition    dict    {0}    has    unrecognized    scheme    {1}'.format(value, scheme_id))
    if hasattr(scheme, 'create_user_partition'):
        return scheme.create_user_partition(value['id'], value['name'], value['description'], groups, parameters, active)
    else:
        return UserPartition(value['id'], value['name'], value['description'], groups, scheme, parameters, active)
