l#g|NddlmZddlmZmZddlmZmZGddeZdS)) namedtuple) FloatField BlobField)instanceModelceZdZdZGddZedZedZe ddZ e dd Z e d Z e dd Ze dfd ZxZS) MessageToSendzc Storage for messages to be sent to server while connection to server is not available c eZdZejZdZdS)MessageToSend.Metamessages_to_send_nrN)__name__ __module__ __qualname__rdbdatabasedb_table[/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model/messages_to_send.pyMetar s;(rrF)nullMessageToSendTztimestamp messagec||j|}|SN)selectorder_by timestamplimit)clsrolds r get_oldestzMessageToSend.get_oldests2jjll##CM2288?? rc||j|}|Sr)deletewhereidin_execute)r queryqs r delete_inzMessageToSend.delete_ins9 JJLL  svzz%00 1 1yy{{rc&||j|}||j|}|Sr) rrrrr$r%r&r'r()r rr!r*s r delete_oldzMessageToSend.delete_old"sbjjll##CM2288?? JJLL  svzz# / /yy{{rreturnNc tdt|dD]G}fd|||dzD}tj|fi|HdS)NrdcHg|]}j|Sr)r_asdict).0rowr s r z-MessageToSend.insert_many..,s=7:""C(0022r)rangelensuper insert_manyr()r rowskwargsidata __class__s` rr9zMessageToSend.insert_many(sq#d))S)) : :A>B1q3w;>OD EGG  / / / / 7 7 9 9 9 9  : :r)r)r.N)r rr__doc__rrrrmessagerr classmethodr"r+r-r9 __classcell__)r>s@rr r s  ))))))))  &&&IiU###GZ 02EFFN[[[ :::::[:::::rr N) collectionsrpeeweerrdefence360agent.modelrrr rrrrFs{""""""((((((((11111111':':':':':E':':':':':r