public static function sanitizeForSerialization($data) {
		if (is_scalar($data) || null === $data) {
			return $data;
		} elseif ($data instanceof \DateTime) {
			return $data->format(\DateTime::ATOM);
		} elseif (is_array($data)) {
			foreach ($data as $property => $value) {
				$data[$property] = self::sanitizeForSerialization($value);
			}
			return $data;
		} elseif ($data instanceof \stdClass) {
			return $data;
		} elseif (is_object($data)) {
			$values = array();
			foreach (array_keys($data::swaggerTypes()) as $property) {
				$getter = 'get' . ucfirst($property);
				$values[$property] = self::sanitizeForSerialization($data->$getter());
			}
			return (object)$values;
		} else {
			return (string)$data;
		}
	}