9{cdZddlZddlmZmZddlmZmZddlm Z ddl m Z ddl m Z mZddlmZmZejeZed d Gd d ZGd de ZdS)u  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.  If not, see . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see N) dataclassfields)AnySelf)urljoin)Request)APIAPIError)IAIDTokenErrorIndependentAgentIDAPIT)frozeneqc^eZdZUeed<eed<eed<edeeefdefdZ dS)RemoteRevertHitInfosig_id app_root_pathapp_namedatareturncdt|Dfd|D}|di|S)Nch|] }|j S)name).0fs L/opt/imunify360/venv/lib/python3.11/site-packages/imav/api/cleanup_revert.py z0RemoteRevertHitInfo.from_dict..-s4441444c$i|] \}}|v || Srr)rkv allowed_keyss r z1RemoteRevertHitInfo.from_dict...s)LLL$!Q!|:K:KA:K:K:Krr)ritems)clsr filtered_datar"s @r from_dictzRemoteRevertHitInfo.from_dict+sS44s 444 LLLL$**,,LLL s##]###rN) __name__ __module__ __qualname__str__annotations__ classmethoddictrrr'rrrrr%sh KKKMMM$T#s(^$$$$[$$$rrcteZdZeejdZedee e e e ffdZ dS)CleanupRevertAPIz/api/cleanup/revertrc0K tjd{V}n#t$rggfcYSwxYwt|jd|i} ||d{V}n6#t $r)}td|ggfcYd}~Sd}~wwxYwdd|vr#t|dtr|dngD}d|vr|dng}t dt|t|||fS)NzX-Auth)headersz'Failed to fetch cleanup revert data: %sc&g|]}tdi|S)r)r)r db_reverts r z*CleanupRevertAPI.paths..Cs6    , ,) , ,   rdbspathsz3Cleanup revert data fetched: %d files, %d databases) r get_tokenr rURL async_requestr loggerwarning isinstancelistinfolen)r%tokenrequestresultexc db_reverts file_revertss rr7zCleanupRevertAPI.paths5s| /9;;;;;;;;EE   8OOO #'He+<=== ,,W55555555FF    NNDc J J J8OOOOOO   F??z&-'F'F?u     +2V*;*;vg  A     OO   j))s*// A'' B1BBBN) r(r)r*rr _BASE_URLr9r-tupler>r+rr7rrrr0r02sa '#-!6 7 7C*E$s)T2E-F"FG***[***rr0)__doc__logging dataclassesrrtypingrr urllib.parserurllib.requestrdefence360agent.api.serverr r defence360agent.internals.iaidr r getLoggerr(r;rr0rrrrRs:*)))))))) """"""44444444  8 $ $ $4    $ $ $ $ $ $ $!  $ * * * * *s * * * * *r