daknode 0.1.0__py3-none-any.whl

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 (84) hide show
  1. daknode/__init__.py +8 -0
  2. daknode/api/__init__.py +1 -0
  3. daknode/api/block_rules/__init__.py +1 -0
  4. daknode/api/block_rules/create_block_rule.py +211 -0
  5. daknode/api/block_rules/create_inbox_block_rule.py +225 -0
  6. daknode/api/block_rules/delete_block_rule.py +192 -0
  7. daknode/api/block_rules/list_block_rules.py +214 -0
  8. daknode/api/block_rules/list_inbox_block_rules.py +228 -0
  9. daknode/api/consent/__init__.py +1 -0
  10. daknode/api/consent/create_consent.py +203 -0
  11. daknode/api/consent/revoke.py +195 -0
  12. daknode/api/control_plane/__init__.py +1 -0
  13. daknode/api/control_plane/close_workspace.py +184 -0
  14. daknode/api/control_plane/create_workspace.py +211 -0
  15. daknode/api/control_plane/list_workspaces.py +155 -0
  16. daknode/api/control_plane/read_workspace.py +176 -0
  17. daknode/api/control_plane/update_workspace.py +197 -0
  18. daknode/api/dead_letters/__init__.py +1 -0
  19. daknode/api/dead_letters/list_dead_letters.py +198 -0
  20. daknode/api/dead_letters/replay_dead_letter.py +216 -0
  21. daknode/api/inboxes/__init__.py +1 -0
  22. daknode/api/inboxes/create_inbox.py +183 -0
  23. daknode/api/inboxes/register_webhook.py +225 -0
  24. daknode/api/inboxes/rotate_webhook_secret.py +224 -0
  25. daknode/api/messages/__init__.py +1 -0
  26. daknode/api/messages/get_message.py +176 -0
  27. daknode/api/messages/get_thread.py +184 -0
  28. daknode/api/messages/list_messages.py +228 -0
  29. daknode/api/messages/list_threads.py +228 -0
  30. daknode/api/privacy/__init__.py +1 -0
  31. daknode/api/privacy/create_erasure_request.py +227 -0
  32. daknode/api/privacy/read_erasure_request.py +200 -0
  33. daknode/api/public/__init__.py +1 -0
  34. daknode/api/public/agent_signup.py +191 -0
  35. daknode/api/public/agent_verify.py +191 -0
  36. daknode/api/search/__init__.py +1 -0
  37. daknode/api/search/search.py +207 -0
  38. daknode/api/send/__init__.py +1 -0
  39. daknode/api/send/send.py +254 -0
  40. daknode/client.py +270 -0
  41. daknode/errors.py +14 -0
  42. daknode/models/__init__.py +79 -0
  43. daknode/models/block_rule_create.py +104 -0
  44. daknode/models/block_rule_out.py +160 -0
  45. daknode/models/block_rule_page.py +116 -0
  46. daknode/models/consent_request.py +104 -0
  47. daknode/models/consent_response.py +105 -0
  48. daknode/models/create_erasure_request_response_create_erasure_request.py +63 -0
  49. daknode/models/create_in.py +119 -0
  50. daknode/models/dead_letter_response.py +205 -0
  51. daknode/models/erasure_request_body.py +60 -0
  52. daknode/models/http_validation_error.py +97 -0
  53. daknode/models/inbox_create_request.py +120 -0
  54. daknode/models/inbox_response.py +148 -0
  55. daknode/models/message_out.py +309 -0
  56. daknode/models/message_page.py +116 -0
  57. daknode/models/read_erasure_request_response_read_erasure_request.py +63 -0
  58. daknode/models/replay_response.py +113 -0
  59. daknode/models/revoke_request.py +74 -0
  60. daknode/models/revoke_response_revoke.py +63 -0
  61. daknode/models/search_match.py +170 -0
  62. daknode/models/search_request.py +107 -0
  63. daknode/models/search_response.py +124 -0
  64. daknode/models/send_request.py +162 -0
  65. daknode/models/send_response_send.py +63 -0
  66. daknode/models/signup_in.py +63 -0
  67. daknode/models/signup_out.py +102 -0
  68. daknode/models/thread_detail_out.py +223 -0
  69. daknode/models/thread_out.py +163 -0
  70. daknode/models/thread_page.py +116 -0
  71. daknode/models/timeline_item_out.py +280 -0
  72. daknode/models/update_in.py +111 -0
  73. daknode/models/validation_error.py +141 -0
  74. daknode/models/validation_error_context.py +63 -0
  75. daknode/models/verify_in.py +67 -0
  76. daknode/models/verify_out.py +74 -0
  77. daknode/models/webhook_register_request.py +74 -0
  78. daknode/models/workspace_list_out.py +92 -0
  79. daknode/models/workspace_out.py +147 -0
  80. daknode/py.typed +1 -0
  81. daknode/types.py +53 -0
  82. daknode-0.1.0.dist-info/METADATA +143 -0
  83. daknode-0.1.0.dist-info/RECORD +84 -0
  84. daknode-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,63 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+ T = TypeVar("T", bound="SignupIn")
