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,195 @@
|
|
|
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.revoke_request import RevokeRequest
|
|
12
|
+
from ...models.revoke_response_revoke import RevokeResponseRevoke
|
|
13
|
+
from typing import cast
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
*,
|
|
19
|
+
body: RevokeRequest,
|
|
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/consents/revoke",
|
|
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, RevokeResponseRevoke]]:
|
|
44
|
+
if response.status_code == 200:
|
|
45
|
+
response_200 = RevokeResponseRevoke.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[HTTPValidationError, RevokeResponseRevoke]]:
|
|
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: RevokeRequest,
|
|
75
|
+
|
|
76
|
+
) -> Response[Union[HTTPValidationError, RevokeResponseRevoke]]:
|
|
77
|
+
""" Revoke
|
|
78
|
+
|
|
79
|
+
Withdraw consent. The row is revoked, never deleted — deleting it would
|
|
80
|
+
erase the record that consent was ever claimed.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
body (RevokeRequest):
|
|
84
|
+
|
|
85
|
+
Raises:
|
|
86
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
87
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
Response[Union[HTTPValidationError, RevokeResponseRevoke]]
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
kwargs = _get_kwargs(
|
|
95
|
+
body=body,
|
|
96
|
+
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
response = client.get_httpx_client().request(
|
|
100
|
+
**kwargs,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
return _build_response(client=client, response=response)
|
|
104
|
+
|
|
105
|
+
def sync(
|
|
106
|
+
*,
|
|
107
|
+
client: AuthenticatedClient,
|
|
108
|
+
body: RevokeRequest,
|
|
109
|
+
|
|
110
|
+
) -> Optional[Union[HTTPValidationError, RevokeResponseRevoke]]:
|
|
111
|
+
""" Revoke
|
|
112
|
+
|
|
113
|
+
Withdraw consent. The row is revoked, never deleted — deleting it would
|
|
114
|
+
erase the record that consent was ever claimed.
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
body (RevokeRequest):
|
|
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
|
+
Union[HTTPValidationError, RevokeResponseRevoke]
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
return sync_detailed(
|
|
129
|
+
client=client,
|
|
130
|
+
body=body,
|
|
131
|
+
|
|
132
|
+
).parsed
|
|
133
|
+
|
|
134
|
+
async def asyncio_detailed(
|
|
135
|
+
*,
|
|
136
|
+
client: AuthenticatedClient,
|
|
137
|
+
body: RevokeRequest,
|
|
138
|
+
|
|
139
|
+
) -> Response[Union[HTTPValidationError, RevokeResponseRevoke]]:
|
|
140
|
+
""" Revoke
|
|
141
|
+
|
|
142
|
+
Withdraw consent. The row is revoked, never deleted — deleting it would
|
|
143
|
+
erase the record that consent was ever claimed.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
body (RevokeRequest):
|
|
147
|
+
|
|
148
|
+
Raises:
|
|
149
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
150
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
Response[Union[HTTPValidationError, RevokeResponseRevoke]]
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
kwargs = _get_kwargs(
|
|
158
|
+
body=body,
|
|
159
|
+
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
response = await client.get_async_httpx_client().request(
|
|
163
|
+
**kwargs
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
return _build_response(client=client, response=response)
|
|
167
|
+
|
|
168
|
+
async def asyncio(
|
|
169
|
+
*,
|
|
170
|
+
client: AuthenticatedClient,
|
|
171
|
+
body: RevokeRequest,
|
|
172
|
+
|
|
173
|
+
) -> Optional[Union[HTTPValidationError, RevokeResponseRevoke]]:
|
|
174
|
+
""" Revoke
|
|
175
|
+
|
|
176
|
+
Withdraw consent. The row is revoked, never deleted — deleting it would
|
|
177
|
+
erase the record that consent was ever claimed.
|
|
178
|
+
|
|
179
|
+
Args:
|
|
180
|
+
body (RevokeRequest):
|
|
181
|
+
|
|
182
|
+
Raises:
|
|
183
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
184
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
185
|
+
|
|
186
|
+
Returns:
|
|
187
|
+
Union[HTTPValidationError, RevokeResponseRevoke]
|
|
188
|
+
"""
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
return (await asyncio_detailed(
|
|
192
|
+
client=client,
|
|
193
|
+
body=body,
|
|
194
|
+
|
|
195
|
+
)).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
""" Contains endpoint functions for accessing the API """
|
|
@@ -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.workspace_out import WorkspaceOut
|
|
12
|
+
from typing import cast
|
|
13
|
+
from uuid import UUID
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
workspace_id: UUID,
|
|
19
|
+
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "post",
|
|
29
|
+
"url": "/v1/workspaces/{workspace_id}/close".format(workspace_id=workspace_id,),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HTTPValidationError, WorkspaceOut]]:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = WorkspaceOut.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, WorkspaceOut]]:
|
|
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
|
+
workspace_id: UUID,
|
|
66
|
+
*,
|
|
67
|
+
client: AuthenticatedClient,
|
|
68
|
+
|
|
69
|
+
) -> Response[Union[HTTPValidationError, WorkspaceOut]]:
|
|
70
|
+
""" Close Workspace
|
|
71
|
+
|
|
72
|
+
Refused with live children, and refused when it is the default (§8a.4).
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
workspace_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, WorkspaceOut]]
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
kwargs = _get_kwargs(
|
|
87
|
+
workspace_id=workspace_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
|
+
workspace_id: UUID,
|
|
99
|
+
*,
|
|
100
|
+
client: AuthenticatedClient,
|
|
101
|
+
|
|
102
|
+
) -> Optional[Union[HTTPValidationError, WorkspaceOut]]:
|
|
103
|
+
""" Close Workspace
|
|
104
|
+
|
|
105
|
+
Refused with live children, and refused when it is the default (§8a.4).
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
workspace_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, WorkspaceOut]
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
return sync_detailed(
|
|
120
|
+
workspace_id=workspace_id,
|
|
121
|
+
client=client,
|
|
122
|
+
|
|
123
|
+
).parsed
|
|
124
|
+
|
|
125
|
+
async def asyncio_detailed(
|
|
126
|
+
workspace_id: UUID,
|
|
127
|
+
*,
|
|
128
|
+
client: AuthenticatedClient,
|
|
129
|
+
|
|
130
|
+
) -> Response[Union[HTTPValidationError, WorkspaceOut]]:
|
|
131
|
+
""" Close Workspace
|
|
132
|
+
|
|
133
|
+
Refused with live children, and refused when it is the default (§8a.4).
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
workspace_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, WorkspaceOut]]
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
kwargs = _get_kwargs(
|
|
148
|
+
workspace_id=workspace_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
|
+
workspace_id: UUID,
|
|
160
|
+
*,
|
|
161
|
+
client: AuthenticatedClient,
|
|
162
|
+
|
|
163
|
+
) -> Optional[Union[HTTPValidationError, WorkspaceOut]]:
|
|
164
|
+
""" Close Workspace
|
|
165
|
+
|
|
166
|
+
Refused with live children, and refused when it is the default (§8a.4).
|
|
167
|
+
|
|
168
|
+
Args:
|
|
169
|
+
workspace_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, WorkspaceOut]
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
return (await asyncio_detailed(
|
|
181
|
+
workspace_id=workspace_id,
|
|
182
|
+
client=client,
|
|
183
|
+
|
|
184
|
+
)).parsed
|
|
@@ -0,0 +1,211 @@
|
|
|
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_in import CreateIn
|
|
11
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
12
|
+
from ...models.workspace_out import WorkspaceOut
|
|
13
|
+
from typing import cast
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
*,
|
|
19
|
+
body: CreateIn,
|
|
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/workspaces",
|
|
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, WorkspaceOut]]:
|
|
44
|
+
if response.status_code == 201:
|
|
45
|
+
response_201 = WorkspaceOut.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, WorkspaceOut]]:
|
|
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: CreateIn,
|
|
75
|
+
|
|
76
|
+
) -> Response[Union[HTTPValidationError, WorkspaceOut]]:
|
|
77
|
+
""" Create Workspace
|
|
78
|
+
|
|
79
|
+
Provision a Workspace. **Idempotent on `external_client_id`** — a repeat
|
|
80
|
+
returns the existing Workspace with 200, so a retrying provisioner can tell
|
|
81
|
+
whether it created anything.
|
|
82
|
+
|
|
83
|
+
**No plan limit is enforced** (W6-BOUNDARY): additional customer-created
|
|
84
|
+
Workspaces must not become production-available until W7a lands.
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
body (CreateIn):
|
|
88
|
+
|
|
89
|
+
Raises:
|
|
90
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
91
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
92
|
+
|
|
93
|
+
Returns:
|
|
94
|
+
Response[Union[HTTPValidationError, WorkspaceOut]]
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
kwargs = _get_kwargs(
|
|
99
|
+
body=body,
|
|
100
|
+
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
response = client.get_httpx_client().request(
|
|
104
|
+
**kwargs,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
return _build_response(client=client, response=response)
|
|
108
|
+
|
|
109
|
+
def sync(
|
|
110
|
+
*,
|
|
111
|
+
client: AuthenticatedClient,
|
|
112
|
+
body: CreateIn,
|
|
113
|
+
|
|
114
|
+
) -> Optional[Union[HTTPValidationError, WorkspaceOut]]:
|
|
115
|
+
""" Create Workspace
|
|
116
|
+
|
|
117
|
+
Provision a Workspace. **Idempotent on `external_client_id`** — a repeat
|
|
118
|
+
returns the existing Workspace with 200, so a retrying provisioner can tell
|
|
119
|
+
whether it created anything.
|
|
120
|
+
|
|
121
|
+
**No plan limit is enforced** (W6-BOUNDARY): additional customer-created
|
|
122
|
+
Workspaces must not become production-available until W7a lands.
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
body (CreateIn):
|
|
126
|
+
|
|
127
|
+
Raises:
|
|
128
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
129
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
Union[HTTPValidationError, WorkspaceOut]
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
return sync_detailed(
|
|
137
|
+
client=client,
|
|
138
|
+
body=body,
|
|
139
|
+
|
|
140
|
+
).parsed
|
|
141
|
+
|
|
142
|
+
async def asyncio_detailed(
|
|
143
|
+
*,
|
|
144
|
+
client: AuthenticatedClient,
|
|
145
|
+
body: CreateIn,
|
|
146
|
+
|
|
147
|
+
) -> Response[Union[HTTPValidationError, WorkspaceOut]]:
|
|
148
|
+
""" Create Workspace
|
|
149
|
+
|
|
150
|
+
Provision a Workspace. **Idempotent on `external_client_id`** — a repeat
|
|
151
|
+
returns the existing Workspace with 200, so a retrying provisioner can tell
|
|
152
|
+
whether it created anything.
|
|
153
|
+
|
|
154
|
+
**No plan limit is enforced** (W6-BOUNDARY): additional customer-created
|
|
155
|
+
Workspaces must not become production-available until W7a lands.
|
|
156
|
+
|
|
157
|
+
Args:
|
|
158
|
+
body (CreateIn):
|
|
159
|
+
|
|
160
|
+
Raises:
|
|
161
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
162
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
Response[Union[HTTPValidationError, WorkspaceOut]]
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
kwargs = _get_kwargs(
|
|
170
|
+
body=body,
|
|
171
|
+
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
response = await client.get_async_httpx_client().request(
|
|
175
|
+
**kwargs
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
return _build_response(client=client, response=response)
|
|
179
|
+
|
|
180
|
+
async def asyncio(
|
|
181
|
+
*,
|
|
182
|
+
client: AuthenticatedClient,
|
|
183
|
+
body: CreateIn,
|
|
184
|
+
|
|
185
|
+
) -> Optional[Union[HTTPValidationError, WorkspaceOut]]:
|
|
186
|
+
""" Create Workspace
|
|
187
|
+
|
|
188
|
+
Provision a Workspace. **Idempotent on `external_client_id`** — a repeat
|
|
189
|
+
returns the existing Workspace with 200, so a retrying provisioner can tell
|
|
190
|
+
whether it created anything.
|
|
191
|
+
|
|
192
|
+
**No plan limit is enforced** (W6-BOUNDARY): additional customer-created
|
|
193
|
+
Workspaces must not become production-available until W7a lands.
|
|
194
|
+
|
|
195
|
+
Args:
|
|
196
|
+
body (CreateIn):
|
|
197
|
+
|
|
198
|
+
Raises:
|
|
199
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
200
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
201
|
+
|
|
202
|
+
Returns:
|
|
203
|
+
Union[HTTPValidationError, WorkspaceOut]
|
|
204
|
+
"""
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
return (await asyncio_detailed(
|
|
208
|
+
client=client,
|
|
209
|
+
body=body,
|
|
210
|
+
|
|
211
|
+
)).parsed
|