daknode 0.3.0__tar.gz → 0.3.2__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.
Files changed (110) hide show
  1. {daknode-0.3.0 → daknode-0.3.2}/PKG-INFO +1 -1
  2. daknode-0.3.2/daknode/api/domains/disable_domain.py +176 -0
  3. daknode-0.3.2/daknode/api/domains/get_domain.py +176 -0
  4. daknode-0.3.2/daknode/api/domains/list_domains.py +206 -0
  5. daknode-0.3.2/daknode/api/domains/register_domain.py +183 -0
  6. daknode-0.3.2/daknode/api/domains/verify_domain.py +197 -0
  7. daknode-0.3.2/daknode/api/messages/download_received_attachment.py +179 -0
  8. daknode-0.3.2/daknode/api/messages/list_received_attachments.py +181 -0
  9. daknode-0.3.2/daknode/api/send/__init__.py +1 -0
  10. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/send/forward_message.py +8 -8
  11. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/__init__.py +14 -0
  12. daknode-0.3.2/daknode/models/attachment_out.py +126 -0
  13. daknode-0.3.2/daknode/models/check_domain_request.py +77 -0
  14. daknode-0.3.2/daknode/models/dns_record.py +98 -0
  15. daknode-0.3.2/daknode/models/domain_out.py +166 -0
  16. daknode-0.3.2/daknode/models/domain_page.py +116 -0
  17. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/forward_request.py +44 -0
  18. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/inbox_create_request.py +34 -0
  19. daknode-0.3.2/daknode/models/outgoing_attachment.py +74 -0
  20. daknode-0.3.2/daknode/models/register_domain_request.py +74 -0
  21. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/send_request.py +47 -0
  22. {daknode-0.3.0 → daknode-0.3.2}/pyproject.toml +1 -1
  23. {daknode-0.3.0 → daknode-0.3.2}/README.md +0 -0
  24. {daknode-0.3.0 → daknode-0.3.2}/daknode/__init__.py +0 -0
  25. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/__init__.py +0 -0
  26. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/block_rules/__init__.py +0 -0
  27. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/block_rules/create_block_rule.py +0 -0
  28. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/block_rules/create_inbox_block_rule.py +0 -0
  29. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/block_rules/delete_block_rule.py +0 -0
  30. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/block_rules/list_block_rules.py +0 -0
  31. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/block_rules/list_inbox_block_rules.py +0 -0
  32. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/consent/__init__.py +0 -0
  33. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/consent/create_consent.py +0 -0
  34. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/consent/revoke.py +0 -0
  35. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/control_plane/__init__.py +0 -0
  36. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/control_plane/close_workspace.py +0 -0
  37. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/control_plane/create_workspace.py +0 -0
  38. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/control_plane/list_workspaces.py +0 -0
  39. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/control_plane/read_workspace.py +0 -0
  40. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/control_plane/update_workspace.py +0 -0
  41. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/dead_letters/__init__.py +0 -0
  42. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/dead_letters/list_dead_letters.py +0 -0
  43. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/dead_letters/replay_dead_letter.py +0 -0
  44. {daknode-0.3.0/daknode/api/inboxes → daknode-0.3.2/daknode/api/domains}/__init__.py +0 -0
  45. {daknode-0.3.0/daknode/api/messages → daknode-0.3.2/daknode/api/inboxes}/__init__.py +0 -0
  46. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/inboxes/create_inbox.py +0 -0
  47. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/inboxes/delete_inbox.py +0 -0
  48. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/inboxes/get_inbox.py +0 -0
  49. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/inboxes/list_inboxes.py +0 -0
  50. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/inboxes/register_webhook.py +0 -0
  51. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/inboxes/rotate_webhook_secret.py +0 -0
  52. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/inboxes/update_inbox.py +0 -0
  53. {daknode-0.3.0/daknode/api/privacy → daknode-0.3.2/daknode/api/messages}/__init__.py +0 -0
  54. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/messages/get_message.py +0 -0
  55. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/messages/get_thread.py +0 -0
  56. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/messages/list_messages.py +0 -0
  57. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/messages/list_threads.py +0 -0
  58. {daknode-0.3.0/daknode/api/public → daknode-0.3.2/daknode/api/privacy}/__init__.py +0 -0
  59. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/privacy/create_erasure_request.py +0 -0
  60. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/privacy/read_erasure_request.py +0 -0
  61. {daknode-0.3.0/daknode/api/search → daknode-0.3.2/daknode/api/public}/__init__.py +0 -0
  62. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/public/agent_signup.py +0 -0
  63. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/public/agent_verify.py +0 -0
  64. {daknode-0.3.0/daknode/api/send → daknode-0.3.2/daknode/api/search}/__init__.py +0 -0
  65. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/search/search.py +0 -0
  66. {daknode-0.3.0 → daknode-0.3.2}/daknode/api/send/send.py +0 -0
  67. {daknode-0.3.0 → daknode-0.3.2}/daknode/client.py +0 -0
  68. {daknode-0.3.0 → daknode-0.3.2}/daknode/errors.py +0 -0
  69. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/block_rule_create.py +0 -0
  70. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/block_rule_out.py +0 -0
  71. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/block_rule_page.py +0 -0
  72. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/consent_request.py +0 -0
  73. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/consent_response.py +0 -0
  74. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/create_erasure_request_response_create_erasure_request.py +0 -0
  75. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/create_in.py +0 -0
  76. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/dead_letter_response.py +0 -0
  77. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/erasure_request_body.py +0 -0
  78. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/forward_message_response_forward_message.py +0 -0
  79. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/http_validation_error.py +0 -0
  80. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/inbox_deleted.py +0 -0
  81. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/inbox_out.py +0 -0
  82. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/inbox_page.py +0 -0
  83. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/inbox_response.py +0 -0
  84. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/inbox_update_request.py +0 -0
  85. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/message_out.py +0 -0
  86. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/message_page.py +0 -0
  87. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/read_erasure_request_response_read_erasure_request.py +0 -0
  88. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/replay_response.py +0 -0
  89. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/revoke_request.py +0 -0
  90. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/revoke_response_revoke.py +0 -0
  91. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/search_match.py +0 -0
  92. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/search_request.py +0 -0
  93. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/search_response.py +0 -0
  94. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/send_response_send.py +0 -0
  95. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/signup_in.py +0 -0
  96. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/signup_out.py +0 -0
  97. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/thread_detail_out.py +0 -0
  98. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/thread_out.py +0 -0
  99. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/thread_page.py +0 -0
  100. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/timeline_item_out.py +0 -0
  101. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/update_in.py +0 -0
  102. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/validation_error.py +0 -0
  103. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/validation_error_context.py +0 -0
  104. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/verify_in.py +0 -0
  105. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/verify_out.py +0 -0
  106. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/webhook_register_request.py +0 -0
  107. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/workspace_list_out.py +0 -0
  108. {daknode-0.3.0 → daknode-0.3.2}/daknode/models/workspace_out.py +0 -0
  109. {daknode-0.3.0 → daknode-0.3.2}/daknode/py.typed +0 -0
  110. {daknode-0.3.0 → daknode-0.3.2}/daknode/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: daknode
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: A client library for accessing DakNode
5
5
  Requires-Python: >=3.9,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -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