daknode 0.2.0__tar.gz → 0.3.1__tar.gz
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-0.2.0 → daknode-0.3.1}/PKG-INFO +1 -1
- daknode-0.3.1/daknode/api/domains/disable_domain.py +176 -0
- daknode-0.3.1/daknode/api/domains/get_domain.py +176 -0
- daknode-0.3.1/daknode/api/domains/list_domains.py +206 -0
- daknode-0.3.1/daknode/api/domains/register_domain.py +183 -0
- daknode-0.3.1/daknode/api/domains/verify_domain.py +197 -0
- daknode-0.3.1/daknode/api/messages/download_received_attachment.py +179 -0
- daknode-0.3.1/daknode/api/messages/list_received_attachments.py +181 -0
- daknode-0.3.1/daknode/api/send/__init__.py +1 -0
- daknode-0.3.1/daknode/api/send/forward_message.py +244 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/send/send.py +4 -4
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/__init__.py +16 -0
- daknode-0.3.1/daknode/models/attachment_out.py +126 -0
- daknode-0.3.1/daknode/models/check_domain_request.py +77 -0
- daknode-0.3.1/daknode/models/dns_record.py +98 -0
- daknode-0.3.1/daknode/models/domain_out.py +166 -0
- daknode-0.3.1/daknode/models/domain_page.py +116 -0
- daknode-0.3.1/daknode/models/forward_message_response_forward_message.py +63 -0
- daknode-0.3.1/daknode/models/forward_request.py +165 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/inbox_create_request.py +34 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/message_out.py +68 -0
- daknode-0.3.1/daknode/models/register_domain_request.py +74 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/send_request.py +107 -6
- {daknode-0.2.0 → daknode-0.3.1}/pyproject.toml +1 -1
- {daknode-0.2.0 → daknode-0.3.1}/README.md +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/block_rules/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/block_rules/create_block_rule.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/block_rules/create_inbox_block_rule.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/block_rules/delete_block_rule.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/block_rules/list_block_rules.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/block_rules/list_inbox_block_rules.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/consent/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/consent/create_consent.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/consent/revoke.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/control_plane/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/control_plane/close_workspace.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/control_plane/create_workspace.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/control_plane/list_workspaces.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/control_plane/read_workspace.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/control_plane/update_workspace.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/dead_letters/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/dead_letters/list_dead_letters.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/dead_letters/replay_dead_letter.py +0 -0
- {daknode-0.2.0/daknode/api/inboxes → daknode-0.3.1/daknode/api/domains}/__init__.py +0 -0
- {daknode-0.2.0/daknode/api/messages → daknode-0.3.1/daknode/api/inboxes}/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/inboxes/create_inbox.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/inboxes/delete_inbox.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/inboxes/get_inbox.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/inboxes/list_inboxes.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/inboxes/register_webhook.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/inboxes/rotate_webhook_secret.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/inboxes/update_inbox.py +0 -0
- {daknode-0.2.0/daknode/api/privacy → daknode-0.3.1/daknode/api/messages}/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/messages/get_message.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/messages/get_thread.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/messages/list_messages.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/messages/list_threads.py +0 -0
- {daknode-0.2.0/daknode/api/public → daknode-0.3.1/daknode/api/privacy}/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/privacy/create_erasure_request.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/privacy/read_erasure_request.py +0 -0
- {daknode-0.2.0/daknode/api/search → daknode-0.3.1/daknode/api/public}/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/public/agent_signup.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/public/agent_verify.py +0 -0
- {daknode-0.2.0/daknode/api/send → daknode-0.3.1/daknode/api/search}/__init__.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/api/search/search.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/client.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/errors.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/block_rule_create.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/block_rule_out.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/block_rule_page.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/consent_request.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/consent_response.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/create_erasure_request_response_create_erasure_request.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/create_in.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/dead_letter_response.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/erasure_request_body.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/http_validation_error.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/inbox_deleted.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/inbox_out.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/inbox_page.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/inbox_response.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/inbox_update_request.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/message_page.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/read_erasure_request_response_read_erasure_request.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/replay_response.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/revoke_request.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/revoke_response_revoke.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/search_match.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/search_request.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/search_response.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/send_response_send.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/signup_in.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/signup_out.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/thread_detail_out.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/thread_out.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/thread_page.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/timeline_item_out.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/update_in.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/validation_error.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/validation_error_context.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/verify_in.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/verify_out.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/webhook_register_request.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/workspace_list_out.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/models/workspace_out.py +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/py.typed +0 -0
- {daknode-0.2.0 → daknode-0.3.1}/daknode/types.py +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
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.domain_out import DomainOut
|
|
11
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
12
|
+
from typing import cast
|
|
13
|
+
from uuid import UUID
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
domain_id: UUID,
|
|
19
|
+
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "post",
|
|
29
|
+
"url": "/v1/domains/{domain_id}/disable".format(domain_id=domain_id,),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[DomainOut, HTTPValidationError]]:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = DomainOut.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[DomainOut, HTTPValidationError]]:
|
|
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
|
+
domain_id: UUID,
|
|
66
|
+
*,
|
|
67
|
+
client: AuthenticatedClient,
|
|
68
|
+
|
|
69
|
+
) -> Response[Union[DomainOut, HTTPValidationError]]:
|
|
70
|
+
""" Disable Domain
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
domain_id (UUID):
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
Response[Union[DomainOut, HTTPValidationError]]
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
kwargs = _get_kwargs(
|
|
85
|
+
domain_id=domain_id,
|
|
86
|
+
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
response = client.get_httpx_client().request(
|
|
90
|
+
**kwargs,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return _build_response(client=client, response=response)
|
|
94
|
+
|
|
95
|
+
def sync(
|
|
96
|
+
domain_id: UUID,
|
|
97
|
+
*,
|
|
98
|
+
client: AuthenticatedClient,
|
|
99
|
+
|
|
100
|
+
) -> Optional[Union[DomainOut, HTTPValidationError]]:
|
|
101
|
+
""" Disable Domain
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
domain_id (UUID):
|
|
105
|
+
|
|
106
|
+
Raises:
|
|
107
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
108
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
Union[DomainOut, HTTPValidationError]
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
return sync_detailed(
|
|
116
|
+
domain_id=domain_id,
|
|
117
|
+
client=client,
|
|
118
|
+
|
|
119
|
+
).parsed
|
|
120
|
+
|
|
121
|
+
async def asyncio_detailed(
|
|
122
|
+
domain_id: UUID,
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient,
|
|
125
|
+
|
|
126
|
+
) -> Response[Union[DomainOut, HTTPValidationError]]:
|
|
127
|
+
""" Disable Domain
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
domain_id (UUID):
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
134
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
Response[Union[DomainOut, HTTPValidationError]]
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
kwargs = _get_kwargs(
|
|
142
|
+
domain_id=domain_id,
|
|
143
|
+
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
response = await client.get_async_httpx_client().request(
|
|
147
|
+
**kwargs
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
return _build_response(client=client, response=response)
|
|
151
|
+
|
|
152
|
+
async def asyncio(
|
|
153
|
+
domain_id: UUID,
|
|
154
|
+
*,
|
|
155
|
+
client: AuthenticatedClient,
|
|
156
|
+
|
|
157
|
+
) -> Optional[Union[DomainOut, HTTPValidationError]]:
|
|
158
|
+
""" Disable Domain
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
domain_id (UUID):
|
|
162
|
+
|
|
163
|
+
Raises:
|
|
164
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
165
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
166
|
+
|
|
167
|
+
Returns:
|
|
168
|
+
Union[DomainOut, HTTPValidationError]
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
return (await asyncio_detailed(
|
|
173
|
+
domain_id=domain_id,
|
|
174
|
+
client=client,
|
|
175
|
+
|
|
176
|
+
)).parsed
|
|
@@ -0,0 +1,176 @@
|
|
|
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.domain_out import DomainOut
|
|
11
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
12
|
+
from typing import cast
|
|
13
|
+
from uuid import UUID
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
domain_id: UUID,
|
|
19
|
+
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "get",
|
|
29
|
+
"url": "/v1/domains/{domain_id}".format(domain_id=domain_id,),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[DomainOut, HTTPValidationError]]:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = DomainOut.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[DomainOut, HTTPValidationError]]:
|
|
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
|
+
domain_id: UUID,
|
|
66
|
+
*,
|
|
67
|
+
client: AuthenticatedClient,
|
|
68
|
+
|
|
69
|
+
) -> Response[Union[DomainOut, HTTPValidationError]]:
|
|
70
|
+
""" Get Domain
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
domain_id (UUID):
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
Response[Union[DomainOut, HTTPValidationError]]
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
kwargs = _get_kwargs(
|
|
85
|
+
domain_id=domain_id,
|
|
86
|
+
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
response = client.get_httpx_client().request(
|
|
90
|
+
**kwargs,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return _build_response(client=client, response=response)
|
|
94
|
+
|
|
95
|
+
def sync(
|
|
96
|
+
domain_id: UUID,
|
|
97
|
+
*,
|
|
98
|
+
client: AuthenticatedClient,
|
|
99
|
+
|
|
100
|
+
) -> Optional[Union[DomainOut, HTTPValidationError]]:
|
|
101
|
+
""" Get Domain
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
domain_id (UUID):
|
|
105
|
+
|
|
106
|
+
Raises:
|
|
107
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
108
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
Union[DomainOut, HTTPValidationError]
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
return sync_detailed(
|
|
116
|
+
domain_id=domain_id,
|
|
117
|
+
client=client,
|
|
118
|
+
|
|
119
|
+
).parsed
|
|
120
|
+
|
|
121
|
+
async def asyncio_detailed(
|
|
122
|
+
domain_id: UUID,
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient,
|
|
125
|
+
|
|
126
|
+
) -> Response[Union[DomainOut, HTTPValidationError]]:
|
|
127
|
+
""" Get Domain
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
domain_id (UUID):
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
134
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
Response[Union[DomainOut, HTTPValidationError]]
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
kwargs = _get_kwargs(
|
|
142
|
+
domain_id=domain_id,
|
|
143
|
+
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
response = await client.get_async_httpx_client().request(
|
|
147
|
+
**kwargs
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
return _build_response(client=client, response=response)
|
|
151
|
+
|
|
152
|
+
async def asyncio(
|
|
153
|
+
domain_id: UUID,
|
|
154
|
+
*,
|
|
155
|
+
client: AuthenticatedClient,
|
|
156
|
+
|
|
157
|
+
) -> Optional[Union[DomainOut, HTTPValidationError]]:
|
|
158
|
+
""" Get Domain
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
domain_id (UUID):
|
|
162
|
+
|
|
163
|
+
Raises:
|
|
164
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
165
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
166
|
+
|
|
167
|
+
Returns:
|
|
168
|
+
Union[DomainOut, HTTPValidationError]
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
return (await asyncio_detailed(
|
|
173
|
+
domain_id=domain_id,
|
|
174
|
+
client=client,
|
|
175
|
+
|
|
176
|
+
)).parsed
|
|
@@ -0,0 +1,206 @@
|
|
|
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.domain_page import DomainPage
|
|
11
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
12
|
+
from ...types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
from typing import cast, Union
|
|
15
|
+
from typing import Union
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _get_kwargs(
|
|
20
|
+
*,
|
|
21
|
+
limit: Union[Unset, int] = 25,
|
|
22
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
23
|
+
|
|
24
|
+
) -> dict[str, Any]:
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
params: dict[str, Any] = {}
|
|
30
|
+
|
|
31
|
+
params["limit"] = limit
|
|
32
|
+
|
|
33
|
+
json_cursor: Union[None, Unset, str]
|
|
34
|
+
if isinstance(cursor, Unset):
|
|
35
|
+
json_cursor = UNSET
|
|
36
|
+
else:
|
|
37
|
+
json_cursor = cursor
|
|
38
|
+
params["cursor"] = json_cursor
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
_kwargs: dict[str, Any] = {
|
|
45
|
+
"method": "get",
|
|
46
|
+
"url": "/v1/domains",
|
|
47
|
+
"params": params,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
return _kwargs
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[DomainPage, HTTPValidationError]]:
|
|
55
|
+
if response.status_code == 200:
|
|
56
|
+
response_200 = DomainPage.from_dict(response.json())
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
return response_200
|
|
61
|
+
if response.status_code == 422:
|
|
62
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
return response_422
|
|
67
|
+
if client.raise_on_unexpected_status:
|
|
68
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
69
|
+
else:
|
|
70
|
+
return None
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[DomainPage, HTTPValidationError]]:
|
|
74
|
+
return Response(
|
|
75
|
+
status_code=HTTPStatus(response.status_code),
|
|
76
|
+
content=response.content,
|
|
77
|
+
headers=response.headers,
|
|
78
|
+
parsed=_parse_response(client=client, response=response),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def sync_detailed(
|
|
83
|
+
*,
|
|
84
|
+
client: AuthenticatedClient,
|
|
85
|
+
limit: Union[Unset, int] = 25,
|
|
86
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
87
|
+
|
|
88
|
+
) -> Response[Union[DomainPage, HTTPValidationError]]:
|
|
89
|
+
""" List Domains
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
limit (Union[Unset, int]): Default: 25.
|
|
93
|
+
cursor (Union[None, Unset, str]):
|
|
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[Union[DomainPage, HTTPValidationError]]
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
kwargs = _get_kwargs(
|
|
105
|
+
limit=limit,
|
|
106
|
+
cursor=cursor,
|
|
107
|
+
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
response = client.get_httpx_client().request(
|
|
111
|
+
**kwargs,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
return _build_response(client=client, response=response)
|
|
115
|
+
|
|
116
|
+
def sync(
|
|
117
|
+
*,
|
|
118
|
+
client: AuthenticatedClient,
|
|
119
|
+
limit: Union[Unset, int] = 25,
|
|
120
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
121
|
+
|
|
122
|
+
) -> Optional[Union[DomainPage, HTTPValidationError]]:
|
|
123
|
+
""" List Domains
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
limit (Union[Unset, int]): Default: 25.
|
|
127
|
+
cursor (Union[None, Unset, str]):
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
Union[DomainPage, HTTPValidationError]
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
return sync_detailed(
|
|
139
|
+
client=client,
|
|
140
|
+
limit=limit,
|
|
141
|
+
cursor=cursor,
|
|
142
|
+
|
|
143
|
+
).parsed
|
|
144
|
+
|
|
145
|
+
async def asyncio_detailed(
|
|
146
|
+
*,
|
|
147
|
+
client: AuthenticatedClient,
|
|
148
|
+
limit: Union[Unset, int] = 25,
|
|
149
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
150
|
+
|
|
151
|
+
) -> Response[Union[DomainPage, HTTPValidationError]]:
|
|
152
|
+
""" List Domains
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
limit (Union[Unset, int]): Default: 25.
|
|
156
|
+
cursor (Union[None, Unset, str]):
|
|
157
|
+
|
|
158
|
+
Raises:
|
|
159
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
160
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
Response[Union[DomainPage, HTTPValidationError]]
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
kwargs = _get_kwargs(
|
|
168
|
+
limit=limit,
|
|
169
|
+
cursor=cursor,
|
|
170
|
+
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
response = await client.get_async_httpx_client().request(
|
|
174
|
+
**kwargs
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
return _build_response(client=client, response=response)
|
|
178
|
+
|
|
179
|
+
async def asyncio(
|
|
180
|
+
*,
|
|
181
|
+
client: AuthenticatedClient,
|
|
182
|
+
limit: Union[Unset, int] = 25,
|
|
183
|
+
cursor: Union[None, Unset, str] = UNSET,
|
|
184
|
+
|
|
185
|
+
) -> Optional[Union[DomainPage, HTTPValidationError]]:
|
|
186
|
+
""" List Domains
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
limit (Union[Unset, int]): Default: 25.
|
|
190
|
+
cursor (Union[None, Unset, str]):
|
|
191
|
+
|
|
192
|
+
Raises:
|
|
193
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
194
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
Union[DomainPage, HTTPValidationError]
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
return (await asyncio_detailed(
|
|
202
|
+
client=client,
|
|
203
|
+
limit=limit,
|
|
204
|
+
cursor=cursor,
|
|
205
|
+
|
|
206
|
+
)).parsed
|