public function getAggregateActualResponses($key = null, $operationId = null, $types = ['headers', 'body'])
    {
        if ($this->valid && isset($this->aggregateActualResponses)) {
            if (null !== $key) {
                foreach ($types as $type) {
                    if (null !== $operationId) {
                        if (isset($this->aggregateActualResponses[$operationId][$type][$key])) {
                            return $this->aggregateActualResponses[$operationId][$type][$key];
                        }
                    } else {
                        foreach (array_reverse($this->aggregateActualResponses) as $values) {
                            if (isset($values[$type][$key])) {
                                return $values[$type][$key];
                            }
                        }
                    }
                }
            } else {
                // Get the entire result, separated by types.
                $result = [];
                foreach ($types as $type) {
                    if (isset($this->aggregateActualResponses[$operationId][$type])) {
                        $result[$type] = $this->aggregateActualResponses[$operationId][$type];
                    }
                }

                return $result;
            }
        }

        return null;
    }