public static function parseResponseToPatrolObject(Patrol $patrol, $data, $class = null, $defaults = null) {
        if (self::isIterator($data)) {
            $parsed = [];
            foreach ($data as $item) {
                $parsed[] = self::parseResponseToPatrolObject($patrol, $item, $class, $defaults);
            }
            return $parsed;
        } else if (self::isObject($data)) {
            $callable_class = is_null($class) ? 'PatrolSdk\PatrolObject' : $class;
            return new $callable_class($patrol, $data, $defaults);
        } else {
            return $data;
        }
    }