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.
- daknode/__init__.py +8 -0
- daknode/api/__init__.py +1 -0
- daknode/api/block_rules/__init__.py +1 -0
- daknode/api/block_rules/create_block_rule.py +211 -0
- daknode/api/block_rules/create_inbox_block_rule.py +225 -0
- daknode/api/block_rules/delete_block_rule.py +192 -0
- daknode/api/block_rules/list_block_rules.py +214 -0
- daknode/api/block_rules/list_inbox_block_rules.py +228 -0
- daknode/api/consent/__init__.py +1 -0
- daknode/api/consent/create_consent.py +203 -0
- daknode/api/consent/revoke.py +195 -0
- daknode/api/control_plane/__init__.py +1 -0
- daknode/api/control_plane/close_workspace.py +184 -0
- daknode/api/control_plane/create_workspace.py +211 -0
- daknode/api/control_plane/list_workspaces.py +155 -0
- daknode/api/control_plane/read_workspace.py +176 -0
- daknode/api/control_plane/update_workspace.py +197 -0
- daknode/api/dead_letters/__init__.py +1 -0
- daknode/api/dead_letters/list_dead_letters.py +198 -0
- daknode/api/dead_letters/replay_dead_letter.py +216 -0
- daknode/api/inboxes/__init__.py +1 -0
- daknode/api/inboxes/create_inbox.py +183 -0
- daknode/api/inboxes/register_webhook.py +225 -0
- daknode/api/inboxes/rotate_webhook_secret.py +224 -0
- daknode/api/messages/__init__.py +1 -0
- daknode/api/messages/get_message.py +176 -0
- daknode/api/messages/get_thread.py +184 -0
- daknode/api/messages/list_messages.py +228 -0
- daknode/api/messages/list_threads.py +228 -0
- daknode/api/privacy/__init__.py +1 -0
- daknode/api/privacy/create_erasure_request.py +227 -0
- daknode/api/privacy/read_erasure_request.py +200 -0
- daknode/api/public/__init__.py +1 -0
- daknode/api/public/agent_signup.py +191 -0
- daknode/api/public/agent_verify.py +191 -0
- daknode/api/search/__init__.py +1 -0
- daknode/api/search/search.py +207 -0
- daknode/api/send/__init__.py +1 -0
- daknode/api/send/send.py +254 -0
- daknode/client.py +270 -0
- daknode/errors.py +14 -0
- daknode/models/__init__.py +79 -0
- daknode/models/block_rule_create.py +104 -0
- daknode/models/block_rule_out.py +160 -0
- daknode/models/block_rule_page.py +116 -0
- daknode/models/consent_request.py +104 -0
- daknode/models/consent_response.py +105 -0
- daknode/models/create_erasure_request_response_create_erasure_request.py +63 -0
- daknode/models/create_in.py +119 -0
- daknode/models/dead_letter_response.py +205 -0
- daknode/models/erasure_request_body.py +60 -0
- daknode/models/http_validation_error.py +97 -0
- daknode/models/inbox_create_request.py +120 -0
- daknode/models/inbox_response.py +148 -0
- daknode/models/message_out.py +309 -0
- daknode/models/message_page.py +116 -0
- daknode/models/read_erasure_request_response_read_erasure_request.py +63 -0
- daknode/models/replay_response.py +113 -0
- daknode/models/revoke_request.py +74 -0
- daknode/models/revoke_response_revoke.py +63 -0
- daknode/models/search_match.py +170 -0
- daknode/models/search_request.py +107 -0
- daknode/models/search_response.py +124 -0
- daknode/models/send_request.py +162 -0
- daknode/models/send_response_send.py +63 -0
- daknode/models/signup_in.py +63 -0
- daknode/models/signup_out.py +102 -0
- daknode/models/thread_detail_out.py +223 -0
- daknode/models/thread_out.py +163 -0
- daknode/models/thread_page.py +116 -0
- daknode/models/timeline_item_out.py +280 -0
- daknode/models/update_in.py +111 -0
- daknode/models/validation_error.py +141 -0
- daknode/models/validation_error_context.py +63 -0
- daknode/models/verify_in.py +67 -0
- daknode/models/verify_out.py +74 -0
- daknode/models/webhook_register_request.py +74 -0
- daknode/models/workspace_list_out.py +92 -0
- daknode/models/workspace_out.py +147 -0
- daknode/py.typed +1 -0
- daknode/types.py +53 -0
- daknode-0.1.0.dist-info/METADATA +143 -0
- daknode-0.1.0.dist-info/RECORD +84 -0
- 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="RevokeResponseRevoke")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class RevokeResponseRevoke:
|
|
21
|
+
"""
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
|
31
|
+
|
|
32
|
+
field_dict: dict[str, Any] = {}
|
|
33
|
+
field_dict.update(self.additional_properties)
|
|
34
|
+
|
|
35
|
+
return field_dict
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
revoke_response_revoke = cls(
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
revoke_response_revoke.additional_properties = d
|
|
47
|
+
return revoke_response_revoke
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def additional_keys(self) -> list[str]:
|
|
51
|
+
return list(self.additional_properties.keys())
|
|
52
|
+
|
|
53
|
+
def __getitem__(self, key: str) -> Any:
|
|
54
|
+
return self.additional_properties[key]
|
|
55
|
+
|
|
56
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
57
|
+
self.additional_properties[key] = value
|
|
58
|
+
|
|
59
|
+
def __delitem__(self, key: str) -> None:
|
|
60
|
+
del self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __contains__(self, key: str) -> bool:
|
|
63
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,170 @@
|
|
|
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
|
+
from uuid import UUID
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="SearchMatch")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class SearchMatch:
|
|
24
|
+
"""
|
|
25
|
+
Attributes:
|
|
26
|
+
chunk_end (int):
|
|
27
|
+
chunk_index (int):
|
|
28
|
+
chunk_start (int):
|
|
29
|
+
inbox_id (UUID):
|
|
30
|
+
message_id (UUID):
|
|
31
|
+
risk_level (str):
|
|
32
|
+
risk_signals (Union[None, list[str]]):
|
|
33
|
+
similarity (float):
|
|
34
|
+
thread_id (UUID):
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
chunk_end: int
|
|
38
|
+
chunk_index: int
|
|
39
|
+
chunk_start: int
|
|
40
|
+
inbox_id: UUID
|
|
41
|
+
message_id: UUID
|
|
42
|
+
risk_level: str
|
|
43
|
+
risk_signals: Union[None, list[str]]
|
|
44
|
+
similarity: float
|
|
45
|
+
thread_id: UUID
|
|
46
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> dict[str, Any]:
|
|
53
|
+
chunk_end = self.chunk_end
|
|
54
|
+
|
|
55
|
+
chunk_index = self.chunk_index
|
|
56
|
+
|
|
57
|
+
chunk_start = self.chunk_start
|
|
58
|
+
|
|
59
|
+
inbox_id = str(self.inbox_id)
|
|
60
|
+
|
|
61
|
+
message_id = str(self.message_id)
|
|
62
|
+
|
|
63
|
+
risk_level = self.risk_level
|
|
64
|
+
|
|
65
|
+
risk_signals: Union[None, list[str]]
|
|
66
|
+
if isinstance(self.risk_signals, list):
|
|
67
|
+
risk_signals = self.risk_signals
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
else:
|
|
71
|
+
risk_signals = self.risk_signals
|
|
72
|
+
|
|
73
|
+
similarity = self.similarity
|
|
74
|
+
|
|
75
|
+
thread_id = str(self.thread_id)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
field_dict: dict[str, Any] = {}
|
|
79
|
+
field_dict.update(self.additional_properties)
|
|
80
|
+
field_dict.update({
|
|
81
|
+
"chunk_end": chunk_end,
|
|
82
|
+
"chunk_index": chunk_index,
|
|
83
|
+
"chunk_start": chunk_start,
|
|
84
|
+
"inbox_id": inbox_id,
|
|
85
|
+
"message_id": message_id,
|
|
86
|
+
"risk_level": risk_level,
|
|
87
|
+
"risk_signals": risk_signals,
|
|
88
|
+
"similarity": similarity,
|
|
89
|
+
"thread_id": thread_id,
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
return field_dict
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
98
|
+
d = dict(src_dict)
|
|
99
|
+
chunk_end = d.pop("chunk_end")
|
|
100
|
+
|
|
101
|
+
chunk_index = d.pop("chunk_index")
|
|
102
|
+
|
|
103
|
+
chunk_start = d.pop("chunk_start")
|
|
104
|
+
|
|
105
|
+
inbox_id = UUID(d.pop("inbox_id"))
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
message_id = UUID(d.pop("message_id"))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
risk_level = d.pop("risk_level")
|
|
116
|
+
|
|
117
|
+
def _parse_risk_signals(data: object) -> Union[None, list[str]]:
|
|
118
|
+
if data is None:
|
|
119
|
+
return data
|
|
120
|
+
try:
|
|
121
|
+
if not isinstance(data, list):
|
|
122
|
+
raise TypeError()
|
|
123
|
+
risk_signals_type_0 = cast(list[str], data)
|
|
124
|
+
|
|
125
|
+
return risk_signals_type_0
|
|
126
|
+
except: # noqa: E722
|
|
127
|
+
pass
|
|
128
|
+
return cast(Union[None, list[str]], data)
|
|
129
|
+
|
|
130
|
+
risk_signals = _parse_risk_signals(d.pop("risk_signals"))
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
similarity = d.pop("similarity")
|
|
134
|
+
|
|
135
|
+
thread_id = UUID(d.pop("thread_id"))
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
search_match = cls(
|
|
141
|
+
chunk_end=chunk_end,
|
|
142
|
+
chunk_index=chunk_index,
|
|
143
|
+
chunk_start=chunk_start,
|
|
144
|
+
inbox_id=inbox_id,
|
|
145
|
+
message_id=message_id,
|
|
146
|
+
risk_level=risk_level,
|
|
147
|
+
risk_signals=risk_signals,
|
|
148
|
+
similarity=similarity,
|
|
149
|
+
thread_id=thread_id,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
search_match.additional_properties = d
|
|
154
|
+
return search_match
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
def additional_keys(self) -> list[str]:
|
|
158
|
+
return list(self.additional_properties.keys())
|
|
159
|
+
|
|
160
|
+
def __getitem__(self, key: str) -> Any:
|
|
161
|
+
return self.additional_properties[key]
|
|
162
|
+
|
|
163
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
164
|
+
self.additional_properties[key] = value
|
|
165
|
+
|
|
166
|
+
def __delitem__(self, key: str) -> None:
|
|
167
|
+
del self.additional_properties[key]
|
|
168
|
+
|
|
169
|
+
def __contains__(self, key: str) -> bool:
|
|
170
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,107 @@
|
|
|
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 typing import cast, Union
|
|
11
|
+
from typing import Union
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="SearchRequest")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class SearchRequest:
|
|
24
|
+
"""
|
|
25
|
+
Attributes:
|
|
26
|
+
query (str):
|
|
27
|
+
min_score (Union[None, Unset, float]):
|
|
28
|
+
top_k (Union[Unset, int]): Default: 10.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
query: str
|
|
32
|
+
min_score: Union[None, Unset, float] = UNSET
|
|
33
|
+
top_k: Union[Unset, int] = 10
|
|
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
|
+
query = self.query
|
|
42
|
+
|
|
43
|
+
min_score: Union[None, Unset, float]
|
|
44
|
+
if isinstance(self.min_score, Unset):
|
|
45
|
+
min_score = UNSET
|
|
46
|
+
else:
|
|
47
|
+
min_score = self.min_score
|
|
48
|
+
|
|
49
|
+
top_k = self.top_k
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
field_dict: dict[str, Any] = {}
|
|
53
|
+
field_dict.update(self.additional_properties)
|
|
54
|
+
field_dict.update({
|
|
55
|
+
"query": query,
|
|
56
|
+
})
|
|
57
|
+
if min_score is not UNSET:
|
|
58
|
+
field_dict["min_score"] = min_score
|
|
59
|
+
if top_k is not UNSET:
|
|
60
|
+
field_dict["top_k"] = top_k
|
|
61
|
+
|
|
62
|
+
return field_dict
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
68
|
+
d = dict(src_dict)
|
|
69
|
+
query = d.pop("query")
|
|
70
|
+
|
|
71
|
+
def _parse_min_score(data: object) -> Union[None, Unset, float]:
|
|
72
|
+
if data is None:
|
|
73
|
+
return data
|
|
74
|
+
if isinstance(data, Unset):
|
|
75
|
+
return data
|
|
76
|
+
return cast(Union[None, Unset, float], data)
|
|
77
|
+
|
|
78
|
+
min_score = _parse_min_score(d.pop("min_score", UNSET))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
top_k = d.pop("top_k", UNSET)
|
|
82
|
+
|
|
83
|
+
search_request = cls(
|
|
84
|
+
query=query,
|
|
85
|
+
min_score=min_score,
|
|
86
|
+
top_k=top_k,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
search_request.additional_properties = d
|
|
91
|
+
return search_request
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def additional_keys(self) -> list[str]:
|
|
95
|
+
return list(self.additional_properties.keys())
|
|
96
|
+
|
|
97
|
+
def __getitem__(self, key: str) -> Any:
|
|
98
|
+
return self.additional_properties[key]
|
|
99
|
+
|
|
100
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
101
|
+
self.additional_properties[key] = value
|
|
102
|
+
|
|
103
|
+
def __delitem__(self, key: str) -> None:
|
|
104
|
+
del self.additional_properties[key]
|
|
105
|
+
|
|
106
|
+
def __contains__(self, key: str) -> bool:
|
|
107
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,124 @@
|
|
|
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 Union
|
|
13
|
+
import datetime
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..models.search_match import SearchMatch
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="SearchResponse")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@_attrs_define
|
|
27
|
+
class SearchResponse:
|
|
28
|
+
"""
|
|
29
|
+
Attributes:
|
|
30
|
+
generated_at (datetime.datetime):
|
|
31
|
+
matches (list['SearchMatch']):
|
|
32
|
+
model (str):
|
|
33
|
+
index_is_eventually_consistent (Union[Unset, bool]): Default: True.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
generated_at: datetime.datetime
|
|
37
|
+
matches: list['SearchMatch']
|
|
38
|
+
model: str
|
|
39
|
+
index_is_eventually_consistent: Union[Unset, bool] = True
|
|
40
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def to_dict(self) -> dict[str, Any]:
|
|
47
|
+
from ..models.search_match import SearchMatch
|
|
48
|
+
generated_at = self.generated_at.isoformat()
|
|
49
|
+
|
|
50
|
+
matches = []
|
|
51
|
+
for matches_item_data in self.matches:
|
|
52
|
+
matches_item = matches_item_data.to_dict()
|
|
53
|
+
matches.append(matches_item)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
model = self.model
|
|
58
|
+
|
|
59
|
+
index_is_eventually_consistent = self.index_is_eventually_consistent
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
field_dict: dict[str, Any] = {}
|
|
63
|
+
field_dict.update(self.additional_properties)
|
|
64
|
+
field_dict.update({
|
|
65
|
+
"generated_at": generated_at,
|
|
66
|
+
"matches": matches,
|
|
67
|
+
"model": model,
|
|
68
|
+
})
|
|
69
|
+
if index_is_eventually_consistent is not UNSET:
|
|
70
|
+
field_dict["index_is_eventually_consistent"] = index_is_eventually_consistent
|
|
71
|
+
|
|
72
|
+
return field_dict
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
78
|
+
from ..models.search_match import SearchMatch
|
|
79
|
+
d = dict(src_dict)
|
|
80
|
+
generated_at = isoparse(d.pop("generated_at"))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
matches = []
|
|
86
|
+
_matches = d.pop("matches")
|
|
87
|
+
for matches_item_data in (_matches):
|
|
88
|
+
matches_item = SearchMatch.from_dict(matches_item_data)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
matches.append(matches_item)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
model = d.pop("model")
|
|
96
|
+
|
|
97
|
+
index_is_eventually_consistent = d.pop("index_is_eventually_consistent", UNSET)
|
|
98
|
+
|
|
99
|
+
search_response = cls(
|
|
100
|
+
generated_at=generated_at,
|
|
101
|
+
matches=matches,
|
|
102
|
+
model=model,
|
|
103
|
+
index_is_eventually_consistent=index_is_eventually_consistent,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
search_response.additional_properties = d
|
|
108
|
+
return search_response
|
|
109
|
+
|
|
110
|
+
@property
|
|
111
|
+
def additional_keys(self) -> list[str]:
|
|
112
|
+
return list(self.additional_properties.keys())
|
|
113
|
+
|
|
114
|
+
def __getitem__(self, key: str) -> Any:
|
|
115
|
+
return self.additional_properties[key]
|
|
116
|
+
|
|
117
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
118
|
+
self.additional_properties[key] = value
|
|
119
|
+
|
|
120
|
+
def __delitem__(self, key: str) -> None:
|
|
121
|
+
del self.additional_properties[key]
|
|
122
|
+
|
|
123
|
+
def __contains__(self, key: str) -> bool:
|
|
124
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,162 @@
|
|
|
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 typing import cast, Union
|
|
11
|
+
from typing import Union
|
|
12
|
+
from uuid import UUID
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="SendRequest")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class SendRequest:
|
|
25
|
+
""" `extra="forbid"` is load-bearing.
|
|
26
|
+
|
|
27
|
+
There is no `from`, `sender` or `return_path` field: the From identity comes
|
|
28
|
+
from the tenant's inbox record. Forbidding extras makes a caller who tries to
|
|
29
|
+
set one get a `422` instead of a silent `202` — being ignored is worse,
|
|
30
|
+
because the integrator believes they chose a sender and nothing says
|
|
31
|
+
otherwise. A caller-chosen From is sender spoofing on infrastructure whose
|
|
32
|
+
DKIM signature makes it look authentic.
|
|
33
|
+
|
|
34
|
+
Attributes:
|
|
35
|
+
inbox_id (UUID):
|
|
36
|
+
to (str):
|
|
37
|
+
body_html (Union[None, Unset, str]):
|
|
38
|
+
body_text (Union[None, Unset, str]):
|
|
39
|
+
subject (Union[Unset, str]): Default: ''.
|
|
40
|
+
thread_id (Union[None, UUID, Unset]):
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
inbox_id: UUID
|
|
44
|
+
to: str
|
|
45
|
+
body_html: Union[None, Unset, str] = UNSET
|
|
46
|
+
body_text: Union[None, Unset, str] = UNSET
|
|
47
|
+
subject: Union[Unset, str] = ''
|
|
48
|
+
thread_id: Union[None, UUID, Unset] = UNSET
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> dict[str, Any]:
|
|
55
|
+
inbox_id = str(self.inbox_id)
|
|
56
|
+
|
|
57
|
+
to = self.to
|
|
58
|
+
|
|
59
|
+
body_html: Union[None, Unset, str]
|
|
60
|
+
if isinstance(self.body_html, Unset):
|
|
61
|
+
body_html = UNSET
|
|
62
|
+
else:
|
|
63
|
+
body_html = self.body_html
|
|
64
|
+
|
|
65
|
+
body_text: Union[None, Unset, str]
|
|
66
|
+
if isinstance(self.body_text, Unset):
|
|
67
|
+
body_text = UNSET
|
|
68
|
+
else:
|
|
69
|
+
body_text = self.body_text
|
|
70
|
+
|
|
71
|
+
subject = self.subject
|
|
72
|
+
|
|
73
|
+
thread_id: Union[None, Unset, str]
|
|
74
|
+
if isinstance(self.thread_id, Unset):
|
|
75
|
+
thread_id = UNSET
|
|
76
|
+
elif isinstance(self.thread_id, UUID):
|
|
77
|
+
thread_id = str(self.thread_id)
|
|
78
|
+
else:
|
|
79
|
+
thread_id = self.thread_id
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
field_dict: dict[str, Any] = {}
|
|
83
|
+
|
|
84
|
+
field_dict.update({
|
|
85
|
+
"inbox_id": inbox_id,
|
|
86
|
+
"to": to,
|
|
87
|
+
})
|
|
88
|
+
if body_html is not UNSET:
|
|
89
|
+
field_dict["body_html"] = body_html
|
|
90
|
+
if body_text is not UNSET:
|
|
91
|
+
field_dict["body_text"] = body_text
|
|
92
|
+
if subject is not UNSET:
|
|
93
|
+
field_dict["subject"] = subject
|
|
94
|
+
if thread_id is not UNSET:
|
|
95
|
+
field_dict["thread_id"] = thread_id
|
|
96
|
+
|
|
97
|
+
return field_dict
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
103
|
+
d = dict(src_dict)
|
|
104
|
+
inbox_id = UUID(d.pop("inbox_id"))
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
to = d.pop("to")
|
|
110
|
+
|
|
111
|
+
def _parse_body_html(data: object) -> Union[None, Unset, str]:
|
|
112
|
+
if data is None:
|
|
113
|
+
return data
|
|
114
|
+
if isinstance(data, Unset):
|
|
115
|
+
return data
|
|
116
|
+
return cast(Union[None, Unset, str], data)
|
|
117
|
+
|
|
118
|
+
body_html = _parse_body_html(d.pop("body_html", UNSET))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _parse_body_text(data: object) -> Union[None, Unset, str]:
|
|
122
|
+
if data is None:
|
|
123
|
+
return data
|
|
124
|
+
if isinstance(data, Unset):
|
|
125
|
+
return data
|
|
126
|
+
return cast(Union[None, Unset, str], data)
|
|
127
|
+
|
|
128
|
+
body_text = _parse_body_text(d.pop("body_text", UNSET))
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
subject = d.pop("subject", UNSET)
|
|
132
|
+
|
|
133
|
+
def _parse_thread_id(data: object) -> Union[None, UUID, Unset]:
|
|
134
|
+
if data is None:
|
|
135
|
+
return data
|
|
136
|
+
if isinstance(data, Unset):
|
|
137
|
+
return data
|
|
138
|
+
try:
|
|
139
|
+
if not isinstance(data, str):
|
|
140
|
+
raise TypeError()
|
|
141
|
+
thread_id_type_0 = UUID(data)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
return thread_id_type_0
|
|
146
|
+
except: # noqa: E722
|
|
147
|
+
pass
|
|
148
|
+
return cast(Union[None, UUID, Unset], data)
|
|
149
|
+
|
|
150
|
+
thread_id = _parse_thread_id(d.pop("thread_id", UNSET))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
send_request = cls(
|
|
154
|
+
inbox_id=inbox_id,
|
|
155
|
+
to=to,
|
|
156
|
+
body_html=body_html,
|
|
157
|
+
body_text=body_text,
|
|
158
|
+
subject=subject,
|
|
159
|
+
thread_id=thread_id,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
return send_request
|
|
@@ -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="SendResponseSend")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class SendResponseSend:
|
|
21
|
+
"""
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
|
31
|
+
|
|
32
|
+
field_dict: dict[str, Any] = {}
|
|
33
|
+
field_dict.update(self.additional_properties)
|
|
34
|
+
|
|
35
|
+
return field_dict
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
send_response_send = cls(
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
send_response_send.additional_properties = d
|
|
47
|
+
return send_response_send
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def additional_keys(self) -> list[str]:
|
|
51
|
+
return list(self.additional_properties.keys())
|
|
52
|
+
|
|
53
|
+
def __getitem__(self, key: str) -> Any:
|
|
54
|
+
return self.additional_properties[key]
|
|
55
|
+
|
|
56
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
57
|
+
self.additional_properties[key] = value
|
|
58
|
+
|
|
59
|
+
def __delitem__(self, key: str) -> None:
|
|
60
|
+
del self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __contains__(self, key: str) -> bool:
|
|
63
|
+
return key in self.additional_properties
|