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.
Files changed (90) hide show
  1. aceapi_v2_client/__init__.py +8 -0
  2. aceapi_v2_client/api/__init__.py +1 -0
  3. aceapi_v2_client/api/alerts/__init__.py +1 -0
  4. aceapi_v2_client/api/alerts/bulk_add_observable_alerts_bulk_add_observable_post.py +174 -0
  5. aceapi_v2_client/api/alerts/download_alert_alerts_alert_uuid_download_get.py +167 -0
  6. aceapi_v2_client/api/alerts/view_alert_logs_alerts_alert_uuid_logs_get.py +200 -0
  7. aceapi_v2_client/api/authentication/__init__.py +1 -0
  8. aceapi_v2_client/api/authentication/login_for_access_token_auth_token_post.py +187 -0
  9. aceapi_v2_client/api/authentication/refresh_access_token_auth_refresh_post.py +182 -0
  10. aceapi_v2_client/api/common/__init__.py +1 -0
  11. aceapi_v2_client/api/common/ping_common_ping_get.py +128 -0
  12. aceapi_v2_client/api/common/supported_api_version_common_supported_api_version_get.py +128 -0
  13. aceapi_v2_client/api/common/valid_companies_common_valid_companies_get.py +128 -0
  14. aceapi_v2_client/api/common/valid_directives_common_valid_directives_get.py +130 -0
  15. aceapi_v2_client/api/common/valid_observables_common_valid_observables_get.py +130 -0
  16. aceapi_v2_client/api/events/__init__.py +1 -0
  17. aceapi_v2_client/api/events/export_events_events_export_get.py +192 -0
  18. aceapi_v2_client/api/events/open_events_events_open_get.py +128 -0
  19. aceapi_v2_client/api/events/update_event_status_events_event_id_patch.py +182 -0
  20. aceapi_v2_client/api/health/__init__.py +1 -0
  21. aceapi_v2_client/api/health/ping_health_ping_get.py +136 -0
  22. aceapi_v2_client/api/nodes/__init__.py +1 -0
  23. aceapi_v2_client/api/nodes/drain_node_nodes_node_id_drain_post.py +173 -0
  24. aceapi_v2_client/api/nodes/get_node_nodes_node_id_get.py +161 -0
  25. aceapi_v2_client/api/nodes/list_nodes_nodes_get.py +128 -0
  26. aceapi_v2_client/api/nodes/resume_node_nodes_node_id_resume_post.py +169 -0
  27. aceapi_v2_client/api/observables/__init__.py +1 -0
  28. aceapi_v2_client/api/observables/create_comment_observable_comments_post.py +166 -0
  29. aceapi_v2_client/api/observables/delete_comment_observable_comments_comment_id_delete.py +159 -0
  30. aceapi_v2_client/api/observables/list_comments_observable_comments_observable_id_get.py +163 -0
  31. aceapi_v2_client/api/observables/list_observable_types_observable_types_get.py +144 -0
  32. aceapi_v2_client/api/observables/set_interesting_observables_interesting_patch.py +191 -0
  33. aceapi_v2_client/api/observables/update_comment_observable_comments_comment_id_patch.py +182 -0
  34. aceapi_v2_client/api/threats/__init__.py +1 -0
  35. aceapi_v2_client/api/threats/create_threat_threats_post.py +166 -0
  36. aceapi_v2_client/api/threats/create_threat_type_threat_types_post.py +166 -0
  37. aceapi_v2_client/api/threats/delete_threat_threats_delete.py +179 -0
  38. aceapi_v2_client/api/threats/delete_threat_type_threat_types_threat_type_id_delete.py +159 -0
  39. aceapi_v2_client/api/threats/get_threat_type_threat_types_threat_type_id_get.py +161 -0
  40. aceapi_v2_client/api/threats/list_threat_types_threat_types_get.py +128 -0
  41. aceapi_v2_client/api/threats/list_threats_threats_get.py +171 -0
  42. aceapi_v2_client/api/threats/update_threat_type_threat_types_threat_type_id_patch.py +182 -0
  43. aceapi_v2_client/auth.py +56 -0
  44. aceapi_v2_client/client.py +282 -0
  45. aceapi_v2_client/errors.py +16 -0
  46. aceapi_v2_client/models/__init__.py +87 -0
  47. aceapi_v2_client/models/body_login_for_access_token_auth_token_post.py +140 -0
  48. aceapi_v2_client/models/bulk_add_observable_request.py +110 -0
  49. aceapi_v2_client/models/bulk_add_observable_result.py +107 -0
  50. aceapi_v2_client/models/bulk_add_observable_result_failed_details.py +47 -0
  51. aceapi_v2_client/models/collector_status_read.py +86 -0
  52. aceapi_v2_client/models/company_read.py +69 -0
  53. aceapi_v2_client/models/event_read.py +84 -0
  54. aceapi_v2_client/models/export_format.py +8 -0
  55. aceapi_v2_client/models/health_response.py +62 -0
  56. aceapi_v2_client/models/http_validation_error.py +79 -0
  57. aceapi_v2_client/models/list_response_company_read.py +75 -0
  58. aceapi_v2_client/models/list_response_event_read.py +75 -0
  59. aceapi_v2_client/models/list_response_named_description_read.py +75 -0
  60. aceapi_v2_client/models/list_response_node_read.py +75 -0
  61. aceapi_v2_client/models/list_response_observable_comment_read.py +75 -0
  62. aceapi_v2_client/models/list_response_observable_type_read.py +75 -0
  63. aceapi_v2_client/models/list_response_threat_read.py +75 -0
  64. aceapi_v2_client/models/list_response_threat_type_read.py +75 -0
  65. aceapi_v2_client/models/named_description_read.py +69 -0
  66. aceapi_v2_client/models/node_read.py +163 -0
  67. aceapi_v2_client/models/observable_comment_create.py +77 -0
  68. aceapi_v2_client/models/observable_comment_read.py +102 -0
  69. aceapi_v2_client/models/observable_comment_update.py +61 -0
  70. aceapi_v2_client/models/observable_type_read.py +62 -0
  71. aceapi_v2_client/models/ping_response.py +61 -0
  72. aceapi_v2_client/models/refresh_request.py +62 -0
  73. aceapi_v2_client/models/set_interesting_observables_interesting_patch_response_set_interesting_observables_interesting_patch.py +50 -0
  74. aceapi_v2_client/models/set_interesting_request.py +77 -0
  75. aceapi_v2_client/models/status_update.py +62 -0
  76. aceapi_v2_client/models/supported_api_version_response.py +61 -0
  77. aceapi_v2_client/models/threat_create.py +69 -0
  78. aceapi_v2_client/models/threat_read.py +77 -0
  79. aceapi_v2_client/models/threat_type_create.py +61 -0
  80. aceapi_v2_client/models/threat_type_read.py +69 -0
  81. aceapi_v2_client/models/threat_type_update.py +73 -0
  82. aceapi_v2_client/models/token.py +81 -0
  83. aceapi_v2_client/models/validation_error.py +123 -0
  84. aceapi_v2_client/models/validation_error_context.py +47 -0
  85. aceapi_v2_client/py.typed +0 -0
  86. aceapi_v2_client/types.py +54 -0
  87. aceapi_v2_client-2.0.0.dist-info/METADATA +192 -0
  88. aceapi_v2_client-2.0.0.dist-info/RECORD +90 -0
  89. aceapi_v2_client-2.0.0.dist-info/WHEEL +4 -0
  90. aceapi_v2_client-2.0.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,75 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.named_description_read import NamedDescriptionRead
