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
|
@@ -0,0 +1,96 @@
|
|
|
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="CountTakedownsResponse200")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class CountTakedownsResponse200:
|
|
24
|
+
"""
|
|
25
|
+
Attributes:
|
|
26
|
+
total (int | Unset):
|
|
27
|
+
active (int | Unset):
|
|
28
|
+
resolved (int | Unset):
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
total: int | Unset = UNSET
|
|
32
|
+
active: int | Unset = UNSET
|
|
33
|
+
resolved: int | Unset = UNSET
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_dict(self) -> dict[str, Any]:
|
|
41
|
+
total = self.total
|
|
42
|
+
|
|
43
|
+
active = self.active
|
|
44
|
+
|
|
45
|
+
resolved = self.resolved
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
field_dict: dict[str, Any] = {}
|
|
49
|
+
field_dict.update(self.additional_properties)
|
|
50
|
+
field_dict.update({
|
|
51
|
+
})
|
|
52
|
+
if total is not UNSET:
|
|
53
|
+
field_dict["total"] = total
|
|
54
|
+
if active is not UNSET:
|
|
55
|
+
field_dict["active"] = active
|
|
56
|
+
if resolved is not UNSET:
|
|
57
|
+
field_dict["resolved"] = resolved
|
|
58
|
+
|
|
59
|
+
return field_dict
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
65
|
+
d = dict(src_dict)
|
|
66
|
+
total = d.pop("total", UNSET)
|
|
67
|
+
|
|
68
|
+
active = d.pop("active", UNSET)
|
|
69
|
+
|
|
70
|
+
resolved = d.pop("resolved", UNSET)
|
|
71
|
+
|
|
72
|
+
count_takedowns_response_200 = cls(
|
|
73
|
+
total=total,
|
|
74
|
+
active=active,
|
|
75
|
+
resolved=resolved,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
count_takedowns_response_200.additional_properties = d
|
|
80
|
+
return count_takedowns_response_200
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def additional_keys(self) -> list[str]:
|
|
84
|
+
return list(self.additional_properties.keys())
|
|
85
|
+
|
|
86
|
+
def __getitem__(self, key: str) -> Any:
|
|
87
|
+
return self.additional_properties[key]
|
|
88
|
+
|
|
89
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
90
|
+
self.additional_properties[key] = value
|
|
91
|
+
|
|
92
|
+
def __delitem__(self, key: str) -> None:
|
|
93
|
+
del self.additional_properties[key]
|
|
94
|
+
|
|
95
|
+
def __contains__(self, key: str) -> bool:
|
|
96
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,96 @@
|
|
|
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.create_report_body_type import CreateReportBodyType
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.report_parameters import ReportParameters
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="CreateReportBody")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class CreateReportBody:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
type_ (CreateReportBodyType):
|
|
30
|
+
parameters (ReportParameters):
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
type_: CreateReportBodyType
|
|
34
|
+
parameters: ReportParameters
|
|
35
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_dict(self) -> dict[str, Any]:
|
|
42
|
+
from ..models.report_parameters import ReportParameters # noqa: PLC0415
|
|
43
|
+
type_ = self.type_.value
|
|
44
|
+
|
|
45
|
+
parameters = self.parameters.to_dict()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
field_dict: dict[str, Any] = {}
|
|
49
|
+
field_dict.update(self.additional_properties)
|
|
50
|
+
field_dict.update({
|
|
51
|
+
"type": type_,
|
|
52
|
+
"parameters": parameters,
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
return field_dict
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
61
|
+
from ..models.report_parameters import ReportParameters # noqa: PLC0415
|
|
62
|
+
d = dict(src_dict)
|
|
63
|
+
type_ = CreateReportBodyType(d.pop("type"))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
parameters = ReportParameters.from_dict(d.pop("parameters"))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
create_report_body = cls(
|
|
74
|
+
type_=type_,
|
|
75
|
+
parameters=parameters,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
create_report_body.additional_properties = d
|
|
80
|
+
return create_report_body
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def additional_keys(self) -> list[str]:
|
|
84
|
+
return list(self.additional_properties.keys())
|
|
85
|
+
|
|
86
|
+
def __getitem__(self, key: str) -> Any:
|
|
87
|
+
return self.additional_properties[key]
|
|
88
|
+
|
|
89
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
90
|
+
self.additional_properties[key] = value
|
|
91
|
+
|
|
92
|
+
def __delitem__(self, key: str) -> None:
|
|
93
|
+
del self.additional_properties[key]
|
|
94
|
+
|
|
95
|
+
def __contains__(self, key: str) -> bool:
|
|
96
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
|
|
3
|
+
class CreateReportBodyType(StrEnum):
|
|
4
|
+
ASSET_STATUS = "asset_status"
|
|
5
|
+
EXECUTIVE_SUMMARY = "executive_summary"
|
|
6
|
+
EXPOSURE_DIGITAL = "exposure_digital"
|
|
7
|
+
INCIDENTS_DETAIL = "incidents_detail"
|
|
8
|
+
|
|
9
|
+
def __str__(self) -> str:
|
|
10
|
+
return str(self.value)
|
|
@@ -0,0 +1,111 @@
|
|
|
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.webhook_endpoint import WebhookEndpoint
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="CreateWebhookResponse201")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class CreateWebhookResponse201:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
endpoint (WebhookEndpoint | Unset):
|
|
30
|
+
secret (str | Unset): Example: whsec_4f1c….
|
|
31
|
+
message (str | Unset):
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
endpoint: WebhookEndpoint | Unset = UNSET
|
|
35
|
+
secret: str | Unset = UNSET
|
|
36
|
+
message: str | Unset = UNSET
|
|
37
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
|
44
|
+
from ..models.webhook_endpoint import WebhookEndpoint # noqa: PLC0415
|
|
45
|
+
endpoint: dict[str, Any] | Unset = UNSET
|
|
46
|
+
if not isinstance(self.endpoint, Unset):
|
|
47
|
+
endpoint = self.endpoint.to_dict()
|
|
48
|
+
|
|
49
|
+
secret = self.secret
|
|
50
|
+
|
|
51
|
+
message = self.message
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
field_dict: dict[str, Any] = {}
|
|
55
|
+
field_dict.update(self.additional_properties)
|
|
56
|
+
field_dict.update({
|
|
57
|
+
})
|
|
58
|
+
if endpoint is not UNSET:
|
|
59
|
+
field_dict["endpoint"] = endpoint
|
|
60
|
+
if secret is not UNSET:
|
|
61
|
+
field_dict["secret"] = secret
|
|
62
|
+
if message is not UNSET:
|
|
63
|
+
field_dict["message"] = message
|
|
64
|
+
|
|
65
|
+
return field_dict
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
71
|
+
from ..models.webhook_endpoint import WebhookEndpoint # noqa: PLC0415
|
|
72
|
+
d = dict(src_dict)
|
|
73
|
+
_endpoint = d.pop("endpoint", UNSET)
|
|
74
|
+
endpoint: WebhookEndpoint | Unset
|
|
75
|
+
if isinstance(_endpoint, Unset):
|
|
76
|
+
endpoint = UNSET
|
|
77
|
+
else:
|
|
78
|
+
endpoint = WebhookEndpoint.from_dict(_endpoint)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
secret = d.pop("secret", UNSET)
|
|
84
|
+
|
|
85
|
+
message = d.pop("message", UNSET)
|
|
86
|
+
|
|
87
|
+
create_webhook_response_201 = cls(
|
|
88
|
+
endpoint=endpoint,
|
|
89
|
+
secret=secret,
|
|
90
|
+
message=message,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
create_webhook_response_201.additional_properties = d
|
|
95
|
+
return create_webhook_response_201
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
def additional_keys(self) -> list[str]:
|
|
99
|
+
return list(self.additional_properties.keys())
|
|
100
|
+
|
|
101
|
+
def __getitem__(self, key: str) -> Any:
|
|
102
|
+
return self.additional_properties[key]
|
|
103
|
+
|
|
104
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
105
|
+
self.additional_properties[key] = value
|
|
106
|
+
|
|
107
|
+
def __delitem__(self, key: str) -> None:
|
|
108
|
+
del self.additional_properties[key]
|
|
109
|
+
|
|
110
|
+
def __contains__(self, key: str) -> bool:
|
|
111
|
+
return key in self.additional_properties
|
kalir/models/error.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
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 typing import cast
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from ..models.error_error import ErrorError
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
T = TypeVar("T", bound="Error")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class Error:
|
|
26
|
+
"""
|
|
27
|
+
Attributes:
|
|
28
|
+
error (ErrorError):
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
error: ErrorError
|
|
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
|
+
from ..models.error_error import ErrorError # noqa: PLC0415
|
|
40
|
+
error = self.error.to_dict()
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
field_dict: dict[str, Any] = {}
|
|
44
|
+
field_dict.update(self.additional_properties)
|
|
45
|
+
field_dict.update({
|
|
46
|
+
"error": error,
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
return field_dict
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
55
|
+
from ..models.error_error import ErrorError # noqa: PLC0415
|
|
56
|
+
d = dict(src_dict)
|
|
57
|
+
error = ErrorError.from_dict(d.pop("error"))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
error = cls(
|
|
63
|
+
error=error,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
error.additional_properties = d
|
|
68
|
+
return error
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def additional_keys(self) -> list[str]:
|
|
72
|
+
return list(self.additional_properties.keys())
|
|
73
|
+
|
|
74
|
+
def __getitem__(self, key: str) -> Any:
|
|
75
|
+
return self.additional_properties[key]
|
|
76
|
+
|
|
77
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
78
|
+
self.additional_properties[key] = value
|
|
79
|
+
|
|
80
|
+
def __delitem__(self, key: str) -> None:
|
|
81
|
+
del self.additional_properties[key]
|
|
82
|
+
|
|
83
|
+
def __contains__(self, key: str) -> bool:
|
|
84
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,106 @@
|
|
|
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.error_error_type import ErrorErrorType
|
|
12
|
+
from ..types import UNSET, Unset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="ErrorError")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class ErrorError:
|
|
25
|
+
"""
|
|
26
|
+
Attributes:
|
|
27
|
+
type_ (ErrorErrorType):
|
|
28
|
+
message (str): Human-readable explanation.
|
|
29
|
+
status (int): HTTP status code.
|
|
30
|
+
retry_after (int | Unset): Seconds to wait (rate_limit_error only).
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
type_: ErrorErrorType
|
|
34
|
+
message: str
|
|
35
|
+
status: int
|
|
36
|
+
retry_after: int | Unset = UNSET
|
|
37
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
|
44
|
+
type_ = self.type_.value
|
|
45
|
+
|
|
46
|
+
message = self.message
|
|
47
|
+
|
|
48
|
+
status = self.status
|
|
49
|
+
|
|
50
|
+
retry_after = self.retry_after
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
field_dict: dict[str, Any] = {}
|
|
54
|
+
field_dict.update(self.additional_properties)
|
|
55
|
+
field_dict.update({
|
|
56
|
+
"type": type_,
|
|
57
|
+
"message": message,
|
|
58
|
+
"status": status,
|
|
59
|
+
})
|
|
60
|
+
if retry_after is not UNSET:
|
|
61
|
+
field_dict["retry_after"] = retry_after
|
|
62
|
+
|
|
63
|
+
return field_dict
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
69
|
+
d = dict(src_dict)
|
|
70
|
+
type_ = ErrorErrorType(d.pop("type"))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
message = d.pop("message")
|
|
76
|
+
|
|
77
|
+
status = d.pop("status")
|
|
78
|
+
|
|
79
|
+
retry_after = d.pop("retry_after", UNSET)
|
|
80
|
+
|
|
81
|
+
error_error = cls(
|
|
82
|
+
type_=type_,
|
|
83
|
+
message=message,
|
|
84
|
+
status=status,
|
|
85
|
+
retry_after=retry_after,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
error_error.additional_properties = d
|
|
90
|
+
return error_error
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def additional_keys(self) -> list[str]:
|
|
94
|
+
return list(self.additional_properties.keys())
|
|
95
|
+
|
|
96
|
+
def __getitem__(self, key: str) -> Any:
|
|
97
|
+
return self.additional_properties[key]
|
|
98
|
+
|
|
99
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
100
|
+
self.additional_properties[key] = value
|
|
101
|
+
|
|
102
|
+
def __delitem__(self, key: str) -> None:
|
|
103
|
+
del self.additional_properties[key]
|
|
104
|
+
|
|
105
|
+
def __contains__(self, key: str) -> bool:
|
|
106
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
|
|
3
|
+
class ErrorErrorType(StrEnum):
|
|
4
|
+
API_ERROR = "api_error"
|
|
5
|
+
AUTHENTICATION_ERROR = "authentication_error"
|
|
6
|
+
CONFLICT_ERROR = "conflict_error"
|
|
7
|
+
INVALID_REQUEST_ERROR = "invalid_request_error"
|
|
8
|
+
METHOD_NOT_ALLOWED_ERROR = "method_not_allowed_error"
|
|
9
|
+
NOT_FOUND_ERROR = "not_found_error"
|
|
10
|
+
PERMISSION_ERROR = "permission_error"
|
|
11
|
+
PLAN_LIMIT_ERROR = "plan_limit_error"
|
|
12
|
+
RATE_LIMIT_ERROR = "rate_limit_error"
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return str(self.value)
|
kalir/models/event.py
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
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.event_asset import EventAsset
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
T = TypeVar("T", bound="Event")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@_attrs_define
|
|
28
|
+
class Event:
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
event_id (UUID | Unset):
|
|
32
|
+
signal_type (str | Unset):
|
|
33
|
+
asset (EventAsset | Unset):
|
|
34
|
+
confidence (float | Unset):
|
|
35
|
+
received_at (datetime.datetime | Unset):
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
event_id: UUID | Unset = UNSET
|
|
39
|
+
signal_type: str | Unset = UNSET
|
|
40
|
+
asset: EventAsset | Unset = UNSET
|
|
41
|
+
confidence: float | Unset = UNSET
|
|
42
|
+
received_at: datetime.datetime | 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.event_asset import EventAsset # noqa: PLC0415
|
|
51
|
+
event_id: str | Unset = UNSET
|
|
52
|
+
if not isinstance(self.event_id, Unset):
|
|
53
|
+
event_id = str(self.event_id)
|
|
54
|
+
|
|
55
|
+
signal_type = self.signal_type
|
|
56
|
+
|
|
57
|
+
asset: dict[str, Any] | Unset = UNSET
|
|
58
|
+
if not isinstance(self.asset, Unset):
|
|
59
|
+
asset = self.asset.to_dict()
|
|
60
|
+
|
|
61
|
+
confidence = self.confidence
|
|
62
|
+
|
|
63
|
+
received_at: str | Unset = UNSET
|
|
64
|
+
if not isinstance(self.received_at, Unset):
|
|
65
|
+
received_at = self.received_at.isoformat()
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
field_dict: dict[str, Any] = {}
|
|
69
|
+
field_dict.update(self.additional_properties)
|
|
70
|
+
field_dict.update({
|
|
71
|
+
})
|
|
72
|
+
if event_id is not UNSET:
|
|
73
|
+
field_dict["event_id"] = event_id
|
|
74
|
+
if signal_type is not UNSET:
|
|
75
|
+
field_dict["signal_type"] = signal_type
|
|
76
|
+
if asset is not UNSET:
|
|
77
|
+
field_dict["asset"] = asset
|
|
78
|
+
if confidence is not UNSET:
|
|
79
|
+
field_dict["confidence"] = confidence
|
|
80
|
+
if received_at is not UNSET:
|
|
81
|
+
field_dict["received_at"] = received_at
|
|
82
|
+
|
|
83
|
+
return field_dict
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
89
|
+
from ..models.event_asset import EventAsset # noqa: PLC0415
|
|
90
|
+
d = dict(src_dict)
|
|
91
|
+
_event_id = d.pop("event_id", UNSET)
|
|
92
|
+
event_id: UUID | Unset
|
|
93
|
+
if isinstance(_event_id, Unset):
|
|
94
|
+
event_id = UNSET
|
|
95
|
+
else:
|
|
96
|
+
event_id = UUID(_event_id)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
signal_type = d.pop("signal_type", UNSET)
|
|
102
|
+
|
|
103
|
+
_asset = d.pop("asset", UNSET)
|
|
104
|
+
asset: EventAsset | Unset
|
|
105
|
+
if isinstance(_asset, Unset):
|
|
106
|
+
asset = UNSET
|
|
107
|
+
else:
|
|
108
|
+
asset = EventAsset.from_dict(_asset)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
confidence = d.pop("confidence", UNSET)
|
|
114
|
+
|
|
115
|
+
_received_at = d.pop("received_at", UNSET)
|
|
116
|
+
received_at: datetime.datetime | Unset
|
|
117
|
+
if isinstance(_received_at, Unset):
|
|
118
|
+
received_at = UNSET
|
|
119
|
+
else:
|
|
120
|
+
received_at = datetime.datetime.fromisoformat(_received_at)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
event = cls(
|
|
126
|
+
event_id=event_id,
|
|
127
|
+
signal_type=signal_type,
|
|
128
|
+
asset=asset,
|
|
129
|
+
confidence=confidence,
|
|
130
|
+
received_at=received_at,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
event.additional_properties = d
|
|
135
|
+
return event
|
|
136
|
+
|
|
137
|
+
@property
|
|
138
|
+
def additional_keys(self) -> list[str]:
|
|
139
|
+
return list(self.additional_properties.keys())
|
|
140
|
+
|
|
141
|
+
def __getitem__(self, key: str) -> Any:
|
|
142
|
+
return self.additional_properties[key]
|
|
143
|
+
|
|
144
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
145
|
+
self.additional_properties[key] = value
|
|
146
|
+
|
|
147
|
+
def __delitem__(self, key: str) -> None:
|
|
148
|
+
del self.additional_properties[key]
|
|
149
|
+
|
|
150
|
+
def __contains__(self, key: str) -> bool:
|
|
151
|
+
return key in self.additional_properties
|