aceapi-v2-client 2.0.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.
- aceapi_v2_client/__init__.py +8 -0
- aceapi_v2_client/api/__init__.py +1 -0
- aceapi_v2_client/api/alerts/__init__.py +1 -0
- aceapi_v2_client/api/alerts/bulk_add_observable_alerts_bulk_add_observable_post.py +174 -0
- aceapi_v2_client/api/alerts/download_alert_alerts_alert_uuid_download_get.py +167 -0
- aceapi_v2_client/api/alerts/view_alert_logs_alerts_alert_uuid_logs_get.py +200 -0
- aceapi_v2_client/api/authentication/__init__.py +1 -0
- aceapi_v2_client/api/authentication/login_for_access_token_auth_token_post.py +187 -0
- aceapi_v2_client/api/authentication/refresh_access_token_auth_refresh_post.py +182 -0
- aceapi_v2_client/api/common/__init__.py +1 -0
- aceapi_v2_client/api/common/ping_common_ping_get.py +128 -0
- aceapi_v2_client/api/common/supported_api_version_common_supported_api_version_get.py +128 -0
- aceapi_v2_client/api/common/valid_companies_common_valid_companies_get.py +128 -0
- aceapi_v2_client/api/common/valid_directives_common_valid_directives_get.py +130 -0
- aceapi_v2_client/api/common/valid_observables_common_valid_observables_get.py +130 -0
- aceapi_v2_client/api/events/__init__.py +1 -0
- aceapi_v2_client/api/events/export_events_events_export_get.py +192 -0
- aceapi_v2_client/api/events/open_events_events_open_get.py +128 -0
- aceapi_v2_client/api/events/update_event_status_events_event_id_patch.py +182 -0
- aceapi_v2_client/api/health/__init__.py +1 -0
- aceapi_v2_client/api/health/ping_health_ping_get.py +136 -0
- aceapi_v2_client/api/nodes/__init__.py +1 -0
- aceapi_v2_client/api/nodes/drain_node_nodes_node_id_drain_post.py +173 -0
- aceapi_v2_client/api/nodes/get_node_nodes_node_id_get.py +161 -0
- aceapi_v2_client/api/nodes/list_nodes_nodes_get.py +128 -0
- aceapi_v2_client/api/nodes/resume_node_nodes_node_id_resume_post.py +169 -0
- aceapi_v2_client/api/observables/__init__.py +1 -0
- aceapi_v2_client/api/observables/create_comment_observable_comments_post.py +166 -0
- aceapi_v2_client/api/observables/delete_comment_observable_comments_comment_id_delete.py +159 -0
- aceapi_v2_client/api/observables/list_comments_observable_comments_observable_id_get.py +163 -0
- aceapi_v2_client/api/observables/list_observable_types_observable_types_get.py +144 -0
- aceapi_v2_client/api/observables/set_interesting_observables_interesting_patch.py +191 -0
- aceapi_v2_client/api/observables/update_comment_observable_comments_comment_id_patch.py +182 -0
- aceapi_v2_client/api/threats/__init__.py +1 -0
- aceapi_v2_client/api/threats/create_threat_threats_post.py +166 -0
- aceapi_v2_client/api/threats/create_threat_type_threat_types_post.py +166 -0
- aceapi_v2_client/api/threats/delete_threat_threats_delete.py +179 -0
- aceapi_v2_client/api/threats/delete_threat_type_threat_types_threat_type_id_delete.py +159 -0
- aceapi_v2_client/api/threats/get_threat_type_threat_types_threat_type_id_get.py +161 -0
- aceapi_v2_client/api/threats/list_threat_types_threat_types_get.py +128 -0
- aceapi_v2_client/api/threats/list_threats_threats_get.py +171 -0
- aceapi_v2_client/api/threats/update_threat_type_threat_types_threat_type_id_patch.py +182 -0
- aceapi_v2_client/auth.py +56 -0
- aceapi_v2_client/client.py +282 -0
- aceapi_v2_client/errors.py +16 -0
- aceapi_v2_client/models/__init__.py +87 -0
- aceapi_v2_client/models/body_login_for_access_token_auth_token_post.py +140 -0
- aceapi_v2_client/models/bulk_add_observable_request.py +110 -0
- aceapi_v2_client/models/bulk_add_observable_result.py +107 -0
- aceapi_v2_client/models/bulk_add_observable_result_failed_details.py +47 -0
- aceapi_v2_client/models/collector_status_read.py +86 -0
- aceapi_v2_client/models/company_read.py +69 -0
- aceapi_v2_client/models/event_read.py +84 -0
- aceapi_v2_client/models/export_format.py +8 -0
- aceapi_v2_client/models/health_response.py +62 -0
- aceapi_v2_client/models/http_validation_error.py +79 -0
- aceapi_v2_client/models/list_response_company_read.py +75 -0
- aceapi_v2_client/models/list_response_event_read.py +75 -0
- aceapi_v2_client/models/list_response_named_description_read.py +75 -0
- aceapi_v2_client/models/list_response_node_read.py +75 -0
- aceapi_v2_client/models/list_response_observable_comment_read.py +75 -0
- aceapi_v2_client/models/list_response_observable_type_read.py +75 -0
- aceapi_v2_client/models/list_response_threat_read.py +75 -0
- aceapi_v2_client/models/list_response_threat_type_read.py +75 -0
- aceapi_v2_client/models/named_description_read.py +69 -0
- aceapi_v2_client/models/node_read.py +163 -0
- aceapi_v2_client/models/observable_comment_create.py +77 -0
- aceapi_v2_client/models/observable_comment_read.py +102 -0
- aceapi_v2_client/models/observable_comment_update.py +61 -0
- aceapi_v2_client/models/observable_type_read.py +62 -0
- aceapi_v2_client/models/ping_response.py +61 -0
- aceapi_v2_client/models/refresh_request.py +62 -0
- aceapi_v2_client/models/set_interesting_observables_interesting_patch_response_set_interesting_observables_interesting_patch.py +50 -0
- aceapi_v2_client/models/set_interesting_request.py +77 -0
- aceapi_v2_client/models/status_update.py +62 -0
- aceapi_v2_client/models/supported_api_version_response.py +61 -0
- aceapi_v2_client/models/threat_create.py +69 -0
- aceapi_v2_client/models/threat_read.py +77 -0
- aceapi_v2_client/models/threat_type_create.py +61 -0
- aceapi_v2_client/models/threat_type_read.py +69 -0
- aceapi_v2_client/models/threat_type_update.py +73 -0
- aceapi_v2_client/models/token.py +81 -0
- aceapi_v2_client/models/validation_error.py +123 -0
- aceapi_v2_client/models/validation_error_context.py +47 -0
- aceapi_v2_client/py.typed +0 -0
- aceapi_v2_client/types.py +54 -0
- aceapi_v2_client-2.0.0.dist-info/METADATA +192 -0
- aceapi_v2_client-2.0.0.dist-info/RECORD +90 -0
- aceapi_v2_client-2.0.0.dist-info/WHEEL +4 -0
- aceapi_v2_client-2.0.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ThreatCreate")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ThreatCreate:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
malware_id (int):
|
|
17
|
+
threat_type_id (int):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
malware_id: int
|
|
21
|
+
threat_type_id: int
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
malware_id = self.malware_id
|
|
26
|
+
|
|
27
|
+
threat_type_id = self.threat_type_id
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"malware_id": malware_id,
|
|
34
|
+
"threat_type_id": threat_type_id,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
malware_id = d.pop("malware_id")
|
|
44
|
+
|
|
45
|
+
threat_type_id = d.pop("threat_type_id")
|
|
46
|
+
|
|
47
|
+
threat_create = cls(
|
|
48
|
+
malware_id=malware_id,
|
|
49
|
+
threat_type_id=threat_type_id,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
threat_create.additional_properties = d
|
|
53
|
+
return threat_create
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ThreatRead")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ThreatRead:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
malware_id (int):
|
|
17
|
+
threat_type_id (int):
|
|
18
|
+
threat_type_name (str):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
malware_id: int
|
|
22
|
+
threat_type_id: int
|
|
23
|
+
threat_type_name: str
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
malware_id = self.malware_id
|
|
28
|
+
|
|
29
|
+
threat_type_id = self.threat_type_id
|
|
30
|
+
|
|
31
|
+
threat_type_name = self.threat_type_name
|
|
32
|
+
|
|
33
|
+
field_dict: dict[str, Any] = {}
|
|
34
|
+
field_dict.update(self.additional_properties)
|
|
35
|
+
field_dict.update(
|
|
36
|
+
{
|
|
37
|
+
"malware_id": malware_id,
|
|
38
|
+
"threat_type_id": threat_type_id,
|
|
39
|
+
"threat_type_name": threat_type_name,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
return field_dict
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
47
|
+
d = dict(src_dict)
|
|
48
|
+
malware_id = d.pop("malware_id")
|
|
49
|
+
|
|
50
|
+
threat_type_id = d.pop("threat_type_id")
|
|
51
|
+
|
|
52
|
+
threat_type_name = d.pop("threat_type_name")
|
|
53
|
+
|
|
54
|
+
threat_read = cls(
|
|
55
|
+
malware_id=malware_id,
|
|
56
|
+
threat_type_id=threat_type_id,
|
|
57
|
+
threat_type_name=threat_type_name,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
threat_read.additional_properties = d
|
|
61
|
+
return threat_read
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def additional_keys(self) -> list[str]:
|
|
65
|
+
return list(self.additional_properties.keys())
|
|
66
|
+
|
|
67
|
+
def __getitem__(self, key: str) -> Any:
|
|
68
|
+
return self.additional_properties[key]
|
|
69
|
+
|
|
70
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
71
|
+
self.additional_properties[key] = value
|
|
72
|
+
|
|
73
|
+
def __delitem__(self, key: str) -> None:
|
|
74
|
+
del self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __contains__(self, key: str) -> bool:
|
|
77
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ThreatTypeCreate")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ThreatTypeCreate:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
name (str):
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
name: str
|
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
name = self.name
|
|
24
|
+
|
|
25
|
+
field_dict: dict[str, Any] = {}
|
|
26
|
+
field_dict.update(self.additional_properties)
|
|
27
|
+
field_dict.update(
|
|
28
|
+
{
|
|
29
|
+
"name": name,
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
return field_dict
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
37
|
+
d = dict(src_dict)
|
|
38
|
+
name = d.pop("name")
|
|
39
|
+
|
|
40
|
+
threat_type_create = cls(
|
|
41
|
+
name=name,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
threat_type_create.additional_properties = d
|
|
45
|
+
return threat_type_create
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def additional_keys(self) -> list[str]:
|
|
49
|
+
return list(self.additional_properties.keys())
|
|
50
|
+
|
|
51
|
+
def __getitem__(self, key: str) -> Any:
|
|
52
|
+
return self.additional_properties[key]
|
|
53
|
+
|
|
54
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
55
|
+
self.additional_properties[key] = value
|
|
56
|
+
|
|
57
|
+
def __delitem__(self, key: str) -> None:
|
|
58
|
+
del self.additional_properties[key]
|
|
59
|
+
|
|
60
|
+
def __contains__(self, key: str) -> bool:
|
|
61
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ThreatTypeRead")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ThreatTypeRead:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
id (int):
|
|
17
|
+
name (str):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
id: int
|
|
21
|
+
name: str
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
id = self.id
|
|
26
|
+
|
|
27
|
+
name = self.name
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"id": id,
|
|
34
|
+
"name": name,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
id = d.pop("id")
|
|
44
|
+
|
|
45
|
+
name = d.pop("name")
|
|
46
|
+
|
|
47
|
+
threat_type_read = cls(
|
|
48
|
+
id=id,
|
|
49
|
+
name=name,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
threat_type_read.additional_properties = d
|
|
53
|
+
return threat_type_read
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
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
|
+
T = TypeVar("T", bound="ThreatTypeUpdate")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class ThreatTypeUpdate:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
name (None | str | Unset):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: None | str | Unset = UNSET
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
name: None | str | Unset
|
|
26
|
+
if isinstance(self.name, Unset):
|
|
27
|
+
name = UNSET
|
|
28
|
+
else:
|
|
29
|
+
name = self.name
|
|
30
|
+
|
|
31
|
+
field_dict: dict[str, Any] = {}
|
|
32
|
+
field_dict.update(self.additional_properties)
|
|
33
|
+
field_dict.update({})
|
|
34
|
+
if name is not UNSET:
|
|
35
|
+
field_dict["name"] = name
|
|
36
|
+
|
|
37
|
+
return field_dict
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
|
|
43
|
+
def _parse_name(data: object) -> None | str | Unset:
|
|
44
|
+
if data is None:
|
|
45
|
+
return data
|
|
46
|
+
if isinstance(data, Unset):
|
|
47
|
+
return data
|
|
48
|
+
return cast(None | str | Unset, data)
|
|
49
|
+
|
|
50
|
+
name = _parse_name(d.pop("name", UNSET))
|
|
51
|
+
|
|
52
|
+
threat_type_update = cls(
|
|
53
|
+
name=name,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
threat_type_update.additional_properties = d
|
|
57
|
+
return threat_type_update
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def additional_keys(self) -> list[str]:
|
|
61
|
+
return list(self.additional_properties.keys())
|
|
62
|
+
|
|
63
|
+
def __getitem__(self, key: str) -> Any:
|
|
64
|
+
return self.additional_properties[key]
|
|
65
|
+
|
|
66
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
67
|
+
self.additional_properties[key] = value
|
|
68
|
+
|
|
69
|
+
def __delitem__(self, key: str) -> None:
|
|
70
|
+
del self.additional_properties[key]
|
|
71
|
+
|
|
72
|
+
def __contains__(self, key: str) -> bool:
|
|
73
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
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
|
+
T = TypeVar("T", bound="Token")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class Token:
|
|
16
|
+
"""Response model for token endpoints.
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
access_token (str):
|
|
20
|
+
refresh_token (str):
|
|
21
|
+
token_type (str | Unset): Default: 'bearer'.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
access_token: str
|
|
25
|
+
refresh_token: str
|
|
26
|
+
token_type: str | Unset = "bearer"
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
|
30
|
+
access_token = self.access_token
|
|
31
|
+
|
|
32
|
+
refresh_token = self.refresh_token
|
|
33
|
+
|
|
34
|
+
token_type = self.token_type
|
|
35
|
+
|
|
36
|
+
field_dict: dict[str, Any] = {}
|
|
37
|
+
field_dict.update(self.additional_properties)
|
|
38
|
+
field_dict.update(
|
|
39
|
+
{
|
|
40
|
+
"access_token": access_token,
|
|
41
|
+
"refresh_token": refresh_token,
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
if token_type is not UNSET:
|
|
45
|
+
field_dict["token_type"] = token_type
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
access_token = d.pop("access_token")
|
|
53
|
+
|
|
54
|
+
refresh_token = d.pop("refresh_token")
|
|
55
|
+
|
|
56
|
+
token_type = d.pop("token_type", UNSET)
|
|
57
|
+
|
|
58
|
+
token = cls(
|
|
59
|
+
access_token=access_token,
|
|
60
|
+
refresh_token=refresh_token,
|
|
61
|
+
token_type=token_type,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
token.additional_properties = d
|
|
65
|
+
return token
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def additional_keys(self) -> list[str]:
|
|
69
|
+
return list(self.additional_properties.keys())
|
|
70
|
+
|
|
71
|
+
def __getitem__(self, key: str) -> Any:
|
|
72
|
+
return self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
75
|
+
self.additional_properties[key] = value
|
|
76
|
+
|
|
77
|
+
def __delitem__(self, key: str) -> None:
|
|
78
|
+
del self.additional_properties[key]
|
|
79
|
+
|
|
80
|
+
def __contains__(self, key: str) -> bool:
|
|
81
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
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
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.validation_error_context import ValidationErrorContext
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="ValidationError")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class ValidationError:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
loc (list[int | str]):
|
|
23
|
+
msg (str):
|
|
24
|
+
type_ (str):
|
|
25
|
+
input_ (Any | Unset):
|
|
26
|
+
ctx (ValidationErrorContext | Unset):
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
loc: list[int | str]
|
|
30
|
+
msg: str
|
|
31
|
+
type_: str
|
|
32
|
+
input_: Any | Unset = UNSET
|
|
33
|
+
ctx: ValidationErrorContext | Unset = UNSET
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
loc = []
|
|
38
|
+
for loc_item_data in self.loc:
|
|
39
|
+
loc_item: int | str
|
|
40
|
+
loc_item = loc_item_data
|
|
41
|
+
loc.append(loc_item)
|
|
42
|
+
|
|
43
|
+
msg = self.msg
|
|
44
|
+
|
|
45
|
+
type_ = self.type_
|
|
46
|
+
|
|
47
|
+
input_ = self.input_
|
|
48
|
+
|
|
49
|
+
ctx: dict[str, Any] | Unset = UNSET
|
|
50
|
+
if not isinstance(self.ctx, Unset):
|
|
51
|
+
ctx = self.ctx.to_dict()
|
|
52
|
+
|
|
53
|
+
field_dict: dict[str, Any] = {}
|
|
54
|
+
field_dict.update(self.additional_properties)
|
|
55
|
+
field_dict.update(
|
|
56
|
+
{
|
|
57
|
+
"loc": loc,
|
|
58
|
+
"msg": msg,
|
|
59
|
+
"type": type_,
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
if input_ is not UNSET:
|
|
63
|
+
field_dict["input"] = input_
|
|
64
|
+
if ctx is not UNSET:
|
|
65
|
+
field_dict["ctx"] = ctx
|
|
66
|
+
|
|
67
|
+
return field_dict
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
71
|
+
from ..models.validation_error_context import ValidationErrorContext
|
|
72
|
+
|
|
73
|
+
d = dict(src_dict)
|
|
74
|
+
loc = []
|
|
75
|
+
_loc = d.pop("loc")
|
|
76
|
+
for loc_item_data in _loc:
|
|
77
|
+
|
|
78
|
+
def _parse_loc_item(data: object) -> int | str:
|
|
79
|
+
return cast(int | str, data)
|
|
80
|
+
|
|
81
|
+
loc_item = _parse_loc_item(loc_item_data)
|
|
82
|
+
|
|
83
|
+
loc.append(loc_item)
|
|
84
|
+
|
|
85
|
+
msg = d.pop("msg")
|
|
86
|
+
|
|
87
|
+
type_ = d.pop("type")
|
|
88
|
+
|
|
89
|
+
input_ = d.pop("input", UNSET)
|
|
90
|
+
|
|
91
|
+
_ctx = d.pop("ctx", UNSET)
|
|
92
|
+
ctx: ValidationErrorContext | Unset
|
|
93
|
+
if isinstance(_ctx, Unset):
|
|
94
|
+
ctx = UNSET
|
|
95
|
+
else:
|
|
96
|
+
ctx = ValidationErrorContext.from_dict(_ctx)
|
|
97
|
+
|
|
98
|
+
validation_error = cls(
|
|
99
|
+
loc=loc,
|
|
100
|
+
msg=msg,
|
|
101
|
+
type_=type_,
|
|
102
|
+
input_=input_,
|
|
103
|
+
ctx=ctx,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
validation_error.additional_properties = d
|
|
107
|
+
return validation_error
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def additional_keys(self) -> list[str]:
|
|
111
|
+
return list(self.additional_properties.keys())
|
|
112
|
+
|
|
113
|
+
def __getitem__(self, key: str) -> Any:
|
|
114
|
+
return self.additional_properties[key]
|
|
115
|
+
|
|
116
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
117
|
+
self.additional_properties[key] = value
|
|
118
|
+
|
|
119
|
+
def __delitem__(self, key: str) -> None:
|
|
120
|
+
del self.additional_properties[key]
|
|
121
|
+
|
|
122
|
+
def __contains__(self, key: str) -> bool:
|
|
123
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ValidationErrorContext")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ValidationErrorContext:
|
|
14
|
+
""" """
|
|
15
|
+
|
|
16
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
17
|
+
|
|
18
|
+
def to_dict(self) -> dict[str, Any]:
|
|
19
|
+
|
|
20
|
+
field_dict: dict[str, Any] = {}
|
|
21
|
+
field_dict.update(self.additional_properties)
|
|
22
|
+
|
|
23
|
+
return field_dict
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
27
|
+
d = dict(src_dict)
|
|
28
|
+
validation_error_context = cls()
|
|
29
|
+
|
|
30
|
+
validation_error_context.additional_properties = d
|
|
31
|
+
return validation_error_context
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def additional_keys(self) -> list[str]:
|
|
35
|
+
return list(self.additional_properties.keys())
|
|
36
|
+
|
|
37
|
+
def __getitem__(self, key: str) -> Any:
|
|
38
|
+
return self.additional_properties[key]
|
|
39
|
+
|
|
40
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
41
|
+
self.additional_properties[key] = value
|
|
42
|
+
|
|
43
|
+
def __delitem__(self, key: str) -> None:
|
|
44
|
+
del self.additional_properties[key]
|
|
45
|
+
|
|
46
|
+
def __contains__(self, key: str) -> bool:
|
|
47
|
+
return key in self.additional_properties
|
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Contains some shared types for properties"""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping, MutableMapping
|
|
4
|
+
from http import HTTPStatus
|
|
5
|
+
from typing import IO, BinaryIO, Generic, Literal, TypeVar
|
|
6
|
+
|
|
7
|
+
from attrs import define
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Unset:
|
|
11
|
+
def __bool__(self) -> Literal[False]:
|
|
12
|
+
return False
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
UNSET: Unset = Unset()
|
|
16
|
+
|
|
17
|
+
# The types that `httpx.Client(files=)` can accept, copied from that library.
|
|
18
|
+
FileContent = IO[bytes] | bytes | str
|
|
19
|
+
FileTypes = (
|
|
20
|
+
# (filename, file (or bytes), content_type)
|
|
21
|
+
tuple[str | None, FileContent, str | None]
|
|
22
|
+
# (filename, file (or bytes), content_type, headers)
|
|
23
|
+
| tuple[str | None, FileContent, str | None, Mapping[str, str]]
|
|
24
|
+
)
|
|
25
|
+
RequestFiles = list[tuple[str, FileTypes]]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@define
|
|
29
|
+
class File:
|
|
30
|
+
"""Contains information for file uploads"""
|
|
31
|
+
|
|
32
|
+
payload: BinaryIO
|
|
33
|
+
file_name: str | None = None
|
|
34
|
+
mime_type: str | None = None
|
|
35
|
+
|
|
36
|
+
def to_tuple(self) -> FileTypes:
|
|
37
|
+
"""Return a tuple representation that httpx will accept for multipart/form-data"""
|
|
38
|
+
return self.file_name, self.payload, self.mime_type
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
T = TypeVar("T")
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@define
|
|
45
|
+
class Response(Generic[T]):
|
|
46
|
+
"""A response from an endpoint"""
|
|
47
|
+
|
|
48
|
+
status_code: HTTPStatus
|
|
49
|
+
content: bytes
|
|
50
|
+
headers: MutableMapping[str, str]
|
|
51
|
+
parsed: T | None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"]
|