11
+
12
+
13
+ T = TypeVar("T", bound="ListResponseNamedDescriptionRead")
14
+
15
+
16
+ @_attrs_define
17
+ class ListResponseNamedDescriptionRead:
18
+ """
19
+ Attributes:
20
+ data (list[NamedDescriptionRead]):
21
+ """
22
+
23
+ data: list[NamedDescriptionRead]
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ data = []
28
+ for data_item_data in self.data:
29
+ data_item = data_item_data.to_dict()
30
+ data.append(data_item)
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update(
35
+ {
36
+ "data": data,
37
+ }
38
+ )
39
+
40
+ return field_dict
41
+
42
+ @classmethod
43
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
44
+ from ..models.named_description_read import NamedDescriptionRead
45
+
46
+ d = dict(src_dict)
47
+ data = []
48
+ _data = d.pop("data")
49
+ for data_item_data in _data:
50
+ data_item = NamedDescriptionRead.from_dict(data_item_data)
51
+
52
+ data.append(data_item)
53
+
54
+ list_response_named_description_read = cls(
55
+ data=data,
56
+ )
57
+
58
+ list_response_named_description_read.additional_properties = d
59
+ return list_response_named_description_read
60
+
61
+ @property
62
+ def additional_keys(self) -> list[str]:
63
+ return list(self.additional_properties.keys())
64
+
65
+ def __getitem__(self, key: str) -> Any:
66
+ return self.additional_properties[key]
67
+
68
+ def __setitem__(self, key: str, value: Any) -> None:
69
+ self.additional_properties[key] = value
70
+
71
+ def __delitem__(self, key: str) -> None:
72
+ del self.additional_properties[key]
73
+
74
+ def __contains__(self, key: str) -> bool:
75
+ return key in self.additional_properties
@@ -0,0 +1,75 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.node_read import NodeRead
11
+
12
+
13
+ T = TypeVar("T", bound="ListResponseNodeRead")
14
+
15
+
16
+ @_attrs_define
17
+ class ListResponseNodeRead:
18
+ """
19
+ Attributes:
20
+ data (list[NodeRead]):
21
+ """
22
+
23
+ data: list[NodeRead]
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ data = []
28
+ for data_item_data in self.data:
29
+ data_item = data_item_data.to_dict()
30
+ data.append(data_item)
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update(
35
+ {
36
+ "data": data,
37
+ }
38
+ )
39
+
40
+ return field_dict
41
+
42
+ @classmethod
43
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
44
+ from ..models.node_read import NodeRead
45
+
46
+ d = dict(src_dict)
47
+ data = []
48
+ _data = d.pop("data")
49
+ for data_item_data in _data:
50
+ data_item = NodeRead.from_dict(data_item_data)
51
+
52
+ data.append(data_item)
53
+
54
+ list_response_node_read = cls(
55
+ data=data,
56
+ )
57
+
58
+ list_response_node_read.additional_properties = d
59
+ return list_response_node_read
60
+
61
+ @property
62
+ def additional_keys(self) -> list[str]:
63
+ return list(self.additional_properties.keys())
64
+
65
+ def __getitem__(self, key: str) -> Any:
66
+ return self.additional_properties[key]
67
+
68
+ def __setitem__(self, key: str, value: Any) -> None:
69
+ self.additional_properties[key] = value
70
+
71
+ def __delitem__(self, key: str) -> None:
72
+ del self.additional_properties[key]
73
+
74
+ def __contains__(self, key: str) -> bool:
75
+ return key in self.additional_properties
@@ -0,0 +1,75 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.observable_comment_read import ObservableCommentRead
11
+
12
+
13
+ T = TypeVar("T", bound="ListResponseObservableCommentRead")
14
+
15
+
16
+ @_attrs_define
17
+ class ListResponseObservableCommentRead:
18
+ """
19
+ Attributes:
20
+ data (list[ObservableCommentRead]):
21
+ """
22
+
23
+ data: list[ObservableCommentRead]
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ data = []
28
+ for data_item_data in self.data:
29
+ data_item = data_item_data.to_dict()
30
+ data.append(data_item)
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update(
35
+ {
36
+ "data": data,
37
+ }
38
+ )
39
+
40
+ return field_dict
41
+
42
+ @classmethod
43
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
44
+ from ..models.observable_comment_read import ObservableCommentRead
45
+
46
+ d = dict(src_dict)
47
+ data = []
48
+ _data = d.pop("data")
49
+ for data_item_data in _data:
50
+ data_item = ObservableCommentRead.from_dict(data_item_data)
51
+
52
+ data.append(data_item)
53
+
54
+ list_response_observable_comment_read = cls(
55
+ data=data,
56
+ )
57
+
58
+ list_response_observable_comment_read.additional_properties = d
59
+ return list_response_observable_comment_read
60
+
61
+ @property
62
+ def additional_keys(self) -> list[str]:
63
+ return list(self.additional_properties.keys())
64
+
65
+ def __getitem__(self, key: str) -> Any:
66
+ return self.additional_properties[key]
67
+
68
+ def __setitem__(self, key: str, value: Any) -> None:
69
+ self.additional_properties[key] = value
70
+
71
+ def __delitem__(self, key: str) -> None:
72
+ del self.additional_properties[key]
73
+
74
+ def __contains__(self, key: str) -> bool:
75
+ return key in self.additional_properties
@@ -0,0 +1,75 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.observable_type_read import ObservableTypeRead
11
+
12
+
13
+ T = TypeVar("T", bound="ListResponseObservableTypeRead")
14
+
15
+
16
+ @_attrs_define
17
+ class ListResponseObservableTypeRead:
18
+ """
19
+ Attributes:
20
+ data (list[ObservableTypeRead]):
21
+ """
22
+
23
+ data: list[ObservableTypeRead]
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ data = []
28
+ for data_item_data in self.data:
29
+ data_item = data_item_data.to_dict()
30
+ data.append(data_item)
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update(
35
+ {
36
+ "data": data,
37
+ }
38
+ )
39
+
40
+ return field_dict
41
+
42
+ @classmethod
43
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
44
+ from ..models.observable_type_read import ObservableTypeRead
45
+
46
+ d = dict(src_dict)
47
+ data = []
48
+ _data = d.pop("data")
49
+ for data_item_data in _data:
50
+ data_item = ObservableTypeRead.from_dict(data_item_data)
51
+
52
+ data.append(data_item)
53
+
54
+ list_response_observable_type_read = cls(
55
+ data=data,
56
+ )
57
+
58
+ list_response_observable_type_read.additional_properties = d
59
+ return list_response_observable_type_read
60
+
61
+ @property
62
+ def additional_keys(self) -> list[str]:
63
+ return list(self.additional_properties.keys())
64
+
65
+ def __getitem__(self, key: str) -> Any:
66
+ return self.additional_properties[key]
67
+
68
+ def __setitem__(self, key: str, value: Any) -> None:
69
+ self.additional_properties[key] = value
70
+
71
+ def __delitem__(self, key: str) -> None:
72
+ del self.additional_properties[key]
73
+
74
+ def __contains__(self, key: str) -> bool:
75
+ return key in self.additional_properties
@@ -0,0 +1,75 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.threat_read import ThreatRead
11
+
12
+
13
+ T = TypeVar("T", bound="ListResponseThreatRead")
14
+
15
+
16
+ @_attrs_define
17
+ class ListResponseThreatRead:
18
+ """
19
+ Attributes:
20
+ data (list[ThreatRead]):
21
+ """
22
+
23
+ data: list[ThreatRead]
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ data = []
28
+ for data_item_data in self.data:
29
+ data_item = data_item_data.to_dict()
30
+ data.append(data_item)
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update(
35
+ {
36
+ "data": data,
37
+ }
38
+ )
39
+
40
+ return field_dict
41
+
42
+ @classmethod
43
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
44
+ from ..models.threat_read import ThreatRead
45
+
46
+ d = dict(src_dict)
47
+ data = []
48
+ _data = d.pop("data")
49
+ for data_item_data in _data:
50
+ data_item = ThreatRead.from_dict(data_item_data)
51
+
52
+ data.append(data_item)
53
+
54
+ list_response_threat_read = cls(
55
+ data=data,
56
+ )
57
+
58
+ list_response_threat_read.additional_properties = d
59
+ return list_response_threat_read
60
+
61
+ @property
62
+ def additional_keys(self) -> list[str]:
63
+ return list(self.additional_properties.keys())
64
+
65
+ def __getitem__(self, key: str) -> Any:
66
+ return self.additional_properties[key]
67
+
68
+ def __setitem__(self, key: str, value: Any) -> None:
69
+ self.additional_properties[key] = value
70
+
71
+ def __delitem__(self, key: str) -> None:
72
+ del self.additional_properties[key]
73
+
74
+ def __contains__(self, key: str) -> bool:
75
+ return key in self.additional_properties
@@ -0,0 +1,75 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.threat_type_read import ThreatTypeRead
11
+
12
+
13
+ T = TypeVar("T", bound="ListResponseThreatTypeRead")
14
+
15
+
16
+ @_attrs_define
17
+ class ListResponseThreatTypeRead:
18
+ """
19
+ Attributes:
20
+ data (list[ThreatTypeRead]):
21
+ """
22
+
23
+ data: list[ThreatTypeRead]
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ data = []
28
+ for data_item_data in self.data:
29
+ data_item = data_item_data.to_dict()
30
+ data.append(data_item)
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update(
35
+ {
36
+ "data": data,
37
+ }
38
+ )
39
+
40
+ return field_dict
41
+
42
+ @classmethod
43
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
44
+ from ..models.threat_type_read import ThreatTypeRead
45
+
46
+ d = dict(src_dict)
47
+ data = []
48
+ _data = d.pop("data")
49
+ for data_item_data in _data:
50
+ data_item = ThreatTypeRead.from_dict(data_item_data)
51
+
52
+ data.append(data_item)
53
+
54
+ list_response_threat_type_read = cls(
55
+ data=data,
56
+ )
57
+
58
+ list_response_threat_type_read.additional_properties = d
59
+ return list_response_threat_type_read
60
+
61
+ @property
62
+ def additional_keys(self) -> list[str]:
63
+ return list(self.additional_properties.keys())
64
+
65
+ def __getitem__(self, key: str) -> Any:
66
+ return self.additional_properties[key]
67
+
68
+ def __setitem__(self, key: str, value: Any) -> None:
69
+ self.additional_properties[key] = value
70
+
71
+ def __delitem__(self, key: str) -> None:
72
+ del self.additional_properties[key]
73
+
74
+ def __contains__(self, key: str) -> bool:
75
+ 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="NamedDescriptionRead")
10
+
11
+
12
+ @_attrs_define
13
+ class NamedDescriptionRead:
14
+ """
15
+ Attributes:
16
+ name (str):
17
+ description (str):
18
+ """
19
+
20
+ name: str
21
+ description: str
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ name = self.name
26
+
27
+ description = self.description
28
+
29
+ field_dict: dict[str, Any] = {}
30
+ field_dict.update(self.additional_properties)
31
+ field_dict.update(
32
+ {
33
+ "name": name,
34
+ "description": description,
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
+ name = d.pop("name")
44
+
45
+ description = d.pop("description")
46
+
47
+ named_description_read = cls(
48
+ name=name,
49
+ description=description,
50
+ )
51
+
52
+ named_description_read.additional_properties = d
53
+ return named_description_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,163 @@
1
+ from __future__ import annotations
2
+
3
+ import datetime
4
+ from collections.abc import Mapping
5
+ from typing import TYPE_CHECKING, Any, TypeVar
6
+
7
+ from attrs import define as _attrs_define
8
+ from attrs import field as _attrs_field
9
+
10
+ from ..types import UNSET, Unset
11
+
12
+ if TYPE_CHECKING:
13
+ from ..models.collector_status_read import CollectorStatusRead
14
+
15
+
16
+ T = TypeVar("T", bound="NodeRead")
17
+
18
+
19
+ @_attrs_define
20
+ class NodeRead:
21
+ """
22
+ Attributes:
23
+ id (int):
24
+ name (str):
25
+ location (str):
26
+ company_id (int):
27
+ status (str):
28
+ last_update (datetime.datetime):
29
+ is_primary (bool):
30
+ any_mode (bool):
31
+ workload_count (int):
32
+ delayed_analysis_count (int):
33
+ collectors (list[CollectorStatusRead] | Unset):
34
+ """
35
+
36
+ id: int
37
+ name: str
38
+ location: str
39
+ company_id: int
40
+ status: str
41
+ last_update: datetime.datetime
42
+ is_primary: bool
43
+ any_mode: bool
44
+ workload_count: int
45
+ delayed_analysis_count: int
46
+ collectors: list[CollectorStatusRead] | Unset = UNSET
47
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
48
+
49
+ def to_dict(self) -> dict[str, Any]:
50
+ id = self.id
51
+
52
+ name = self.name
53
+
54
+ location = self.location
55
+
56
+ company_id = self.company_id
57
+
58
+ status = self.status
59
+
60
+ last_update = self.last_update.isoformat()
61
+
62
+ is_primary = self.is_primary
63
+
64
+ any_mode = self.any_mode
65
+
66
+ workload_count = self.workload_count
67
+
68
+ delayed_analysis_count = self.delayed_analysis_count
69
+
70
+ collectors: list[dict[str, Any]] | Unset = UNSET
71
+ if not isinstance(self.collectors, Unset):
72
+ collectors = []
73
+ for collectors_item_data in self.collectors:
74
+ collectors_item = collectors_item_data.to_dict()
75
+ collectors.append(collectors_item)
76
+
77
+ field_dict: dict[str, Any] = {}
78
+ field_dict.update(self.additional_properties)
79
+ field_dict.update(
80
+ {
81
+ "id": id,
82
+ "name": name,
83
+ "location": location,
84
+ "company_id": company_id,
85
+ "status": status,
86
+ "last_update": last_update,
87
+ "is_primary": is_primary,
88
+ "any_mode": any_mode,
89
+ "workload_count": workload_count,
90
+ "delayed_analysis_count": delayed_analysis_count,
91
+ }
92
+ )
93
+ if collectors is not UNSET:
94
+ field_dict["collectors"] = collectors
95
+
96
+ return field_dict
97
+
98
+ @classmethod
99
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
100
+ from ..models.collector_status_read import CollectorStatusRead
101
+
102
+ d = dict(src_dict)
103
+ id = d.pop("id")
104
+
105
+ name = d.pop("name")
106
+
107
+ location = d.pop("location")
108
+
109
+ company_id = d.pop("company_id")
110
+
111
+ status = d.pop("status")
112
+
113
+ last_update = datetime.datetime.fromisoformat(d.pop("last_update"))
114
+
115
+ is_primary = d.pop("is_primary")
116
+
117
+ any_mode = d.pop("any_mode")
118
+
119
+ workload_count = d.pop("workload_count")
120
+
121
+ delayed_analysis_count = d.pop("delayed_analysis_count")
122
+
123
+ _collectors = d.pop("collectors", UNSET)
124
+ collectors: list[CollectorStatusRead] | Unset = UNSET
125
+ if _collectors is not UNSET:
126
+ collectors = []
127
+ for collectors_item_data in _collectors:
128
+ collectors_item = CollectorStatusRead.from_dict(collectors_item_data)
129
+
130
+ collectors.append(collectors_item)
131
+
132
+ node_read = cls(
133
+ id=id,
134
+ name=name,
135
+ location=location,
136
+ company_id=company_id,
137
+ status=status,
138
+ last_update=last_update,
139
+ is_primary=is_primary,
140
+ any_mode=any_mode,
141
+ workload_count=workload_count,
142
+ delayed_analysis_count=delayed_analysis_count,
143
+ collectors=collectors,
144
+ )
145
+
146
+ node_read.additional_properties = d
147
+ return node_read
148
+
149
+ @property
150
+ def additional_keys(self) -> list[str]:
151
+ return list(self.additional_properties.keys())
152
+
153
+ def __getitem__(self, key: str) -> Any:
154
+ return self.additional_properties[key]
155
+
156
+ def __setitem__(self, key: str, value: Any) -> None:
157
+ self.additional_properties[key] = value
158
+
159
+ def __delitem__(self, key: str) -> None:
160
+ del self.additional_properties[key]
161
+
162
+ def __contains__(self, key: str) -> bool:
163
+ return key in self.additional_properties