daknode 0.3.3__tar.gz → 0.3.5__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 (129) hide show
  1. {daknode-0.3.3 → daknode-0.3.5}/PKG-INFO +1 -1
  2. daknode-0.3.5/daknode/api/events/poll_inbox_events.py +279 -0
  3. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/messages/list_messages.py +40 -0
  4. daknode-0.3.5/daknode/api/messages/update_message_state.py +197 -0
  5. daknode-0.3.5/daknode/api/send/__init__.py +1 -0
  6. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/__init__.py +10 -0
  7. daknode-0.3.5/daknode/models/inbox_event.py +154 -0
  8. daknode-0.3.5/daknode/models/inbox_event_page.py +116 -0
  9. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/message_out.py +47 -0
  10. daknode-0.3.5/daknode/models/message_state.py +121 -0
  11. daknode-0.3.5/daknode/models/poll_inbox_events_start.py +8 -0
  12. daknode-0.3.5/daknode/models/state_change.py +100 -0
  13. {daknode-0.3.3 → daknode-0.3.5}/pyproject.toml +1 -1
  14. {daknode-0.3.3 → daknode-0.3.5}/README.md +0 -0
  15. {daknode-0.3.3 → daknode-0.3.5}/daknode/__init__.py +0 -0
  16. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/__init__.py +0 -0
  17. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/block_rules/__init__.py +0 -0
  18. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/block_rules/create_block_rule.py +0 -0
  19. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/block_rules/create_inbox_block_rule.py +0 -0
  20. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/block_rules/delete_block_rule.py +0 -0
  21. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/block_rules/list_block_rules.py +0 -0
  22. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/block_rules/list_inbox_block_rules.py +0 -0
  23. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/consent/__init__.py +0 -0
  24. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/consent/create_consent.py +0 -0
  25. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/consent/revoke.py +0 -0
  26. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/control_plane/__init__.py +0 -0
  27. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/control_plane/close_workspace.py +0 -0
  28. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/control_plane/create_workspace.py +0 -0
  29. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/control_plane/list_workspaces.py +0 -0
  30. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/control_plane/read_workspace.py +0 -0
  31. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/control_plane/update_workspace.py +0 -0
  32. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/dead_letters/__init__.py +0 -0
  33. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/dead_letters/list_dead_letters.py +0 -0
  34. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/dead_letters/replay_dead_letter.py +0 -0
  35. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/domains/__init__.py +0 -0
  36. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/domains/disable_domain.py +0 -0
  37. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/domains/get_domain.py +0 -0
  38. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/domains/list_domains.py +0 -0
  39. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/domains/register_domain.py +0 -0
  40. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/domains/verify_domain.py +0 -0
  41. {daknode-0.3.3/daknode/api/inboxes → daknode-0.3.5/daknode/api/events}/__init__.py +0 -0
  42. {daknode-0.3.3/daknode/api/messages → daknode-0.3.5/daknode/api/inboxes}/__init__.py +0 -0
  43. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/inboxes/create_inbox.py +0 -0
  44. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/inboxes/delete_inbox.py +0 -0
  45. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/inboxes/get_inbox.py +0 -0
  46. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/inboxes/list_inboxes.py +0 -0
  47. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/inboxes/register_webhook.py +0 -0
  48. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/inboxes/rotate_webhook_secret.py +0 -0
  49. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/inboxes/update_inbox.py +0 -0
  50. {daknode-0.3.3/daknode/api/metrics → daknode-0.3.5/daknode/api/messages}/__init__.py +0 -0
  51. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/messages/download_raw_message.py +0 -0
  52. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/messages/download_received_attachment.py +0 -0
  53. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/messages/get_message.py +0 -0
  54. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/messages/get_thread.py +0 -0
  55. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/messages/list_received_attachments.py +0 -0
  56. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/messages/list_threads.py +0 -0
  57. {daknode-0.3.3/daknode/api/privacy → daknode-0.3.5/daknode/api/metrics}/__init__.py +0 -0
  58. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/metrics/inbox_metrics.py +0 -0
  59. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/metrics/workspace_metrics.py +0 -0
  60. {daknode-0.3.3/daknode/api/public → daknode-0.3.5/daknode/api/privacy}/__init__.py +0 -0
  61. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/privacy/create_erasure_request.py +0 -0
  62. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/privacy/read_erasure_request.py +0 -0
  63. {daknode-0.3.3/daknode/api/search → daknode-0.3.5/daknode/api/public}/__init__.py +0 -0
  64. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/public/agent_signup.py +0 -0
  65. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/public/agent_verify.py +0 -0
  66. {daknode-0.3.3/daknode/api/send → daknode-0.3.5/daknode/api/search}/__init__.py +0 -0
  67. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/search/search.py +0 -0
  68. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/send/forward_message.py +0 -0
  69. {daknode-0.3.3 → daknode-0.3.5}/daknode/api/send/send.py +0 -0
  70. {daknode-0.3.3 → daknode-0.3.5}/daknode/client.py +0 -0
  71. {daknode-0.3.3 → daknode-0.3.5}/daknode/errors.py +0 -0
  72. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/attachment_out.py +0 -0
  73. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/block_rule_create.py +0 -0
  74. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/block_rule_out.py +0 -0
  75. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/block_rule_page.py +0 -0
  76. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/check_domain_request.py +0 -0
  77. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/consent_request.py +0 -0
  78. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/consent_response.py +0 -0
  79. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/create_erasure_request_response_create_erasure_request.py +0 -0
  80. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/create_in.py +0 -0
  81. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/daily_usage.py +0 -0
  82. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/dead_letter_response.py +0 -0
  83. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/delivery_cohort.py +0 -0
  84. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/delivery_cohort_current_status.py +0 -0
  85. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/delivery_cohort_provider_outcomes.py +0 -0
  86. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/dns_record.py +0 -0
  87. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/domain_out.py +0 -0
  88. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/domain_page.py +0 -0
  89. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/erasure_request_body.py +0 -0
  90. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/forward_message_response_forward_message.py +0 -0
  91. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/forward_request.py +0 -0
  92. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/http_validation_error.py +0 -0
  93. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/inbox_create_request.py +0 -0
  94. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/inbox_deleted.py +0 -0
  95. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/inbox_out.py +0 -0
  96. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/inbox_page.py +0 -0
  97. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/inbox_response.py +0 -0
  98. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/inbox_update_request.py +0 -0
  99. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/message_page.py +0 -0
  100. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/metrics_out.py +0 -0
  101. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/metrics_window.py +0 -0
  102. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/outgoing_attachment.py +0 -0
  103. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/read_erasure_request_response_read_erasure_request.py +0 -0
  104. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/register_domain_request.py +0 -0
  105. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/replay_response.py +0 -0
  106. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/revoke_request.py +0 -0
  107. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/revoke_response_revoke.py +0 -0
  108. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/search_match.py +0 -0
  109. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/search_request.py +0 -0
  110. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/search_response.py +0 -0
  111. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/send_request.py +0 -0
  112. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/send_response_send.py +0 -0
  113. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/signup_in.py +0 -0
  114. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/signup_out.py +0 -0
  115. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/thread_detail_out.py +0 -0
  116. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/thread_out.py +0 -0
  117. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/thread_page.py +0 -0
  118. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/timeline_item_out.py +0 -0
  119. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/update_in.py +0 -0
  120. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/usage_counts.py +0 -0
  121. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/validation_error.py +0 -0
  122. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/validation_error_context.py +0 -0
  123. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/verify_in.py +0 -0
  124. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/verify_out.py +0 -0
  125. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/webhook_register_request.py +0 -0
  126. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/workspace_list_out.py +0 -0
  127. {daknode-0.3.3 → daknode-0.3.5}/daknode/models/workspace_out.py +0 -0
  128. {daknode-0.3.3 → daknode-0.3.5}/daknode/py.typed +0 -0
  129. {daknode-0.3.3 → daknode-0.3.5}/daknode/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: daknode
