daknode 0.3.2__tar.gz → 0.3.3__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 (121) hide show
  1. {daknode-0.3.2 → daknode-0.3.3}/PKG-INFO +1 -1
  2. daknode-0.3.3/daknode/api/messages/download_raw_message.py +187 -0
  3. daknode-0.3.3/daknode/api/metrics/inbox_metrics.py +222 -0
  4. daknode-0.3.3/daknode/api/metrics/workspace_metrics.py +208 -0
  5. daknode-0.3.3/daknode/api/send/__init__.py +1 -0
  6. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/__init__.py +14 -0
  7. daknode-0.3.3/daknode/models/daily_usage.py +109 -0
  8. daknode-0.3.3/daknode/models/delivery_cohort.py +162 -0
  9. daknode-0.3.3/daknode/models/delivery_cohort_current_status.py +63 -0
  10. daknode-0.3.3/daknode/models/delivery_cohort_provider_outcomes.py +63 -0
  11. daknode-0.3.3/daknode/models/metrics_out.py +191 -0
  12. daknode-0.3.3/daknode/models/metrics_window.py +121 -0
  13. daknode-0.3.3/daknode/models/usage_counts.py +95 -0
  14. {daknode-0.3.2 → daknode-0.3.3}/pyproject.toml +1 -1
  15. {daknode-0.3.2 → daknode-0.3.3}/README.md +0 -0
  16. {daknode-0.3.2 → daknode-0.3.3}/daknode/__init__.py +0 -0
  17. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/__init__.py +0 -0
  18. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/block_rules/__init__.py +0 -0
  19. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/block_rules/create_block_rule.py +0 -0
  20. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/block_rules/create_inbox_block_rule.py +0 -0
  21. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/block_rules/delete_block_rule.py +0 -0
  22. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/block_rules/list_block_rules.py +0 -0
  23. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/block_rules/list_inbox_block_rules.py +0 -0
  24. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/consent/__init__.py +0 -0
  25. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/consent/create_consent.py +0 -0
  26. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/consent/revoke.py +0 -0
  27. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/control_plane/__init__.py +0 -0
  28. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/control_plane/close_workspace.py +0 -0
  29. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/control_plane/create_workspace.py +0 -0
  30. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/control_plane/list_workspaces.py +0 -0
  31. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/control_plane/read_workspace.py +0 -0
  32. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/control_plane/update_workspace.py +0 -0
  33. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/dead_letters/__init__.py +0 -0
  34. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/dead_letters/list_dead_letters.py +0 -0
  35. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/dead_letters/replay_dead_letter.py +0 -0
  36. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/domains/__init__.py +0 -0
  37. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/domains/disable_domain.py +0 -0
  38. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/domains/get_domain.py +0 -0
  39. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/domains/list_domains.py +0 -0
  40. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/domains/register_domain.py +0 -0
  41. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/domains/verify_domain.py +0 -0
  42. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/inboxes/__init__.py +0 -0
  43. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/inboxes/create_inbox.py +0 -0
  44. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/inboxes/delete_inbox.py +0 -0
  45. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/inboxes/get_inbox.py +0 -0
  46. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/inboxes/list_inboxes.py +0 -0
  47. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/inboxes/register_webhook.py +0 -0
  48. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/inboxes/rotate_webhook_secret.py +0 -0
  49. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/inboxes/update_inbox.py +0 -0
  50. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/messages/__init__.py +0 -0
  51. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/messages/download_received_attachment.py +0 -0
  52. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/messages/get_message.py +0 -0
  53. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/messages/get_thread.py +0 -0
  54. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/messages/list_messages.py +0 -0
  55. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/messages/list_received_attachments.py +0 -0
  56. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/messages/list_threads.py +0 -0
  57. {daknode-0.3.2/daknode/api/privacy → daknode-0.3.3/daknode/api/metrics}/__init__.py +0 -0
  58. {daknode-0.3.2/daknode/api/public → daknode-0.3.3/daknode/api/privacy}/__init__.py +0 -0
  59. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/privacy/create_erasure_request.py +0 -0
  60. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/privacy/read_erasure_request.py +0 -0
  61. {daknode-0.3.2/daknode/api/search → daknode-0.3.3/daknode/api/public}/__init__.py +0 -0
  62. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/public/agent_signup.py +0 -0
  63. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/public/agent_verify.py +0 -0
  64. {daknode-0.3.2/daknode/api/send → daknode-0.3.3/daknode/api/search}/__init__.py +0 -0
  65. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/search/search.py +0 -0
  66. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/send/forward_message.py +0 -0
  67. {daknode-0.3.2 → daknode-0.3.3}/daknode/api/send/send.py +0 -0
  68. {daknode-0.3.2 → daknode-0.3.3}/daknode/client.py +0 -0
  69. {daknode-0.3.2 → daknode-0.3.3}/daknode/errors.py +0 -0
  70. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/attachment_out.py +0 -0
  71. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/block_rule_create.py +0 -0
  72. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/block_rule_out.py +0 -0
  73. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/block_rule_page.py +0 -0
  74. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/check_domain_request.py +0 -0
  75. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/consent_request.py +0 -0
  76. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/consent_response.py +0 -0
  77. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/create_erasure_request_response_create_erasure_request.py +0 -0
  78. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/create_in.py +0 -0
  79. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/dead_letter_response.py +0 -0
  80. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/dns_record.py +0 -0
  81. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/domain_out.py +0 -0
  82. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/domain_page.py +0 -0
  83. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/erasure_request_body.py +0 -0
  84. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/forward_message_response_forward_message.py +0 -0
  85. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/forward_request.py +0 -0
  86. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/http_validation_error.py +0 -0
  87. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/inbox_create_request.py +0 -0
  88. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/inbox_deleted.py +0 -0
  89. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/inbox_out.py +0 -0
  90. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/inbox_page.py +0 -0
  91. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/inbox_response.py +0 -0
  92. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/inbox_update_request.py +0 -0
  93. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/message_out.py +0 -0
  94. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/message_page.py +0 -0
  95. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/outgoing_attachment.py +0 -0
  96. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/read_erasure_request_response_read_erasure_request.py +0 -0
  97. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/register_domain_request.py +0 -0
  98. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/replay_response.py +0 -0
  99. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/revoke_request.py +0 -0
  100. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/revoke_response_revoke.py +0 -0
  101. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/search_match.py +0 -0
  102. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/search_request.py +0 -0
  103. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/search_response.py +0 -0
  104. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/send_request.py +0 -0
  105. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/send_response_send.py +0 -0
  106. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/signup_in.py +0 -0
  107. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/signup_out.py +0 -0
  108. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/thread_detail_out.py +0 -0
  109. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/thread_out.py +0 -0
  110. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/thread_page.py +0 -0
  111. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/timeline_item_out.py +0 -0
  112. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/update_in.py +0 -0
  113. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/validation_error.py +0 -0
  114. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/validation_error_context.py +0 -0
  115. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/verify_in.py +0 -0
  116. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/verify_out.py +0 -0
  117. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/webhook_register_request.py +0 -0
  118. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/workspace_list_out.py +0 -0
  119. {daknode-0.3.2 → daknode-0.3.3}/daknode/models/workspace_out.py +0 -0
  120. {daknode-0.3.2 → daknode-0.3.3}/daknode/py.typed +0 -0
  121. {daknode-0.3.2 → daknode-0.3.3}/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.3
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,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
@@ -0,0 +1,208 @@
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
+
16
+
17
+
18
+ def _get_kwargs(
19
+ *,
20
+ days: Union[Unset, int] = 30,
21
+ include_today: Union[Unset, bool] = True,
22
+
23
+ ) -> dict[str, Any]:
24
+
25
+
26
+
27
+
28
+ params: dict[str, Any] = {}
29
+
30
+ params["days"] = days
31
+
32
+ params["include_today"] = include_today
33
+
34
+
35
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
36
+
37
+
38
+ _kwargs: dict[str, Any] = {
39
+ "method": "get",
40
+ "url": "/v1/metrics",
41
+ "params": params,
42
+ }
43
+
44
+
45
+ return _kwargs
46
+
47
+
48
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[HTTPValidationError, MetricsOut]]:
49
+ if response.status_code == 200:
50
+ response_200 = MetricsOut.from_dict(response.json())
51
+
52
+
53
+
54
+ return response_200
55
+ if response.status_code == 422:
56
+ response_422 = HTTPValidationError.from_dict(response.json())
57
+
58
+
59
+
60
+ return response_422
61
+ if client.raise_on_unexpected_status:
62
+ raise errors.UnexpectedStatus(response.status_code, response.content)
63
+ else:
64
+ return None
65
+
66
+
67
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[HTTPValidationError, MetricsOut]]:
68
+ return Response(
69
+ status_code=HTTPStatus(response.status_code),
70
+ content=response.content,
71
+ headers=response.headers,
72
+ parsed=_parse_response(client=client, response=response),
73
+ )
74
+
75
+
76
+ def sync_detailed(
77
+ *,
78
+ client: AuthenticatedClient,
79
+ days: Union[Unset, int] = 30,
80
+ include_today: Union[Unset, bool] = True,
81
+
82
+ ) -> Response[Union[HTTPValidationError, MetricsOut]]:
83
+ """ Workspace Metrics
84
+
85
+ Usage facts and observed delivery outcomes; inbox keys see only their inbox.
86
+
87
+ Args:
88
+ days (Union[Unset, int]): Default: 30.
89
+ include_today (Union[Unset, bool]): Default: True.
90
+
91
+ Raises:
92
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
93
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
94
+
95
+ Returns:
96
+ Response[Union[HTTPValidationError, MetricsOut]]
97
+ """
98
+
99
+
100
+ kwargs = _get_kwargs(
101
+ days=days,
102
+ include_today=include_today,
103
+
104
+ )
105
+
106
+ response = client.get_httpx_client().request(
107
+ **kwargs,
108
+ )
109
+
110
+ return _build_response(client=client, response=response)
111
+
112
+ def sync(
113
+ *,
114
+ client: AuthenticatedClient,
115
+ days: Union[Unset, int] = 30,
116
+ include_today: Union[Unset, bool] = True,
117
+
118
+ ) -> Optional[Union[HTTPValidationError, MetricsOut]]:
119
+ """ Workspace Metrics
120
+
121
+ Usage facts and observed delivery outcomes; inbox keys see only their inbox.
122
+
123
+ Args:
124
+ days (Union[Unset, int]): Default: 30.
125
+ include_today (Union[Unset, bool]): Default: True.
126
+
127
+ Raises:
128
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
129
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
130
+
131
+ Returns:
132
+ Union[HTTPValidationError, MetricsOut]
133
+ """
134
+
135
+
136
+ return sync_detailed(
137
+ client=client,
138
+ days=days,
139
+ include_today=include_today,
140
+
141
+ ).parsed
142
+
143
+ async def asyncio_detailed(
144
+ *,
145
+ client: AuthenticatedClient,
146
+ days: Union[Unset, int] = 30,
147
+ include_today: Union[Unset, bool] = True,
148
+
149
+ ) -> Response[Union[HTTPValidationError, MetricsOut]]:
150
+ """ Workspace Metrics
151
+
152
+ Usage facts and observed delivery outcomes; inbox keys see only their inbox.
153
+
154
+ Args:
155
+ days (Union[Unset, int]): Default: 30.
156
+ include_today (Union[Unset, bool]): Default: True.
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[HTTPValidationError, MetricsOut]]
164
+ """
165
+
166
+
167
+ kwargs = _get_kwargs(
168
+ days=days,
169
+ include_today=include_today,
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
+ days: Union[Unset, int] = 30,
183
+ include_today: Union[Unset, bool] = True,
184
+
185
+ ) -> Optional[Union[HTTPValidationError, MetricsOut]]:
186
+ """ Workspace Metrics
187
+
188
+ Usage facts and observed delivery outcomes; inbox keys see only their inbox.
189
+
190
+ Args:
191
+ days (Union[Unset, int]): Default: 30.
192
+ include_today (Union[Unset, bool]): Default: True.
193
+
194
+ Raises:
195
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
196
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
197
+
198
+ Returns:
199
+ Union[HTTPValidationError, MetricsOut]
200
+ """
201
+
202
+
203
+ return (await asyncio_detailed(
204
+ client=client,
205
+ days=days,
206
+ include_today=include_today,
207
+
208
+ )).parsed
@@ -0,0 +1 @@
1
+ """ Contains endpoint functions for accessing the API """
@@ -9,7 +9,11 @@ from .consent_request import ConsentRequest
9
9
  from .consent_response import ConsentResponse
10
10
  from .create_erasure_request_response_create_erasure_request import CreateErasureRequestResponseCreateErasureRequest
11
11
  from .create_in import CreateIn
12
+ from .daily_usage import DailyUsage
12
13
  from .dead_letter_response import DeadLetterResponse
14
+ from .delivery_cohort import DeliveryCohort
15
+ from .delivery_cohort_current_status import DeliveryCohortCurrentStatus
16
+ from .delivery_cohort_provider_outcomes import DeliveryCohortProviderOutcomes
13
17
  from .dns_record import DnsRecord
14
18
  from .domain_out import DomainOut
15
19
  from .domain_page import DomainPage
@@ -25,6 +29,8 @@ from .inbox_response import InboxResponse
25
29
  from .inbox_update_request import InboxUpdateRequest
26
30
  from .message_out import MessageOut
27
31
  from .message_page import MessagePage
32
+ from .metrics_out import MetricsOut
33
+ from .metrics_window import MetricsWindow
28
34
  from .outgoing_attachment import OutgoingAttachment
29
35
  from .read_erasure_request_response_read_erasure_request import ReadErasureRequestResponseReadErasureRequest
30
36
  from .register_domain_request import RegisterDomainRequest
@@ -43,6 +49,7 @@ from .thread_out import ThreadOut
43
49
  from .thread_page import ThreadPage
