#NEWLINE# @ classmethod #NEWLINE# def from_api_repr( cls , resource , client , loggers = None ) : #NEWLINE# #INDENT# 'Factory:  construct an entry given its API representation\n\n        :type resource: dict\n        :param resource: text entry resource representation returned from\n                         the API\n\n        :type client: :class:`gcloud.logging.client.Client`\n        :param client: Client which holds credentials and project\n                       configuration.\n\n        :type loggers: dict or None\n        :param loggers: A mapping of logger fullnames -> loggers.  If not\n                        passed, the entry will have a newly-created logger.\n\n        :rtype: :class:`gcloud.logging.entries.TextEntry`\n        :returns: Text entry parsed from ``resource``.\n        ' #NEWLINE# if ( loggers is None ) : #NEWLINE# #INDENT# loggers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# logger_fullname = resource [ 'logName' ] #NEWLINE# logger = loggers . get ( logger_fullname ) #NEWLINE# if ( logger is None ) : #NEWLINE# #INDENT# logger_name = logger_name_from_path ( logger_fullname , client . project ) #NEWLINE# logger = loggers [ logger_fullname ] = client . logger ( logger_name ) #NEWLINE# #UNINDENT# payload = resource [ cls . _PAYLOAD_KEY ] #NEWLINE# insert_id = resource . get ( 'insertId' ) #NEWLINE# timestamp = resource . get ( 'timestamp' ) #NEWLINE# if ( timestamp is not None ) : #NEWLINE# #INDENT# timestamp = _rfc3339_nanos_to_datetime ( timestamp ) #NEWLINE# #UNINDENT# labels = resource . get ( 'labels' ) #NEWLINE# severity = resource . get ( 'severity' ) #NEWLINE# http_request = resource . get ( 'httpRequest' ) #NEWLINE# return cls ( payload , logger , insert_id = insert_id , timestamp = timestamp , labels = labels , severity = severity , http_request = http_request )