def entry_from_resource(resource, client, loggers):
 if ('textPayload' in resource):
  return TextEntry.from_api_repr(resource, client, loggers)
 elif ('jsonPayload' in resource):
  return StructEntry.from_api_repr(resource, client, loggers)
 elif ('protoPayload' in resource):
  return ProtobufEntry.from_api_repr(resource, client, loggers)
 raise ValueError('Cannot parse log entry resource.')

def entry_from_resource ( resource , client , loggers ) : if ( 'textPayload' in resource ) : return TextEntry . from_api_repr ( resource , client , loggers ) elif ( 'jsonPayload' in resource ) : return StructEntry . from_api_repr ( resource , client , loggers ) elif ( 'protoPayload' in resource ) : return ProtobufEntry . from_api_repr ( resource , client , loggers ) raise ValueError ( 'Cannot parse log entry resource.' )
detect correct entry type from resource and instantiate .