Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions dynatrace/environment_v2/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,6 @@ class EventType(Enum):
UPDATE = "UPDATE"


class Category(Enum):
ACTIVEGATE_TOKEN = "ACTIVEGATE_TOKEN"
CONFIG = "CONFIG"
DEBUG_UI = "DEBUG_UI"
MANUAL_TAGGING_SERVICE = "MANUAL_TAGGING_SERVICE"
REST = "REST"
TOKEN = "TOKEN"
WEB_UI = "WEB_UI"


class UserType(Enum):
PUBLIC_TOKEN_IDENTIFIER = "PUBLIC_TOKEN_IDENTIFIER"
REQUEST_ID = "REQUEST_ID"
Expand All @@ -86,7 +76,7 @@ class UserType(Enum):

class AuditLogEntry(DynatraceObject):
def _create_from_raw_data(self, raw_element: Dict[str, Any]):
self.category: Category = Category(raw_element.get("category"))
self.category: str = raw_element.get("category")
self.environment_id: str = raw_element.get("environmentId")
self.event_type: EventType = EventType(raw_element.get("eventType"))
self.log_id: str = raw_element.get("logId")
Expand Down
6 changes: 3 additions & 3 deletions test/environment_v2/test_audit_logs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dynatrace import Dynatrace
from datetime import datetime

from dynatrace.environment_v2.audit_logs import AuditLogEntry, EventType, Category, UserType
from dynatrace.environment_v2.audit_logs import AuditLogEntry, EventType, UserType
from dynatrace.pagination import PaginatedList


Expand All @@ -16,7 +16,7 @@ def test_list(dt: Dynatrace):
assert isinstance(first, AuditLogEntry)
assert first.log_id == "162100314800090003"
assert first.event_type == EventType("DELETE")
assert first.category == Category("CONFIG")
assert first.category == "CONFIG"
assert first.entity_id == "builtin:alerting.profile (tenant): d89472d3-f9f4-420d-9398-768bb3351e85: test"
assert first.environment_id == "eaa50379"
assert first.user == "Dynatrace support user #649982176"
Expand All @@ -31,7 +31,7 @@ def test_get(dt: Dynatrace):
assert isinstance(audit_log, AuditLogEntry)
assert audit_log.log_id == "162100314800090003"
assert audit_log.event_type == EventType("DELETE")
assert audit_log.category == Category("CONFIG")
assert audit_log.category == "CONFIG"
assert audit_log.entity_id == "builtin:alerting.profile (tenant): d89472d3-f9f4-420d-9398-768bb3351e85: test"
assert audit_log.environment_id == "eaa50379"
assert audit_log.user == "Dynatrace support user #649982176"
Expand Down