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,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.list_response_company_read import ListResponseCompanyRead
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/valid_companies",
17
+ }
18
+
19
+ return _kwargs
20
+
21
+
22
+ def _parse_response(
23
+ *, client: AuthenticatedClient | Client, response: httpx.Response
24
+ ) -> ListResponseCompanyRead | None:
25
+ if response.status_code == 200:
26
+ response_200 = ListResponseCompanyRead.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[ListResponseCompanyRead]:
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[ListResponseCompanyRead]:
51
+ """Valid Companies
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[ListResponseCompanyRead]
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
+ ) -> ListResponseCompanyRead | None:
74
+ """Valid Companies
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
+ ListResponseCompanyRead
82
+ """
83
+
84
+ return sync_detailed(
85
+ client=client,
86
+ ).parsed
87
+
88
+
89
+ async def asyncio_detailed(
90
+ *,
91
+ client: AuthenticatedClient,
92
+ ) -> Response[ListResponseCompanyRead]:
93
+ """Valid Companies
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[ListResponseCompanyRead]
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
+ ) -> ListResponseCompanyRead | None:
114
+ """Valid Companies
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
+ ListResponseCompanyRead
122
+ """
123
+
124
+ return (
125
+ await asyncio_detailed(
126
+ client=client,
127
+ )
128
+ ).parsed
@@ -0,0 +1,130 @@
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_named_description_read import (
9
+ ListResponseNamedDescriptionRead,
10
+ )
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs() -> dict[str, Any]:
15
+
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "get",
18
+ "url": "/common/valid_directives",
19
+ }
20
+
21
+ return _kwargs
22
+
23
+
24
+ def _parse_response(
25
+ *, client: AuthenticatedClient | Client, response: httpx.Response
26
+ ) -> ListResponseNamedDescriptionRead | None:
27
+ if response.status_code == 200:
28
+ response_200 = ListResponseNamedDescriptionRead.from_dict(response.json())
29
+
30
+ return response_200
31
+
32
+ if client.raise_on_unexpected_status:
33
+ raise errors.UnexpectedStatus(response.status_code, response.content)
34
+ else:
35
+ return None
36
+
37
+
38
+ def _build_response(
39
+ *, client: AuthenticatedClient | Client, response: httpx.Response
40
+ ) -> Response[ListResponseNamedDescriptionRead]:
41
+ return Response(
42
+ status_code=HTTPStatus(response.status_code),
43
+ content=response.content,
44
+ headers=response.headers,
45
+ parsed=_parse_response(client=client, response=response),
46
+ )
47
+
48
+
49
+ def sync_detailed(
50
+ *,
51
+ client: AuthenticatedClient,
52
+ ) -> Response[ListResponseNamedDescriptionRead]:
53
+ """Valid Directives
54
+
55
+ Raises:
56
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
57
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
58
+
59
+ Returns:
60
+ Response[ListResponseNamedDescriptionRead]
61
+ """
62
+
63
+ kwargs = _get_kwargs()
64
+
65
+ response = client.get_httpx_client().request(
66
+ **kwargs,
67
+ )
68
+
69
+ return _build_response(client=client, response=response)
70
+
71
+
72
+ def sync(
73
+ *,
74
+ client: AuthenticatedClient,
75
+ ) -> ListResponseNamedDescriptionRead | None:
76
+ """Valid Directives
77
+
78
+ Raises:
79
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
80
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
81
+
82
+ Returns:
83
+ ListResponseNamedDescriptionRead
84
+ """
85
+
86
+ return sync_detailed(
87
+ client=client,
88
+ ).parsed
89
+
90
+
91
+ async def asyncio_detailed(
92
+ *,
93
+ client: AuthenticatedClient,
94
+ ) -> Response[ListResponseNamedDescriptionRead]:
95
+ """Valid Directives
96
+
97
+ Raises:
98
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
99
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
100
+
101
+ Returns:
102
+ Response[ListResponseNamedDescriptionRead]
103
+ """
104
+
105
+ kwargs = _get_kwargs()
106
+
107
+ response = await client.get_async_httpx_client().request(**kwargs)
108
+
109
+ return _build_response(client=client, response=response)
110
+
111
+
112
+ async def asyncio(
113
+ *,
114
+ client: AuthenticatedClient,
115
+ ) -> ListResponseNamedDescriptionRead | None:
116
+ """Valid Directives
117
+
118
+ Raises:
119
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
120
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
121
+
122
+ Returns:
123
+ ListResponseNamedDescriptionRead
124
+ """
125
+
126
+ return (
127
+ await asyncio_detailed(
128
+ client=client,
129
+ )
130
+ ).parsed
@@ -0,0 +1,130 @@
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_named_description_read import (
9
+ ListResponseNamedDescriptionRead,
10
+ )
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs() -> dict[str, Any]:
15
+
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "get",
18
+ "url": "/common/valid_observables",
19
+ }
20
+
21
+ return _kwargs
22
+
23
+
24
+ def _parse_response(
25
+ *, client: AuthenticatedClient | Client, response: httpx.Response
26
+ ) -> ListResponseNamedDescriptionRead | None:
27
+ if response.status_code == 200:
28
+ response_200 = ListResponseNamedDescriptionRead.from_dict(response.json())
29
+
30
+ return response_200
31
+
32
+ if client.raise_on_unexpected_status:
33
+ raise errors.UnexpectedStatus(response.status_code, response.content)
34
+ else:
35
+ return None
36
+
37
+
38
+ def _build_response(
39
+ *, client: AuthenticatedClient | Client, response: httpx.Response
40
+ ) -> Response[ListResponseNamedDescriptionRead]:
41
+ return Response(
42
+ status_code=HTTPStatus(response.status_code),
43
+ content=response.content,
44
+ headers=response.headers,
45
+ parsed=_parse_response(client=client, response=response),
46
+ )
47
+
48
+
49
+ def sync_detailed(
50
+ *,
51
+ client: AuthenticatedClient,
52
+ ) -> Response[ListResponseNamedDescriptionRead]:
53
+ """Valid Observables
54
+
55
+ Raises:
56
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
57
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
58
+
59
+ Returns:
60
+ Response[ListResponseNamedDescriptionRead]
61
+ """
62
+
63
+ kwargs = _get_kwargs()
64
+
65
+ response = client.get_httpx_client().request(
66
+ **kwargs,
67
+ )
68
+
69
+ return _build_response(client=client, response=response)
70
+
71
+
72
+ def sync(
73
+ *,
74
+ client: AuthenticatedClient,
75
+ ) -> ListResponseNamedDescriptionRead | None:
76
+ """Valid Observables
77
+
78
+ Raises:
79
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
80
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
81
+
82
+ Returns:
83
+ ListResponseNamedDescriptionRead
84
+ """
85
+
86
+ return sync_detailed(
87
+ client=client,
88
+ ).parsed
89
+
90
+
91
+ async def asyncio_detailed(
92
+ *,
93
+ client: AuthenticatedClient,
94
+ ) -> Response[ListResponseNamedDescriptionRead]:
95
+ """Valid Observables
96
+
97
+ Raises:
98
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
99
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
100
+
101
+ Returns:
102
+ Response[ListResponseNamedDescriptionRead]
103
+ """
104
+
105
+ kwargs = _get_kwargs()
106
+
107
+ response = await client.get_async_httpx_client().request(**kwargs)
108
+
109
+ return _build_response(client=client, response=response)
110
+
111
+
112
+ async def asyncio(
113
+ *,
114
+ client: AuthenticatedClient,
115
+ ) -> ListResponseNamedDescriptionRead | None:
116
+ """Valid Observables
117
+
118
+ Raises:
119
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
120
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
121
+
122
+ Returns:
123
+ ListResponseNamedDescriptionRead
124
+ """
125
+
126
+ return (
127
+ await asyncio_detailed(
128
+ client=client,
129
+ )
130
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,192 @@
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.export_format import ExportFormat
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...types import UNSET, Response, Unset
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ type_: ExportFormat | Unset = UNSET,
16
+ checked_events: list[int] | Unset = UNSET,
17
+ ) -> dict[str, Any]:
18
+
19
+ params: dict[str, Any] = {}
20
+
21
+ json_type_: str | Unset = UNSET
22
+ if not isinstance(type_, Unset):
23
+ json_type_ = type_.value
24
+
25
+ params["type"] = json_type_
26
+
27
+ json_checked_events: list[int] | Unset = UNSET
28
+ if not isinstance(checked_events, Unset):
29
+ json_checked_events = checked_events
30
+
31
+ params["checked_events[]"] = json_checked_events
32
+
33
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
34
+
35
+ _kwargs: dict[str, Any] = {
36
+ "method": "get",
37
+ "url": "/events/export",
38
+ "params": params,
39
+ }
40
+
41
+ return _kwargs
42
+
43
+
44
+ def _parse_response(
45
+ *, client: AuthenticatedClient | Client, response: httpx.Response
46
+ ) -> Any | HTTPValidationError | None:
47
+ if response.status_code == 200:
48
+ response_200 = response.json()
49
+ return response_200
50
+
51
+ if response.status_code == 422:
52
+ response_422 = HTTPValidationError.from_dict(response.json())
53
+
54
+ return response_422
55
+
56
+ if client.raise_on_unexpected_status:
57
+ raise errors.UnexpectedStatus(response.status_code, response.content)
58
+ else:
59
+ return None
60
+
61
+
62
+ def _build_response(
63
+ *, client: AuthenticatedClient | Client, response: httpx.Response
64
+ ) -> Response[Any | HTTPValidationError]:
65
+ return Response(
66
+ status_code=HTTPStatus(response.status_code),
67
+ content=response.content,
68
+ headers=response.headers,
69
+ parsed=_parse_response(client=client, response=response),
70
+ )
71
+
72
+
73
+ def sync_detailed(
74
+ *,
75
+ client: AuthenticatedClient,
76
+ type_: ExportFormat | Unset = UNSET,
77
+ checked_events: list[int] | Unset = UNSET,
78
+ ) -> Response[Any | HTTPValidationError]:
79
+ """Export Events
80
+
81
+ Args:
82
+ type_ (ExportFormat | Unset): Supported event export formats. Add new formats here without
83
+ a new route.
84
+ checked_events (list[int] | Unset):
85
+
86
+ Raises:
87
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
88
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
89
+
90
+ Returns:
91
+ Response[Any | HTTPValidationError]
92
+ """
93
+
94
+ kwargs = _get_kwargs(
95
+ type_=type_,
96
+ checked_events=checked_events,
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
+ type_: ExportFormat | Unset = UNSET,
110
+ checked_events: list[int] | Unset = UNSET,
111
+ ) -> Any | HTTPValidationError | None:
112
+ """Export Events
113
+
114
+ Args:
115
+ type_ (ExportFormat | Unset): Supported event export formats. Add new formats here without
116
+ a new route.
117
+ checked_events (list[int] | Unset):
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
+ Any | HTTPValidationError
125
+ """
126
+
127
+ return sync_detailed(
128
+ client=client,
129
+ type_=type_,
130
+ checked_events=checked_events,
131
+ ).parsed
132
+
133
+
134
+ async def asyncio_detailed(
135
+ *,
136
+ client: AuthenticatedClient,
137
+ type_: ExportFormat | Unset = UNSET,
138
+ checked_events: list[int] | Unset = UNSET,
139
+ ) -> Response[Any | HTTPValidationError]:
140
+ """Export Events
141
+
142
+ Args:
143
+ type_ (ExportFormat | Unset): Supported event export formats. Add new formats here without
144
+ a new route.
145
+ checked_events (list[int] | Unset):
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[Any | HTTPValidationError]
153
+ """
154
+
155
+ kwargs = _get_kwargs(
156
+ type_=type_,
157
+ checked_events=checked_events,
158
+ )
159
+
160
+ response = await client.get_async_httpx_client().request(**kwargs)
161
+
162
+ return _build_response(client=client, response=response)
163
+
164
+
165
+ async def asyncio(
166
+ *,
167
+ client: AuthenticatedClient,
168
+ type_: ExportFormat | Unset = UNSET,
169
+ checked_events: list[int] | Unset = UNSET,
170
+ ) -> Any | HTTPValidationError | None:
171
+ """Export Events
172
+
173
+ Args:
174
+ type_ (ExportFormat | Unset): Supported event export formats. Add new formats here without
175
+ a new route.
176
+ checked_events (list[int] | Unset):
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
+ Any | HTTPValidationError
184
+ """
185
+
186
+ return (
187
+ await asyncio_detailed(
188
+ client=client,
189
+ type_=type_,
190
+ checked_events=checked_events,
191
+ )
192
+ ).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.list_response_event_read import ListResponseEventRead
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": "/events/open",
17
+ }
18
+
19
+ return _kwargs
20
+
21
+
22
+ def _parse_response(
23
+ *, client: AuthenticatedClient | Client, response: httpx.Response
24
+ ) -> ListResponseEventRead | None:
25
+ if response.status_code == 200:
26
+ response_200 = ListResponseEventRead.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[ListResponseEventRead]:
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[ListResponseEventRead]:
51
+ """Open Events
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[ListResponseEventRead]
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
+ ) -> ListResponseEventRead | None:
74
+ """Open Events
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
+ ListResponseEventRead
82
+ """
83
+
84
+ return sync_detailed(
85
+ client=client,
86
+ ).parsed
87
+
88
+
89
+ async def asyncio_detailed(
90
+ *,
91
+ client: AuthenticatedClient,
92
+ ) -> Response[ListResponseEventRead]:
93
+ """Open Events
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[ListResponseEventRead]
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
+ ) -> ListResponseEventRead | None:
114
+ """Open Events
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
+ ListResponseEventRead
122
+ """
123
+
124
+ return (
125
+ await asyncio_detailed(
126
+ client=client,
127
+ )
128
+ ).parsed