original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Serializes the given group update object to JSON.
  
  @param Api\GroupUpdate $groupUpdate the group update to serialize
  
  @return string a JSON string
docstring_tokens: Serializes the given group update object to JSON .