44
50
  from .timeline_item_out import TimelineItemOut
45
51
  from .update_in import UpdateIn
52
+ from .usage_counts import UsageCounts
46
53
  from .validation_error import ValidationError
47
54
  from .validation_error_context import ValidationErrorContext
48
55
  from .verify_in import VerifyIn
@@ -61,7 +68,11 @@ __all__ = (
61
68
  "ConsentResponse",
62
69
  "CreateErasureRequestResponseCreateErasureRequest",
63
70
  "CreateIn",
71
+ "DailyUsage",
64
72
  "DeadLetterResponse",
73
+ "DeliveryCohort",
74
+ "DeliveryCohortCurrentStatus",
75
+ "DeliveryCohortProviderOutcomes",
65
76
  "DnsRecord",
66
77
  "DomainOut",
67
78
  "DomainPage",
@@ -77,6 +88,8 @@ __all__ = (
77
88
  "InboxUpdateRequest",
78
89
  "MessageOut",
79
90
  "MessagePage",
91
+ "MetricsOut",
92
+ "MetricsWindow",
80
93
  "OutgoingAttachment",
81
94
  "ReadErasureRequestResponseReadErasureRequest",
82
95
  "RegisterDomainRequest",
@@ -95,6 +108,7 @@ __all__ = (
95
108
  "ThreadPage",
96
109
  "TimelineItemOut",
97
110
  "UpdateIn",
111
+ "UsageCounts",
98
112
  "ValidationError",
99
113
  "ValidationErrorContext",
100
114
  "VerifyIn",