protected void updateActivityEntity(String requestUrl, Activity activity, Map<String, String> parameters, HTTPCode expectedCode) throws ClientServicesException {
try {
String payload = null;
if (activity != null) {
ActivitySerializer serializer = new ActivitySerializer(activity);
payload = serializer.generateUpdate();
}
Map<String, String> headers = activity.hasAttachments() ? getMultipartHeaders() : getAtomHeaders();
String uniqueId = (activity == null) ? null : activity.getActivityUuid();
Response response = putData(requestUrl, parameters, headers, payload, uniqueId);
checkResponseCode(response, expectedCode);