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,163 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
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 ...models.list_response_observable_comment_read import (
|
|
11
|
+
ListResponseObservableCommentRead,
|
|
12
|
+
)
|
|
13
|
+
from ...types import Response
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
observable_id: int,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "get",
|
|
22
|
+
"url": "/observable-comments/{observable_id}".format(
|
|
23
|
+
observable_id=quote(str(observable_id), safe=""),
|
|
24
|
+
),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return _kwargs
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _parse_response(
|
|
31
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
32
|
+
) -> HTTPValidationError | ListResponseObservableCommentRead | None:
|
|
33
|
+
if response.status_code == 200:
|
|
34
|
+
response_200 = ListResponseObservableCommentRead.from_dict(response.json())
|
|
35
|
+
|
|
36
|
+
return response_200
|
|
37
|
+
|
|
38
|
+
if response.status_code == 422:
|
|
39
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
40
|
+
|
|
41
|
+
return response_422
|
|
42
|
+
|
|
43
|
+
if client.raise_on_unexpected_status:
|
|
44
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
45
|
+
else:
|
|
46
|
+
return None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _build_response(
|
|
50
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
51
|
+
) -> Response[HTTPValidationError | ListResponseObservableCommentRead]:
|
|
52
|
+
return Response(
|
|
53
|
+
status_code=HTTPStatus(response.status_code),
|
|
54
|
+
content=response.content,
|
|
55
|
+
headers=response.headers,
|
|
56
|
+
parsed=_parse_response(client=client, response=response),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def sync_detailed(
|
|
61
|
+
observable_id: int,
|
|
62
|
+
*,
|
|
63
|
+
client: AuthenticatedClient,
|
|
64
|
+
) -> Response[HTTPValidationError | ListResponseObservableCommentRead]:
|
|
65
|
+
"""List Comments
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
observable_id (int):
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
72
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
Response[HTTPValidationError | ListResponseObservableCommentRead]
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
kwargs = _get_kwargs(
|
|
79
|
+
observable_id=observable_id,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
response = client.get_httpx_client().request(
|
|
83
|
+
**kwargs,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
return _build_response(client=client, response=response)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def sync(
|
|
90
|
+
observable_id: int,
|
|
91
|
+
*,
|
|
92
|
+
client: AuthenticatedClient,
|
|
93
|
+
) -> HTTPValidationError | ListResponseObservableCommentRead | None:
|
|
94
|
+
"""List Comments
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
observable_id (int):
|
|
98
|
+
|
|
99
|
+
Raises:
|
|
100
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
101
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
HTTPValidationError | ListResponseObservableCommentRead
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
return sync_detailed(
|
|
108
|
+
observable_id=observable_id,
|
|
109
|
+
client=client,
|
|
110
|
+
).parsed
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
async def asyncio_detailed(
|
|
114
|
+
observable_id: int,
|
|
115
|
+
*,
|
|
116
|
+
client: AuthenticatedClient,
|
|
117
|
+
) -> Response[HTTPValidationError | ListResponseObservableCommentRead]:
|
|
118
|
+
"""List Comments
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
observable_id (int):
|
|
122
|
+
|
|
123
|
+
Raises:
|
|
124
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
125
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
Response[HTTPValidationError | ListResponseObservableCommentRead]
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
kwargs = _get_kwargs(
|
|
132
|
+
observable_id=observable_id,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
136
|
+
|
|
137
|
+
return _build_response(client=client, response=response)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
async def asyncio(
|
|
141
|
+
observable_id: int,
|
|
142
|
+
*,
|
|
143
|
+
client: AuthenticatedClient,
|
|
144
|
+
) -> HTTPValidationError | ListResponseObservableCommentRead | None:
|
|
145
|
+
"""List Comments
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
observable_id (int):
|
|
149
|
+
|
|
150
|
+
Raises:
|
|
151
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
152
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
153
|
+
|
|
154
|
+
Returns:
|
|
155
|
+
HTTPValidationError | ListResponseObservableCommentRead
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
await asyncio_detailed(
|
|
160
|
+
observable_id=observable_id,
|
|
161
|
+
client=client,
|
|
162
|
+
)
|
|
163
|
+
).parsed
|
|
@@ -0,0 +1,144 @@
|
|
|
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.list_response_observable_type_read import ListResponseObservableTypeRead
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
13
|
+
|
|
14
|
+
_kwargs: dict[str, Any] = {
|
|
15
|
+
"method": "get",
|
|
16
|
+
"url": "/observable-types/",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return _kwargs
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _parse_response(
|
|
23
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
24
|
+
) -> ListResponseObservableTypeRead | None:
|
|
25
|
+
if response.status_code == 200:
|
|
26
|
+
response_200 = ListResponseObservableTypeRead.from_dict(response.json())
|
|
27
|
+
|
|
28
|
+
return response_200
|
|
29
|
+
|
|
30
|
+
if client.raise_on_unexpected_status:
|
|
31
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
32
|
+
else:
|
|
33
|
+
return None
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _build_response(
|
|
37
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
38
|
+
) -> Response[ListResponseObservableTypeRead]:
|
|
39
|
+
return Response(
|
|
40
|
+
status_code=HTTPStatus(response.status_code),
|
|
41
|
+
content=response.content,
|
|
42
|
+
headers=response.headers,
|
|
43
|
+
parsed=_parse_response(client=client, response=response),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def sync_detailed(
|
|
48
|
+
*,
|
|
49
|
+
client: AuthenticatedClient,
|
|
50
|
+
) -> Response[ListResponseObservableTypeRead]:
|
|
51
|
+
"""List Observable Types
|
|
52
|
+
|
|
53
|
+
Return a list of unique observable types from the database.
|
|
54
|
+
|
|
55
|
+
Requires authentication (API key or JWT token).
|
|
56
|
+
|
|
57
|
+
Raises:
|
|
58
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
59
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
Response[ListResponseObservableTypeRead]
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
kwargs = _get_kwargs()
|
|
66
|
+
|
|
67
|
+
response = client.get_httpx_client().request(
|
|
68
|
+
**kwargs,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
return _build_response(client=client, response=response)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def sync(
|
|
75
|
+
*,
|
|
76
|
+
client: AuthenticatedClient,
|
|
77
|
+
) -> ListResponseObservableTypeRead | None:
|
|
78
|
+
"""List Observable Types
|
|
79
|
+
|
|
80
|
+
Return a list of unique observable types from the database.
|
|
81
|
+
|
|
82
|
+
Requires authentication (API key or JWT token).
|
|
83
|
+
|
|
84
|
+
Raises:
|
|
85
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
86
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
ListResponseObservableTypeRead
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
return sync_detailed(
|
|
93
|
+
client=client,
|
|
94
|
+
).parsed
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
async def asyncio_detailed(
|
|
98
|
+
*,
|
|
99
|
+
client: AuthenticatedClient,
|
|
100
|
+
) -> Response[ListResponseObservableTypeRead]:
|
|
101
|
+
"""List Observable Types
|
|
102
|
+
|
|
103
|
+
Return a list of unique observable types from the database.
|
|
104
|
+
|
|
105
|
+
Requires authentication (API key or JWT token).
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
109
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Response[ListResponseObservableTypeRead]
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
kwargs = _get_kwargs()
|
|
116
|
+
|
|
117
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
118
|
+
|
|
119
|
+
return _build_response(client=client, response=response)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
async def asyncio(
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient,
|
|
125
|
+
) -> ListResponseObservableTypeRead | None:
|
|
126
|
+
"""List Observable Types
|
|
127
|
+
|
|
128
|
+
Return a list of unique observable types from the database.
|
|
129
|
+
|
|
130
|
+
Requires authentication (API key or JWT token).
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
134
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
ListResponseObservableTypeRead
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
await asyncio_detailed(
|
|
142
|
+
client=client,
|
|
143
|
+
)
|
|
144
|
+
).parsed
|
|
@@ -0,0 +1,191 @@
|
|
|
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.set_interesting_observables_interesting_patch_response_set_interesting_observables_interesting_patch import (
|
|
10
|
+
SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch,
|
|
11
|
+
)
|
|
12
|
+
from ...models.set_interesting_request import SetInterestingRequest
|
|
13
|
+
from ...types import Response
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
*,
|
|
18
|
+
body: SetInterestingRequest,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
headers: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
_kwargs: dict[str, Any] = {
|
|
23
|
+
"method": "patch",
|
|
24
|
+
"url": "/observables/interesting",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_kwargs["json"] = body.to_dict()
|
|
28
|
+
|
|
29
|
+
headers["Content-Type"] = "application/json"
|
|
30
|
+
|
|
31
|
+
_kwargs["headers"] = headers
|
|
32
|
+
return _kwargs
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _parse_response(
|
|
36
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
37
|
+
) -> (
|
|
38
|
+
HTTPValidationError
|
|
39
|
+
| SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch
|
|
40
|
+
| None
|
|
41
|
+
):
|
|
42
|
+
if response.status_code == 200:
|
|
43
|
+
response_200 = SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch.from_dict(
|
|
44
|
+
response.json()
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return response_200
|
|
48
|
+
|
|
49
|
+
if response.status_code == 422:
|
|
50
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
51
|
+
|
|
52
|
+
return response_422
|
|
53
|
+
|
|
54
|
+
if client.raise_on_unexpected_status:
|
|
55
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
56
|
+
else:
|
|
57
|
+
return None
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _build_response(
|
|
61
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
62
|
+
) -> Response[
|
|
63
|
+
HTTPValidationError
|
|
64
|
+
| SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch
|
|
65
|
+
]:
|
|
66
|
+
return Response(
|
|
67
|
+
status_code=HTTPStatus(response.status_code),
|
|
68
|
+
content=response.content,
|
|
69
|
+
headers=response.headers,
|
|
70
|
+
parsed=_parse_response(client=client, response=response),
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def sync_detailed(
|
|
75
|
+
*,
|
|
76
|
+
client: AuthenticatedClient,
|
|
77
|
+
body: SetInterestingRequest,
|
|
78
|
+
) -> Response[
|
|
79
|
+
HTTPValidationError
|
|
80
|
+
| SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch
|
|
81
|
+
]:
|
|
82
|
+
"""Set Interesting
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
body (SetInterestingRequest):
|
|
86
|
+
|
|
87
|
+
Raises:
|
|
88
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
89
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
Response[HTTPValidationError | SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch]
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
kwargs = _get_kwargs(
|
|
96
|
+
body=body,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
response = client.get_httpx_client().request(
|
|
100
|
+
**kwargs,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
return _build_response(client=client, response=response)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def sync(
|
|
107
|
+
*,
|
|
108
|
+
client: AuthenticatedClient,
|
|
109
|
+
body: SetInterestingRequest,
|
|
110
|
+
) -> (
|
|
111
|
+
HTTPValidationError
|
|
112
|
+
| SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch
|
|
113
|
+
| None
|
|
114
|
+
):
|
|
115
|
+
"""Set Interesting
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
body (SetInterestingRequest):
|
|
119
|
+
|
|
120
|
+
Raises:
|
|
121
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
122
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
HTTPValidationError | SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
return sync_detailed(
|
|
129
|
+
client=client,
|
|
130
|
+
body=body,
|
|
131
|
+
).parsed
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
async def asyncio_detailed(
|
|
135
|
+
*,
|
|
136
|
+
client: AuthenticatedClient,
|
|
137
|
+
body: SetInterestingRequest,
|
|
138
|
+
) -> Response[
|
|
139
|
+
HTTPValidationError
|
|
140
|
+
| SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch
|
|
141
|
+
]:
|
|
142
|
+
"""Set Interesting
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
body (SetInterestingRequest):
|
|
146
|
+
|
|
147
|
+
Raises:
|
|
148
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
149
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
150
|
+
|
|
151
|
+
Returns:
|
|
152
|
+
Response[HTTPValidationError | SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch]
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
kwargs = _get_kwargs(
|
|
156
|
+
body=body,
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
160
|
+
|
|
161
|
+
return _build_response(client=client, response=response)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
async def asyncio(
|
|
165
|
+
*,
|
|
166
|
+
client: AuthenticatedClient,
|
|
167
|
+
body: SetInterestingRequest,
|
|
168
|
+
) -> (
|
|
169
|
+
HTTPValidationError
|
|
170
|
+
| SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch
|
|
171
|
+
| None
|
|
172
|
+
):
|
|
173
|
+
"""Set Interesting
|
|
174
|
+
|
|
175
|
+
Args:
|
|
176
|
+
body (SetInterestingRequest):
|
|
177
|
+
|
|
178
|
+
Raises:
|
|
179
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
180
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
HTTPValidationError | SetInterestingObservablesInterestingPatchResponseSetInterestingObservablesInterestingPatch
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
await asyncio_detailed(
|
|
188
|
+
client=client,
|
|
189
|
+
body=body,
|
|
190
|
+
)
|
|
191
|
+
).parsed
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
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 ...models.observable_comment_read import ObservableCommentRead
|
|
11
|
+
from ...models.observable_comment_update import ObservableCommentUpdate
|
|
12
|
+
from ...types import Response
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
comment_id: int,
|
|
17
|
+
*,
|
|
18
|
+
body: ObservableCommentUpdate,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
headers: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
_kwargs: dict[str, Any] = {
|
|
23
|
+
"method": "patch",
|
|
24
|
+
"url": "/observable-comments/{comment_id}".format(
|
|
25
|
+
comment_id=quote(str(comment_id), safe=""),
|
|
26
|
+
),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_kwargs["json"] = body.to_dict()
|
|
30
|
+
|
|
31
|
+
headers["Content-Type"] = "application/json"
|
|
32
|
+
|
|
33
|
+
_kwargs["headers"] = headers
|
|
34
|
+
return _kwargs
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _parse_response(
|
|
38
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
39
|
+
) -> HTTPValidationError | ObservableCommentRead | None:
|
|
40
|
+
if response.status_code == 200:
|
|
41
|
+
response_200 = ObservableCommentRead.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_200
|
|
44
|
+
|
|
45
|
+
if response.status_code == 422:
|
|
46
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_422
|
|
49
|
+
|
|
50
|
+
if client.raise_on_unexpected_status:
|
|
51
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _build_response(
|
|
57
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
58
|
+
) -> Response[HTTPValidationError | ObservableCommentRead]:
|
|
59
|
+
return Response(
|
|
60
|
+
status_code=HTTPStatus(response.status_code),
|
|
61
|
+
content=response.content,
|
|
62
|
+
headers=response.headers,
|
|
63
|
+
parsed=_parse_response(client=client, response=response),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync_detailed(
|
|
68
|
+
comment_id: int,
|
|
69
|
+
*,
|
|
70
|
+
client: AuthenticatedClient,
|
|
71
|
+
body: ObservableCommentUpdate,
|
|
72
|
+
) -> Response[HTTPValidationError | ObservableCommentRead]:
|
|
73
|
+
"""Update Comment
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
comment_id (int):
|
|
77
|
+
body (ObservableCommentUpdate):
|
|
78
|
+
|
|
79
|
+
Raises:
|
|
80
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
81
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
Response[HTTPValidationError | ObservableCommentRead]
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
kwargs = _get_kwargs(
|
|
88
|
+
comment_id=comment_id,
|
|
89
|
+
body=body,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
response = client.get_httpx_client().request(
|
|
93
|
+
**kwargs,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
return _build_response(client=client, response=response)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def sync(
|
|
100
|
+
comment_id: int,
|
|
101
|
+
*,
|
|
102
|
+
client: AuthenticatedClient,
|
|
103
|
+
body: ObservableCommentUpdate,
|
|
104
|
+
) -> HTTPValidationError | ObservableCommentRead | None:
|
|
105
|
+
"""Update Comment
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
comment_id (int):
|
|
109
|
+
body (ObservableCommentUpdate):
|
|
110
|
+
|
|
111
|
+
Raises:
|
|
112
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
113
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
HTTPValidationError | ObservableCommentRead
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
return sync_detailed(
|
|
120
|
+
comment_id=comment_id,
|
|
121
|
+
client=client,
|
|
122
|
+
body=body,
|
|
123
|
+
).parsed
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
async def asyncio_detailed(
|
|
127
|
+
comment_id: int,
|
|
128
|
+
*,
|
|
129
|
+
client: AuthenticatedClient,
|
|
130
|
+
body: ObservableCommentUpdate,
|
|
131
|
+
) -> Response[HTTPValidationError | ObservableCommentRead]:
|
|
132
|
+
"""Update Comment
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
comment_id (int):
|
|
136
|
+
body (ObservableCommentUpdate):
|
|
137
|
+
|
|
138
|
+
Raises:
|
|
139
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
140
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
141
|
+
|
|
142
|
+
Returns:
|
|
143
|
+
Response[HTTPValidationError | ObservableCommentRead]
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
kwargs = _get_kwargs(
|
|
147
|
+
comment_id=comment_id,
|
|
148
|
+
body=body,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
152
|
+
|
|
153
|
+
return _build_response(client=client, response=response)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
async def asyncio(
|
|
157
|
+
comment_id: int,
|
|
158
|
+
*,
|
|
159
|
+
client: AuthenticatedClient,
|
|
160
|
+
body: ObservableCommentUpdate,
|
|
161
|
+
) -> HTTPValidationError | ObservableCommentRead | None:
|
|
162
|
+
"""Update Comment
|
|
163
|
+
|
|
164
|
+
Args:
|
|
165
|
+
comment_id (int):
|
|
166
|
+
body (ObservableCommentUpdate):
|
|
167
|
+
|
|
168
|
+
Raises:
|
|
169
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
170
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
HTTPValidationError | ObservableCommentRead
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
await asyncio_detailed(
|
|
178
|
+
comment_id=comment_id,
|
|
179
|
+
client=client,
|
|
180
|
+
body=body,
|
|
181
|
+
)
|
|
182
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|