Skip to content

Commit

Permalink
plgn-380 salesforce add deduping (#1993)
Browse files Browse the repository at this point in the history
  • Loading branch information
llaszuk-r7 authored and igorski-r7 committed Oct 10, 2023
1 parent 6824956 commit c30133a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions plugins/salesforce/komand_salesforce/util/event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from dataclasses import dataclass, fields

from typing import Optional


@dataclass(frozen=True, eq=True)
class UserEvent:
attributes: dict
dataType: str
Id: Optional[str] = None
FirstName: Optional[str] = None
LastName: Optional[str] = None
Email: Optional[str] = None
Alias: Optional[str] = None
IsActive: Optional[bool] = None
LoginTime: Optional[str] = None
UserId: Optional[str] = None
LoginType: Optional[str] = None
LoginUrl: Optional[str] = None
SourceIp: Optional[str] = None
Status: Optional[str] = None
Application: Optional[str] = None
Browser: Optional[str] = None

def __hash__(self):
exclude_fields = ["attributes"]
return hash(tuple(getattr(self, field.name) for field in fields(self) if field.name not in exclude_fields))

0 comments on commit c30133a

Please sign in to comment.