3
- Version: 0.3.3
3
+ Version: 0.3.5
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,279 @@
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.inbox_event_page import InboxEventPage
12
+ from ...models.poll_inbox_events_start import PollInboxEventsStart
13
+ from ...types import UNSET, Unset
14
+ from typing import cast
15
+ from typing import cast, Union
16
+ from typing import Union
17
+ from uuid import UUID
18
+
19
+
20
+
21
+ def _get_kwargs(
22
+ inbox_id: UUID,
23
+ *,
24
+ cursor: Union[None, Unset, str] = UNSET,
25
+ start: Union[Unset, PollInboxEventsStart] = PollInboxEventsStart.BEGINNING,
26
+ limit: Union[Unset, int] = 25,
27
+ wait_seconds: Union[Unset, int] = 0,
28
+
29
+ ) -> dict[str, Any]:
30
+
31
+
32
+
33
+
34
+ params: dict[str, Any] = {}
35
+
36
+ json_cursor: Union[None, Unset, str]
37
+ if isinstance(cursor, Unset):
38
+ json_cursor = UNSET
39
+ else:
40
+ json_cursor = cursor
41
+ params["cursor"] = json_cursor
42
+
43
+ json_start: Union[Unset, str] = UNSET
44
+ if not isinstance(start, Unset):
45
+ json_start = start.value
46
+
47
+ params["start"] = json_start
48
+
49
+ params["limit"] = limit
50
+
51
+ params["wait_seconds"] = wait_seconds
52
+
53
+
54
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
55
+
56
+
57
+ _kwargs: dict[str, Any] = {
58
+ "method": "get",
59
+ "url": "/v1/inboxes/{inbox_id}/events".format(inbox_id=inbox_id,),
60
+ "params": params,
61
+ }
62
+
63
+
64
+ return _kwargs
65
+
66
+
67
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HTTPValidationError, InboxEventPage]]:
68
+ if response.status_code == 200:
69
+ response_200 = InboxEventPage.from_dict(response.json())
70
+
71
+
72
+
73
+ return response_200
74
+ if response.status_code == 422:
75
+ response_422 = HTTPValidationError.from_dict(response.json())
76
+
77
+
78
+
79
+ return response_422
80
+ if client.raise_on_unexpected_status:
81
+ raise errors.UnexpectedStatus(response.status_code, response.content)
82
+ else:
83
+ return None
84
+
85
+
86
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[HTTPValidationError, InboxEventPage]]:
87
+ return Response(
88
+ status_code=HTTPStatus(response.status_code),
89
+ content=response.content,
90
+ headers=response.headers,
91
+ parsed=_parse_response(client=client, response=response),
92
+ )
93
+
94
+
95
+ def sync_detailed(
96
+ inbox_id: UUID,
97
+ *,
98
+ client: AuthenticatedClient,
99
+ cursor: Union[None, Unset, str] = UNSET,
100
+ start: Union[Unset, PollInboxEventsStart] = PollInboxEventsStart.BEGINNING,
101
+ limit: Union[Unset, int] = 25,
102
+ wait_seconds: Union[Unset, int] = 0,
103
+
104
+ ) -> Response[Union[HTTPValidationError, InboxEventPage]]:
105
+ """ Poll Inbox Events
106
+
107
+ Poll retained inbound message availability; persist next_cursor and deduplicate IDs.
108
+
109
+ No webhook registration needed. An empty response still has a tail cursor.
110
+ Cursors expire after one hour: restart from beginning and deduplicate on id.
111
+ This is not a complete webhook/audit catalogue; fetch content via the message API.
112
+
113
+ Args:
114
+ inbox_id (UUID):
115
+ cursor (Union[None, Unset, str]):
116
+ start (Union[Unset, PollInboxEventsStart]): Default: PollInboxEventsStart.BEGINNING.
117
+ limit (Union[Unset, int]): Default: 25.
118
+ wait_seconds (Union[Unset, int]): Default: 0.
119
+
120
+ Raises:
121
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
122
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
123
+
124
+ Returns:
125
+ Response[Union[HTTPValidationError, InboxEventPage]]
126
+ """
127
+
128
+
129
+ kwargs = _get_kwargs(
130
+ inbox_id=inbox_id,
131
+ cursor=cursor,
132
+ start=start,
133
+ limit=limit,
134
+ wait_seconds=wait_seconds,
135
+
136
+ )
137
+
138
+ response = client.get_httpx_client().request(
139
+ **kwargs,
140
+ )
141
+
142
+ return _build_response(client=client, response=response)
143
+
144
+ def sync(
145
+ inbox_id: UUID,
146
+ *,
147
+ client: AuthenticatedClient,
148
+ cursor: Union[None, Unset, str] = UNSET,
149
+ start: Union[Unset, PollInboxEventsStart] = PollInboxEventsStart.BEGINNING,
150
+ limit: Union[Unset, int] = 25,
151
+ wait_seconds: Union[Unset, int] = 0,
152
+
153
+ ) -> Optional[Union[HTTPValidationError, InboxEventPage]]:
154
+ """ Poll Inbox Events
155
+
156
+ Poll retained inbound message availability; persist next_cursor and deduplicate IDs.
157
+
158
+ No webhook registration needed. An empty response still has a tail cursor.
159
+ Cursors expire after one hour: restart from beginning and deduplicate on id.
160
+ This is not a complete webhook/audit catalogue; fetch content via the message API.
161
+
162
+ Args:
163
+ inbox_id (UUID):
164
+ cursor (Union[None, Unset, str]):
165
+ start (Union[Unset, PollInboxEventsStart]): Default: PollInboxEventsStart.BEGINNING.
166
+ limit (Union[Unset, int]): Default: 25.
167
+ wait_seconds (Union[Unset, int]): Default: 0.
168
+
169
+ Raises:
170
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
171
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
172
+
173
+ Returns:
174
+ Union[HTTPValidationError, InboxEventPage]
175
+ """
176
+
177
+
178
+ return sync_detailed(
179
+ inbox_id=inbox_id,
180
+ client=client,
181
+ cursor=cursor,
182
+ start=start,
183
+ limit=limit,
184
+ wait_seconds=wait_seconds,
185
+
186
+ ).parsed
187
+
188
+ async def asyncio_detailed(
189
+ inbox_id: UUID,
190
+ *,
191
+ client: AuthenticatedClient,
192
+ cursor: Union[None, Unset, str] = UNSET,
193
+ start: Union[Unset, PollInboxEventsStart] = PollInboxEventsStart.BEGINNING,
194
+ limit: Union[Unset, int] = 25,
195
+ wait_seconds: Union[Unset, int] = 0,
196
+
197
+ ) -> Response[Union[HTTPValidationError, InboxEventPage]]:
198
+ """ Poll Inbox Events
199
+
200
+ Poll retained inbound message availability; persist next_cursor and deduplicate IDs.
201
+
202
+ No webhook registration needed. An empty response still has a tail cursor.
203
+ Cursors expire after one hour: restart from beginning and deduplicate on id.
204
+ This is not a complete webhook/audit catalogue; fetch content via the message API.
205
+
206
+ Args:
207
+ inbox_id (UUID):
208
+ cursor (Union[None, Unset, str]):
209
+ start (Union[Unset, PollInboxEventsStart]): Default: PollInboxEventsStart.BEGINNING.
210
+ limit (Union[Unset, int]): Default: 25.
211
+ wait_seconds (Union[Unset, int]): Default: 0.
212
+
213
+ Raises:
214
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
215
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
216
+
217
+ Returns:
218
+ Response[Union[HTTPValidationError, InboxEventPage]]
219
+ """
220
+
221
+
222
+ kwargs = _get_kwargs(
223
+ inbox_id=inbox_id,
224
+ cursor=cursor,
225
+ start=start,
226
+ limit=limit,
227
+ wait_seconds=wait_seconds,
228
+
229
+ )
230
+
231
+ response = await client.get_async_httpx_client().request(
232
+ **kwargs
233
+ )
234
+
235
+ return _build_response(client=client, response=response)
236
+
237
+ async def asyncio(
238
+ inbox_id: UUID,
239
+ *,
240
+ client: AuthenticatedClient,
241
+ cursor: Union[None, Unset, str] = UNSET,
242
+ start: Union[Unset, PollInboxEventsStart] = PollInboxEventsStart.BEGINNING,
243
+ limit: Union[Unset, int] = 25,
244
+ wait_seconds: Union[Unset, int] = 0,
245
+
246
+ ) -> Optional[Union[HTTPValidationError, InboxEventPage]]:
247
+ """ Poll Inbox Events
248
+
249
+ Poll retained inbound message availability; persist next_cursor and deduplicate IDs.
250
+
251
+ No webhook registration needed. An empty response still has a tail cursor.
252
+ Cursors expire after one hour: restart from beginning and deduplicate on id.
253
+ This is not a complete webhook/audit catalogue; fetch content via the message API.
254
+
255
+ Args:
256
+ inbox_id (UUID):
257
+ cursor (Union[None, Unset, str]):
258
+ start (Union[Unset, PollInboxEventsStart]): Default: PollInboxEventsStart.BEGINNING.
259
+ limit (Union[Unset, int]): Default: 25.
260
+ wait_seconds (Union[Unset, int]): Default: 0.
261
+
262
+ Raises:
263
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
264
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
265
+
266
+ Returns:
267
+ Union[HTTPValidationError, InboxEventPage]
268
+ """
269
+
270
+
271
+ return (await asyncio_detailed(
272
+ inbox_id=inbox_id,
273
+ client=client,
274
+ cursor=cursor,
275
+ start=start,
276
+ limit=limit,
277
+ wait_seconds=wait_seconds,
278
+
279
+ )).parsed
@@ -22,6 +22,8 @@ def _get_kwargs(
22
22
  *,
23
23
  limit: Union[Unset, int] = 25,
24
24
  cursor: Union[None, Unset, str] = UNSET,
25
+ label: Union[None, Unset, str] = UNSET,
26
+ is_read: Union[None, Unset, bool] = UNSET,
25
27
 
26
28
  ) -> dict[str, Any]:
