-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plgn-380 salesforce add deduping (#1993)
- Loading branch information
1 parent
f65e53f
commit 16e8b81
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |