관리-도구
편집 파일: events.cpython-311.pyc
� IMgI � �~ � d dl Zd dlZd dlZd dlmZ d dlmZ d dlm Z ej e� � Z G d� de� � Z dS )� N)�API)�IndependentAgentIDAPI)�run_in_executor_decoratorc � � e Zd ZdZdZdZeed� � � � � Zed� � � Z ed� � � Z eed� � � � � ZdS ) � EventsAPIzV{base}/api/dashboard/events?dashboard=false&popup=true¬_snoozed_at={not_snoozed_at}z:{base}/api/dashboard/v2/events?notification=1&enduser=truez/{base}/api/dashboard/v2/events?smartadvice=truec �2 � t j � | j � | j t t j � � � � � � � � �� � d�� � }| � |� � }|d S )N)�base�not_snoozed_at�GET)�method�result) �urllib�request�Request�ADVICES_API_URL_TEMPLATE�format� _BASE_URL�int�datetime�now� timestamp��clsr r s �V/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/api/server/events.py�adviceszEventsAPI.advices s� � � �.�(�(��(�/�/��]�"�8�#4�#8�#8�#:�#:�#D�#D�#F�#F�G�G� 0� � � � )� � �� ���W�%�%���h��� c � �� K � t j � | j � | j �� � ddt j � � � d {V ��i�� � }| � |� � � d {V ��S )N�r r �X-Auth�r �headers) r r r �NOTIFICATIONS_API_URL_TEMPLATEr r r � get_token�_send_notifications�r r s r �notificationzEventsAPI.notification% s� � � � ��.�(�(��.�5�5�3�=�5�I�I���%:�%D�%F�%F�F�F�F�F�F�F�G� )� � �� �,�,�W�5�5�5�5�5�5�5�5�5r c � �� K � t j � | j � | j �� � ddt j � � � d {V ��i�� � }| � |� � d S )Nr r r r r )r r r �SMART_ADVICE_API_URL_TEMPLATEr r r r# r% s r � smart_adviceszEventsAPI.smart_advices. s{ � � � ��.�(�(��-�4�4�#�-�4�H�H���%:�%D�%F�%F�F�F�F�F�F�F�G� )� � �� �{�{�7�#�#�H�-�-r c �<