27
29
 
@@ -39,6 +41,20 @@ def _get_kwargs(
39
41
  json_cursor = cursor
40
42
  params["cursor"] = json_cursor
41
43
 
44
+ json_label: Union[None, Unset, str]
45
+ if isinstance(label, Unset):
46
+ json_label = UNSET
47
+ else:
48
+ json_label = label
49
+ params["label"] = json_label
50
+
51
+ json_is_read: Union[None, Unset, bool]
52
+ if isinstance(is_read, Unset):
53
+ json_is_read = UNSET
54
+ else:
55
+ json_is_read = is_read
56
+ params["is_read"] = json_is_read
57
+
42
58
 
43
59
  params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
44
60
 
@@ -87,6 +103,8 @@ def sync_detailed(
87
103
  client: AuthenticatedClient,
88
104
  limit: Union[Unset, int] = 25,
89
105
  cursor: Union[None, Unset, str] = UNSET,
106
+ label: Union[None, Unset, str] = UNSET,
107
+ is_read: Union[None, Unset, bool] = UNSET,
90
108
 
91
109
  ) -> Response[Union[HTTPValidationError, MessagePage]]:
92
110
  """ List Messages
@@ -97,6 +115,8 @@ def sync_detailed(
97
115
  inbox_id (UUID):
98
116
  limit (Union[Unset, int]): Default: 25.
99
117
  cursor (Union[None, Unset, str]):
118
+ label (Union[None, Unset, str]):
119
+ is_read (Union[None, Unset, bool]):
100
120
 
101
121
  Raises:
102
122
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -111,6 +131,8 @@ def sync_detailed(
111
131
  inbox_id=inbox_id,
112
132
  limit=limit,
113
133
  cursor=cursor,
134
+ label=label,
135
+ is_read=is_read,
114
136
 
115
137
  )
116
138
 
@@ -126,6 +148,8 @@ def sync(
126
148
  client: AuthenticatedClient,
127
149
  limit: Union[Unset, int] = 25,
128
150
  cursor: Union[None, Unset, str] = UNSET,
151
+ label: Union[None, Unset, str] = UNSET,
152
+ is_read: Union[None, Unset, bool] = UNSET,
129
153
 
130
154
  ) -> Optional[Union[HTTPValidationError, MessagePage]]:
131
155
  """ List Messages
@@ -136,6 +160,8 @@ def sync(
136
160
  inbox_id (UUID):
137
161
  limit (Union[Unset, int]): Default: 25.
138
162
  cursor (Union[None, Unset, str]):
163
+ label (Union[None, Unset, str]):
164
+ is_read (Union[None, Unset, bool]):
139
165
 
140
166
  Raises:
141
167
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -151,6 +177,8 @@ def sync(
151
177
  client=client,
152
178
  limit=limit,
153
179
  cursor=cursor,
180
+ label=label,
181
+ is_read=is_read,
154
182
 
155
183
  ).parsed
156
184
 
@@ -160,6 +188,8 @@ async def asyncio_detailed(
160
188
  client: AuthenticatedClient,
161
189
  limit: Union[Unset, int] = 25,
162
190
  cursor: Union[None, Unset, str] = UNSET,
191
+ label: Union[None, Unset, str] = UNSET,
192
+ is_read: Union[None, Unset, bool] = UNSET,
163
193
 
164
194
  ) -> Response[Union[HTTPValidationError, MessagePage]]:
165
195
  """ List Messages
@@ -170,6 +200,8 @@ async def asyncio_detailed(
170
200
  inbox_id (UUID):
171
201
  limit (Union[Unset, int]): Default: 25.
172
202
  cursor (Union[None, Unset, str]):
203
+ label (Union[None, Unset, str]):
204
+ is_read (Union[None, Unset, bool]):
173
205
 
174
206
  Raises:
175
207
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -184,6 +216,8 @@ async def asyncio_detailed(
184
216
  inbox_id=inbox_id,
185
217
  limit=limit,
186
218
  cursor=cursor,
219
+ label=label,
220
+ is_read=is_read,
187
221
 
188
222
  )
189
223
 
@@ -199,6 +233,8 @@ async def asyncio(
199
233
  client: AuthenticatedClient,
200
234
  limit: Union[Unset, int] = 25,
201
235
  cursor: Union[None, Unset, str] = UNSET,
236
+ label: Union[None, Unset, str] = UNSET,
237
+ is_read: Union[None, Unset, bool] = UNSET,
202
238
 
203
239
  ) -> Optional[Union[HTTPValidationError, MessagePage]]:
204
240
  """ List Messages
@@ -209,6 +245,8 @@ async def asyncio(
209
245
  inbox_id (UUID):
210
246
  limit (Union[Unset, int]): Default: 25.
211
247
  cursor (Union[None, Unset, str]):
248
+ label (Union[None, Unset, str]):
249
+ is_read (Union[None, Unset, bool]):
212
250
 
213
251
  Raises:
214
252
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -224,5 +262,7 @@ async def asyncio(
224
262
  client=client,
225
263
  limit=limit,
226
264
  cursor=cursor,
265
+ label=label,
266
+ is_read=is_read,
227
267
 
228
268
  )).parsed
@@ -0,0 +1,197 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ...client import AuthenticatedClient, Client
7
+ from ...types import Response, UNSET
8
+ from ... import errors
9
+
10
+ from ...models.http_validation_error import HTTPValidationError
11
+ from ...models.message_state import MessageState
12
+ from ...models.state_change import StateChange
13
+ from typing import cast
14
+ from uuid import UUID
15
+
16
+
17
+
18
+ def _get_kwargs(
19
+ message_id: UUID,
20
+ *,
21
+ body: StateChange,
22
+
23
+ ) -> dict[str, Any]:
24
+ headers: dict[str, Any] = {}
25
+
26
+
27
+
28
+
29
+
30
+
31
+ _kwargs: dict[str, Any] = {
32
+ "method": "patch",
33
+ "url": "/v1/messages/{message_id}/state".format(message_id=message_id,),
34
+ }
35
+
36
+ _kwargs["json"] = body.to_dict()
37
+
38
+
39
+ headers["Content-Type"] = "application/json"
40
+
41
+ _kwargs["headers"] = headers
42
+ return _kwargs
43
+
44
+
45
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HTTPValidationError, MessageState]]:
46
+ if response.status_code == 200:
47
+ response_200 = MessageState.from_dict(response.json())
48
+
49
+
50
+
51
+ return response_200
52
+ if response.status_code == 422:
53
+ response_422 = HTTPValidationError.from_dict(response.json())
54
+
55
+
56
+
57
+ return response_422
58
+ if client.raise_on_unexpected_status:
59
+ raise errors.UnexpectedStatus(response.status_code, response.content)
60
+ else:
61
+ return None
62
+
63
+
64
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[HTTPValidationError, MessageState]]:
65
+ return Response(
66
+ status_code=HTTPStatus(response.status_code),
67
+ content=response.content,
68
+ headers=response.headers,
69
+ parsed=_parse_response(client=client, response=response),
70
+ )
71
+
72
+
73
+ def sync_detailed(
74
+ message_id: UUID,
75
+ *,
76
+ client: AuthenticatedClient,
77
+ body: StateChange,
78
+
79
+ ) -> Response[Union[HTTPValidationError, MessageState]]:
80
+ """ Update Message State
81
+
82
+ Args:
83
+ message_id (UUID):
84
+ body (StateChange):
85
+
86
+ Raises:
87
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
88
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
89
+
90
+ Returns:
91
+ Response[Union[HTTPValidationError, MessageState]]
92
+ """
93
+
94
+
95
+ kwargs = _get_kwargs(
96
+ message_id=message_id,
97
+ body=body,
98
+
99
+ )
100
+
101
+ response = client.get_httpx_client().request(
102
+ **kwargs,
103
+ )
104
+
105
+ return _build_response(client=client, response=response)
106
+
107
+ def sync(
108
+ message_id: UUID,
109
+ *,
110
+ client: AuthenticatedClient,
111
+ body: StateChange,
112
+
113
+ ) -> Optional[Union[HTTPValidationError, MessageState]]:
114
+ """ Update Message State
115
+
116
+ Args:
117
+ message_id (UUID):
118
+ body (StateChange):
119
+
120
+ Raises:
121
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
122
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
123
+
124
+ Returns:
125
+ Union[HTTPValidationError, MessageState]
126
+ """
127
+
128
+
129
+ return sync_detailed(
130
+ message_id=message_id,
131
+ client=client,
132
+ body=body,
133
+
134
+ ).parsed
135
+
136
+ async def asyncio_detailed(
137
+ message_id: UUID,
138
+ *,
139
+ client: AuthenticatedClient,
140
+ body: StateChange,
141
+
142
+ ) -> Response[Union[HTTPValidationError, MessageState]]:
143
+ """ Update Message State
144
+
145
+ Args:
146
+ message_id (UUID):
147
+ body (StateChange):
148
+
149
+ Raises:
150
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
151
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
152
+
153
+ Returns:
154
+ Response[Union[HTTPValidationError, MessageState]]
155
+ """
156
+
157
+
158
+ kwargs = _get_kwargs(
159
+ message_id=message_id,
160
+ body=body,
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
+ message_id: UUID,
172
+ *,
173
+ client: AuthenticatedClient,
174
+ body: StateChange,
175
+
176
+ ) -> Optional[Union[HTTPValidationError, MessageState]]:
177
+ """ Update Message State
178
+
179
+ Args:
180
+ message_id (UUID):
181
+ body (StateChange):
182
+
183
+ Raises:
184
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
185
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
186
+
187
+ Returns:
188
+ Union[HTTPValidationError, MessageState]
189
+ """
190
+
191
+
192
+ return (await asyncio_detailed(
193
+ message_id=message_id,
194
+ client=client,
195
+ body=body,
196
+
197
+ )).parsed
@@ -0,0 +1 @@
1
+ """ Contains endpoint functions for accessing the API """
@@ -23,15 +23,19 @@ from .forward_request import ForwardRequest
23
23
  from .http_validation_error import HTTPValidationError
