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