public static function groupUpdate(Api\GroupUpdate $groupUpdate)
    {
        $fields = [];

        if (null != $groupUpdate->getName()) {
            $fields['name'] = $groupUpdate->getName() === Api\Reset::reset()
                            ? null
                            : $groupUpdate->getName();
        }

        if (!empty($groupUpdate->getMemberInsertions())) {
            $fields['add'] = $groupUpdate->getMemberInsertions();
        }

        if (!empty($groupUpdate->getMemberRemovals())) {
            $fields['remove'] = $groupUpdate->getMemberRemovals();
        }

        if (!empty($groupUpdate->getChildGroupInsertions())) {
            $fields['child_groups_add']
                = $groupUpdate->getChildGroupInsertions();
        }

        if (!empty($groupUpdate->getChildGroupRemovals())) {
            $fields['child_groups_remove']
                = $groupUpdate->getChildGroupRemovals();
        }

        if (null != $groupUpdate->getAddFromGroup()) {
            $fields['add_from_group'] = $groupUpdate->getAddFromGroup();
        }

        if (null != $groupUpdate->getRemoveFromGroup()) {
            $fields['remove_from_group'] = $groupUpdate->getRemoveFromGroup();
        }

        if (null != $groupUpdate->getAutoUpdate()) {
            if ($groupUpdate->getAutoUpdate() === Api\Reset::reset()) {
                $fields['auto_update'] = null;
            } else {
                $fields['auto_update'] = Serialize::_groupAutoUpdateHelper(
                    $groupUpdate->getAutoUpdate()
                );
            }
        }

        return empty($fields) ? '{}' : Serialize::_toJson($fields);
    }