private function buildEntry(array $entry)
{
if (isset($entry['jsonPayload'])) {
$entry['jsonPayload'] = $this->formatStructForApi($entry['jsonPayload']);
}
if (isset($entry['labels'])) {
$entry['labels'] = $this->formatLabelsForApi($entry['labels']);
}
if (isset($entry['resource']['labels'])) {
$entry['resource']['labels'] = $this->formatLabelsForApi($entry['resource']['labels']);
}
if (isset($entry['severity']) && is_string($entry['severity'])) {
$entry['severity'] = array_flip(Logger::getLogLevelMap())[$entry['severity']];
}
return (new LogEntry())->deserialize($entry, $this->codec);
}