kalir-python 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kalir/__init__.py +11 -0
- kalir/api/__init__.py +1 -0
- kalir/api/assets/__init__.py +1 -0
- kalir/api/assets/create_asset.py +193 -0
- kalir/api/assets/delete_asset.py +182 -0
- kalir/api/assets/get_asset.py +186 -0
- kalir/api/assets/list_assets.py +165 -0
- kalir/api/assets/update_asset.py +206 -0
- kalir/api/events/__init__.py +1 -0
- kalir/api/events/get_event.py +194 -0
- kalir/api/events/ingest_event.py +215 -0
- kalir/api/events/list_events.py +259 -0
- kalir/api/exposures/__init__.py +1 -0
- kalir/api/exposures/count_exposures.py +165 -0
- kalir/api/exposures/get_infostealer_summary.py +181 -0
- kalir/api/exposures/list_exposures.py +225 -0
- kalir/api/incidents/__init__.py +1 -0
- kalir/api/incidents/get_incident.py +194 -0
- kalir/api/incidents/list_incidents.py +265 -0
- kalir/api/incidents/update_incident_status.py +207 -0
- kalir/api/intel/__init__.py +1 -0
- kalir/api/intel/get_ransomware_stats.py +165 -0
- kalir/api/intel/list_ransomware_victims.py +165 -0
- kalir/api/mentions/__init__.py +1 -0
- kalir/api/mentions/list_mentions.py +283 -0
- kalir/api/overview/__init__.py +1 -0
- kalir/api/overview/get_overview.py +184 -0
- kalir/api/phishing/__init__.py +1 -0
- kalir/api/phishing/list_phishing.py +245 -0
- kalir/api/reports/__init__.py +1 -0
- kalir/api/reports/create_report.py +193 -0
- kalir/api/reports/download_report.py +186 -0
- kalir/api/reports/list_reports.py +165 -0
- kalir/api/rules/__init__.py +1 -0
- kalir/api/rules/create_rule.py +193 -0
- kalir/api/rules/delete_rule.py +183 -0
- kalir/api/rules/get_rule.py +187 -0
- kalir/api/rules/list_rules.py +165 -0
- kalir/api/rules/replace_rule.py +207 -0
- kalir/api/takedowns/__init__.py +1 -0
- kalir/api/takedowns/count_takedowns.py +165 -0
- kalir/api/takedowns/create_takedown.py +193 -0
- kalir/api/takedowns/delete_takedown.py +183 -0
- kalir/api/takedowns/get_takedown.py +187 -0
- kalir/api/takedowns/list_takedowns.py +165 -0
- kalir/api/takedowns/replace_takedown.py +210 -0
- kalir/api/takedowns/update_takedown.py +210 -0
- kalir/api/webhooks/__init__.py +1 -0
- kalir/api/webhooks/create_webhook.py +222 -0
- kalir/api/webhooks/delete_webhook.py +190 -0
- kalir/api/webhooks/get_webhook.py +194 -0
- kalir/api/webhooks/get_webhook_delivery.py +194 -0
- kalir/api/webhooks/list_webhook_deliveries.py +239 -0
- kalir/api/webhooks/list_webhook_event_types.py +165 -0
- kalir/api/webhooks/list_webhooks.py +172 -0
- kalir/api/webhooks/retry_webhook_delivery.py +190 -0
- kalir/api/webhooks/rotate_webhook_secret.py +202 -0
- kalir/api/webhooks/send_webhook_test.py +202 -0
- kalir/api/webhooks/update_webhook.py +229 -0
- kalir/client.py +271 -0
- kalir/errors.py +14 -0
- kalir/models/__init__.py +195 -0
- kalir/models/asset.py +162 -0
- kalir/models/asset_create.py +122 -0
- kalir/models/asset_create_asset_type.py +14 -0
- kalir/models/asset_create_metadata.py +64 -0
- kalir/models/count_exposures_response_200.py +78 -0
- kalir/models/count_takedowns_response_200.py +96 -0
- kalir/models/create_report_body.py +96 -0
- kalir/models/create_report_body_type.py +10 -0
- kalir/models/create_webhook_response_201.py +111 -0
- kalir/models/error.py +84 -0
- kalir/models/error_error.py +106 -0
- kalir/models/error_error_type.py +15 -0
- kalir/models/event.py +151 -0
- kalir/models/event_asset.py +87 -0
- kalir/models/event_ingest.py +146 -0
- kalir/models/event_ingest_asset.py +87 -0
- kalir/models/event_ingest_evidence.py +64 -0
- kalir/models/event_ingest_source.py +87 -0
- kalir/models/exposure.py +137 -0
- kalir/models/exposure_webhook_event.py +152 -0
- kalir/models/exposure_webhook_event_data.py +115 -0
- kalir/models/exposure_webhook_event_data_exposure.py +149 -0
- kalir/models/exposure_webhook_event_data_infection.py +136 -0
- kalir/models/exposure_webhook_event_type.py +8 -0
- kalir/models/get_incident_response_200.py +174 -0
- kalir/models/get_infostealer_summary_response_200.py +100 -0
- kalir/models/get_ransomware_stats_response_200.py +156 -0
- kalir/models/get_ransomware_stats_response_200_top_countries_7d_item.py +64 -0
- kalir/models/get_ransomware_stats_response_200_top_groups_7d_item.py +64 -0
- kalir/models/incident.py +170 -0
- kalir/models/incident_severity.py +10 -0
- kalir/models/incident_status.py +10 -0
- kalir/models/incident_webhook_event.py +152 -0
- kalir/models/incident_webhook_event_data.py +115 -0
- kalir/models/incident_webhook_event_data_previous.py +88 -0
- kalir/models/incident_webhook_event_type.py +9 -0
- kalir/models/infostealer_domain_summary.py +122 -0
- kalir/models/infostealer_domain_summary_snapshot.py +201 -0
- kalir/models/infostealer_domain_summary_snapshot_top_employee_urls_item.py +87 -0
- kalir/models/infostealer_domain_summary_snapshot_top_families_item.py +87 -0
- kalir/models/list_assets_response_200.py +100 -0
- kalir/models/list_events_response_200.py +109 -0
- kalir/models/list_exposures_response_200.py +127 -0
- kalir/models/list_incidents_bucket.py +10 -0
- kalir/models/list_incidents_response_200.py +149 -0
- kalir/models/list_incidents_response_200_counts.py +106 -0
- kalir/models/list_incidents_status.py +12 -0
- kalir/models/list_mentions_response_200.py +122 -0
- kalir/models/list_mentions_source.py +8 -0
- kalir/models/list_phishing_response_200.py +122 -0
- kalir/models/list_phishing_verdict.py +11 -0
- kalir/models/list_ransomware_victims_response_200.py +109 -0
- kalir/models/list_ransomware_victims_response_200_victims_item.py +64 -0
- kalir/models/list_reports_response_200.py +109 -0
- kalir/models/list_rules_response_200.py +100 -0
- kalir/models/list_takedowns_response_200.py +109 -0
- kalir/models/list_webhook_deliveries_response_200.py +122 -0
- kalir/models/list_webhook_event_types_response_200.py +100 -0
- kalir/models/list_webhook_event_types_response_200_data_item.py +87 -0
- kalir/models/list_webhooks_response_200.py +100 -0
- kalir/models/mention.py +194 -0
- kalir/models/mention_source.py +8 -0
- kalir/models/overview.py +231 -0
- kalir/models/overview_assets.py +96 -0
- kalir/models/overview_exposures.py +105 -0
- kalir/models/overview_incidents.py +114 -0
- kalir/models/overview_phishing.py +87 -0
- kalir/models/overview_risk_level.py +10 -0
- kalir/models/overview_takedowns.py +87 -0
- kalir/models/pagination.py +105 -0
- kalir/models/phishing_domain.py +186 -0
- kalir/models/phishing_domain_verdict.py +11 -0
- kalir/models/report.py +182 -0
- kalir/models/report_parameters.py +181 -0
- kalir/models/report_parameters_date_range.py +11 -0
- kalir/models/report_parameters_language.py +8 -0
- kalir/models/report_parameters_sections_item.py +15 -0
- kalir/models/report_status.py +10 -0
- kalir/models/rotate_webhook_secret_response_200.py +87 -0
- kalir/models/rule.py +174 -0
- kalir/models/rule_input.py +134 -0
- kalir/models/rule_input_actions_item.py +64 -0
- kalir/models/takedown.py +163 -0
- kalir/models/takedown_create.py +113 -0
- kalir/models/takedown_update.py +96 -0
- kalir/models/update_incident_status_body.py +90 -0
- kalir/models/update_incident_status_body_status.py +10 -0
- kalir/models/webhook_delivery.py +274 -0
- kalir/models/webhook_delivery_payload.py +64 -0
- kalir/models/webhook_delivery_status.py +9 -0
- kalir/models/webhook_endpoint.py +216 -0
- kalir/models/webhook_endpoint_input.py +124 -0
- kalir/models/webhook_endpoint_input_event_types_item.py +11 -0
- kalir/models/webhook_incident.py +232 -0
- kalir/models/webhook_incident_severity.py +10 -0
- kalir/py.typed +1 -0
- kalir/types.py +53 -0
- kalir/webhooks.py +63 -0
- kalir_python-0.1.0.dist-info/METADATA +76 -0
- kalir_python-0.1.0.dist-info/RECORD +163 -0
- kalir_python-0.1.0.dist-info/WHEEL +4 -0
kalir/models/incident.py
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..models.incident_severity import IncidentSeverity
|
|
12
|
+
from ..models.incident_status import IncidentStatus
|
|
13
|
+
from ..types import UNSET, Unset
|
|
14
|
+
from typing import cast
|
|
15
|
+
from uuid import UUID
|
|
16
|
+
import datetime
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
T = TypeVar("T", bound="Incident")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@_attrs_define
|
|
28
|
+
class Incident:
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
incident_id (UUID | Unset):
|
|
32
|
+
title (str | Unset):
|
|
33
|
+
status (IncidentStatus | Unset):
|
|
34
|
+
severity (IncidentSeverity | Unset):
|
|
35
|
+
signal_family (str | Unset):
|
|
36
|
+
created_at (datetime.datetime | Unset):
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
incident_id: UUID | Unset = UNSET
|
|
40
|
+
title: str | Unset = UNSET
|
|
41
|
+
status: IncidentStatus | Unset = UNSET
|
|
42
|
+
severity: IncidentSeverity | Unset = UNSET
|
|
43
|
+
signal_family: str | Unset = UNSET
|
|
44
|
+
created_at: datetime.datetime | Unset = UNSET
|
|
45
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def to_dict(self) -> dict[str, Any]:
|
|
52
|
+
incident_id: str | Unset = UNSET
|
|
53
|
+
if not isinstance(self.incident_id, Unset):
|
|
54
|
+
incident_id = str(self.incident_id)
|
|
55
|
+
|
|
56
|
+
title = self.title
|
|
57
|
+
|
|
58
|
+
status: str | Unset = UNSET
|
|
59
|
+
if not isinstance(self.status, Unset):
|
|
60
|
+
status = self.status.value
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
severity: str | Unset = UNSET
|
|
64
|
+
if not isinstance(self.severity, Unset):
|
|
65
|
+
severity = self.severity.value
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
signal_family = self.signal_family
|
|
69
|
+
|
|
70
|
+
created_at: str | Unset = UNSET
|
|
71
|
+
if not isinstance(self.created_at, Unset):
|
|
72
|
+
created_at = self.created_at.isoformat()
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
field_dict: dict[str, Any] = {}
|
|
76
|
+
field_dict.update(self.additional_properties)
|
|
77
|
+
field_dict.update({
|
|
78
|
+
})
|
|
79
|
+
if incident_id is not UNSET:
|
|
80
|
+
field_dict["incident_id"] = incident_id
|
|
81
|
+
if title is not UNSET:
|
|
82
|
+
field_dict["title"] = title
|
|
83
|
+
if status is not UNSET:
|
|
84
|
+
field_dict["status"] = status
|
|
85
|
+
if severity is not UNSET:
|
|
86
|
+
field_dict["severity"] = severity
|
|
87
|
+
if signal_family is not UNSET:
|
|
88
|
+
field_dict["signal_family"] = signal_family
|
|
89
|
+
if created_at is not UNSET:
|
|
90
|
+
field_dict["created_at"] = created_at
|
|
91
|
+
|
|
92
|
+
return field_dict
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
98
|
+
d = dict(src_dict)
|
|
99
|
+
_incident_id = d.pop("incident_id", UNSET)
|
|
100
|
+
incident_id: UUID | Unset
|
|
101
|
+
if isinstance(_incident_id, Unset):
|
|
102
|
+
incident_id = UNSET
|
|
103
|
+
else:
|
|
104
|
+
incident_id = UUID(_incident_id)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
title = d.pop("title", UNSET)
|
|
110
|
+
|
|
111
|
+
_status = d.pop("status", UNSET)
|
|
112
|
+
status: IncidentStatus | Unset
|
|
113
|
+
if isinstance(_status, Unset):
|
|
114
|
+
status = UNSET
|
|
115
|
+
else:
|
|
116
|
+
status = IncidentStatus(_status)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
_severity = d.pop("severity", UNSET)
|
|
122
|
+
severity: IncidentSeverity | Unset
|
|
123
|
+
if isinstance(_severity, Unset):
|
|
124
|
+
severity = UNSET
|
|
125
|
+
else:
|
|
126
|
+
severity = IncidentSeverity(_severity)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
signal_family = d.pop("signal_family", UNSET)
|
|
132
|
+
|
|
133
|
+
_created_at = d.pop("created_at", UNSET)
|
|
134
|
+
created_at: datetime.datetime | Unset
|
|
135
|
+
if isinstance(_created_at, Unset):
|
|
136
|
+
created_at = UNSET
|
|
137
|
+
else:
|
|
138
|
+
created_at = datetime.datetime.fromisoformat(_created_at)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
incident = cls(
|
|
144
|
+
incident_id=incident_id,
|
|
145
|
+
title=title,
|
|
146
|
+
status=status,
|
|
147
|
+
severity=severity,
|
|
148
|
+
signal_family=signal_family,
|
|
149
|
+
created_at=created_at,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
incident.additional_properties = d
|
|
154
|
+
return incident
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
def additional_keys(self) -> list[str]:
|
|
158
|
+
return list(self.additional_properties.keys())
|
|
159
|
+
|
|
160
|
+
def __getitem__(self, key: str) -> Any:
|
|
161
|
+
return self.additional_properties[key]
|
|
162
|
+
|
|
163
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
164
|
+
self.additional_properties[key] = value
|
|
165
|
+
|
|
166
|
+
def __delitem__(self, key: str) -> None:
|
|
167
|
+
del self.additional_properties[key]
|
|
168
|
+
|
|
169
|
+
def __contains__(self, key: str) -> bool:
|
|
170
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..models.incident_webhook_event_type import IncidentWebhookEventType
|
|
12
|
+
from ..types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
import datetime
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ..models.incident_webhook_event_data import IncidentWebhookEventData
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
T = TypeVar("T", bound="IncidentWebhookEvent")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@_attrs_define
|
|
28
|
+
class IncidentWebhookEvent:
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
id (str | Unset):
|
|
32
|
+
type_ (IncidentWebhookEventType | Unset):
|
|
33
|
+
api_version (str | Unset):
|
|
34
|
+
created_at (datetime.datetime | Unset):
|
|
35
|
+
data (IncidentWebhookEventData | Unset):
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
id: str | Unset = UNSET
|
|
39
|
+
type_: IncidentWebhookEventType | Unset = UNSET
|
|
40
|
+
api_version: str | Unset = UNSET
|
|
41
|
+
created_at: datetime.datetime | Unset = UNSET
|
|
42
|
+
data: IncidentWebhookEventData | Unset = UNSET
|
|
43
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_dict(self) -> dict[str, Any]:
|
|
50
|
+
from ..models.incident_webhook_event_data import IncidentWebhookEventData # noqa: PLC0415
|
|
51
|
+
id = self.id
|
|
52
|
+
|
|
53
|
+
type_: str | Unset = UNSET
|
|
54
|
+
if not isinstance(self.type_, Unset):
|
|
55
|
+
type_ = self.type_.value
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
api_version = self.api_version
|
|
59
|
+
|
|
60
|
+
created_at: str | Unset = UNSET
|
|
61
|
+
if not isinstance(self.created_at, Unset):
|
|
62
|
+
created_at = self.created_at.isoformat()
|
|
63
|
+
|
|
64
|
+
data: dict[str, Any] | Unset = UNSET
|
|
65
|
+
if not isinstance(self.data, Unset):
|
|
66
|
+
data = self.data.to_dict()
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
field_dict: dict[str, Any] = {}
|
|
70
|
+
field_dict.update(self.additional_properties)
|
|
71
|
+
field_dict.update({
|
|
72
|
+
})
|
|
73
|
+
if id is not UNSET:
|
|
74
|
+
field_dict["id"] = id
|
|
75
|
+
if type_ is not UNSET:
|
|
76
|
+
field_dict["type"] = type_
|
|
77
|
+
if api_version is not UNSET:
|
|
78
|
+
field_dict["api_version"] = api_version
|
|
79
|
+
if created_at is not UNSET:
|
|
80
|
+
field_dict["created_at"] = created_at
|
|
81
|
+
if data is not UNSET:
|
|
82
|
+
field_dict["data"] = data
|
|
83
|
+
|
|
84
|
+
return field_dict
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
90
|
+
from ..models.incident_webhook_event_data import IncidentWebhookEventData # noqa: PLC0415
|
|
91
|
+
d = dict(src_dict)
|
|
92
|
+
id = d.pop("id", UNSET)
|
|
93
|
+
|
|
94
|
+
_type_ = d.pop("type", UNSET)
|
|
95
|
+
type_: IncidentWebhookEventType | Unset
|
|
96
|
+
if isinstance(_type_, Unset):
|
|
97
|
+
type_ = UNSET
|
|
98
|
+
else:
|
|
99
|
+
type_ = IncidentWebhookEventType(_type_)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
api_version = d.pop("api_version", UNSET)
|
|
105
|
+
|
|
106
|
+
_created_at = d.pop("created_at", UNSET)
|
|
107
|
+
created_at: datetime.datetime | Unset
|
|
108
|
+
if isinstance(_created_at, Unset):
|
|
109
|
+
created_at = UNSET
|
|
110
|
+
else:
|
|
111
|
+
created_at = datetime.datetime.fromisoformat(_created_at)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
_data = d.pop("data", UNSET)
|
|
117
|
+
data: IncidentWebhookEventData | Unset
|
|
118
|
+
if isinstance(_data, Unset):
|
|
119
|
+
data = UNSET
|
|
120
|
+
else:
|
|
121
|
+
data = IncidentWebhookEventData.from_dict(_data)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
incident_webhook_event = cls(
|
|
127
|
+
id=id,
|
|
128
|
+
type_=type_,
|
|
129
|
+
api_version=api_version,
|
|
130
|
+
created_at=created_at,
|
|
131
|
+
data=data,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
incident_webhook_event.additional_properties = d
|
|
136
|
+
return incident_webhook_event
|
|
137
|
+
|
|
138
|
+
@property
|
|
139
|
+
def additional_keys(self) -> list[str]:
|
|
140
|
+
return list(self.additional_properties.keys())
|
|
141
|
+
|
|
142
|
+
def __getitem__(self, key: str) -> Any:
|
|
143
|
+
return self.additional_properties[key]
|
|
144
|
+
|
|
145
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
146
|
+
self.additional_properties[key] = value
|
|
147
|
+
|
|
148
|
+
def __delitem__(self, key: str) -> None:
|
|
149
|
+
del self.additional_properties[key]
|
|
150
|
+
|
|
151
|
+
def __contains__(self, key: str) -> bool:
|
|
152
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..types import UNSET, Unset
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.incident_webhook_event_data_previous import IncidentWebhookEventDataPrevious
|
|
16
|
+
from ..models.webhook_incident import WebhookIncident
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="IncidentWebhookEventData")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@_attrs_define
|
|
27
|
+
class IncidentWebhookEventData:
|
|
28
|
+
"""
|
|
29
|
+
Attributes:
|
|
30
|
+
incident (WebhookIncident | Unset):
|
|
31
|
+
previous (IncidentWebhookEventDataPrevious | Unset): Only on incident.updated.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
incident: WebhookIncident | Unset = UNSET
|
|
35
|
+
previous: IncidentWebhookEventDataPrevious | Unset = UNSET
|
|
36
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_dict(self) -> dict[str, Any]:
|
|
43
|
+
from ..models.incident_webhook_event_data_previous import IncidentWebhookEventDataPrevious # noqa: PLC0415
|
|
44
|
+
from ..models.webhook_incident import WebhookIncident # noqa: PLC0415
|
|
45
|
+
incident: dict[str, Any] | Unset = UNSET
|
|
46
|
+
if not isinstance(self.incident, Unset):
|
|
47
|
+
incident = self.incident.to_dict()
|
|
48
|
+
|
|
49
|
+
previous: dict[str, Any] | Unset = UNSET
|
|
50
|
+
if not isinstance(self.previous, Unset):
|
|
51
|
+
previous = self.previous.to_dict()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
field_dict: dict[str, Any] = {}
|
|
55
|
+
field_dict.update(self.additional_properties)
|
|
56
|
+
field_dict.update({
|
|
57
|
+
})
|
|
58
|
+
if incident is not UNSET:
|
|
59
|
+
field_dict["incident"] = incident
|
|
60
|
+
if previous is not UNSET:
|
|
61
|
+
field_dict["previous"] = previous
|
|
62
|
+
|
|
63
|
+
return field_dict
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
69
|
+
from ..models.incident_webhook_event_data_previous import IncidentWebhookEventDataPrevious # noqa: PLC0415
|
|
70
|
+
from ..models.webhook_incident import WebhookIncident # noqa: PLC0415
|
|
71
|
+
d = dict(src_dict)
|
|
72
|
+
_incident = d.pop("incident", UNSET)
|
|
73
|
+
incident: WebhookIncident | Unset
|
|
74
|
+
if isinstance(_incident, Unset):
|
|
75
|
+
incident = UNSET
|
|
76
|
+
else:
|
|
77
|
+
incident = WebhookIncident.from_dict(_incident)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
_previous = d.pop("previous", UNSET)
|
|
83
|
+
previous: IncidentWebhookEventDataPrevious | Unset
|
|
84
|
+
if isinstance(_previous, Unset):
|
|
85
|
+
previous = UNSET
|
|
86
|
+
else:
|
|
87
|
+
previous = IncidentWebhookEventDataPrevious.from_dict(_previous)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
incident_webhook_event_data = cls(
|
|
93
|
+
incident=incident,
|
|
94
|
+
previous=previous,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
incident_webhook_event_data.additional_properties = d
|
|
99
|
+
return incident_webhook_event_data
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def additional_keys(self) -> list[str]:
|
|
103
|
+
return list(self.additional_properties.keys())
|
|
104
|
+
|
|
105
|
+
def __getitem__(self, key: str) -> Any:
|
|
106
|
+
return self.additional_properties[key]
|
|
107
|
+
|
|
108
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
109
|
+
self.additional_properties[key] = value
|
|
110
|
+
|
|
111
|
+
def __delitem__(self, key: str) -> None:
|
|
112
|
+
del self.additional_properties[key]
|
|
113
|
+
|
|
114
|
+
def __contains__(self, key: str) -> bool:
|
|
115
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..types import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="IncidentWebhookEventDataPrevious")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class IncidentWebhookEventDataPrevious:
|
|
24
|
+
""" Only on incident.updated.
|
|
25
|
+
|
|
26
|
+
Attributes:
|
|
27
|
+
status (str | Unset):
|
|
28
|
+
severity (str | Unset):
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
status: str | Unset = UNSET
|
|
32
|
+
severity: str | Unset = UNSET
|
|
33
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_dict(self) -> dict[str, Any]:
|
|
40
|
+
status = self.status
|
|
41
|
+
|
|
42
|
+
severity = self.severity
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update({
|
|
48
|
+
})
|
|
49
|
+
if status is not UNSET:
|
|
50
|
+
field_dict["status"] = status
|
|
51
|
+
if severity is not UNSET:
|
|
52
|
+
field_dict["severity"] = severity
|
|
53
|
+
|
|
54
|
+
return field_dict
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
60
|
+
d = dict(src_dict)
|
|
61
|
+
status = d.pop("status", UNSET)
|
|
62
|
+
|
|
63
|
+
severity = d.pop("severity", UNSET)
|
|
64
|
+
|
|
65
|
+
incident_webhook_event_data_previous = cls(
|
|
66
|
+
status=status,
|
|
67
|
+
severity=severity,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
incident_webhook_event_data_previous.additional_properties = d
|
|
72
|
+
return incident_webhook_event_data_previous
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def additional_keys(self) -> list[str]:
|
|
76
|
+
return list(self.additional_properties.keys())
|
|
77
|
+
|
|
78
|
+
def __getitem__(self, key: str) -> Any:
|
|
79
|
+
return self.additional_properties[key]
|
|
80
|
+
|
|
81
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
82
|
+
self.additional_properties[key] = value
|
|
83
|
+
|
|
84
|
+
def __delitem__(self, key: str) -> None:
|
|
85
|
+
del self.additional_properties[key]
|
|
86
|
+
|
|
87
|
+
def __contains__(self, key: str) -> bool:
|
|
88
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..types import UNSET, Unset
|
|
12
|
+
from typing import cast
|
|
13
|
+
import datetime
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..models.infostealer_domain_summary_snapshot import InfostealerDomainSummarySnapshot
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="InfostealerDomainSummary")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@_attrs_define
|
|
27
|
+
class InfostealerDomainSummary:
|
|
28
|
+
"""
|
|
29
|
+
Attributes:
|
|
30
|
+
domain (str | Unset):
|
|
31
|
+
refreshed_at (datetime.datetime | Unset):
|
|
32
|
+
snapshot (InfostealerDomainSummarySnapshot | Unset):
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
domain: str | Unset = UNSET
|
|
36
|
+
refreshed_at: datetime.datetime | Unset = UNSET
|
|
37
|
+
snapshot: InfostealerDomainSummarySnapshot | Unset = UNSET
|
|
38
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_dict(self) -> dict[str, Any]:
|
|
45
|
+
from ..models.infostealer_domain_summary_snapshot import InfostealerDomainSummarySnapshot # noqa: PLC0415
|
|
46
|
+
domain = self.domain
|
|
47
|
+
|
|
48
|
+
refreshed_at: str | Unset = UNSET
|
|
49
|
+
if not isinstance(self.refreshed_at, Unset):
|
|
50
|
+
refreshed_at = self.refreshed_at.isoformat()
|
|
51
|
+
|
|
52
|
+
snapshot: dict[str, Any] | Unset = UNSET
|
|
53
|
+
if not isinstance(self.snapshot, Unset):
|
|
54
|
+
snapshot = self.snapshot.to_dict()
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
field_dict: dict[str, Any] = {}
|
|
58
|
+
field_dict.update(self.additional_properties)
|
|
59
|
+
field_dict.update({
|
|
60
|
+
})
|
|
61
|
+
if domain is not UNSET:
|
|
62
|
+
field_dict["domain"] = domain
|
|
63
|
+
if refreshed_at is not UNSET:
|
|
64
|
+
field_dict["refreshed_at"] = refreshed_at
|
|
65
|
+
if snapshot is not UNSET:
|
|
66
|
+
field_dict["snapshot"] = snapshot
|
|
67
|
+
|
|
68
|
+
return field_dict
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
74
|
+
from ..models.infostealer_domain_summary_snapshot import InfostealerDomainSummarySnapshot # noqa: PLC0415
|
|
75
|
+
d = dict(src_dict)
|
|
76
|
+
domain = d.pop("domain", UNSET)
|
|
77
|
+
|
|
78
|
+
_refreshed_at = d.pop("refreshed_at", UNSET)
|
|
79
|
+
refreshed_at: datetime.datetime | Unset
|
|
80
|
+
if isinstance(_refreshed_at, Unset):
|
|
81
|
+
refreshed_at = UNSET
|
|
82
|
+
else:
|
|
83
|
+
refreshed_at = datetime.datetime.fromisoformat(_refreshed_at)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
_snapshot = d.pop("snapshot", UNSET)
|
|
89
|
+
snapshot: InfostealerDomainSummarySnapshot | Unset
|
|
90
|
+
if isinstance(_snapshot, Unset):
|
|
91
|
+
snapshot = UNSET
|
|
92
|
+
else:
|
|
93
|
+
snapshot = InfostealerDomainSummarySnapshot.from_dict(_snapshot)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
infostealer_domain_summary = cls(
|
|
99
|
+
domain=domain,
|
|
100
|
+
refreshed_at=refreshed_at,
|
|
101
|
+
snapshot=snapshot,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
infostealer_domain_summary.additional_properties = d
|
|
106
|
+
return infostealer_domain_summary
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def additional_keys(self) -> list[str]:
|
|
110
|
+
return list(self.additional_properties.keys())
|
|
111
|
+
|
|
112
|
+
def __getitem__(self, key: str) -> Any:
|
|
113
|
+
return self.additional_properties[key]
|
|
114
|
+
|
|
115
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
116
|
+
self.additional_properties[key] = value
|
|
117
|
+
|
|
118
|
+
def __delitem__(self, key: str) -> None:
|
|
119
|
+
del self.additional_properties[key]
|
|
120
|
+
|
|
121
|
+
def __contains__(self, key: str) -> bool:
|
|
122
|
+
return key in self.additional_properties
|