daknode 0.1.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.
- daknode/__init__.py +8 -0
- daknode/api/__init__.py +1 -0
- daknode/api/block_rules/__init__.py +1 -0
- daknode/api/block_rules/create_block_rule.py +211 -0
- daknode/api/block_rules/create_inbox_block_rule.py +225 -0
- daknode/api/block_rules/delete_block_rule.py +192 -0
- daknode/api/block_rules/list_block_rules.py +214 -0
- daknode/api/block_rules/list_inbox_block_rules.py +228 -0
- daknode/api/consent/__init__.py +1 -0
- daknode/api/consent/create_consent.py +203 -0
- daknode/api/consent/revoke.py +195 -0
- daknode/api/control_plane/__init__.py +1 -0
- daknode/api/control_plane/close_workspace.py +184 -0
- daknode/api/control_plane/create_workspace.py +211 -0
- daknode/api/control_plane/list_workspaces.py +155 -0
- daknode/api/control_plane/read_workspace.py +176 -0
- daknode/api/control_plane/update_workspace.py +197 -0
- daknode/api/dead_letters/__init__.py +1 -0
- daknode/api/dead_letters/list_dead_letters.py +198 -0
- daknode/api/dead_letters/replay_dead_letter.py +216 -0
- daknode/api/inboxes/__init__.py +1 -0
- daknode/api/inboxes/create_inbox.py +183 -0
- daknode/api/inboxes/register_webhook.py +225 -0
- daknode/api/inboxes/rotate_webhook_secret.py +224 -0
- daknode/api/messages/__init__.py +1 -0
- daknode/api/messages/get_message.py +176 -0
- daknode/api/messages/get_thread.py +184 -0
- daknode/api/messages/list_messages.py +228 -0
- daknode/api/messages/list_threads.py +228 -0
- daknode/api/privacy/__init__.py +1 -0
- daknode/api/privacy/create_erasure_request.py +227 -0
- daknode/api/privacy/read_erasure_request.py +200 -0
- daknode/api/public/__init__.py +1 -0
- daknode/api/public/agent_signup.py +191 -0
- daknode/api/public/agent_verify.py +191 -0
- daknode/api/search/__init__.py +1 -0
- daknode/api/search/search.py +207 -0
- daknode/api/send/__init__.py +1 -0
- daknode/api/send/send.py +254 -0
- daknode/client.py +270 -0
- daknode/errors.py +14 -0
- daknode/models/__init__.py +79 -0
- daknode/models/block_rule_create.py +104 -0
- daknode/models/block_rule_out.py +160 -0
- daknode/models/block_rule_page.py +116 -0
- daknode/models/consent_request.py +104 -0
- daknode/models/consent_response.py +105 -0
- daknode/models/create_erasure_request_response_create_erasure_request.py +63 -0
- daknode/models/create_in.py +119 -0
- daknode/models/dead_letter_response.py +205 -0
- daknode/models/erasure_request_body.py +60 -0
- daknode/models/http_validation_error.py +97 -0
- daknode/models/inbox_create_request.py +120 -0
- daknode/models/inbox_response.py +148 -0
- daknode/models/message_out.py +309 -0
- daknode/models/message_page.py +116 -0
- daknode/models/read_erasure_request_response_read_erasure_request.py +63 -0
- daknode/models/replay_response.py +113 -0
- daknode/models/revoke_request.py +74 -0
- daknode/models/revoke_response_revoke.py +63 -0
- daknode/models/search_match.py +170 -0
- daknode/models/search_request.py +107 -0
- daknode/models/search_response.py +124 -0
- daknode/models/send_request.py +162 -0
- daknode/models/send_response_send.py +63 -0
- daknode/models/signup_in.py +63 -0
- daknode/models/signup_out.py +102 -0
- daknode/models/thread_detail_out.py +223 -0
- daknode/models/thread_out.py +163 -0
- daknode/models/thread_page.py +116 -0
- daknode/models/timeline_item_out.py +280 -0
- daknode/models/update_in.py +111 -0
- daknode/models/validation_error.py +141 -0
- daknode/models/validation_error_context.py +63 -0
- daknode/models/verify_in.py +67 -0
- daknode/models/verify_out.py +74 -0
- daknode/models/webhook_register_request.py +74 -0
- daknode/models/workspace_list_out.py +92 -0
- daknode/models/workspace_out.py +147 -0
- daknode/py.typed +1 -0
- daknode/types.py +53 -0
- daknode-0.1.0.dist-info/METADATA +143 -0
- daknode-0.1.0.dist-info/RECORD +84 -0
- daknode-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ...client import AuthenticatedClient, Client
|
|
7
|
+
from ...types import Response, UNSET
|
|
8
|
+
from ... import errors
|
|
9
|
+
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...models.thread_detail_out import ThreadDetailOut
|
|
12
|
+
from typing import cast
|
|
13
|
+
from uuid import UUID
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
thread_id: UUID,
|
|
19
|
+
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "get",
|
|
29
|
+
"url": "/v1/threads/{thread_id}".format(thread_id=thread_id,),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HTTPValidationError, ThreadDetailOut]]:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = ThreadDetailOut.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
return response_200
|
|
43
|
+
if response.status_code == 422:
|
|
44
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
return response_422
|
|
49
|
+
if client.raise_on_unexpected_status:
|
|
50
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
51
|
+
else:
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[HTTPValidationError, ThreadDetailOut]]:
|
|
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
|
+
thread_id: UUID,
|
|
66
|
+
*,
|
|
67
|
+
client: AuthenticatedClient,
|
|
68
|
+
|
|
69
|
+
) -> Response[Union[HTTPValidationError, ThreadDetailOut]]:
|
|
70
|
+
""" Get Thread
|
|
71
|
+
|
|
72
|
+
Follows one merge alias, so a thread id already sent in a webhook still resolves.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
thread_id (UUID):
|
|
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[Union[HTTPValidationError, ThreadDetailOut]]
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
kwargs = _get_kwargs(
|
|
87
|
+
thread_id=thread_id,
|
|
88
|
+
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
response = client.get_httpx_client().request(
|
|
92
|
+
**kwargs,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
return _build_response(client=client, response=response)
|
|
96
|
+
|
|
97
|
+
def sync(
|
|
98
|
+
thread_id: UUID,
|
|
99
|
+
*,
|
|
100
|
+
client: AuthenticatedClient,
|
|
101
|
+
|
|
102
|
+
) -> Optional[Union[HTTPValidationError, ThreadDetailOut]]:
|
|
103
|
+
""" Get Thread
|
|
104
|
+
|
|
105
|
+
Follows one merge alias, so a thread id already sent in a webhook still resolves.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
thread_id (UUID):
|
|
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
|
+
Union[HTTPValidationError, ThreadDetailOut]
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
return sync_detailed(
|
|
120
|
+
thread_id=thread_id,
|
|
121
|
+
client=client,
|
|
122
|
+
|
|
123
|
+
).parsed
|
|
124
|
+
|
|
125
|
+
async def asyncio_detailed(
|
|
126
|
+
thread_id: UUID,
|
|
127
|
+
*,
|
|
128
|
+
client: AuthenticatedClient,
|
|
129
|
+
|
|
130
|
+
) -> Response[Union[HTTPValidationError, ThreadDetailOut]]:
|
|
131
|
+
""" Get Thread
|
|
132
|
+
|
|
133
|
+
Follows one merge alias, so a thread id already sent in a webhook still resolves.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
thread_id (UUID):
|
|
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[Union[HTTPValidationError, ThreadDetailOut]]
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
kwargs = _get_kwargs(
|
|
148
|
+
thread_id=thread_id,
|
|
149
|
+
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
response = await client.get_async_httpx_client().request(
|
|
153
|
+
**kwargs
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
return _build_response(client=client, response=response)
|
|
157
|
+
|
|
158
|
+
async def asyncio(
|
|
159
|
+
thread_id: UUID,
|
|
160
|
+
*,
|
|
161
|
+
client: AuthenticatedClient,
|
|
162
|
+
|
|
163
|
+
) -> Optional[Union[HTTPValidationError, ThreadDetailOut]]:
|
|
164
|
+
""" Get Thread
|
|
165
|
+
|
|
166
|
+
Follows one merge alias, so a thread id already sent in a webhook still resolves.
|
|
167
|
+
|
|
168
|
+
Args:
|
|
169
|
+
thread_id (UUID):
|
|
170
|
+
|
|
171
|
+
Raises:
|
|
172
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
173
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
174
|
+
|
|
175
|
+
Returns:
|
|
176
|
+
Union[HTTPValidationError, ThreadDetailOut]
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
return (await asyncio_detailed(
|
|
181
|
+
thread_id=thread_id,
|
|
182
|
+
client=client,
|
|
183
|
+
|
|
184
|
+
)).parsed
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ...client import AuthenticatedClient, Client
|
|
7
|
+
from ...types import Response, UNSET
|
|
8
|
+
from ... import errors
|
|
9
|
+
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...models.message_page import MessagePage
|
|
12
|
+
from ...types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
from typing import cast, Union
|
|
15
|
+
from typing import Union
|
|
16
|
+
from uuid import UUID
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _get_kwargs(
|
|
21
|
+
inbox_id: UUID,
|
|
22
|
+
*,
|
|
23
|
+
limit: Union[Unset, int] = 25,
|
|
24
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
25
|
+
|
|
26
|
+
) -> dict[str, Any]:
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
params: dict[str, Any] = {}
|
|
32
|
+
|
|
33
|
+
params["limit"] = limit
|
|
34
|
+
|
|
35
|
+
json_cursor: Union[None, Unset, str]
|
|
36
|
+
if isinstance(cursor, Unset):
|
|
37
|
+
json_cursor = UNSET
|
|
38
|
+
else:
|
|
39
|
+
json_cursor = cursor
|
|
40
|
+
params["cursor"] = json_cursor
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
_kwargs: dict[str, Any] = {
|
|
47
|
+
"method": "get",
|
|
48
|
+
"url": "/v1/inboxes/{inbox_id}/messages".format(inbox_id=inbox_id,),
|
|
49
|
+
"params": params,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
return _kwargs
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HTTPValidationError, MessagePage]]:
|
|
57
|
+
if response.status_code == 200:
|
|
58
|
+
response_200 = MessagePage.from_dict(response.json())
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
return response_200
|
|
63
|
+
if response.status_code == 422:
|
|
64
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
return response_422
|
|
69
|
+
if client.raise_on_unexpected_status:
|
|
70
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
71
|
+
else:
|
|
72
|
+
return None
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[HTTPValidationError, MessagePage]]:
|
|
76
|
+
return Response(
|
|
77
|
+
status_code=HTTPStatus(response.status_code),
|
|
78
|
+
content=response.content,
|
|
79
|
+
headers=response.headers,
|
|
80
|
+
parsed=_parse_response(client=client, response=response),
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def sync_detailed(
|
|
85
|
+
inbox_id: UUID,
|
|
86
|
+
*,
|
|
87
|
+
client: AuthenticatedClient,
|
|
88
|
+
limit: Union[Unset, int] = 25,
|
|
89
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
90
|
+
|
|
91
|
+
) -> Response[Union[HTTPValidationError, MessagePage]]:
|
|
92
|
+
""" List Messages
|
|
93
|
+
|
|
94
|
+
Newest first. Keyset pagination per `specs/12` §3.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
inbox_id (UUID):
|
|
98
|
+
limit (Union[Unset, int]): Default: 25.
|
|
99
|
+
cursor (Union[None, Unset, str]):
|
|
100
|
+
|
|
101
|
+
Raises:
|
|
102
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
103
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
Response[Union[HTTPValidationError, MessagePage]]
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
kwargs = _get_kwargs(
|
|
111
|
+
inbox_id=inbox_id,
|
|
112
|
+
limit=limit,
|
|
113
|
+
cursor=cursor,
|
|
114
|
+
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
response = client.get_httpx_client().request(
|
|
118
|
+
**kwargs,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
return _build_response(client=client, response=response)
|
|
122
|
+
|
|
123
|
+
def sync(
|
|
124
|
+
inbox_id: UUID,
|
|
125
|
+
*,
|
|
126
|
+
client: AuthenticatedClient,
|
|
127
|
+
limit: Union[Unset, int] = 25,
|
|
128
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
129
|
+
|
|
130
|
+
) -> Optional[Union[HTTPValidationError, MessagePage]]:
|
|
131
|
+
""" List Messages
|
|
132
|
+
|
|
133
|
+
Newest first. Keyset pagination per `specs/12` §3.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
inbox_id (UUID):
|
|
137
|
+
limit (Union[Unset, int]): Default: 25.
|
|
138
|
+
cursor (Union[None, Unset, str]):
|
|
139
|
+
|
|
140
|
+
Raises:
|
|
141
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
142
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
Union[HTTPValidationError, MessagePage]
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
return sync_detailed(
|
|
150
|
+
inbox_id=inbox_id,
|
|
151
|
+
client=client,
|
|
152
|
+
limit=limit,
|
|
153
|
+
cursor=cursor,
|
|
154
|
+
|
|
155
|
+
).parsed
|
|
156
|
+
|
|
157
|
+
async def asyncio_detailed(
|
|
158
|
+
inbox_id: UUID,
|
|
159
|
+
*,
|
|
160
|
+
client: AuthenticatedClient,
|
|
161
|
+
limit: Union[Unset, int] = 25,
|
|
162
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
163
|
+
|
|
164
|
+
) -> Response[Union[HTTPValidationError, MessagePage]]:
|
|
165
|
+
""" List Messages
|
|
166
|
+
|
|
167
|
+
Newest first. Keyset pagination per `specs/12` §3.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
inbox_id (UUID):
|
|
171
|
+
limit (Union[Unset, int]): Default: 25.
|
|
172
|
+
cursor (Union[None, Unset, str]):
|
|
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
|
+
Response[Union[HTTPValidationError, MessagePage]]
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
kwargs = _get_kwargs(
|
|
184
|
+
inbox_id=inbox_id,
|
|
185
|
+
limit=limit,
|
|
186
|
+
cursor=cursor,
|
|
187
|
+
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
response = await client.get_async_httpx_client().request(
|
|
191
|
+
**kwargs
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
return _build_response(client=client, response=response)
|
|
195
|
+
|
|
196
|
+
async def asyncio(
|
|
197
|
+
inbox_id: UUID,
|
|
198
|
+
*,
|
|
199
|
+
client: AuthenticatedClient,
|
|
200
|
+
limit: Union[Unset, int] = 25,
|
|
201
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
202
|
+
|
|
203
|
+
) -> Optional[Union[HTTPValidationError, MessagePage]]:
|
|
204
|
+
""" List Messages
|
|
205
|
+
|
|
206
|
+
Newest first. Keyset pagination per `specs/12` §3.
|
|
207
|
+
|
|
208
|
+
Args:
|
|
209
|
+
inbox_id (UUID):
|
|
210
|
+
limit (Union[Unset, int]): Default: 25.
|
|
211
|
+
cursor (Union[None, Unset, str]):
|
|
212
|
+
|
|
213
|
+
Raises:
|
|
214
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
215
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
216
|
+
|
|
217
|
+
Returns:
|
|
218
|
+
Union[HTTPValidationError, MessagePage]
|
|
219
|
+
"""
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
return (await asyncio_detailed(
|
|
223
|
+
inbox_id=inbox_id,
|
|
224
|
+
client=client,
|
|
225
|
+
limit=limit,
|
|
226
|
+
cursor=cursor,
|
|
227
|
+
|
|
228
|
+
)).parsed
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ...client import AuthenticatedClient, Client
|
|
7
|
+
from ...types import Response, UNSET
|
|
8
|
+
from ... import errors
|
|
9
|
+
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...models.thread_page import ThreadPage
|
|
12
|
+
from ...types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
from typing import cast, Union
|
|
15
|
+
from typing import Union
|
|
16
|
+
from uuid import UUID
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _get_kwargs(
|
|
21
|
+
inbox_id: UUID,
|
|
22
|
+
*,
|
|
23
|
+
limit: Union[Unset, int] = 25,
|
|
24
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
25
|
+
|
|
26
|
+
) -> dict[str, Any]:
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
params: dict[str, Any] = {}
|
|
32
|
+
|
|
33
|
+
params["limit"] = limit
|
|
34
|
+
|
|
35
|
+
json_cursor: Union[None, Unset, str]
|
|
36
|
+
if isinstance(cursor, Unset):
|
|
37
|
+
json_cursor = UNSET
|
|
38
|
+
else:
|
|
39
|
+
json_cursor = cursor
|
|
40
|
+
params["cursor"] = json_cursor
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
_kwargs: dict[str, Any] = {
|
|
47
|
+
"method": "get",
|
|
48
|
+
"url": "/v1/inboxes/{inbox_id}/threads".format(inbox_id=inbox_id,),
|
|
49
|
+
"params": params,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
return _kwargs
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HTTPValidationError, ThreadPage]]:
|
|
57
|
+
if response.status_code == 200:
|
|
58
|
+
response_200 = ThreadPage.from_dict(response.json())
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
return response_200
|
|
63
|
+
if response.status_code == 422:
|
|
64
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
return response_422
|
|
69
|
+
if client.raise_on_unexpected_status:
|
|
70
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
71
|
+
else:
|
|
72
|
+
return None
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[HTTPValidationError, ThreadPage]]:
|
|
76
|
+
return Response(
|
|
77
|
+
status_code=HTTPStatus(response.status_code),
|
|
78
|
+
content=response.content,
|
|
79
|
+
headers=response.headers,
|
|
80
|
+
parsed=_parse_response(client=client, response=response),
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def sync_detailed(
|
|
85
|
+
inbox_id: UUID,
|
|
86
|
+
*,
|
|
87
|
+
client: AuthenticatedClient,
|
|
88
|
+
limit: Union[Unset, int] = 25,
|
|
89
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
90
|
+
|
|
91
|
+
) -> Response[Union[HTTPValidationError, ThreadPage]]:
|
|
92
|
+
""" List Threads
|
|
93
|
+
|
|
94
|
+
Most recently active first, NULL `last_message_at` last.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
inbox_id (UUID):
|
|
98
|
+
limit (Union[Unset, int]): Default: 25.
|
|
99
|
+
cursor (Union[None, Unset, str]):
|
|
100
|
+
|
|
101
|
+
Raises:
|
|
102
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
103
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
Response[Union[HTTPValidationError, ThreadPage]]
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
kwargs = _get_kwargs(
|
|
111
|
+
inbox_id=inbox_id,
|
|
112
|
+
limit=limit,
|
|
113
|
+
cursor=cursor,
|
|
114
|
+
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
response = client.get_httpx_client().request(
|
|
118
|
+
**kwargs,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
return _build_response(client=client, response=response)
|
|
122
|
+
|
|
123
|
+
def sync(
|
|
124
|
+
inbox_id: UUID,
|
|
125
|
+
*,
|
|
126
|
+
client: AuthenticatedClient,
|
|
127
|
+
limit: Union[Unset, int] = 25,
|
|
128
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
129
|
+
|
|
130
|
+
) -> Optional[Union[HTTPValidationError, ThreadPage]]:
|
|
131
|
+
""" List Threads
|
|
132
|
+
|
|
133
|
+
Most recently active first, NULL `last_message_at` last.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
inbox_id (UUID):
|
|
137
|
+
limit (Union[Unset, int]): Default: 25.
|
|
138
|
+
cursor (Union[None, Unset, str]):
|
|
139
|
+
|
|
140
|
+
Raises:
|
|
141
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
142
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
Union[HTTPValidationError, ThreadPage]
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
return sync_detailed(
|
|
150
|
+
inbox_id=inbox_id,
|
|
151
|
+
client=client,
|
|
152
|
+
limit=limit,
|
|
153
|
+
cursor=cursor,
|
|
154
|
+
|
|
155
|
+
).parsed
|
|
156
|
+
|
|
157
|
+
async def asyncio_detailed(
|
|
158
|
+
inbox_id: UUID,
|
|
159
|
+
*,
|
|
160
|
+
client: AuthenticatedClient,
|
|
161
|
+
limit: Union[Unset, int] = 25,
|
|
162
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
163
|
+
|
|
164
|
+
) -> Response[Union[HTTPValidationError, ThreadPage]]:
|
|
165
|
+
""" List Threads
|
|
166
|
+
|
|
167
|
+
Most recently active first, NULL `last_message_at` last.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
inbox_id (UUID):
|
|
171
|
+
limit (Union[Unset, int]): Default: 25.
|
|
172
|
+
cursor (Union[None, Unset, str]):
|
|
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
|
+
Response[Union[HTTPValidationError, ThreadPage]]
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
kwargs = _get_kwargs(
|
|
184
|
+
inbox_id=inbox_id,
|
|
185
|
+
limit=limit,
|
|
186
|
+
cursor=cursor,
|
|
187
|
+
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
response = await client.get_async_httpx_client().request(
|
|
191
|
+
**kwargs
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
return _build_response(client=client, response=response)
|
|
195
|
+
|
|
196
|
+
async def asyncio(
|
|
197
|
+
inbox_id: UUID,
|
|
198
|
+
*,
|
|
199
|
+
client: AuthenticatedClient,
|
|
200
|
+
limit: Union[Unset, int] = 25,
|
|
201
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
202
|
+
|
|
203
|
+
) -> Optional[Union[HTTPValidationError, ThreadPage]]:
|
|
204
|
+
""" List Threads
|
|
205
|
+
|
|
206
|
+
Most recently active first, NULL `last_message_at` last.
|
|
207
|
+
|
|
208
|
+
Args:
|
|
209
|
+
inbox_id (UUID):
|
|
210
|
+
limit (Union[Unset, int]): Default: 25.
|
|
211
|
+
cursor (Union[None, Unset, str]):
|
|
212
|
+
|
|
213
|
+
Raises:
|
|
214
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
215
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
216
|
+
|
|
217
|
+
Returns:
|
|
218
|
+
Union[HTTPValidationError, ThreadPage]
|
|
219
|
+
"""
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
return (await asyncio_detailed(
|
|
223
|
+
inbox_id=inbox_id,
|
|
224
|
+
client=client,
|
|
225
|
+
limit=limit,
|
|
226
|
+
cursor=cursor,
|
|
227
|
+
|
|
228
|
+
)).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
""" Contains endpoint functions for accessing the API """
|