Skip to content

Commit 0d2c1ac

Browse files
committed
chore(models): change certain fields to str
1 parent e2f0498 commit 0d2c1ac

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

pygitguardian/models.py

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -903,25 +903,7 @@ class Detector(Base, FromDictMixin):
903903

904904
Severity = Literal["info", "low", "medium", "high", "critical", "unknown"]
905905
ValidityStatus = Literal["valid", "invalid", "failed_to_check", "no_checker", "unknown"]
906-
IncidentStatus = Literal["IGNORED", "TRIGGERED", "RESOLVED", "ASSIGNED"]
907-
Tag = Literal[
908-
"DEFAULT_BRANCH",
909-
"FROM_HISTORICAL_SCAN",
910-
"CHECK_RUN_SKIP_FALSE_POSITIVE",
911-
"CHECK_RUN_SKIP_LOW_RISK",
912-
"CHECK_RUN_SKIP_TEST_CRED",
913-
"IGNORED_IN_CHECK_RUN",
914-
"FALSE_POSITIVE",
915-
"PUBLICLY_EXPOSED",
916-
"PUBLICLY_LEAKED",
917-
"REGRESSION",
918-
"SENSITIVE_FILE",
919-
"TEST_FILE",
920-
]
921-
IgnoreReason = Literal["test_credential", "false_positive", "low_risk"]
922-
OccurrenceKind = Literal["realtime", "historical"]
923-
OccurrencePresence = Literal["present", "removed"]
924-
Visibility = Literal["private", "internal", "public"]
906+
Presence = str
925907

926908

927909
@dataclass
@@ -1003,7 +985,7 @@ class Source(FromDictWithBase):
1003985
open_incidents_count: int
1004986
closed_incidents_count: int
1005987
secret_incidents_breakdown: SecretIncidentsBreakdown
1006-
visibility: Visibility
988+
visibility: str
1007989
external_id: str
1008990
source_criticality: SourceCriticality
1009991
last_scan: Optional[Scan]
@@ -1044,7 +1026,7 @@ class OccurrenceMatch(Base, FromDictMixin):
10441026
class SecretOccurrence(Base, FromDictMixin):
10451027
id: int
10461028
incident_id: int
1047-
kind: OccurrenceKind
1029+
kind: str
10481030
source: Source
10491031
author_name: str
10501032
author_info: str
@@ -1053,7 +1035,7 @@ class SecretOccurrence(Base, FromDictMixin):
10531035
matches: List[OccurrenceMatch]
10541036
tags: List[str]
10551037
sha: Optional[str] # Commit sha
1056-
presence: OccurrencePresence
1038+
presence: str
10571039
filepath: Optional[str]
10581040

10591041

@@ -1077,12 +1059,12 @@ class SecretIncident(Base, FromDictMixin):
10771059
hmsl_hash: str
10781060
gitguardian_url: str
10791061
regression: bool
1080-
status: IncidentStatus
1062+
status: str
10811063
assignee_id: Optional[int]
10821064
assignee_email: Optional[str]
10831065
occurrences_count: int
10841066
secret_presence: SecretPresence
1085-
ignore_reason: Optional[IgnoreReason]
1067+
ignore_reason: Optional[str]
10861068
triggered_at: Optional[datetime]
10871069
ignored_at: Optional[datetime]
10881070
ignorer_id: Optional[int]
@@ -1094,7 +1076,7 @@ class SecretIncident(Base, FromDictMixin):
10941076
validity: ValidityStatus
10951077
resolved_at: Optional[datetime]
10961078
share_url: Optional[str]
1097-
tags: List[Tag]
1079+
tags: List[str]
10981080
feedback_list: List[Feedback]
10991081
occurrences: Optional[List[SecretOccurrence]]
11001082

@@ -1480,7 +1462,7 @@ class TeamSourceParameters(PaginationParameter, SearchParameter, ToDictMixin):
14801462
health: Optional[SourceHealth] = None
14811463
type: Optional[str] = None
14821464
ordering: Optional[Literal["last_scan_date", "-last_scan_date"]] = None
1483-
visibility: Optional[Visibility] = None
1465+
visibility: Optional[str] = None
14841466
external_id: Optional[str] = None
14851467

14861468

0 commit comments

Comments
 (0)