'Constructs PutResult from RequestStatus pb and doc_id.'

def _NewPutResultFromPb(self, status_pb, doc_id):

    message = None
    if status_pb.has_error_detail():
        message = _DecodeUTF8(status_pb.error_detail())
    code = _ERROR_OPERATION_CODE_MAP.get(status_pb.code(), OperationResult.INTERNAL_ERROR)
    return PutResult(code=code, message=message, id=_DecodeUTF8(doc_id))
