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/report.py
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
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.report_status import ReportStatus
|
|
12
|
+
from ..types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
from uuid import UUID
|
|
15
|
+
import datetime
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from ..models.report_parameters import ReportParameters
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
T = TypeVar("T", bound="Report")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@_attrs_define
|
|
29
|
+
class Report:
|
|
30
|
+
"""
|
|
31
|
+
Attributes:
|
|
32
|
+
id (UUID | Unset):
|
|
33
|
+
type_ (str | Unset):
|
|
34
|
+
status (ReportStatus | Unset):
|
|
35
|
+
created_at (datetime.datetime | Unset):
|
|
36
|
+
completed_at (datetime.datetime | Unset):
|
|
37
|
+
parameters (ReportParameters | Unset):
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
id: UUID | Unset = UNSET
|
|
41
|
+
type_: str | Unset = UNSET
|
|
42
|
+
status: ReportStatus | Unset = UNSET
|
|
43
|
+
created_at: datetime.datetime | Unset = UNSET
|
|
44
|
+
completed_at: datetime.datetime | Unset = UNSET
|
|
45
|
+
parameters: ReportParameters | Unset = UNSET
|
|
46
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> dict[str, Any]:
|
|
53
|
+
from ..models.report_parameters import ReportParameters # noqa: PLC0415
|
|
54
|
+
id: str | Unset = UNSET
|
|
55
|
+
if not isinstance(self.id, Unset):
|
|
56
|
+
id = str(self.id)
|
|
57
|
+
|
|
58
|
+
type_ = self.type_
|
|
59
|
+
|
|
60
|
+
status: str | Unset = UNSET
|
|
61
|
+
if not isinstance(self.status, Unset):
|
|
62
|
+
status = self.status.value
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
created_at: str | Unset = UNSET
|
|
66
|
+
if not isinstance(self.created_at, Unset):
|
|
67
|
+
created_at = self.created_at.isoformat()
|
|
68
|
+
|
|
69
|
+
completed_at: str | Unset = UNSET
|
|
70
|
+
if not isinstance(self.completed_at, Unset):
|
|
71
|
+
completed_at = self.completed_at.isoformat()
|
|
72
|
+
|
|
73
|
+
parameters: dict[str, Any] | Unset = UNSET
|
|
74
|
+
if not isinstance(self.parameters, Unset):
|
|
75
|
+
parameters = self.parameters.to_dict()
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
field_dict: dict[str, Any] = {}
|
|
79
|
+
field_dict.update(self.additional_properties)
|
|
80
|
+
field_dict.update({
|
|
81
|
+
})
|
|
82
|
+
if id is not UNSET:
|
|
83
|
+
field_dict["id"] = id
|
|
84
|
+
if type_ is not UNSET:
|
|
85
|
+
field_dict["type"] = type_
|
|
86
|
+
if status is not UNSET:
|
|
87
|
+
field_dict["status"] = status
|
|
88
|
+
if created_at is not UNSET:
|
|
89
|
+
field_dict["created_at"] = created_at
|
|
90
|
+
if completed_at is not UNSET:
|
|
91
|
+
field_dict["completed_at"] = completed_at
|
|
92
|
+
if parameters is not UNSET:
|
|
93
|
+
field_dict["parameters"] = parameters
|
|
94
|
+
|
|
95
|
+
return field_dict
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
101
|
+
from ..models.report_parameters import ReportParameters # noqa: PLC0415
|
|
102
|
+
d = dict(src_dict)
|
|
103
|
+
_id = d.pop("id", UNSET)
|
|
104
|
+
id: UUID | Unset
|
|
105
|
+
if isinstance(_id, Unset):
|
|
106
|
+
id = UNSET
|
|
107
|
+
else:
|
|
108
|
+
id = UUID(_id)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
type_ = d.pop("type", UNSET)
|
|
114
|
+
|
|
115
|
+
_status = d.pop("status", UNSET)
|
|
116
|
+
status: ReportStatus | Unset
|
|
117
|
+
if isinstance(_status, Unset):
|
|
118
|
+
status = UNSET
|
|
119
|
+
else:
|
|
120
|
+
status = ReportStatus(_status)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
_created_at = d.pop("created_at", UNSET)
|
|
126
|
+
created_at: datetime.datetime | Unset
|
|
127
|
+
if isinstance(_created_at, Unset):
|
|
128
|
+
created_at = UNSET
|
|
129
|
+
else:
|
|
130
|
+
created_at = datetime.datetime.fromisoformat(_created_at)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
_completed_at = d.pop("completed_at", UNSET)
|
|
136
|
+
completed_at: datetime.datetime | Unset
|
|
137
|
+
if isinstance(_completed_at, Unset):
|
|
138
|
+
completed_at = UNSET
|
|
139
|
+
else:
|
|
140
|
+
completed_at = datetime.datetime.fromisoformat(_completed_at)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
_parameters = d.pop("parameters", UNSET)
|
|
146
|
+
parameters: ReportParameters | Unset
|
|
147
|
+
if isinstance(_parameters, Unset):
|
|
148
|
+
parameters = UNSET
|
|
149
|
+
else:
|
|
150
|
+
parameters = ReportParameters.from_dict(_parameters)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
report = cls(
|
|
156
|
+
id=id,
|
|
157
|
+
type_=type_,
|
|
158
|
+
status=status,
|
|
159
|
+
created_at=created_at,
|
|
160
|
+
completed_at=completed_at,
|
|
161
|
+
parameters=parameters,
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
report.additional_properties = d
|
|
166
|
+
return report
|
|
167
|
+
|
|
168
|
+
@property
|
|
169
|
+
def additional_keys(self) -> list[str]:
|
|
170
|
+
return list(self.additional_properties.keys())
|
|
171
|
+
|
|
172
|
+
def __getitem__(self, key: str) -> Any:
|
|
173
|
+
return self.additional_properties[key]
|
|
174
|
+
|
|
175
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
176
|
+
self.additional_properties[key] = value
|
|
177
|
+
|
|
178
|
+
def __delitem__(self, key: str) -> None:
|
|
179
|
+
del self.additional_properties[key]
|
|
180
|
+
|
|
181
|
+
def __contains__(self, key: str) -> bool:
|
|
182
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,181 @@
|
|
|
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.report_parameters_date_range import ReportParametersDateRange
|
|
12
|
+
from ..models.report_parameters_language import ReportParametersLanguage
|
|
13
|
+
from ..models.report_parameters_sections_item import ReportParametersSectionsItem
|
|
14
|
+
from ..types import UNSET, Unset
|
|
15
|
+
from typing import cast
|
|
16
|
+
import datetime
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
T = TypeVar("T", bound="ReportParameters")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@_attrs_define
|
|
28
|
+
class ReportParameters:
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
report_name (str):
|
|
32
|
+
sections (list[ReportParametersSectionsItem]):
|
|
33
|
+
date_range (ReportParametersDateRange | Unset):
|
|
34
|
+
date_from (datetime.datetime | Unset):
|
|
35
|
+
date_to (datetime.datetime | Unset):
|
|
36
|
+
language (ReportParametersLanguage | Unset):
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
report_name: str
|
|
40
|
+
sections: list[ReportParametersSectionsItem]
|
|
41
|
+
date_range: ReportParametersDateRange | Unset = UNSET
|
|
42
|
+
date_from: datetime.datetime | Unset = UNSET
|
|
43
|
+
date_to: datetime.datetime | Unset = UNSET
|
|
44
|
+
language: ReportParametersLanguage | 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
|
+
report_name = self.report_name
|
|
53
|
+
|
|
54
|
+
sections = []
|
|
55
|
+
for sections_item_data in self.sections:
|
|
56
|
+
sections_item = sections_item_data.value
|
|
57
|
+
sections.append(sections_item)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
date_range: str | Unset = UNSET
|
|
62
|
+
if not isinstance(self.date_range, Unset):
|
|
63
|
+
date_range = self.date_range.value
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
date_from: str | Unset = UNSET
|
|
67
|
+
if not isinstance(self.date_from, Unset):
|
|
68
|
+
date_from = self.date_from.isoformat()
|
|
69
|
+
|
|
70
|
+
date_to: str | Unset = UNSET
|
|
71
|
+
if not isinstance(self.date_to, Unset):
|
|
72
|
+
date_to = self.date_to.isoformat()
|
|
73
|
+
|
|
74
|
+
language: str | Unset = UNSET
|
|
75
|
+
if not isinstance(self.language, Unset):
|
|
76
|
+
language = self.language.value
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
field_dict: dict[str, Any] = {}
|
|
81
|
+
field_dict.update(self.additional_properties)
|
|
82
|
+
field_dict.update({
|
|
83
|
+
"report_name": report_name,
|
|
84
|
+
"sections": sections,
|
|
85
|
+
})
|
|
86
|
+
if date_range is not UNSET:
|
|
87
|
+
field_dict["date_range"] = date_range
|
|
88
|
+
if date_from is not UNSET:
|
|
89
|
+
field_dict["date_from"] = date_from
|
|
90
|
+
if date_to is not UNSET:
|
|
91
|
+
field_dict["date_to"] = date_to
|
|
92
|
+
if language is not UNSET:
|
|
93
|
+
field_dict["language"] = language
|
|
94
|
+
|
|
95
|
+
return field_dict
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
101
|
+
d = dict(src_dict)
|
|
102
|
+
report_name = d.pop("report_name")
|
|
103
|
+
|
|
104
|
+
sections = []
|
|
105
|
+
_sections = d.pop("sections")
|
|
106
|
+
for sections_item_data in (_sections):
|
|
107
|
+
sections_item = ReportParametersSectionsItem(sections_item_data)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
sections.append(sections_item)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
_date_range = d.pop("date_range", UNSET)
|
|
115
|
+
date_range: ReportParametersDateRange | Unset
|
|
116
|
+
if isinstance(_date_range, Unset):
|
|
117
|
+
date_range = UNSET
|
|
118
|
+
else:
|
|
119
|
+
date_range = ReportParametersDateRange(_date_range)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
_date_from = d.pop("date_from", UNSET)
|
|
125
|
+
date_from: datetime.datetime | Unset
|
|
126
|
+
if isinstance(_date_from, Unset):
|
|
127
|
+
date_from = UNSET
|
|
128
|
+
else:
|
|
129
|
+
date_from = datetime.datetime.fromisoformat(_date_from)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
_date_to = d.pop("date_to", UNSET)
|
|
135
|
+
date_to: datetime.datetime | Unset
|
|
136
|
+
if isinstance(_date_to, Unset):
|
|
137
|
+
date_to = UNSET
|
|
138
|
+
else:
|
|
139
|
+
date_to = datetime.datetime.fromisoformat(_date_to)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
_language = d.pop("language", UNSET)
|
|
145
|
+
language: ReportParametersLanguage | Unset
|
|
146
|
+
if isinstance(_language, Unset):
|
|
147
|
+
language = UNSET
|
|
148
|
+
else:
|
|
149
|
+
language = ReportParametersLanguage(_language)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
report_parameters = cls(
|
|
155
|
+
report_name=report_name,
|
|
156
|
+
sections=sections,
|
|
157
|
+
date_range=date_range,
|
|
158
|
+
date_from=date_from,
|
|
159
|
+
date_to=date_to,
|
|
160
|
+
language=language,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
report_parameters.additional_properties = d
|
|
165
|
+
return report_parameters
|
|
166
|
+
|
|
167
|
+
@property
|
|
168
|
+
def additional_keys(self) -> list[str]:
|
|
169
|
+
return list(self.additional_properties.keys())
|
|
170
|
+
|
|
171
|
+
def __getitem__(self, key: str) -> Any:
|
|
172
|
+
return self.additional_properties[key]
|
|
173
|
+
|
|
174
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
175
|
+
self.additional_properties[key] = value
|
|
176
|
+
|
|
177
|
+
def __delitem__(self, key: str) -> None:
|
|
178
|
+
del self.additional_properties[key]
|
|
179
|
+
|
|
180
|
+
def __contains__(self, key: str) -> bool:
|
|
181
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
|
|
3
|
+
class ReportParametersSectionsItem(StrEnum):
|
|
4
|
+
ASSETS = "assets"
|
|
5
|
+
ATTACK_SURFACE = "attack_surface"
|
|
6
|
+
CREDENTIALS = "credentials"
|
|
7
|
+
DARKWEB = "darkweb"
|
|
8
|
+
EXECUTIVE_SUMMARY = "executive_summary"
|
|
9
|
+
INCIDENTS = "incidents"
|
|
10
|
+
PERSONNEL = "personnel"
|
|
11
|
+
TAKEDOWNS = "takedowns"
|
|
12
|
+
TELEGRAM = "telegram"
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return str(self.value)
|
|
@@ -0,0 +1,87 @@
|
|
|
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="RotateWebhookSecretResponse200")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class RotateWebhookSecretResponse200:
|
|
24
|
+
"""
|
|
25
|
+
Attributes:
|
|
26
|
+
secret (str | Unset):
|
|
27
|
+
message (str | Unset):
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
secret: str | Unset = UNSET
|
|
31
|
+
message: str | Unset = UNSET
|
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def to_dict(self) -> dict[str, Any]:
|
|
39
|
+
secret = self.secret
|
|
40
|
+
|
|
41
|
+
message = self.message
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
field_dict: dict[str, Any] = {}
|
|
45
|
+
field_dict.update(self.additional_properties)
|
|
46
|
+
field_dict.update({
|
|
47
|
+
})
|
|
48
|
+
if secret is not UNSET:
|
|
49
|
+
field_dict["secret"] = secret
|
|
50
|
+
if message is not UNSET:
|
|
51
|
+
field_dict["message"] = message
|
|
52
|
+
|
|
53
|
+
return field_dict
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
59
|
+
d = dict(src_dict)
|
|
60
|
+
secret = d.pop("secret", UNSET)
|
|
61
|
+
|
|
62
|
+
message = d.pop("message", UNSET)
|
|
63
|
+
|
|
64
|
+
rotate_webhook_secret_response_200 = cls(
|
|
65
|
+
secret=secret,
|
|
66
|
+
message=message,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
rotate_webhook_secret_response_200.additional_properties = d
|
|
71
|
+
return rotate_webhook_secret_response_200
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def additional_keys(self) -> list[str]:
|
|
75
|
+
return list(self.additional_properties.keys())
|
|
76
|
+
|
|
77
|
+
def __getitem__(self, key: str) -> Any:
|
|
78
|
+
return self.additional_properties[key]
|
|
79
|
+
|
|
80
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
81
|
+
self.additional_properties[key] = value
|
|
82
|
+
|
|
83
|
+
def __delitem__(self, key: str) -> None:
|
|
84
|
+
del self.additional_properties[key]
|
|
85
|
+
|
|
86
|
+
def __contains__(self, key: str) -> bool:
|
|
87
|
+
return key in self.additional_properties
|
kalir/models/rule.py
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
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
|
+
from uuid import UUID
|
|
14
|
+
import datetime
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ..models.rule_input_actions_item import RuleInputActionsItem
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
T = TypeVar("T", bound="Rule")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@_attrs_define
|
|
28
|
+
class Rule:
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
name (str):
|
|
32
|
+
condition (str): CEL expression.
|
|
33
|
+
description (str | Unset):
|
|
34
|
+
actions (list[RuleInputActionsItem] | Unset):
|
|
35
|
+
enabled (bool | Unset): Default: True.
|
|
36
|
+
rule_id (UUID | Unset):
|
|
37
|
+
created_at (datetime.datetime | Unset):
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
name: str
|
|
41
|
+
condition: str
|
|
42
|
+
description: str | Unset = UNSET
|
|
43
|
+
actions: list[RuleInputActionsItem] | Unset = UNSET
|
|
44
|
+
enabled: bool | Unset = True
|
|
45
|
+
rule_id: UUID | Unset = UNSET
|
|
46
|
+
created_at: datetime.datetime | Unset = UNSET
|
|
47
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> dict[str, Any]:
|
|
54
|
+
from ..models.rule_input_actions_item import RuleInputActionsItem # noqa: PLC0415
|
|
55
|
+
name = self.name
|
|
56
|
+
|
|
57
|
+
condition = self.condition
|
|
58
|
+
|
|
59
|
+
description = self.description
|
|
60
|
+
|
|
61
|
+
actions: list[dict[str, Any]] | Unset = UNSET
|
|
62
|
+
if not isinstance(self.actions, Unset):
|
|
63
|
+
actions = []
|
|
64
|
+
for actions_item_data in self.actions:
|
|
65
|
+
actions_item = actions_item_data.to_dict()
|
|
66
|
+
actions.append(actions_item)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
enabled = self.enabled
|
|
71
|
+
|
|
72
|
+
rule_id: str | Unset = UNSET
|
|
73
|
+
if not isinstance(self.rule_id, Unset):
|
|
74
|
+
rule_id = str(self.rule_id)
|
|
75
|
+
|
|
76
|
+
created_at: str | Unset = UNSET
|
|
77
|
+
if not isinstance(self.created_at, Unset):
|
|
78
|
+
created_at = self.created_at.isoformat()
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
field_dict: dict[str, Any] = {}
|
|
82
|
+
field_dict.update(self.additional_properties)
|
|
83
|
+
field_dict.update({
|
|
84
|
+
"name": name,
|
|
85
|
+
"condition": condition,
|
|
86
|
+
})
|
|
87
|
+
if description is not UNSET:
|
|
88
|
+
field_dict["description"] = description
|
|
89
|
+
if actions is not UNSET:
|
|
90
|
+
field_dict["actions"] = actions
|
|
91
|
+
if enabled is not UNSET:
|
|
92
|
+
field_dict["enabled"] = enabled
|
|
93
|
+
if rule_id is not UNSET:
|
|
94
|
+
field_dict["rule_id"] = rule_id
|
|
95
|
+
if created_at is not UNSET:
|
|
96
|
+
field_dict["created_at"] = created_at
|
|
97
|
+
|
|
98
|
+
return field_dict
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
@classmethod
|
|
103
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
104
|
+
from ..models.rule_input_actions_item import RuleInputActionsItem # noqa: PLC0415
|
|
105
|
+
d = dict(src_dict)
|
|
106
|
+
name = d.pop("name")
|
|
107
|
+
|
|
108
|
+
condition = d.pop("condition")
|
|
109
|
+
|
|
110
|
+
description = d.pop("description", UNSET)
|
|
111
|
+
|
|
112
|
+
_actions = d.pop("actions", UNSET)
|
|
113
|
+
actions: list[RuleInputActionsItem] | Unset = UNSET
|
|
114
|
+
if _actions is not UNSET:
|
|
115
|
+
actions = []
|
|
116
|
+
for actions_item_data in _actions:
|
|
117
|
+
actions_item = RuleInputActionsItem.from_dict(actions_item_data)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
actions.append(actions_item)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
enabled = d.pop("enabled", UNSET)
|
|
125
|
+
|
|
126
|
+
_rule_id = d.pop("rule_id", UNSET)
|
|
127
|
+
rule_id: UUID | Unset
|
|
128
|
+
if isinstance(_rule_id, Unset):
|
|
129
|
+
rule_id = UNSET
|
|
130
|
+
else:
|
|
131
|
+
rule_id = UUID(_rule_id)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
_created_at = d.pop("created_at", UNSET)
|
|
137
|
+
created_at: datetime.datetime | Unset
|
|
138
|
+
if isinstance(_created_at, Unset):
|
|
139
|
+
created_at = UNSET
|
|
140
|
+
else:
|
|
141
|
+
created_at = datetime.datetime.fromisoformat(_created_at)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
rule = cls(
|
|
147
|
+
name=name,
|
|
148
|
+
condition=condition,
|
|
149
|
+
description=description,
|
|
150
|
+
actions=actions,
|
|
151
|
+
enabled=enabled,
|
|
152
|
+
rule_id=rule_id,
|
|
153
|
+
created_at=created_at,
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
rule.additional_properties = d
|
|
158
|
+
return rule
|
|
159
|
+
|
|
160
|
+
@property
|
|
161
|
+
def additional_keys(self) -> list[str]:
|
|
162
|
+
return list(self.additional_properties.keys())
|
|
163
|
+
|
|
164
|
+
def __getitem__(self, key: str) -> Any:
|
|
165
|
+
return self.additional_properties[key]
|
|
166
|
+
|
|
167
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
168
|
+
self.additional_properties[key] = value
|
|
169
|
+
|
|
170
|
+
def __delitem__(self, key: str) -> None:
|
|
171
|
+
del self.additional_properties[key]
|
|
172
|
+
|
|
173
|
+
def __contains__(self, key: str) -> bool:
|
|
174
|
+
return key in self.additional_properties
|