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,74 @@
|
|
|
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="VerifyOut")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class VerifyOut:
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
verified (bool):
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
verified: bool
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def to_dict(self) -> dict[str, Any]:
|
|
34
|
+
verified = self.verified
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
field_dict: dict[str, Any] = {}
|
|
38
|
+
field_dict.update(self.additional_properties)
|
|
39
|
+
field_dict.update({
|
|
40
|
+
"verified": verified,
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
return field_dict
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
49
|
+
d = dict(src_dict)
|
|
50
|
+
verified = d.pop("verified")
|
|
51
|
+
|
|
52
|
+
verify_out = cls(
|
|
53
|
+
verified=verified,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
verify_out.additional_properties = d
|
|
58
|
+
return verify_out
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def additional_keys(self) -> list[str]:
|
|
62
|
+
return list(self.additional_properties.keys())
|
|
63
|
+
|
|
64
|
+
def __getitem__(self, key: str) -> Any:
|
|
65
|
+
return self.additional_properties[key]
|
|
66
|
+
|
|
67
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
68
|
+
self.additional_properties[key] = value
|
|
69
|
+
|
|
70
|
+
def __delitem__(self, key: str) -> None:
|
|
71
|
+
del self.additional_properties[key]
|
|
72
|
+
|
|
73
|
+
def __contains__(self, key: str) -> bool:
|
|
74
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,74 @@
|
|
|
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="WebhookRegisterRequest")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class WebhookRegisterRequest:
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
webhook_url (str):
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
webhook_url: str
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def to_dict(self) -> dict[str, Any]:
|
|
34
|
+
webhook_url = self.webhook_url
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
field_dict: dict[str, Any] = {}
|
|
38
|
+
field_dict.update(self.additional_properties)
|
|
39
|
+
field_dict.update({
|
|
40
|
+
"webhook_url": webhook_url,
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
return field_dict
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
49
|
+
d = dict(src_dict)
|
|
50
|
+
webhook_url = d.pop("webhook_url")
|
|
51
|
+
|
|
52
|
+
webhook_register_request = cls(
|
|
53
|
+
webhook_url=webhook_url,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
webhook_register_request.additional_properties = d
|
|
58
|
+
return webhook_register_request
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def additional_keys(self) -> list[str]:
|
|
62
|
+
return list(self.additional_properties.keys())
|
|
63
|
+
|
|
64
|
+
def __getitem__(self, key: str) -> Any:
|
|
65
|
+
return self.additional_properties[key]
|
|
66
|
+
|
|
67
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
68
|
+
self.additional_properties[key] = value
|
|
69
|
+
|
|
70
|
+
def __delitem__(self, key: str) -> None:
|
|
71
|
+
del self.additional_properties[key]
|
|
72
|
+
|
|
73
|
+
def __contains__(self, key: str) -> bool:
|
|
74
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.workspace_out import WorkspaceOut
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="WorkspaceListOut")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class WorkspaceListOut:
|
|
24
|
+
"""
|
|
25
|
+
Attributes:
|
|
26
|
+
workspaces (list['WorkspaceOut']):
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
workspaces: list['WorkspaceOut']
|
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
from ..models.workspace_out import WorkspaceOut
|
|
38
|
+
workspaces = []
|
|
39
|
+
for workspaces_item_data in self.workspaces:
|
|
40
|
+
workspaces_item = workspaces_item_data.to_dict()
|
|
41
|
+
workspaces.append(workspaces_item)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
field_dict: dict[str, Any] = {}
|
|
47
|
+
field_dict.update(self.additional_properties)
|
|
48
|
+
field_dict.update({
|
|
49
|
+
"workspaces": workspaces,
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
return field_dict
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
58
|
+
from ..models.workspace_out import WorkspaceOut
|
|
59
|
+
d = dict(src_dict)
|
|
60
|
+
workspaces = []
|
|
61
|
+
_workspaces = d.pop("workspaces")
|
|
62
|
+
for workspaces_item_data in (_workspaces):
|
|
63
|
+
workspaces_item = WorkspaceOut.from_dict(workspaces_item_data)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
workspaces.append(workspaces_item)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
workspace_list_out = cls(
|
|
71
|
+
workspaces=workspaces,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
workspace_list_out.additional_properties = d
|
|
76
|
+
return workspace_list_out
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def additional_keys(self) -> list[str]:
|
|
80
|
+
return list(self.additional_properties.keys())
|
|
81
|
+
|
|
82
|
+
def __getitem__(self, key: str) -> Any:
|
|
83
|
+
return self.additional_properties[key]
|
|
84
|
+
|
|
85
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
86
|
+
self.additional_properties[key] = value
|
|
87
|
+
|
|
88
|
+
def __delitem__(self, key: str) -> None:
|
|
89
|
+
del self.additional_properties[key]
|
|
90
|
+
|
|
91
|
+
def __contains__(self, key: str) -> bool:
|
|
92
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,147 @@
|
|
|
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="WorkspaceOut")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class WorkspaceOut:
|
|
26
|
+
"""
|
|
27
|
+
Attributes:
|
|
28
|
+
created_at (datetime.datetime):
|
|
29
|
+
external_client_id (Union[None, str]):
|
|
30
|
+
id (UUID):
|
|
31
|
+
is_default (bool):
|
|
32
|
+
name (str):
|
|
33
|
+
status (str):
|
|
34
|
+
workspace_slug (Union[None, str]):
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
created_at: datetime.datetime
|
|
38
|
+
external_client_id: Union[None, str]
|
|
39
|
+
id: UUID
|
|
40
|
+
is_default: bool
|
|
41
|
+
name: str
|
|
42
|
+
status: str
|
|
43
|
+
workspace_slug: 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
|
+
created_at = self.created_at.isoformat()
|
|
52
|
+
|
|
53
|
+
external_client_id: Union[None, str]
|
|
54
|
+
external_client_id = self.external_client_id
|
|
55
|
+
|
|
56
|
+
id = str(self.id)
|
|
57
|
+
|
|
58
|
+
is_default = self.is_default
|
|
59
|
+
|
|
60
|
+
name = self.name
|
|
61
|
+
|
|
62
|
+
status = self.status
|
|
63
|
+
|
|
64
|
+
workspace_slug: Union[None, str]
|
|
65
|
+
workspace_slug = self.workspace_slug
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
field_dict: dict[str, Any] = {}
|
|
69
|
+
field_dict.update(self.additional_properties)
|
|
70
|
+
field_dict.update({
|
|
71
|
+
"created_at": created_at,
|
|
72
|
+
"external_client_id": external_client_id,
|
|
73
|
+
"id": id,
|
|
74
|
+
"is_default": is_default,
|
|
75
|
+
"name": name,
|
|
76
|
+
"status": status,
|
|
77
|
+
"workspace_slug": workspace_slug,
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
return field_dict
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
86
|
+
d = dict(src_dict)
|
|
87
|
+
created_at = isoparse(d.pop("created_at"))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _parse_external_client_id(data: object) -> Union[None, str]:
|
|
93
|
+
if data is None:
|
|
94
|
+
return data
|
|
95
|
+
return cast(Union[None, str], data)
|
|
96
|
+
|
|
97
|
+
external_client_id = _parse_external_client_id(d.pop("external_client_id"))
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
id = UUID(d.pop("id"))
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
is_default = d.pop("is_default")
|
|
106
|
+
|
|
107
|
+
name = d.pop("name")
|
|
108
|
+
|
|
109
|
+
status = d.pop("status")
|
|
110
|
+
|
|
111
|
+
def _parse_workspace_slug(data: object) -> Union[None, str]:
|
|
112
|
+
if data is None:
|
|
113
|
+
return data
|
|
114
|
+
return cast(Union[None, str], data)
|
|
115
|
+
|
|
116
|
+
workspace_slug = _parse_workspace_slug(d.pop("workspace_slug"))
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
workspace_out = cls(
|
|
120
|
+
created_at=created_at,
|
|
121
|
+
external_client_id=external_client_id,
|
|
122
|
+
id=id,
|
|
123
|
+
is_default=is_default,
|
|
124
|
+
name=name,
|
|
125
|
+
status=status,
|
|
126
|
+
workspace_slug=workspace_slug,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
workspace_out.additional_properties = d
|
|
131
|
+
return workspace_out
|
|
132
|
+
|
|
133
|
+
@property
|
|
134
|
+
def additional_keys(self) -> list[str]:
|
|
135
|
+
return list(self.additional_properties.keys())
|
|
136
|
+
|
|
137
|
+
def __getitem__(self, key: str) -> Any:
|
|
138
|
+
return self.additional_properties[key]
|
|
139
|
+
|
|
140
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
141
|
+
self.additional_properties[key] = value
|
|
142
|
+
|
|
143
|
+
def __delitem__(self, key: str) -> None:
|
|
144
|
+
del self.additional_properties[key]
|
|
145
|
+
|
|
146
|
+
def __contains__(self, key: str) -> bool:
|
|
147
|
+
return key in self.additional_properties
|
daknode/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Marker file for PEP 561
|
daknode/types.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
""" Contains some shared types for properties """
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping, MutableMapping
|
|
4
|
+
from http import HTTPStatus
|
|
5
|
+
from typing import BinaryIO, Generic, Optional, TypeVar, Literal, Union, IO
|
|
6
|
+
|
|
7
|
+
from attrs import define
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Unset:
|
|
11
|
+
def __bool__(self) -> Literal[False]:
|
|
12
|
+
return False
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
UNSET: Unset = Unset()
|
|
16
|
+
|
|
17
|
+
# The types that `httpx.Client(files=)` can accept, copied from that library.
|
|
18
|
+
FileContent = Union[IO[bytes], bytes, str]
|
|
19
|
+
FileTypes = Union[
|
|
20
|
+
# (filename, file (or bytes), content_type)
|
|
21
|
+
tuple[Optional[str], FileContent, Optional[str]],
|
|
22
|
+
# (filename, file (or bytes), content_type, headers)
|
|
23
|
+
tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]],
|
|
24
|
+
]
|
|
25
|
+
RequestFiles = list[tuple[str, FileTypes]]
|
|
26
|
+
|
|
27
|
+
@define
|
|
28
|
+
class File:
|
|
29
|
+
""" Contains information for file uploads """
|
|
30
|
+
|
|
31
|
+
payload: BinaryIO
|
|
32
|
+
file_name: Optional[str] = None
|
|
33
|
+
mime_type: Optional[str] = None
|
|
34
|
+
|
|
35
|
+
def to_tuple(self) -> FileTypes:
|
|
36
|
+
""" Return a tuple representation that httpx will accept for multipart/form-data """
|
|
37
|
+
return self.file_name, self.payload, self.mime_type
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
T = TypeVar("T")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@define
|
|
44
|
+
class Response(Generic[T]):
|
|
45
|
+
""" A response from an endpoint """
|
|
46
|
+
|
|
47
|
+
status_code: HTTPStatus
|
|
48
|
+
content: bytes
|
|
49
|
+
headers: MutableMapping[str, str]
|
|
50
|
+
parsed: Optional[T]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"]
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: daknode
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A client library for accessing DakNode
|
|
5
|
+
Requires-Python: >=3.9,<4.0
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
14
|
+
Requires-Dist: attrs (>=22.2.0)
|
|
15
|
+
Requires-Dist: httpx (>=0.23.0,<0.29.0)
|
|
16
|
+
Requires-Dist: python-dateutil (>=2.8.0,<3.0.0)
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# daknode
|
|
20
|
+
A client library for accessing DakNode
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
First, create a client:
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from daknode import Client
|
|
27
|
+
|
|
28
|
+
client = Client(base_url="https://api.example.com")
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from daknode import AuthenticatedClient
|
|
35
|
+
|
|
36
|
+
client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Now call your endpoint and use your models:
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from daknode.models import MyDataModel
|
|
43
|
+
from daknode.api.my_tag import get_my_data_model
|
|
44
|
+
from daknode.types import Response
|
|
45
|
+
|
|
46
|
+
with client as client:
|
|
47
|
+
my_data: MyDataModel = get_my_data_model.sync(client=client)
|
|
48
|
+
# or if you need more info (e.g. status_code)
|
|
49
|
+
response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or do the same thing with an async version:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from daknode.models import MyDataModel
|
|
56
|
+
from daknode.api.my_tag import get_my_data_model
|
|
57
|
+
from daknode.types import Response
|
|
58
|
+
|
|
59
|
+
async with client as client:
|
|
60
|
+
my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
|
|
61
|
+
response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
client = AuthenticatedClient(
|
|
68
|
+
base_url="https://internal_api.example.com",
|
|
69
|
+
token="SuperSecretToken",
|
|
70
|
+
verify_ssl="/path/to/certificate_bundle.pem",
|
|
71
|
+
)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
You can also disable certificate validation altogether, but beware that **this is a security risk**.
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
client = AuthenticatedClient(
|
|
78
|
+
base_url="https://internal_api.example.com",
|
|
79
|
+
token="SuperSecretToken",
|
|
80
|
+
verify_ssl=False
|
|
81
|
+
)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Things to know:
|
|
85
|
+
1. Every path/method combo becomes a Python module with four functions:
|
|
86
|
+
1. `sync`: Blocking request that returns parsed data (if successful) or `None`
|
|
87
|
+
1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
|
|
88
|
+
1. `asyncio`: Like `sync` but async instead of blocking
|
|
89
|
+
1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
|
|
90
|
+
|
|
91
|
+
1. All path/query params, and bodies become method arguments.
|
|
92
|
+
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
|
|
93
|
+
1. Any endpoint which did not have a tag will be in `daknode.api.default`
|
|
94
|
+
|
|
95
|
+
## Advanced customizations
|
|
96
|
+
|
|
97
|
+
There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from daknode import Client
|
|
101
|
+
|
|
102
|
+
def log_request(request):
|
|
103
|
+
print(f"Request event hook: {request.method} {request.url} - Waiting for response")
|
|
104
|
+
|
|
105
|
+
def log_response(response):
|
|
106
|
+
request = response.request
|
|
107
|
+
print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
|
|
108
|
+
|
|
109
|
+
client = Client(
|
|
110
|
+
base_url="https://api.example.com",
|
|
111
|
+
httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
import httpx
|
|
121
|
+
from daknode import Client
|
|
122
|
+
|
|
123
|
+
client = Client(
|
|
124
|
+
base_url="https://api.example.com",
|
|
125
|
+
)
|
|
126
|
+
# Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
|
|
127
|
+
client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030"))
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Building / publishing this package
|
|
131
|
+
This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
|
|
132
|
+
1. Update the metadata in pyproject.toml (e.g. authors, version)
|
|
133
|
+
1. If you're using a private repository, configure it with Poetry
|
|
134
|
+
1. `poetry config repositories.<your-repository-name> <url-to-your-repository>`
|
|
135
|
+
1. `poetry config http-basic.<your-repository-name> <username> <password>`
|
|
136
|
+
1. Publish the client with `poetry publish --build -r <your-repository-name>` or, if for public PyPI, just `poetry publish --build`
|
|
137
|
+
|
|
138
|
+
If you want to install this client into another project without publishing it (e.g. for development) then:
|
|
139
|
+
1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
|
|
140
|
+
1. If that project is not using Poetry:
|
|
141
|
+
1. Build a wheel with `poetry build -f wheel`
|
|
142
|
+
1. Install that wheel from the other project `pip install <path-to-wheel>`
|
|
143
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
daknode/__init__.py,sha256=51rQG6O-vndKZjtYGJ4IW9MeyX1mrqpMOvskV1X_Y-k,152
|
|
2
|
+
daknode/api/__init__.py,sha256=87ApBzKyGb5zsgTMOkQXDqsLZCmaSFoJMwbGzCDQZMw,47
|
|
3
|
+
daknode/api/block_rules/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
4
|
+
daknode/api/block_rules/create_block_rule.py,sha256=-HkzfnEPxEhqjy9AOSJIpomUJ4rZkzY9rKzMolgiv30,6070
|
|
5
|
+
daknode/api/block_rules/create_inbox_block_rule.py,sha256=RgqjuOrGF-1qu3sxu0LRCzAzPFm3qNkA6cQl7pYtRvo,6414
|
|
6
|
+
daknode/api/block_rules/delete_block_rule.py,sha256=Pf42r89pWtqL9VwWBf1XPrE35Aj7Zxq714FB9q2MbZQ,4725
|
|
7
|
+
daknode/api/block_rules/list_block_rules.py,sha256=epHFZDrcxt1LKSNM6WdnO9jhzMiyuPF2wMJsKTpkPX4,5425
|
|
8
|
+
daknode/api/block_rules/list_inbox_block_rules.py,sha256=1-K4guIuDiV6IJizWa352kfP3BzsVVprSwJhUaH1_EE,5753
|
|
9
|
+
daknode/api/consent/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
10
|
+
daknode/api/consent/create_consent.py,sha256=EBBb6ICo0ID0uDfd9QAunV0LOdpHMi7_75hrS5QjkdY,5077
|
|
11
|
+
daknode/api/consent/revoke.py,sha256=CXrasc0Gug5cNQUto1ccIWsjTKzdL3uAkb6t9Vpfrj0,4867
|
|
12
|
+
daknode/api/control_plane/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
13
|
+
daknode/api/control_plane/close_workspace.py,sha256=grgNcCkGZqRub3CXkkdhI5DoUF3k6sT8a-uqjt7mt0o,4502
|
|
14
|
+
daknode/api/control_plane/create_workspace.py,sha256=zvyRwvRXFsout8gPZtoaXZNSE6Z9OTPEt5yQ5odVtds,5578
|
|
15
|
+
daknode/api/control_plane/list_workspaces.py,sha256=jvMTvM-GAQvAPHe-Iv-PWvbYfS0pBTn5eQHrqFqplBc,3503
|
|
16
|
+
daknode/api/control_plane/read_workspace.py,sha256=bqj91Ld4D2h__xNcQR2U63UtNPZbI5F5Jjc0T8aE71w,4175
|
|
17
|
+
daknode/api/control_plane/update_workspace.py,sha256=Z_eSmXFyHz7AqSM3nyfYIGPEdSJD9brYn96YbsZ93V8,4631
|
|
18
|
+
daknode/api/dead_letters/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
19
|
+
daknode/api/dead_letters/list_dead_letters.py,sha256=S3w19ZCKNDdlMltVySU9UVlfmUMFyXq1wTaGriUOmGI,5079
|
|
20
|
+
daknode/api/dead_letters/replay_dead_letter.py,sha256=D_MHC4xOzPo1-TW052a53Jc9DjfLiALM3drKg-SJZcY,6076
|
|
21
|
+
daknode/api/inboxes/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
22
|
+
daknode/api/inboxes/create_inbox.py,sha256=sznZkl1SK74K6K2i6csr83W2Ssd7G9YPWCUyS-0-isM,4319
|
|
23
|
+
daknode/api/inboxes/register_webhook.py,sha256=mtRz0rWOrZUj52yIWI4DgZ2JZiFlO3Hy7lwhUIj4hj8,6238
|
|
24
|
+
daknode/api/inboxes/rotate_webhook_secret.py,sha256=HUGG5z4wwAW1A1mlK-JvJs1g9CkpcZ5nkFoqlrcv-LU,6833
|
|
25
|
+
daknode/api/messages/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
26
|
+
daknode/api/messages/get_message.py,sha256=mwjUgrAi9rpFevtj__jM1zX9_wkV2hZTOdGfKfJviyA,4095
|
|
27
|
+
daknode/api/messages/get_thread.py,sha256=0F1d97OpYacMkQiRfpl5j0-B-s_db0TrLed7Fm23sPw,4488
|
|
28
|
+
daknode/api/messages/list_messages.py,sha256=_Q9p9iI1JBUEnT1ETEjr84KZDwp87WkM9JZIzH8zbCk,5639
|
|
29
|
+
daknode/api/messages/list_threads.py,sha256=WiIrIhkRp31PoADShFC2MdyP87we-6i1UgUy1SEBg0I,5641
|
|
30
|
+
daknode/api/privacy/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
31
|
+
daknode/api/privacy/create_erasure_request.py,sha256=7xwwgmxTcO6dDU70Hrefy6ojn5PPVUZ7wYNyn3G_LZQ,7052
|
|
32
|
+
daknode/api/privacy/read_erasure_request.py,sha256=rFUZ4-tzOvgYmnSouceBVtBK41IaWDIrT6JZ4u0AALs,5774
|
|
33
|
+
daknode/api/public/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
34
|
+
daknode/api/public/agent_signup.py,sha256=eqeupbMCQO08uuBNleB0Ow9fThZOM0ooOwskPxMi0sw,4485
|
|
35
|
+
daknode/api/public/agent_verify.py,sha256=YvVh6Yb41PtX323fALuNxQ9CV3dPi2YQ9CVd_vpJS8U,4449
|
|
36
|
+
daknode/api/search/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
37
|
+
daknode/api/search/search.py,sha256=ZEENquT1t1osc0c7YhWM2bwvhSmt5HipprRy1k1AkAo,5287
|
|
38
|
+
daknode/api/send/__init__.py,sha256=wYN6A3_bvYW13B1J9YvYCmcv5Els-q-E07kZJwJ7Vto,58
|
|
39
|
+
daknode/api/send/send.py,sha256=GdtN6lrtfC8YoNp03GhHGq1C9ONMsWt5Ub7MHJ_ob1E,8075
|
|
40
|
+
daknode/client.py,sha256=hD5d5p7NCfrEQy6oEGiQkmf73nkIUXfOyZMQpheUpFw,12421
|
|
41
|
+
daknode/errors.py,sha256=trp-p5qn1_JLRxGZhdHtICaNPaCrcDCe4TgIihBravk,546
|
|
42
|
+
daknode/models/__init__.py,sha256=sVLAnyZ0I92pEkQl4dN1nOroIQG8O0YEl2Y6nTUwBkw,2686
|
|
43
|
+
daknode/models/block_rule_create.py,sha256=PdbK5xBmJuUpCvc6IeIVn4T5eQdSIHPrZipUJRjNyZA,2660
|
|
44
|
+
daknode/models/block_rule_out.py,sha256=UnqrP2y0zZy0xTRB_3AKWKRcq1YVpPA2FE0En48OjHQ,3564
|
|
45
|
+
daknode/models/block_rule_page.py,sha256=NHSMncZgP9jRZV61kQFOyqGH6bPstJgIfFuE7r-kIXc,2761
|
|
46
|
+
daknode/models/consent_request.py,sha256=GdrlcSvuFAUDBfIVQpdUZiIsasg50QATpJDF5j9bWyY,2517
|
|
47
|
+
daknode/models/consent_response.py,sha256=myv3rYyPEE35M59VJihiM9xP1W3Ws54nB1MV03ko_1M,2331
|
|
48
|
+
daknode/models/create_erasure_request_response_create_erasure_request.py,sha256=RnI8bsC2JJtJgC9sHgA32Nk-_h_UXyBZvhCLtRiwY-o,1517
|
|
49
|
+
daknode/models/create_in.py,sha256=IYlCMeEMEcM3PXrLD42nnBUfrEj1kUdTXiqMjcFTdc0,3223
|
|
50
|
+
daknode/models/dead_letter_response.py,sha256=KpdJVgoHvA3tEbxGggVnLHnlpUw4hjJYEPgfWtUtbps,5793
|
|
51
|
+
daknode/models/erasure_request_body.py,sha256=D_Nrb_Rt_BNqZrBhof01U_02IJ6XvX7x0s4g4ScsNlw,1237
|
|
52
|
+
daknode/models/http_validation_error.py,sha256=mEHY63CwIynwS_qX_Z-Cr9rdxUiaEBygnoROVmrFZAw,2424
|
|
53
|
+
daknode/models/inbox_create_request.py,sha256=nuM-k_s_KRK2tMv8Ch4DTRJ2CGb4hEtDUokEmDxAdMg,3319
|
|
54
|
+
daknode/models/inbox_response.py,sha256=G0TDhnpviOQtv6JZjwQtnxzH-98YVmRrydktQG6I8HI,3778
|
|
55
|
+
daknode/models/message_out.py,sha256=2lFGd-t2Z0YFmhR47LZvpJLbiwzy5JCGE5jStyURwtU,8340
|
|
56
|
+
daknode/models/message_page.py,sha256=5FYonXWdmH_xcRwU7zcb3cAojrgTjX_UTT4UM7Bsnjw,2727
|
|
57
|
+
daknode/models/read_erasure_request_response_read_erasure_request.py,sha256=7_GAqVe879G-Ij7SN1fgck1pcogRfPhX3vCwaHyykj8,1497
|
|
58
|
+
daknode/models/replay_response.py,sha256=-IBVHMmkuuYfse41_bB4aH93HzlVX90SKq5y4eUXIzQ,2648
|
|
59
|
+
daknode/models/revoke_request.py,sha256=jS9Ni9B884hqpj5aOSQyU_jOESfRotjxG-ahdqubFCc,1579
|
|
60
|
+
daknode/models/revoke_response_revoke.py,sha256=gZ4W93tOtemDIDigLjNMsC8tWqu1V4djTBEXk_S0K5I,1365
|
|
61
|
+
daknode/models/search_match.py,sha256=K3HE6INZpRWqU_iBuqn_J9C_v4d04aqUB79kjBVKeng,3995
|
|
62
|
+
daknode/models/search_request.py,sha256=vm72Ic5CyaH_1wmUgsfYyIB4awnFzHn4NZTgy0rTH0s,2591
|
|
63
|
+
daknode/models/search_response.py,sha256=Y_zAcA7BDbRZJEz9ufXoaCqYpJege-KaZkN9F-oskzM,3180
|
|
64
|
+
daknode/models/send_request.py,sha256=QebpqV7a4Xf3Us31X_rD49ikTJJC6BhB8tSThFvdYB0,4320
|
|
65
|
+
daknode/models/send_response_send.py,sha256=ZCFJ_m8CyyzUhRT-PfhjkaJ0odiIoykzgZHrvuWKOUs,1345
|
|
66
|
+
daknode/models/signup_in.py,sha256=WiJ4aS0QaTEAcf4RKP08kScuULIK0ebH0u8AiojyRRo,1018
|
|
67
|
+
daknode/models/signup_out.py,sha256=LtRBeTeC3smQ-xbX_zXSYzrN8fVrdYMyW7EQxCh_rd0,2160
|
|
68
|
+
daknode/models/thread_detail_out.py,sha256=ifanObFvRDhFLbXLIr8s3M2dT4O9Glh9q1d199magss,5778
|
|
69
|
+
daknode/models/thread_out.py,sha256=9i9j7Jd3jYe1Fc9Va7GSpTW8FFrWSkq0Hc8YsMehkKc,3827
|
|
70
|
+
daknode/models/thread_page.py,sha256=l9gYMjVUzavc8tBPfLGcjYJM9vzc3mz9EtY8NKwX_vw,2713
|
|
71
|
+
daknode/models/timeline_item_out.py,sha256=W-8nx-ocTdTTzk5M8poy-uuoAyD0EXiioPjYbQBXqdU,8003
|
|
72
|
+
daknode/models/update_in.py,sha256=yZ4mW5j6MFSzFWXA8hUB9Pm0ATLitwnlbhDokDqFd8Q,2920
|
|
73
|
+
daknode/models/validation_error.py,sha256=KhhiDpdFyEAGP9QvtC2o3ogJV5FT5S_UcOImpyCuJrs,3409
|
|
74
|
+
daknode/models/validation_error_context.py,sha256=bCRFOpqPWbO91nrIrG5egiQHry6FaIdOXdIQe18gRG0,1375
|
|
75
|
+
daknode/models/verify_in.py,sha256=-7lo5xIttAYjaUC7Na4d4jVcbLOfBCfLHAta9dN7DwY,1046
|
|
76
|
+
daknode/models/verify_out.py,sha256=vozyly9_X9-H-0NrV6FbpeEZyGQrfTmbd6gF_Mb-AmQ,1551
|
|
77
|
+
daknode/models/webhook_register_request.py,sha256=RZPnCJfhLPpX_TSZ69x97KDfjGF__fIlsloyyNqiH9s,1647
|
|
78
|
+
daknode/models/workspace_list_out.py,sha256=7_RwfBVVrOytK9OOvRZ_KDNbeBzQTnOQyJEkGQhW-KI,2197
|
|
79
|
+
daknode/models/workspace_out.py,sha256=b0UYiLJD1_K3t_TLAEb9DmT968U-6FhUT6tuC1SB4aQ,3487
|
|
80
|
+
daknode/py.typed,sha256=8ZJUsxZiuOy1oJeVhsTWQhTG_6pTVHVXk5hJL79ebTk,25
|
|
81
|
+
daknode/types.py,sha256=hEuJx--jICd2FIQy390JC7wcmZgGuB-uFzp3_mouNdo,1398
|
|
82
|
+
daknode-0.1.0.dist-info/METADATA,sha256=Wn3H5nWljoLySZSKYwlFRfEuM4MpYdOvtRLbdYWuwi4,5591
|
|
83
|
+
daknode-0.1.0.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
84
|
+
daknode-0.1.0.dist-info/RECORD,,
|