16
+
17
+
18
+
19
+ @_attrs_define
20
+ class SignupIn:
21
+ """
22
+ Attributes:
23
+ email (str):
24
+ username (str):
25
+ """
26
+
27
+ email: str
28
+ username: str
29
+
30
+
31
+
32
+
33
+
34
+ def to_dict(self) -> dict[str, Any]:
35
+ email = self.email
36
+
37
+ username = self.username
38
+
39
+
40
+ field_dict: dict[str, Any] = {}
41
+
42
+ field_dict.update({
43
+ "email": email,
44
+ "username": username,
45
+ })
46
+
47
+ return field_dict
48
+
49
+
50
+
51
+ @classmethod
52
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
53
+ d = dict(src_dict)
54
+ email = d.pop("email")
55
+
56
+ username = d.pop("username")
57
+
58
+ signup_in = cls(
59
+ email=email,
60
+ username=username,
61
+ )
62
+
63
+ return signup_in
@@ -0,0 +1,102 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ from uuid import UUID
10
+
11
+
12
+
13
+
14
+
15
+
16
+ T = TypeVar("T", bound="SignupOut")
17
+
18
+
19
+
20
+ @_attrs_define
21
+ class SignupOut:
22
+ """
23
+ Attributes:
24
+ agent_id (UUID):
25
+ api_key (str):
26
+ code_queued (bool):
27
+ verified (bool):
28
+ """
29
+
30
+ agent_id: UUID
31
+ api_key: str
32
+ code_queued: bool
33
+ verified: bool
34
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
35
+
36
+
37
+
38
+
39
+
40
+ def to_dict(self) -> dict[str, Any]:
41
+ agent_id = str(self.agent_id)
42
+
43
+ api_key = self.api_key
44
+
45
+ code_queued = self.code_queued
46
+
47
+ verified = self.verified
48
+
49
+
50
+ field_dict: dict[str, Any] = {}
51
+ field_dict.update(self.additional_properties)
52
+ field_dict.update({
53
+ "agent_id": agent_id,
54
+ "api_key": api_key,
55
+ "code_queued": code_queued,
56
+ "verified": verified,
57
+ })
58
+
59
+ return field_dict
60
+
61
+
62
+
63
+ @classmethod
64
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
65
+ d = dict(src_dict)
66
+ agent_id = UUID(d.pop("agent_id"))
67
+
68
+
69
+
70
+
71
+ api_key = d.pop("api_key")
72
+
73
+ code_queued = d.pop("code_queued")
74
+
75
+ verified = d.pop("verified")
76
+
77
+ signup_out = cls(
78
+ agent_id=agent_id,
79
+ api_key=api_key,
80
+ code_queued=code_queued,
81
+ verified=verified,
82
+ )
83
+
84
+
85
+ signup_out.additional_properties = d
86
+ return signup_out
87
+
88
+ @property
89
+ def additional_keys(self) -> list[str]:
90
+ return list(self.additional_properties.keys())
91
+
92
+ def __getitem__(self, key: str) -> Any:
93
+ return self.additional_properties[key]
94
+
95
+ def __setitem__(self, key: str, value: Any) -> None:
96
+ self.additional_properties[key] = value
97
+
98
+ def __delitem__(self, key: str) -> None:
99
+ del self.additional_properties[key]
100
+
101
+ def __contains__(self, key: str) -> bool:
102
+ return key in self.additional_properties
@@ -0,0 +1,223 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ from ..types import UNSET, Unset
10
+ from dateutil.parser import isoparse
11
+ from typing import cast
12
+ from typing import cast, Union
13
+ from typing import Union
14
+ from uuid import UUID
15
+ import datetime
16
+
17
+ if TYPE_CHECKING:
18
+ from ..models.timeline_item_out import TimelineItemOut
19
+
20
+
21
+
22
+
23
+
24
+ T = TypeVar("T", bound="ThreadDetailOut")
25
+
26
+
27
+
28
+ @_attrs_define
29
+ class ThreadDetailOut:
30
+ """
31
+ Attributes:
32
+ channel (str):
33
+ created_at (datetime.datetime):
34
+ id (UUID):
35
+ inbox_id (UUID):
36
+ last_message_at (Union[None, datetime.datetime]):
37
+ messages (list['TimelineItemOut']):
38
+ status (str):
39
+ subject (Union[None, str]):
40
+ requested_id (Union[None, UUID, Unset]):
41
+ """
42
+
43
+ channel: str
44
+ created_at: datetime.datetime
45
+ id: UUID
46
+ inbox_id: UUID
47
+ last_message_at: Union[None, datetime.datetime]
48
+ messages: list['TimelineItemOut']
49
+ status: str
50
+ subject: Union[None, str]
51
+ requested_id: Union[None, UUID, Unset] = UNSET
52
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
53
+
54
+
55
+
56
+
57
+
58
+ def to_dict(self) -> dict[str, Any]:
59
+ from ..models.timeline_item_out import TimelineItemOut
60
+ channel = self.channel
61
+
62
+ created_at = self.created_at.isoformat()
63
+
64
+ id = str(self.id)
65
+
66
+ inbox_id = str(self.inbox_id)
67
+
68
+ last_message_at: Union[None, str]
69
+ if isinstance(self.last_message_at, datetime.datetime):
70
+ last_message_at = self.last_message_at.isoformat()
71
+ else:
72
+ last_message_at = self.last_message_at
73
+
74
+ messages = []
75
+ for messages_item_data in self.messages:
76
+ messages_item = messages_item_data.to_dict()
77
+ messages.append(messages_item)
78
+
79
+
80
+
81
+ status = self.status
82
+
83
+ subject: Union[None, str]
84
+ subject = self.subject
85
+
86
+ requested_id: Union[None, Unset, str]
87
+ if isinstance(self.requested_id, Unset):
88
+ requested_id = UNSET
89
+ elif isinstance(self.requested_id, UUID):
90
+ requested_id = str(self.requested_id)
91
+ else:
92
+ requested_id = self.requested_id
93
+
94
+
95
+ field_dict: dict[str, Any] = {}
96
+ field_dict.update(self.additional_properties)
97
+ field_dict.update({
98
+ "channel": channel,
99
+ "created_at": created_at,
100
+ "id": id,
101
+ "inbox_id": inbox_id,
102
+ "last_message_at": last_message_at,
103
+ "messages": messages,
104
+ "status": status,
105
+ "subject": subject,
106
+ })
107
+ if requested_id is not UNSET:
108
+ field_dict["requested_id"] = requested_id
109
+
110
+ return field_dict
111
+
112
+
113
+
114
+ @classmethod
115
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
116
+ from ..models.timeline_item_out import TimelineItemOut
117
+ d = dict(src_dict)
118
+ channel = d.pop("channel")
119
+
120
+ created_at = isoparse(d.pop("created_at"))
121
+
122
+
123
+
124
+
125
+ id = UUID(d.pop("id"))
126
+
127
+
128
+
129
+
130
+ inbox_id = UUID(d.pop("inbox_id"))
131
+
132
+
133
+
134
+
135
+ def _parse_last_message_at(data: object) -> Union[None, datetime.datetime]:
136
+ if data is None:
137
+ return data
138
+ try:
139
+ if not isinstance(data, str):
140
+ raise TypeError()
141
+ last_message_at_type_0 = isoparse(data)
142
+
143
+
144
+
145
+ return last_message_at_type_0
146
+ except: # noqa: E722
147
+ pass
148
+ return cast(Union[None, datetime.datetime], data)
149
+
150
+ last_message_at = _parse_last_message_at(d.pop("last_message_at"))
151
+
152
+
153
+ messages = []
154
+ _messages = d.pop("messages")
155
+ for messages_item_data in (_messages):
156
+ messages_item = TimelineItemOut.from_dict(messages_item_data)
157
+
158
+
159
+
160
+ messages.append(messages_item)
161
+
162
+
163
+ status = d.pop("status")
164
+
165
+ def _parse_subject(data: object) -> Union[None, str]:
166
+ if data is None:
167
+ return data
168
+ return cast(Union[None, str], data)
169
+
170
+ subject = _parse_subject(d.pop("subject"))
171
+
172
+
173
+ def _parse_requested_id(data: object) -> Union[None, UUID, Unset]:
174
+ if data is None:
175
+ return data
176
+ if isinstance(data, Unset):
177
+ return data
178
+ try:
179
+ if not isinstance(data, str):
180
+ raise TypeError()
181
+ requested_id_type_0 = UUID(data)
182
+
183
+
184
+
185
+ return requested_id_type_0
186
+ except: # noqa: E722
187
+ pass
188
+ return cast(Union[None, UUID, Unset], data)
189
+
190
+ requested_id = _parse_requested_id(d.pop("requested_id", UNSET))
191
+
192
+
193
+ thread_detail_out = cls(
194
+ channel=channel,
195
+ created_at=created_at,
196
+ id=id,
197
+ inbox_id=inbox_id,
198
+ last_message_at=last_message_at,
199
+ messages=messages,
200
+ status=status,
201
+ subject=subject,
202
+ requested_id=requested_id,
203
+ )
204
+
205
+
206
+ thread_detail_out.additional_properties = d
207
+ return thread_detail_out
208
+
209
+ @property
210
+ def additional_keys(self) -> list[str]:
211
+ return list(self.additional_properties.keys())
212
+
213
+ def __getitem__(self, key: str) -> Any:
214
+ return self.additional_properties[key]
215
+
216
+ def __setitem__(self, key: str, value: Any) -> None:
217
+ self.additional_properties[key] = value
218
+
219
+ def __delitem__(self, key: str) -> None:
220
+ del self.additional_properties[key]
221
+
222
+ def __contains__(self, key: str) -> bool:
223
+ return key in self.additional_properties
@@ -0,0 +1,163 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ from dateutil.parser import isoparse
10
+ from typing import cast
11
+ from typing import cast, Union
12
+ from uuid import UUID
13
+ import datetime
14
+
15
+
16
+
17
+
18
+
19
+
20
+ T = TypeVar("T", bound="ThreadOut")
21
+
22
+
23
+
24
+ @_attrs_define
25
+ class ThreadOut:
26
+ """
27
+ Attributes:
28
+ channel (str):
29
+ created_at (datetime.datetime):
30
+ id (UUID):
31
+ inbox_id (UUID):
32
+ last_message_at (Union[None, datetime.datetime]):
33
+ status (str):
34
+ subject (Union[None, str]):
35
+ """
36
+
37
+ channel: str
38
+ created_at: datetime.datetime
39
+ id: UUID
40
+ inbox_id: UUID
41
+ last_message_at: Union[None, datetime.datetime]
42
+ status: str
43
+ subject: Union[None, str]
44
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
45
+
46
+
47
+
48
+
49
+
50
+ def to_dict(self) -> dict[str, Any]:
51
+ channel = self.channel
52
+
53
+ created_at = self.created_at.isoformat()
54
+
55
+ id = str(self.id)
56
+
57
+ inbox_id = str(self.inbox_id)
58
+
59
+ last_message_at: Union[None, str]
60
+ if isinstance(self.last_message_at, datetime.datetime):
61
+ last_message_at = self.last_message_at.isoformat()
62
+ else:
63
+ last_message_at = self.last_message_at
64
+
65
+ status = self.status
66
+
67
+ subject: Union[None, str]
68
+ subject = self.subject
69
+
70
+
71
+ field_dict: dict[str, Any] = {}
72
+ field_dict.update(self.additional_properties)
73
+ field_dict.update({
74
+ "channel": channel,
75
+ "created_at": created_at,
76
+ "id": id,
77
+ "inbox_id": inbox_id,
78
+ "last_message_at": last_message_at,
79
+ "status": status,
80
+ "subject": subject,
81
+ })
82
+
83
+ return field_dict
84
+
85
+
86
+
87
+ @classmethod
88
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
89
+ d = dict(src_dict)
90
+ channel = d.pop("channel")
91
+
92
+ created_at = isoparse(d.pop("created_at"))
93
+
94
+
95
+
96
+
97
+ id = UUID(d.pop("id"))
98
+
99
+
100
+
101
+
102
+ inbox_id = UUID(d.pop("inbox_id"))
103
+
104
+
105
+
106
+
107
+ def _parse_last_message_at(data: object) -> Union[None, datetime.datetime]:
108
+ if data is None:
109
+ return data
110
+ try:
111
+ if not isinstance(data, str):
112
+ raise TypeError()
113
+ last_message_at_type_0 = isoparse(data)
114
+
115
+
116
+
117
+ return last_message_at_type_0
118
+ except: # noqa: E722
119
+ pass
120
+ return cast(Union[None, datetime.datetime], data)
121
+
122
+ last_message_at = _parse_last_message_at(d.pop("last_message_at"))
123
+
124
+
125
+ status = d.pop("status")
126
+
127
+ def _parse_subject(data: object) -> Union[None, str]:
128
+ if data is None:
129
+ return data
130
+ return cast(Union[None, str], data)
131
+
132
+ subject = _parse_subject(d.pop("subject"))
133
+
134
+
135
+ thread_out = cls(
136
+ channel=channel,
137
+ created_at=created_at,
138
+ id=id,
139
+ inbox_id=inbox_id,
140
+ last_message_at=last_message_at,
141
+ status=status,
142
+ subject=subject,
143
+ )
144
+
145
+
146
+ thread_out.additional_properties = d
147
+ return thread_out
148
+
149
+ @property
150
+ def additional_keys(self) -> list[str]:
151
+ return list(self.additional_properties.keys())
152
+
153
+ def __getitem__(self, key: str) -> Any:
154
+ return self.additional_properties[key]
155
+
156
+ def __setitem__(self, key: str, value: Any) -> None:
157
+ self.additional_properties[key] = value
158
+
159
+ def __delitem__(self, key: str) -> None:
160
+ del self.additional_properties[key]
161
+
162
+ def __contains__(self, key: str) -> bool:
163
+ return key in self.additional_properties
@@ -0,0 +1,116 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ from typing import cast
10
+ from typing import cast, Union
11
+
12
+ if TYPE_CHECKING:
13
+ from ..models.thread_out import ThreadOut
14
+
15
+
16
+
17
+
18
+
19
+ T = TypeVar("T", bound="ThreadPage")
20
+
21
+
22
+
23
+ @_attrs_define
24
+ class ThreadPage:
25
+ """
26
+ Attributes:
27
+ has_more (bool):
28
+ items (list['ThreadOut']):
29
+ next_cursor (Union[None, str]):
30
+ """
31
+
32
+ has_more: bool
33
+ items: list['ThreadOut']
34
+ next_cursor: Union[None, str]
35
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
36
+
37
+
38
+
39
+
40
+
41
+ def to_dict(self) -> dict[str, Any]:
42
+ from ..models.thread_out import ThreadOut
43
+ has_more = self.has_more
44
+
45
+ items = []
46
+ for items_item_data in self.items:
47
+ items_item = items_item_data.to_dict()
48
+ items.append(items_item)
49
+
50
+
51
+
52
+ next_cursor: Union[None, str]
53
+ next_cursor = self.next_cursor
54
+
55
+
56
+ field_dict: dict[str, Any] = {}
57
+ field_dict.update(self.additional_properties)
58
+ field_dict.update({
59
+ "has_more": has_more,
60
+ "items": items,
61
+ "next_cursor": next_cursor,
62
+ })
63
+
64
+ return field_dict
65
+
66
+
67
+
68
+ @classmethod
69
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
70
+ from ..models.thread_out import ThreadOut
71
+ d = dict(src_dict)
72
+ has_more = d.pop("has_more")
73
+
74
+ items = []
75
+ _items = d.pop("items")
76
+ for items_item_data in (_items):
77
+ items_item = ThreadOut.from_dict(items_item_data)
78
+
79
+
80
+
81
+ items.append(items_item)
82
+
83
+
84
+ def _parse_next_cursor(data: object) -> Union[None, str]:
85
+ if data is None:
86
+ return data
87
+ return cast(Union[None, str], data)
88
+
89
+ next_cursor = _parse_next_cursor(d.pop("next_cursor"))
90
+
91
+
92
+ thread_page = cls(
93
+ has_more=has_more,
94
+ items=items,
95
+ next_cursor=next_cursor,
96
+ )
97
+
98
+
99
+ thread_page.additional_properties = d
100
+ return thread_page
101
+
102
+ @property
103
+ def additional_keys(self) -> list[str]:
104
+ return list(self.additional_properties.keys())
105
+
106
+ def __getitem__(self, key: str) -> Any:
107
+ return self.additional_properties[key]
108
+
109
+ def __setitem__(self, key: str, value: Any) -> None:
110
+ self.additional_properties[key] = value
111
+
112
+ def __delitem__(self, key: str) -> None:
113
+ del self.additional_properties[key]
114
+
115
+ def __contains__(self, key: str) -> bool:
116
+ return key in self.additional_properties