24
24
  from .inbox_create_request import InboxCreateRequest
25
25
  from .inbox_deleted import InboxDeleted
26
+ from .inbox_event import InboxEvent
27
+ from .inbox_event_page import InboxEventPage
26
28
  from .inbox_out import InboxOut
27
29
  from .inbox_page import InboxPage
28
30
  from .inbox_response import InboxResponse
29
31
  from .inbox_update_request import InboxUpdateRequest
30
32
  from .message_out import MessageOut
31
33
  from .message_page import MessagePage
34
+ from .message_state import MessageState
32
35
  from .metrics_out import MetricsOut
33
36
  from .metrics_window import MetricsWindow
34
37
  from .outgoing_attachment import OutgoingAttachment
38
+ from .poll_inbox_events_start import PollInboxEventsStart
35
39
  from .read_erasure_request_response_read_erasure_request import ReadErasureRequestResponseReadErasureRequest
36
40
  from .register_domain_request import RegisterDomainRequest
37
41
  from .replay_response import ReplayResponse
@@ -44,6 +48,7 @@ from .send_request import SendRequest
44
48
  from .send_response_send import SendResponseSend
45
49
  from .signup_in import SignupIn
46
50
  from .signup_out import SignupOut
51
+ from .state_change import StateChange
47
52
  from .thread_detail_out import ThreadDetailOut
48
53
  from .thread_out import ThreadOut
49
54
  from .thread_page import ThreadPage
@@ -82,15 +87,19 @@ __all__ = (
82
87
  "HTTPValidationError",
83
88
  "InboxCreateRequest",
84
89
  "InboxDeleted",
90
+ "InboxEvent",
91
+ "InboxEventPage",
85
92
  "InboxOut",
86
93
  "InboxPage",
87
94
  "InboxResponse",
88
95
  "InboxUpdateRequest",
89
96
  "MessageOut",
90
97
  "MessagePage",
98
+ "MessageState",
91
99
  "MetricsOut",
92
100
  "MetricsWindow",
93
101
  "OutgoingAttachment",
102
+ "PollInboxEventsStart",
94
103
  "ReadErasureRequestResponseReadErasureRequest",
95
104
  "RegisterDomainRequest",
96
105
  "ReplayResponse",
@@ -103,6 +112,7 @@ __all__ = (
103
112
  "SendResponseSend",
104
113
  "SignupIn",
105
114
  "SignupOut",
115
+ "StateChange",
106
116
  "ThreadDetailOut",
107
117
  "ThreadOut",
108
118
  "ThreadPage",