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,166 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...models.threat_create import ThreatCreate
10
+ from ...models.threat_read import ThreatRead
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ body: ThreatCreate,
17
+ ) -> dict[str, Any]:
18
+ headers: dict[str, Any] = {}
19
+
20
+ _kwargs: dict[str, Any] = {
21
+ "method": "post",
22
+ "url": "/threats/",
23
+ }
24
+
25
+ _kwargs["json"] = body.to_dict()
26
+
27
+ headers["Content-Type"] = "application/json"
28
+
29
+ _kwargs["headers"] = headers
30
+ return _kwargs
31
+
32
+
33
+ def _parse_response(
34
+ *, client: AuthenticatedClient | Client, response: httpx.Response
35
+ ) -> HTTPValidationError | ThreatRead | None:
36
+ if response.status_code == 201:
37
+ response_201 = ThreatRead.from_dict(response.json())
38
+
39
+ return response_201
40
+
41
+ if response.status_code == 422:
42
+ response_422 = HTTPValidationError.from_dict(response.json())
43
+
44
+ return response_422
45
+
46
+ if client.raise_on_unexpected_status:
47
+ raise errors.UnexpectedStatus(response.status_code, response.content)
48
+ else:
49
+ return None
50
+
51
+
52
+ def _build_response(
53
+ *, client: AuthenticatedClient | Client, response: httpx.Response
54
+ ) -> Response[HTTPValidationError | ThreatRead]:
55
+ return Response(
56
+ status_code=HTTPStatus(response.status_code),
57
+ content=response.content,
58
+ headers=response.headers,
59
+ parsed=_parse_response(client=client, response=response),
60
+ )
61
+
62
+
63
+ def sync_detailed(
64
+ *,
65
+ client: AuthenticatedClient,
66
+ body: ThreatCreate,
67
+ ) -> Response[HTTPValidationError | ThreatRead]:
68
+ """Create Threat
69
+
70
+ Args:
71
+ body (ThreatCreate):
72
+
73
+ Raises:
74
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
75
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
76
+
77
+ Returns:
78
+ Response[HTTPValidationError | ThreatRead]
79
+ """
80
+
81
+ kwargs = _get_kwargs(
82
+ body=body,
83
+ )
84
+
85
+ response = client.get_httpx_client().request(
86
+ **kwargs,
87
+ )
88
+
89
+ return _build_response(client=client, response=response)
90
+
91
+
92
+ def sync(
93
+ *,
94
+ client: AuthenticatedClient,
95
+ body: ThreatCreate,
96
+ ) -> HTTPValidationError | ThreatRead | None:
97
+ """Create Threat
98
+
99
+ Args:
100
+ body (ThreatCreate):
101
+
102
+ Raises:
103
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
104
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
105
+
106
+ Returns:
107
+ HTTPValidationError | ThreatRead
108
+ """
109
+
110
+ return sync_detailed(
111
+ client=client,
112
+ body=body,
113
+ ).parsed
114
+
115
+
116
+ async def asyncio_detailed(
117
+ *,
118
+ client: AuthenticatedClient,
119
+ body: ThreatCreate,
120
+ ) -> Response[HTTPValidationError | ThreatRead]:
121
+ """Create Threat
122
+
123
+ Args:
124
+ body (ThreatCreate):
125
+
126
+ Raises:
127
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
128
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
129
+
130
+ Returns:
131
+ Response[HTTPValidationError | ThreatRead]
132
+ """
133
+
134
+ kwargs = _get_kwargs(
135
+ body=body,
136
+ )
137
+
138
+ response = await client.get_async_httpx_client().request(**kwargs)
139
+
140
+ return _build_response(client=client, response=response)
141
+
142
+
143
+ async def asyncio(
144
+ *,
145
+ client: AuthenticatedClient,
146
+ body: ThreatCreate,
147
+ ) -> HTTPValidationError | ThreatRead | None:
148
+ """Create Threat
149
+
150
+ Args:
151
+ body (ThreatCreate):
152
+
153
+ Raises:
154
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
155
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
156
+
157
+ Returns:
158
+ HTTPValidationError | ThreatRead
159
+ """
160
+
161
+ return (
162
+ await asyncio_detailed(
163
+ client=client,
164
+ body=body,
165
+ )
166
+ ).parsed
@@ -0,0 +1,166 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...models.threat_type_create import ThreatTypeCreate
10
+ from ...models.threat_type_read import ThreatTypeRead
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ body: ThreatTypeCreate,
17
+ ) -> dict[str, Any]:
18
+ headers: dict[str, Any] = {}
19
+
20
+ _kwargs: dict[str, Any] = {
21
+ "method": "post",
22
+ "url": "/threat-types/",
23
+ }
24
+
25
+ _kwargs["json"] = body.to_dict()
26
+
27
+ headers["Content-Type"] = "application/json"
28
+
29
+ _kwargs["headers"] = headers
30
+ return _kwargs
31
+
32
+
33
+ def _parse_response(
34
+ *, client: AuthenticatedClient | Client, response: httpx.Response
35
+ ) -> HTTPValidationError | ThreatTypeRead | None:
36
+ if response.status_code == 201:
37
+ response_201 = ThreatTypeRead.from_dict(response.json())
38
+
39
+ return response_201
40
+
41
+ if response.status_code == 422:
42
+ response_422 = HTTPValidationError.from_dict(response.json())
43
+
44
+ return response_422
45
+
46
+ if client.raise_on_unexpected_status:
47
+ raise errors.UnexpectedStatus(response.status_code, response.content)
48
+ else:
49
+ return None
50
+
51
+
52
+ def _build_response(
53
+ *, client: AuthenticatedClient | Client, response: httpx.Response
54
+ ) -> Response[HTTPValidationError | ThreatTypeRead]:
55
+ return Response(
56
+ status_code=HTTPStatus(response.status_code),
57
+ content=response.content,
58
+ headers=response.headers,
59
+ parsed=_parse_response(client=client, response=response),
60
+ )
61
+
62
+
63
+ def sync_detailed(
64
+ *,
65
+ client: AuthenticatedClient,
66
+ body: ThreatTypeCreate,
67
+ ) -> Response[HTTPValidationError | ThreatTypeRead]:
68
+ """Create Threat Type
69
+
70
+ Args:
71
+ body (ThreatTypeCreate):
72
+
73
+ Raises:
74
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
75
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
76
+
77
+ Returns:
78
+ Response[HTTPValidationError | ThreatTypeRead]
79
+ """
80
+
81
+ kwargs = _get_kwargs(
82
+ body=body,
83
+ )
84
+
85
+ response = client.get_httpx_client().request(
86
+ **kwargs,
87
+ )
88
+
89
+ return _build_response(client=client, response=response)
90
+
91
+
92
+ def sync(
93
+ *,
94
+ client: AuthenticatedClient,
95
+ body: ThreatTypeCreate,
96
+ ) -> HTTPValidationError | ThreatTypeRead | None:
97
+ """Create Threat Type
98
+
99
+ Args:
100
+ body (ThreatTypeCreate):
101
+
102
+ Raises:
103
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
104
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
105
+
106
+ Returns:
107
+ HTTPValidationError | ThreatTypeRead
108
+ """
109
+
110
+ return sync_detailed(
111
+ client=client,
112
+ body=body,
113
+ ).parsed
114
+
115
+
116
+ async def asyncio_detailed(
117
+ *,
118
+ client: AuthenticatedClient,
119
+ body: ThreatTypeCreate,
120
+ ) -> Response[HTTPValidationError | ThreatTypeRead]:
121
+ """Create Threat Type
122
+
123
+ Args:
124
+ body (ThreatTypeCreate):
125
+
126
+ Raises:
127
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
128
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
129
+
130
+ Returns:
131
+ Response[HTTPValidationError | ThreatTypeRead]
132
+ """
133
+
134
+ kwargs = _get_kwargs(
135
+ body=body,
136
+ )
137
+
138
+ response = await client.get_async_httpx_client().request(**kwargs)
139
+
140
+ return _build_response(client=client, response=response)
141
+
142
+
143
+ async def asyncio(
144
+ *,
145
+ client: AuthenticatedClient,
146
+ body: ThreatTypeCreate,
147
+ ) -> HTTPValidationError | ThreatTypeRead | None:
148
+ """Create Threat Type
149
+
150
+ Args:
151
+ body (ThreatTypeCreate):
152
+
153
+ Raises:
154
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
155
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
156
+
157
+ Returns:
158
+ HTTPValidationError | ThreatTypeRead
159
+ """
160
+
161
+ return (
162
+ await asyncio_detailed(
163
+ client=client,
164
+ body=body,
165
+ )
166
+ ).parsed
@@ -0,0 +1,179 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...types import UNSET, Response
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ malware_id: int,
15
+ threat_type_id: int,
16
+ ) -> dict[str, Any]:
17
+
18
+ params: dict[str, Any] = {}
19
+
20
+ params["malware_id"] = malware_id
21
+
22
+ params["threat_type_id"] = threat_type_id
23
+
24
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
25
+
26
+ _kwargs: dict[str, Any] = {
27
+ "method": "delete",
28
+ "url": "/threats/",
29
+ "params": params,
30
+ }
31
+
32
+ return _kwargs
33
+
34
+
35
+ def _parse_response(
36
+ *, client: AuthenticatedClient | Client, response: httpx.Response
37
+ ) -> Any | HTTPValidationError | None:
38
+ if response.status_code == 204:
39
+ response_204 = cast(Any, None)
40
+ return response_204
41
+
42
+ if response.status_code == 422:
43
+ response_422 = HTTPValidationError.from_dict(response.json())
44
+
45
+ return response_422
46
+
47
+ if client.raise_on_unexpected_status:
48
+ raise errors.UnexpectedStatus(response.status_code, response.content)
49
+ else:
50
+ return None
51
+
52
+
53
+ def _build_response(
54
+ *, client: AuthenticatedClient | Client, response: httpx.Response
55
+ ) -> Response[Any | HTTPValidationError]:
56
+ return Response(
57
+ status_code=HTTPStatus(response.status_code),
58
+ content=response.content,
59
+ headers=response.headers,
60
+ parsed=_parse_response(client=client, response=response),
61
+ )
62
+
63
+
64
+ def sync_detailed(
65
+ *,
66
+ client: AuthenticatedClient,
67
+ malware_id: int,
68
+ threat_type_id: int,
69
+ ) -> Response[Any | HTTPValidationError]:
70
+ """Delete Threat
71
+
72
+ Args:
73
+ malware_id (int):
74
+ threat_type_id (int):
75
+
76
+ Raises:
77
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
78
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
79
+
80
+ Returns:
81
+ Response[Any | HTTPValidationError]
82
+ """
83
+
84
+ kwargs = _get_kwargs(
85
+ malware_id=malware_id,
86
+ threat_type_id=threat_type_id,
87
+ )
88
+
89
+ response = client.get_httpx_client().request(
90
+ **kwargs,
91
+ )
92
+
93
+ return _build_response(client=client, response=response)
94
+
95
+
96
+ def sync(
97
+ *,
98
+ client: AuthenticatedClient,
99
+ malware_id: int,
100
+ threat_type_id: int,
101
+ ) -> Any | HTTPValidationError | None:
102
+ """Delete Threat
103
+
104
+ Args:
105
+ malware_id (int):
106
+ threat_type_id (int):
107
+
108
+ Raises:
109
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
110
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
111
+
112
+ Returns:
113
+ Any | HTTPValidationError
114
+ """
115
+
116
+ return sync_detailed(
117
+ client=client,
118
+ malware_id=malware_id,
119
+ threat_type_id=threat_type_id,
120
+ ).parsed
121
+
122
+
123
+ async def asyncio_detailed(
124
+ *,
125
+ client: AuthenticatedClient,
126
+ malware_id: int,
127
+ threat_type_id: int,
128
+ ) -> Response[Any | HTTPValidationError]:
129
+ """Delete Threat
130
+
131
+ Args:
132
+ malware_id (int):
133
+ threat_type_id (int):
134
+
135
+ Raises:
136
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
137
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
138
+
139
+ Returns:
140
+ Response[Any | HTTPValidationError]
141
+ """
142
+
143
+ kwargs = _get_kwargs(
144
+ malware_id=malware_id,
145
+ threat_type_id=threat_type_id,
146
+ )
147
+
148
+ response = await client.get_async_httpx_client().request(**kwargs)
149
+
150
+ return _build_response(client=client, response=response)
151
+
152
+
153
+ async def asyncio(
154
+ *,
155
+ client: AuthenticatedClient,
156
+ malware_id: int,
157
+ threat_type_id: int,
158
+ ) -> Any | HTTPValidationError | None:
159
+ """Delete Threat
160
+
161
+ Args:
162
+ malware_id (int):
163
+ threat_type_id (int):
164
+
165
+ Raises:
166
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
167
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
168
+
169
+ Returns:
170
+ Any | HTTPValidationError
171
+ """
172
+
173
+ return (
174
+ await asyncio_detailed(
175
+ client=client,
176
+ malware_id=malware_id,
177
+ threat_type_id=threat_type_id,
178
+ )
179
+ ).parsed
@@ -0,0 +1,159 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ threat_type_id: int,
15
+ ) -> dict[str, Any]:
16
+
17
+ _kwargs: dict[str, Any] = {
18
+ "method": "delete",
19
+ "url": "/threat-types/{threat_type_id}".format(
20
+ threat_type_id=quote(str(threat_type_id), safe=""),
21
+ ),
22
+ }
23
+
24
+ return _kwargs
25
+
26
+
27
+ def _parse_response(
28
+ *, client: AuthenticatedClient | Client, response: httpx.Response
29
+ ) -> Any | HTTPValidationError | None:
30
+ if response.status_code == 204:
31
+ response_204 = cast(Any, None)
32
+ return response_204
33
+
34
+ if response.status_code == 422:
35
+ response_422 = HTTPValidationError.from_dict(response.json())
36
+
37
+ return response_422
38
+
39
+ if client.raise_on_unexpected_status:
40
+ raise errors.UnexpectedStatus(response.status_code, response.content)
41
+ else:
42
+ return None
43
+
44
+
45
+ def _build_response(
46
+ *, client: AuthenticatedClient | Client, response: httpx.Response
47
+ ) -> Response[Any | HTTPValidationError]:
48
+ return Response(
49
+ status_code=HTTPStatus(response.status_code),
50
+ content=response.content,
51
+ headers=response.headers,
52
+ parsed=_parse_response(client=client, response=response),
53
+ )
54
+
55
+
56
+ def sync_detailed(
57
+ threat_type_id: int,
58
+ *,
59
+ client: AuthenticatedClient,
60
+ ) -> Response[Any | HTTPValidationError]:
61
+ """Delete Threat Type
62
+
63
+ Args:
64
+ threat_type_id (int):
65
+
66
+ Raises:
67
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
68
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
69
+
70
+ Returns:
71
+ Response[Any | HTTPValidationError]
72
+ """
73
+
74
+ kwargs = _get_kwargs(
75
+ threat_type_id=threat_type_id,
76
+ )
77
+
78
+ response = client.get_httpx_client().request(
79
+ **kwargs,
80
+ )
81
+
82
+ return _build_response(client=client, response=response)
83
+
84
+
85
+ def sync(
86
+ threat_type_id: int,
87
+ *,
88
+ client: AuthenticatedClient,
89
+ ) -> Any | HTTPValidationError | None:
90
+ """Delete Threat Type
91
+
92
+ Args:
93
+ threat_type_id (int):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ Any | HTTPValidationError
101
+ """
102
+
103
+ return sync_detailed(
104
+ threat_type_id=threat_type_id,
105
+ client=client,
106
+ ).parsed
107
+
108
+
109
+ async def asyncio_detailed(
110
+ threat_type_id: int,
111
+ *,
112
+ client: AuthenticatedClient,
113
+ ) -> Response[Any | HTTPValidationError]:
114
+ """Delete Threat Type
115
+
116
+ Args:
117
+ threat_type_id (int):
118
+
119
+ Raises:
120
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
121
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
122
+
123
+ Returns:
124
+ Response[Any | HTTPValidationError]
125
+ """
126
+
127
+ kwargs = _get_kwargs(
128
+ threat_type_id=threat_type_id,
129
+ )
130
+
131
+ response = await client.get_async_httpx_client().request(**kwargs)
132
+
133
+ return _build_response(client=client, response=response)
134
+
135
+
136
+ async def asyncio(
137
+ threat_type_id: int,
138
+ *,
139
+ client: AuthenticatedClient,
140
+ ) -> Any | HTTPValidationError | None:
141
+ """Delete Threat Type
142
+
143
+ Args:
144
+ threat_type_id (int):
145
+
146
+ Raises:
147
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
148
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
149
+
150
+ Returns:
151
+ Any | HTTPValidationError
152
+ """
153
+
154
+ return (
155
+ await asyncio_detailed(
156
+ threat_type_id=threat_type_id,
157
+ client=client,
158
+ )
159
+ ).parsed