@classmethod
def _from_dict(cls, _dict):
    """Initialize a DocCounts object from a json dictionary."""
    args = {}
    if 'total' in _dict:
        args['total'] = _dict.get('total')
    if 'pending' in _dict:
        args['pending'] = _dict.get('pending')
    if 'successful' in _dict:
        args['successful'] = _dict.get('successful')
    if 'failed' in _dict:
        args['failed'] = _dict.get('failed')
    return cls(**args)
