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,187 @@
|
|
|
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.body_login_for_access_token_auth_token_post import (
|
|
9
|
+
BodyLoginForAccessTokenAuthTokenPost,
|
|
10
|
+
)
|
|
11
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
12
|
+
from ...models.token import Token
|
|
13
|
+
from ...types import Response
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
*,
|
|
18
|
+
body: BodyLoginForAccessTokenAuthTokenPost,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
headers: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
_kwargs: dict[str, Any] = {
|
|
23
|
+
"method": "post",
|
|
24
|
+
"url": "/auth/token",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_kwargs["data"] = body.to_dict()
|
|
28
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
|
29
|
+
|
|
30
|
+
_kwargs["headers"] = headers
|
|
31
|
+
return _kwargs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _parse_response(
|
|
35
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
36
|
+
) -> HTTPValidationError | Token | None:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = Token.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_200
|
|
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[HTTPValidationError | Token]:
|
|
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 | Client,
|
|
67
|
+
body: BodyLoginForAccessTokenAuthTokenPost,
|
|
68
|
+
) -> Response[HTTPValidationError | Token]:
|
|
69
|
+
"""Login For Access Token
|
|
70
|
+
|
|
71
|
+
Authenticate user and return access + refresh tokens.
|
|
72
|
+
|
|
73
|
+
Use OAuth2 password flow: POST with form data containing
|
|
74
|
+
'username' and 'password' fields.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
body (BodyLoginForAccessTokenAuthTokenPost):
|
|
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 | Token]
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
kwargs = _get_kwargs(
|
|
88
|
+
body=body,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
response = client.get_httpx_client().request(
|
|
92
|
+
**kwargs,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
return _build_response(client=client, response=response)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def sync(
|
|
99
|
+
*,
|
|
100
|
+
client: AuthenticatedClient | Client,
|
|
101
|
+
body: BodyLoginForAccessTokenAuthTokenPost,
|
|
102
|
+
) -> HTTPValidationError | Token | None:
|
|
103
|
+
"""Login For Access Token
|
|
104
|
+
|
|
105
|
+
Authenticate user and return access + refresh tokens.
|
|
106
|
+
|
|
107
|
+
Use OAuth2 password flow: POST with form data containing
|
|
108
|
+
'username' and 'password' fields.
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
body (BodyLoginForAccessTokenAuthTokenPost):
|
|
112
|
+
|
|
113
|
+
Raises:
|
|
114
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
115
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
116
|
+
|
|
117
|
+
Returns:
|
|
118
|
+
HTTPValidationError | Token
|
|
119
|
+
"""
|
|
120
|
+
|
|
121
|
+
return sync_detailed(
|
|
122
|
+
client=client,
|
|
123
|
+
body=body,
|
|
124
|
+
).parsed
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
async def asyncio_detailed(
|
|
128
|
+
*,
|
|
129
|
+
client: AuthenticatedClient | Client,
|
|
130
|
+
body: BodyLoginForAccessTokenAuthTokenPost,
|
|
131
|
+
) -> Response[HTTPValidationError | Token]:
|
|
132
|
+
"""Login For Access Token
|
|
133
|
+
|
|
134
|
+
Authenticate user and return access + refresh tokens.
|
|
135
|
+
|
|
136
|
+
Use OAuth2 password flow: POST with form data containing
|
|
137
|
+
'username' and 'password' fields.
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
body (BodyLoginForAccessTokenAuthTokenPost):
|
|
141
|
+
|
|
142
|
+
Raises:
|
|
143
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
144
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
Response[HTTPValidationError | Token]
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
kwargs = _get_kwargs(
|
|
151
|
+
body=body,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
155
|
+
|
|
156
|
+
return _build_response(client=client, response=response)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
async def asyncio(
|
|
160
|
+
*,
|
|
161
|
+
client: AuthenticatedClient | Client,
|
|
162
|
+
body: BodyLoginForAccessTokenAuthTokenPost,
|
|
163
|
+
) -> HTTPValidationError | Token | None:
|
|
164
|
+
"""Login For Access Token
|
|
165
|
+
|
|
166
|
+
Authenticate user and return access + refresh tokens.
|
|
167
|
+
|
|
168
|
+
Use OAuth2 password flow: POST with form data containing
|
|
169
|
+
'username' and 'password' fields.
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
body (BodyLoginForAccessTokenAuthTokenPost):
|
|
173
|
+
|
|
174
|
+
Raises:
|
|
175
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
176
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
177
|
+
|
|
178
|
+
Returns:
|
|
179
|
+
HTTPValidationError | Token
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
await asyncio_detailed(
|
|
184
|
+
client=client,
|
|
185
|
+
body=body,
|
|
186
|
+
)
|
|
187
|
+
).parsed
|
|
@@ -0,0 +1,182 @@
|
|
|
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.refresh_request import RefreshRequest
|
|
10
|
+
from ...models.token import Token
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: RefreshRequest,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "post",
|
|
22
|
+
"url": "/auth/refresh",
|
|
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 | Token | None:
|
|
36
|
+
if response.status_code == 200:
|
|
37
|
+
response_200 = Token.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_200
|
|
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 | Token]:
|
|
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 | Client,
|
|
66
|
+
body: RefreshRequest,
|
|
67
|
+
) -> Response[HTTPValidationError | Token]:
|
|
68
|
+
"""Refresh Access Token
|
|
69
|
+
|
|
70
|
+
Use refresh token to get new access + refresh tokens.
|
|
71
|
+
|
|
72
|
+
TODO: Invalidate the old refresh token once new tokens are issued.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
body (RefreshRequest): Request model for token refresh endpoint.
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
79
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
Response[HTTPValidationError | Token]
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
kwargs = _get_kwargs(
|
|
86
|
+
body=body,
|
|
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 | Client,
|
|
99
|
+
body: RefreshRequest,
|
|
100
|
+
) -> HTTPValidationError | Token | None:
|
|
101
|
+
"""Refresh Access Token
|
|
102
|
+
|
|
103
|
+
Use refresh token to get new access + refresh tokens.
|
|
104
|
+
|
|
105
|
+
TODO: Invalidate the old refresh token once new tokens are issued.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
body (RefreshRequest): Request model for token refresh endpoint.
|
|
109
|
+
|
|
110
|
+
Raises:
|
|
111
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
112
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
HTTPValidationError | Token
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
return sync_detailed(
|
|
119
|
+
client=client,
|
|
120
|
+
body=body,
|
|
121
|
+
).parsed
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
async def asyncio_detailed(
|
|
125
|
+
*,
|
|
126
|
+
client: AuthenticatedClient | Client,
|
|
127
|
+
body: RefreshRequest,
|
|
128
|
+
) -> Response[HTTPValidationError | Token]:
|
|
129
|
+
"""Refresh Access Token
|
|
130
|
+
|
|
131
|
+
Use refresh token to get new access + refresh tokens.
|
|
132
|
+
|
|
133
|
+
TODO: Invalidate the old refresh token once new tokens are issued.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
body (RefreshRequest): Request model for token refresh endpoint.
|
|
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 | Token]
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
kwargs = _get_kwargs(
|
|
147
|
+
body=body,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
151
|
+
|
|
152
|
+
return _build_response(client=client, response=response)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
async def asyncio(
|
|
156
|
+
*,
|
|
157
|
+
client: AuthenticatedClient | Client,
|
|
158
|
+
body: RefreshRequest,
|
|
159
|
+
) -> HTTPValidationError | Token | None:
|
|
160
|
+
"""Refresh Access Token
|
|
161
|
+
|
|
162
|
+
Use refresh token to get new access + refresh tokens.
|
|
163
|
+
|
|
164
|
+
TODO: Invalidate the old refresh token once new tokens are issued.
|
|
165
|
+
|
|
166
|
+
Args:
|
|
167
|
+
body (RefreshRequest): Request model for token refresh endpoint.
|
|
168
|
+
|
|
169
|
+
Raises:
|
|
170
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
171
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
172
|
+
|
|
173
|
+
Returns:
|
|
174
|
+
HTTPValidationError | Token
|
|
175
|
+
"""
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
await asyncio_detailed(
|
|
179
|
+
client=client,
|
|
180
|
+
body=body,
|
|
181
|
+
)
|
|
182
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,128 @@
|
|
|
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.ping_response import PingResponse
|
|
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": "/common/ping",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return _kwargs
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _parse_response(
|
|
23
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
24
|
+
) -> PingResponse | None:
|
|
25
|
+
if response.status_code == 200:
|
|
26
|
+
response_200 = PingResponse.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[PingResponse]:
|
|
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[PingResponse]:
|
|
51
|
+
"""Ping
|
|
52
|
+
|
|
53
|
+
Raises:
|
|
54
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
55
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
Response[PingResponse]
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
kwargs = _get_kwargs()
|
|
62
|
+
|
|
63
|
+
response = client.get_httpx_client().request(
|
|
64
|
+
**kwargs,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return _build_response(client=client, response=response)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def sync(
|
|
71
|
+
*,
|
|
72
|
+
client: AuthenticatedClient,
|
|
73
|
+
) -> PingResponse | None:
|
|
74
|
+
"""Ping
|
|
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
|
+
PingResponse
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
return sync_detailed(
|
|
85
|
+
client=client,
|
|
86
|
+
).parsed
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
async def asyncio_detailed(
|
|
90
|
+
*,
|
|
91
|
+
client: AuthenticatedClient,
|
|
92
|
+
) -> Response[PingResponse]:
|
|
93
|
+
"""Ping
|
|
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
|
+
Response[PingResponse]
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
kwargs = _get_kwargs()
|
|
104
|
+
|
|
105
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
106
|
+
|
|
107
|
+
return _build_response(client=client, response=response)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
async def asyncio(
|
|
111
|
+
*,
|
|
112
|
+
client: AuthenticatedClient,
|
|
113
|
+
) -> PingResponse | None:
|
|
114
|
+
"""Ping
|
|
115
|
+
|
|
116
|
+
Raises:
|
|
117
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
118
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
119
|
+
|
|
120
|
+
Returns:
|
|
121
|
+
PingResponse
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
await asyncio_detailed(
|
|
126
|
+
client=client,
|
|
127
|
+
)
|
|
128
|
+
).parsed
|
|
@@ -0,0 +1,128 @@
|
|
|
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.supported_api_version_response import SupportedApiVersionResponse
|
|
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": "/common/supported_api_version",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return _kwargs
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _parse_response(
|
|
23
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
24
|
+
) -> SupportedApiVersionResponse | None:
|
|
25
|
+
if response.status_code == 200:
|
|
26
|
+
response_200 = SupportedApiVersionResponse.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[SupportedApiVersionResponse]:
|
|
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[SupportedApiVersionResponse]:
|
|
51
|
+
"""Supported Api Version
|
|
52
|
+
|
|
53
|
+
Raises:
|
|
54
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
55
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
Response[SupportedApiVersionResponse]
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
kwargs = _get_kwargs()
|
|
62
|
+
|
|
63
|
+
response = client.get_httpx_client().request(
|
|
64
|
+
**kwargs,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return _build_response(client=client, response=response)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def sync(
|
|
71
|
+
*,
|
|
72
|
+
client: AuthenticatedClient,
|
|
73
|
+
) -> SupportedApiVersionResponse | None:
|
|
74
|
+
"""Supported Api Version
|
|
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
|
+
SupportedApiVersionResponse
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
return sync_detailed(
|
|
85
|
+
client=client,
|
|
86
|
+
).parsed
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
async def asyncio_detailed(
|
|
90
|
+
*,
|
|
91
|
+
client: AuthenticatedClient,
|
|
92
|
+
) -> Response[SupportedApiVersionResponse]:
|
|
93
|
+
"""Supported Api Version
|
|
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
|
+
Response[SupportedApiVersionResponse]
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
kwargs = _get_kwargs()
|
|
104
|
+
|
|
105
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
106
|
+
|
|
107
|
+
return _build_response(client=client, response=response)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
async def asyncio(
|
|
111
|
+
*,
|
|
112
|
+
client: AuthenticatedClient,
|
|
113
|
+
) -> SupportedApiVersionResponse | None:
|
|
114
|
+
"""Supported Api Version
|
|
115
|
+
|
|
116
|
+
Raises:
|
|
117
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
118
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
119
|
+
|
|
120
|
+
Returns:
|
|
121
|
+
SupportedApiVersionResponse
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
await asyncio_detailed(
|
|
126
|
+
client=client,
|
|
127
|
+
)
|
|
128
|
+
).parsed
|