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,227 @@
|
|
|
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.create_erasure_request_response_create_erasure_request import CreateErasureRequestResponseCreateErasureRequest
|
|
11
|
+
from ...models.erasure_request_body import ErasureRequestBody
|
|
12
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
13
|
+
from typing import cast
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
*,
|
|
19
|
+
body: ErasureRequestBody,
|
|
20
|
+
|
|
21
|
+
) -> dict[str, Any]:
|
|
22
|
+
headers: dict[str, Any] = {}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
_kwargs: dict[str, Any] = {
|
|
30
|
+
"method": "post",
|
|
31
|
+
"url": "/v1/privacy/erasure-requests",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_kwargs["json"] = body.to_dict()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
headers["Content-Type"] = "application/json"
|
|
38
|
+
|
|
39
|
+
_kwargs["headers"] = headers
|
|
40
|
+
return _kwargs
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]]:
|
|
44
|
+
if response.status_code == 200:
|
|
45
|
+
response_200 = CreateErasureRequestResponseCreateErasureRequest.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
return response_200
|
|
50
|
+
if response.status_code == 422:
|
|
51
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
return response_422
|
|
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(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]]:
|
|
63
|
+
return Response(
|
|
64
|
+
status_code=HTTPStatus(response.status_code),
|
|
65
|
+
content=response.content,
|
|
66
|
+
headers=response.headers,
|
|
67
|
+
parsed=_parse_response(client=client, response=response),
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def sync_detailed(
|
|
72
|
+
*,
|
|
73
|
+
client: AuthenticatedClient,
|
|
74
|
+
body: ErasureRequestBody,
|
|
75
|
+
|
|
76
|
+
) -> Response[Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]]:
|
|
77
|
+
""" Create Erasure Request
|
|
78
|
+
|
|
79
|
+
Accept an erasure request for one subject.
|
|
80
|
+
|
|
81
|
+
`202` for a new request, `200` when an open one already existed — a client
|
|
82
|
+
that timed out and retried gets the original back rather than a second sweep
|
|
83
|
+
over the same records.
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
body (ErasureRequestBody): The address is in the BODY, never the path or a query
|
|
87
|
+
parameter.
|
|
88
|
+
|
|
89
|
+
A URL is written to every proxy, load balancer and access log on the path
|
|
90
|
+
and leaks through `Referer`. Putting a data subject's address there would
|
|
91
|
+
scatter it across systems this erasure cannot reach.
|
|
92
|
+
|
|
93
|
+
Raises:
|
|
94
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
95
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
Response[Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]]
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
kwargs = _get_kwargs(
|
|
103
|
+
body=body,
|
|
104
|
+
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
response = client.get_httpx_client().request(
|
|
108
|
+
**kwargs,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
return _build_response(client=client, response=response)
|
|
112
|
+
|
|
113
|
+
def sync(
|
|
114
|
+
*,
|
|
115
|
+
client: AuthenticatedClient,
|
|
116
|
+
body: ErasureRequestBody,
|
|
117
|
+
|
|
118
|
+
) -> Optional[Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]]:
|
|
119
|
+
""" Create Erasure Request
|
|
120
|
+
|
|
121
|
+
Accept an erasure request for one subject.
|
|
122
|
+
|
|
123
|
+
`202` for a new request, `200` when an open one already existed — a client
|
|
124
|
+
that timed out and retried gets the original back rather than a second sweep
|
|
125
|
+
over the same records.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
body (ErasureRequestBody): The address is in the BODY, never the path or a query
|
|
129
|
+
parameter.
|
|
130
|
+
|
|
131
|
+
A URL is written to every proxy, load balancer and access log on the path
|
|
132
|
+
and leaks through `Referer`. Putting a data subject's address there would
|
|
133
|
+
scatter it across systems this erasure cannot reach.
|
|
134
|
+
|
|
135
|
+
Raises:
|
|
136
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
137
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
return sync_detailed(
|
|
145
|
+
client=client,
|
|
146
|
+
body=body,
|
|
147
|
+
|
|
148
|
+
).parsed
|
|
149
|
+
|
|
150
|
+
async def asyncio_detailed(
|
|
151
|
+
*,
|
|
152
|
+
client: AuthenticatedClient,
|
|
153
|
+
body: ErasureRequestBody,
|
|
154
|
+
|
|
155
|
+
) -> Response[Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]]:
|
|
156
|
+
""" Create Erasure Request
|
|
157
|
+
|
|
158
|
+
Accept an erasure request for one subject.
|
|
159
|
+
|
|
160
|
+
`202` for a new request, `200` when an open one already existed — a client
|
|
161
|
+
that timed out and retried gets the original back rather than a second sweep
|
|
162
|
+
over the same records.
|
|
163
|
+
|
|
164
|
+
Args:
|
|
165
|
+
body (ErasureRequestBody): The address is in the BODY, never the path or a query
|
|
166
|
+
parameter.
|
|
167
|
+
|
|
168
|
+
A URL is written to every proxy, load balancer and access log on the path
|
|
169
|
+
and leaks through `Referer`. Putting a data subject's address there would
|
|
170
|
+
scatter it across systems this erasure cannot reach.
|
|
171
|
+
|
|
172
|
+
Raises:
|
|
173
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
174
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
175
|
+
|
|
176
|
+
Returns:
|
|
177
|
+
Response[Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]]
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
kwargs = _get_kwargs(
|
|
182
|
+
body=body,
|
|
183
|
+
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
response = await client.get_async_httpx_client().request(
|
|
187
|
+
**kwargs
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
return _build_response(client=client, response=response)
|
|
191
|
+
|
|
192
|
+
async def asyncio(
|
|
193
|
+
*,
|
|
194
|
+
client: AuthenticatedClient,
|
|
195
|
+
body: ErasureRequestBody,
|
|
196
|
+
|
|
197
|
+
) -> Optional[Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]]:
|
|
198
|
+
""" Create Erasure Request
|
|
199
|
+
|
|
200
|
+
Accept an erasure request for one subject.
|
|
201
|
+
|
|
202
|
+
`202` for a new request, `200` when an open one already existed — a client
|
|
203
|
+
that timed out and retried gets the original back rather than a second sweep
|
|
204
|
+
over the same records.
|
|
205
|
+
|
|
206
|
+
Args:
|
|
207
|
+
body (ErasureRequestBody): The address is in the BODY, never the path or a query
|
|
208
|
+
parameter.
|
|
209
|
+
|
|
210
|
+
A URL is written to every proxy, load balancer and access log on the path
|
|
211
|
+
and leaks through `Referer`. Putting a data subject's address there would
|
|
212
|
+
scatter it across systems this erasure cannot reach.
|
|
213
|
+
|
|
214
|
+
Raises:
|
|
215
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
216
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
217
|
+
|
|
218
|
+
Returns:
|
|
219
|
+
Union[CreateErasureRequestResponseCreateErasureRequest, HTTPValidationError]
|
|
220
|
+
"""
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
return (await asyncio_detailed(
|
|
224
|
+
client=client,
|
|
225
|
+
body=body,
|
|
226
|
+
|
|
227
|
+
)).parsed
|
|
@@ -0,0 +1,200 @@
|
|
|
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.read_erasure_request_response_read_erasure_request import ReadErasureRequestResponseReadErasureRequest
|
|
12
|
+
from typing import cast
|
|
13
|
+
from uuid import UUID
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
request_id: UUID,
|
|
19
|
+
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "get",
|
|
29
|
+
"url": "/v1/privacy/erasure-requests/{request_id}".format(request_id=request_id,),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HTTPValidationError, ReadErasureRequestResponseReadErasureRequest]]:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = ReadErasureRequestResponseReadErasureRequest.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, ReadErasureRequestResponseReadErasureRequest]]:
|
|
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
|
+
request_id: UUID,
|
|
66
|
+
*,
|
|
67
|
+
client: AuthenticatedClient,
|
|
68
|
+
|
|
69
|
+
) -> Response[Union[HTTPValidationError, ReadErasureRequestResponseReadErasureRequest]]:
|
|
70
|
+
""" Read Erasure Request
|
|
71
|
+
|
|
72
|
+
Report progress. Takes the **request id**, never the address.
|
|
73
|
+
|
|
74
|
+
A cross-tenant read is a `404` *and* a security event. Unlike a wrong
|
|
75
|
+
`inbox_id` — a plausible client bug — a request naming another tenant's
|
|
76
|
+
erasure record is an attempt to reach data the caller does not own.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
request_id (UUID):
|
|
80
|
+
|
|
81
|
+
Raises:
|
|
82
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
83
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
Response[Union[HTTPValidationError, ReadErasureRequestResponseReadErasureRequest]]
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
kwargs = _get_kwargs(
|
|
91
|
+
request_id=request_id,
|
|
92
|
+
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
response = client.get_httpx_client().request(
|
|
96
|
+
**kwargs,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
return _build_response(client=client, response=response)
|
|
100
|
+
|
|
101
|
+
def sync(
|
|
102
|
+
request_id: UUID,
|
|
103
|
+
*,
|
|
104
|
+
client: AuthenticatedClient,
|
|
105
|
+
|
|
106
|
+
) -> Optional[Union[HTTPValidationError, ReadErasureRequestResponseReadErasureRequest]]:
|
|
107
|
+
""" Read Erasure Request
|
|
108
|
+
|
|
109
|
+
Report progress. Takes the **request id**, never the address.
|
|
110
|
+
|
|
111
|
+
A cross-tenant read is a `404` *and* a security event. Unlike a wrong
|
|
112
|
+
`inbox_id` — a plausible client bug — a request naming another tenant's
|
|
113
|
+
erasure record is an attempt to reach data the caller does not own.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
request_id (UUID):
|
|
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
|
+
Union[HTTPValidationError, ReadErasureRequestResponseReadErasureRequest]
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
return sync_detailed(
|
|
128
|
+
request_id=request_id,
|
|
129
|
+
client=client,
|
|
130
|
+
|
|
131
|
+
).parsed
|
|
132
|
+
|
|
133
|
+
async def asyncio_detailed(
|
|
134
|
+
request_id: UUID,
|
|
135
|
+
*,
|
|
136
|
+
client: AuthenticatedClient,
|
|
137
|
+
|
|
138
|
+
) -> Response[Union[HTTPValidationError, ReadErasureRequestResponseReadErasureRequest]]:
|
|
139
|
+
""" Read Erasure Request
|
|
140
|
+
|
|
141
|
+
Report progress. Takes the **request id**, never the address.
|
|
142
|
+
|
|
143
|
+
A cross-tenant read is a `404` *and* a security event. Unlike a wrong
|
|
144
|
+
`inbox_id` — a plausible client bug — a request naming another tenant's
|
|
145
|
+
erasure record is an attempt to reach data the caller does not own.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
request_id (UUID):
|
|
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
|
+
Response[Union[HTTPValidationError, ReadErasureRequestResponseReadErasureRequest]]
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
kwargs = _get_kwargs(
|
|
160
|
+
request_id=request_id,
|
|
161
|
+
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
response = await client.get_async_httpx_client().request(
|
|
165
|
+
**kwargs
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
return _build_response(client=client, response=response)
|
|
169
|
+
|
|
170
|
+
async def asyncio(
|
|
171
|
+
request_id: UUID,
|
|
172
|
+
*,
|
|
173
|
+
client: AuthenticatedClient,
|
|
174
|
+
|
|
175
|
+
) -> Optional[Union[HTTPValidationError, ReadErasureRequestResponseReadErasureRequest]]:
|
|
176
|
+
""" Read Erasure Request
|
|
177
|
+
|
|
178
|
+
Report progress. Takes the **request id**, never the address.
|
|
179
|
+
|
|
180
|
+
A cross-tenant read is a `404` *and* a security event. Unlike a wrong
|
|
181
|
+
`inbox_id` — a plausible client bug — a request naming another tenant's
|
|
182
|
+
erasure record is an attempt to reach data the caller does not own.
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
request_id (UUID):
|
|
186
|
+
|
|
187
|
+
Raises:
|
|
188
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
189
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
190
|
+
|
|
191
|
+
Returns:
|
|
192
|
+
Union[HTTPValidationError, ReadErasureRequestResponseReadErasureRequest]
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
return (await asyncio_detailed(
|
|
197
|
+
request_id=request_id,
|
|
198
|
+
client=client,
|
|
199
|
+
|
|
200
|
+
)).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
""" Contains endpoint functions for accessing the API """
|
|
@@ -0,0 +1,191 @@
|
|
|
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.signup_in import SignupIn
|
|
12
|
+
from ...models.signup_out import SignupOut
|
|
13
|
+
from typing import cast
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
*,
|
|
19
|
+
body: SignupIn,
|
|
20
|
+
|
|
21
|
+
) -> dict[str, Any]:
|
|
22
|
+
headers: dict[str, Any] = {}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
_kwargs: dict[str, Any] = {
|
|
30
|
+
"method": "post",
|
|
31
|
+
"url": "/v1/public/agents/signup",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_kwargs["json"] = body.to_dict()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
headers["Content-Type"] = "application/json"
|
|
38
|
+
|
|
39
|
+
_kwargs["headers"] = headers
|
|
40
|
+
return _kwargs
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HTTPValidationError, SignupOut]]:
|
|
44
|
+
if response.status_code == 201:
|
|
45
|
+
response_201 = SignupOut.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
return response_201
|
|
50
|
+
if response.status_code == 422:
|
|
51
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
return response_422
|
|
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(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[HTTPValidationError, SignupOut]]:
|
|
63
|
+
return Response(
|
|
64
|
+
status_code=HTTPStatus(response.status_code),
|
|
65
|
+
content=response.content,
|
|
66
|
+
headers=response.headers,
|
|
67
|
+
parsed=_parse_response(client=client, response=response),
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def sync_detailed(
|
|
72
|
+
*,
|
|
73
|
+
client: Union[AuthenticatedClient, Client],
|
|
74
|
+
body: SignupIn,
|
|
75
|
+
|
|
76
|
+
) -> Response[Union[HTTPValidationError, SignupOut]]:
|
|
77
|
+
""" Agent Signup
|
|
78
|
+
|
|
79
|
+
Register an agent and mail its human a verification code.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
body (SignupIn):
|
|
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
|
+
Response[Union[HTTPValidationError, SignupOut]]
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
kwargs = _get_kwargs(
|
|
94
|
+
body=body,
|
|
95
|
+
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
response = client.get_httpx_client().request(
|
|
99
|
+
**kwargs,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
return _build_response(client=client, response=response)
|
|
103
|
+
|
|
104
|
+
def sync(
|
|
105
|
+
*,
|
|
106
|
+
client: Union[AuthenticatedClient, Client],
|
|
107
|
+
body: SignupIn,
|
|
108
|
+
|
|
109
|
+
) -> Optional[Union[HTTPValidationError, SignupOut]]:
|
|
110
|
+
""" Agent Signup
|
|
111
|
+
|
|
112
|
+
Register an agent and mail its human a verification code.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
body (SignupIn):
|
|
116
|
+
|
|
117
|
+
Raises:
|
|
118
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
119
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
Union[HTTPValidationError, SignupOut]
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
return sync_detailed(
|
|
127
|
+
client=client,
|
|
128
|
+
body=body,
|
|
129
|
+
|
|
130
|
+
).parsed
|
|
131
|
+
|
|
132
|
+
async def asyncio_detailed(
|
|
133
|
+
*,
|
|
134
|
+
client: Union[AuthenticatedClient, Client],
|
|
135
|
+
body: SignupIn,
|
|
136
|
+
|
|
137
|
+
) -> Response[Union[HTTPValidationError, SignupOut]]:
|
|
138
|
+
""" Agent Signup
|
|
139
|
+
|
|
140
|
+
Register an agent and mail its human a verification code.
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
body (SignupIn):
|
|
144
|
+
|
|
145
|
+
Raises:
|
|
146
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
147
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
Response[Union[HTTPValidationError, SignupOut]]
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
kwargs = _get_kwargs(
|
|
155
|
+
body=body,
|
|
156
|
+
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
response = await client.get_async_httpx_client().request(
|
|
160
|
+
**kwargs
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
return _build_response(client=client, response=response)
|
|
164
|
+
|
|
165
|
+
async def asyncio(
|
|
166
|
+
*,
|
|
167
|
+
client: Union[AuthenticatedClient, Client],
|
|
168
|
+
body: SignupIn,
|
|
169
|
+
|
|
170
|
+
) -> Optional[Union[HTTPValidationError, SignupOut]]:
|
|
171
|
+
""" Agent Signup
|
|
172
|
+
|
|
173
|
+
Register an agent and mail its human a verification code.
|
|
174
|
+
|
|
175
|
+
Args:
|
|
176
|
+
body (SignupIn):
|
|
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
|
+
Union[HTTPValidationError, SignupOut]
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
return (await asyncio_detailed(
|
|
188
|
+
client=client,
|
|
189
|
+
body=body,
|
|
190
|
+
|
|
191
|
+
)).parsed
|