'Deserialize fields from JSON.'

@classmethod
def fields_from_json(cls, jobj):

    cls._check_required(jobj)
    fields = {}
    for (slot, field) in six.iteritems(cls._fields):
        if ((field.json_name not in jobj) and field.omitempty):
            fields[slot] = field.default
        else:
            value = jobj[field.json_name]
            try:
                fields[slot] = field.decode(value)
            except errors.DeserializationError as error:
                raise errors.DeserializationError('Could    not    decode    {0!r}    ({1!r}):    {2}'.format(slot, value, error))
    return fields
