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,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.block_rule_out import BlockRuleOut
14
+
15
+
16
+
17
+
18
+
19
+ T = TypeVar("T", bound="BlockRulePage")
20
+
21
+
22
+
23
+ @_attrs_define
24
+ class BlockRulePage:
25
+ """
26
+ Attributes:
27
+ has_more (bool):
28
+ items (list['BlockRuleOut']):
29
+ next_cursor (Union[None, str]):
30
+ """
31
+
32
+ has_more: bool
33
+ items: list['BlockRuleOut']
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.block_rule_out import BlockRuleOut
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.block_rule_out import BlockRuleOut
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 = BlockRuleOut.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
+ block_rule_page = cls(
93
+ has_more=has_more,
94
+ items=items,
95
+ next_cursor=next_cursor,
96
+ )
97
+
98
+
99
+ block_rule_page.additional_properties = d
100
+ return block_rule_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
@@ -0,0 +1,104 @@
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
+ import datetime
12
+
13
+
14
+
15
+
16
+
17
+
18
+ T = TypeVar("T", bound="ConsentRequest")
19
+
20
+
21
+
22
+ @_attrs_define
23
+ class ConsentRequest:
24
+ """
25
+ Attributes:
26
+ collected_at (datetime.datetime): When consent was collected. Must be in the past.
27
+ evidence_ref (str): Form URL, contract id or import batch identifying the evidence retained for this consent.
28
+ recipient (str):
29
+ source (str): One of: api_signup, contract, offline_import, web_form
30
+ """
31
+
32
+ collected_at: datetime.datetime
33
+ evidence_ref: str
34
+ recipient: str
35
+ source: str
36
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
37
+
38
+
39
+
40
+
41
+
42
+ def to_dict(self) -> dict[str, Any]:
43
+ collected_at = self.collected_at.isoformat()
44
+
45
+ evidence_ref = self.evidence_ref
46
+
47
+ recipient = self.recipient
48
+
49
+ source = self.source
50
+
51
+
52
+ field_dict: dict[str, Any] = {}
53
+ field_dict.update(self.additional_properties)
54
+ field_dict.update({
55
+ "collected_at": collected_at,
56
+ "evidence_ref": evidence_ref,
57
+ "recipient": recipient,
58
+ "source": source,
59
+ })
60
+
61
+ return field_dict
62
+
63
+
64
+
65
+ @classmethod
66
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
67
+ d = dict(src_dict)
68
+ collected_at = isoparse(d.pop("collected_at"))
69
+
70
+
71
+
72
+
73
+ evidence_ref = d.pop("evidence_ref")
74
+
75
+ recipient = d.pop("recipient")
76
+
77
+ source = d.pop("source")
78
+
79
+ consent_request = cls(
80
+ collected_at=collected_at,
81
+ evidence_ref=evidence_ref,
82
+ recipient=recipient,
83
+ source=source,
84
+ )
85
+
86
+
87
+ consent_request.additional_properties = d
88
+ return consent_request
89
+
90
+ @property
91
+ def additional_keys(self) -> list[str]:
92
+ return list(self.additional_properties.keys())
93
+
94
+ def __getitem__(self, key: str) -> Any:
95
+ return self.additional_properties[key]
96
+
97
+ def __setitem__(self, key: str, value: Any) -> None:
98
+ self.additional_properties[key] = value
99
+
100
+ def __delitem__(self, key: str) -> None:
101
+ del self.additional_properties[key]
102
+
103
+ def __contains__(self, key: str) -> bool:
104
+ return key in self.additional_properties
@@ -0,0 +1,105 @@
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 Union
11
+ from uuid import UUID
12
+
13
+
14
+
15
+
16
+
17
+
18
+ T = TypeVar("T", bound="ConsentResponse")
19
+
20
+
21
+
22
+ @_attrs_define
23
+ class ConsentResponse:
24
+ """
25
+ Attributes:
26
+ consent_id (UUID):
27
+ recipient (str):
28
+ source (str):
29
+ basis (Union[Unset, str]): Default: 'tenant_declared'.
30
+ """
31
+
32
+ consent_id: UUID
33
+ recipient: str
34
+ source: str
35
+ basis: Union[Unset, str] = 'tenant_declared'
36
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
37
+
38
+
39
+
40
+
41
+
42
+ def to_dict(self) -> dict[str, Any]:
43
+ consent_id = str(self.consent_id)
44
+
45
+ recipient = self.recipient
46
+
47
+ source = self.source
48
+
49
+ basis = self.basis
50
+
51
+
52
+ field_dict: dict[str, Any] = {}
53
+ field_dict.update(self.additional_properties)
54
+ field_dict.update({
55
+ "consent_id": consent_id,
56
+ "recipient": recipient,
57
+ "source": source,
58
+ })
59
+ if basis is not UNSET:
60
+ field_dict["basis"] = basis
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
+ consent_id = UUID(d.pop("consent_id"))
70
+
71
+
72
+
73
+
74
+ recipient = d.pop("recipient")
75
+
76
+ source = d.pop("source")
77
+
78
+ basis = d.pop("basis", UNSET)
79
+
80
+ consent_response = cls(
81
+ consent_id=consent_id,
82
+ recipient=recipient,
83
+ source=source,
84
+ basis=basis,
85
+ )
86
+
87
+
88
+ consent_response.additional_properties = d
89
+ return consent_response
90
+
91
+ @property
92
+ def additional_keys(self) -> list[str]:
93
+ return list(self.additional_properties.keys())
94
+
95
+ def __getitem__(self, key: str) -> Any:
96
+ return self.additional_properties[key]
97
+
98
+ def __setitem__(self, key: str, value: Any) -> None:
99
+ self.additional_properties[key] = value
100
+
101
+ def __delitem__(self, key: str) -> None:
102
+ del self.additional_properties[key]
103
+
104
+ def __contains__(self, key: str) -> bool:
105
+ return key in self.additional_properties
@@ -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="CreateErasureRequestResponseCreateErasureRequest")
16
+
17
+
18
+
19
+ @_attrs_define
20
+ class CreateErasureRequestResponseCreateErasureRequest:
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
+ create_erasure_request_response_create_erasure_request = cls(
43
+ )
44
+
45
+
46
+ create_erasure_request_response_create_erasure_request.additional_properties = d
47
+ return create_erasure_request_response_create_erasure_request
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,119 @@
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="CreateIn")
19
+
20
+
21
+
22
+ @_attrs_define
23
+ class CreateIn:
24
+ """
25
+ Attributes:
26
+ name (str):
27
+ external_client_id (Union[None, Unset, str]):
28
+ workspace_slug (Union[None, Unset, str]):
29
+ """
30
+
31
+ name: str
32
+ external_client_id: Union[None, Unset, str] = UNSET
33
+ workspace_slug: Union[None, Unset, str] = UNSET
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
+ name = self.name
42
+
43
+ external_client_id: Union[None, Unset, str]
44
+ if isinstance(self.external_client_id, Unset):
45
+ external_client_id = UNSET
46
+ else:
47
+ external_client_id = self.external_client_id
48
+
49
+ workspace_slug: Union[None, Unset, str]
50
+ if isinstance(self.workspace_slug, Unset):
51
+ workspace_slug = UNSET
52
+ else:
53
+ workspace_slug = self.workspace_slug
54
+
55
+
56
+ field_dict: dict[str, Any] = {}
57
+ field_dict.update(self.additional_properties)
58
+ field_dict.update({
59
+ "name": name,
60
+ })
61
+ if external_client_id is not UNSET:
62
+ field_dict["external_client_id"] = external_client_id
63
+ if workspace_slug is not UNSET:
64
+ field_dict["workspace_slug"] = workspace_slug
65
+
66
+ return field_dict
67
+
68
+
69
+
70
+ @classmethod
71
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
72
+ d = dict(src_dict)
73
+ name = d.pop("name")
74
+
75
+ def _parse_external_client_id(data: object) -> Union[None, Unset, str]:
76
+ if data is None:
77
+ return data
78
+ if isinstance(data, Unset):
79
+ return data
80
+ return cast(Union[None, Unset, str], data)
81
+
82
+ external_client_id = _parse_external_client_id(d.pop("external_client_id", UNSET))
83
+
84
+
85
+ def _parse_workspace_slug(data: object) -> Union[None, Unset, str]:
86
+ if data is None:
87
+ return data
88
+ if isinstance(data, Unset):
89
+ return data
90
+ return cast(Union[None, Unset, str], data)
91
+
92
+ workspace_slug = _parse_workspace_slug(d.pop("workspace_slug", UNSET))
93
+
94
+
95
+ create_in = cls(
96
+ name=name,
97
+ external_client_id=external_client_id,
98
+ workspace_slug=workspace_slug,
99
+ )
100
+
101
+
102
+ create_in.additional_properties = d
103
+ return create_in
104
+
105
+ @property
106
+ def additional_keys(self) -> list[str]:
107
+ return list(self.additional_properties.keys())
108
+
109
+ def __getitem__(self, key: str) -> Any:
110
+ return self.additional_properties[key]
111
+
112
+ def __setitem__(self, key: str, value: Any) -> None:
113
+ self.additional_properties[key] = value
114
+
115
+ def __delitem__(self, key: str) -> None:
116
+ del self.additional_properties[key]
117
+
118
+ def __contains__(self, key: str) -> bool:
119
+ return key in self.additional_properties
@@ -0,0 +1,205 @@
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="DeadLetterResponse")
21
+
22
+
23
+
24
+ @_attrs_define
25
+ class DeadLetterResponse:
26
+ """ Everything needed to understand a failure — and nothing more.
27
+
28
+ Deliberately excludes `payload`: it carries the tenant's message content,
29
+ and a list endpoint is the wrong place to spray it. It is still stored, and
30
+ still what gets replayed.
31
+
32
+ Attributes:
33
+ attempt_count (int):
34
+ destination_url (str):
35
+ event_id (str):
36
+ failed_at (Union[None, datetime.datetime]):
37
+ last_error (Union[None, str]):
38
+ last_replayed_at (Union[None, datetime.datetime]):
39
+ last_response_code (Union[None, int]):
40
+ outbox_id (UUID):
41
+ replay_count (int):
42
+ """
43
+
44
+ attempt_count: int
45
+ destination_url: str
46
+ event_id: str
47
+ failed_at: Union[None, datetime.datetime]
48
+ last_error: Union[None, str]
49
+ last_replayed_at: Union[None, datetime.datetime]
50
+ last_response_code: Union[None, int]
51
+ outbox_id: UUID
52
+ replay_count: int
53
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
54
+
55
+
56
+
57
+
58
+
59
+ def to_dict(self) -> dict[str, Any]:
60
+ attempt_count = self.attempt_count
61
+
62
+ destination_url = self.destination_url
63
+
64
+ event_id = self.event_id
65
+
66
+ failed_at: Union[None, str]
67
+ if isinstance(self.failed_at, datetime.datetime):
68
+ failed_at = self.failed_at.isoformat()
69
+ else:
70
+ failed_at = self.failed_at
71
+
72
+ last_error: Union[None, str]
73
+ last_error = self.last_error
74
+
75
+ last_replayed_at: Union[None, str]
76
+ if isinstance(self.last_replayed_at, datetime.datetime):
77
+ last_replayed_at = self.last_replayed_at.isoformat()
78
+ else:
79
+ last_replayed_at = self.last_replayed_at
80
+
81
+ last_response_code: Union[None, int]
82
+ last_response_code = self.last_response_code
83
+
84
+ outbox_id = str(self.outbox_id)
85
+
86
+ replay_count = self.replay_count
87
+
88
+
89
+ field_dict: dict[str, Any] = {}
90
+ field_dict.update(self.additional_properties)
91
+ field_dict.update({
92
+ "attempt_count": attempt_count,
93
+ "destination_url": destination_url,
94
+ "event_id": event_id,
95
+ "failed_at": failed_at,
96
+ "last_error": last_error,
97
+ "last_replayed_at": last_replayed_at,
98
+ "last_response_code": last_response_code,
99
+ "outbox_id": outbox_id,
100
+ "replay_count": replay_count,
101
+ })
102
+
103
+ return field_dict
104
+
105
+
106
+
107
+ @classmethod
108
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
109
+ d = dict(src_dict)
110
+ attempt_count = d.pop("attempt_count")
111
+
112
+ destination_url = d.pop("destination_url")
113
+
114
+ event_id = d.pop("event_id")
115
+
116
+ def _parse_failed_at(data: object) -> Union[None, datetime.datetime]:
117
+ if data is None:
118
+ return data
119
+ try:
120
+ if not isinstance(data, str):
121
+ raise TypeError()
122
+ failed_at_type_0 = isoparse(data)
123
+
124
+
125
+
126
+ return failed_at_type_0
127
+ except: # noqa: E722
128
+ pass
129
+ return cast(Union[None, datetime.datetime], data)
130
+
131
+ failed_at = _parse_failed_at(d.pop("failed_at"))
132
+
133
+
134
+ def _parse_last_error(data: object) -> Union[None, str]:
135
+ if data is None:
136
+ return data
137
+ return cast(Union[None, str], data)
138
+
139
+ last_error = _parse_last_error(d.pop("last_error"))
140
+
141
+
142
+ def _parse_last_replayed_at(data: object) -> Union[None, datetime.datetime]:
143
+ if data is None:
144
+ return data
145
+ try:
146
+ if not isinstance(data, str):
147
+ raise TypeError()
148
+ last_replayed_at_type_0 = isoparse(data)
149
+
150
+
151
+
152
+ return last_replayed_at_type_0
153
+ except: # noqa: E722
154
+ pass
155
+ return cast(Union[None, datetime.datetime], data)
156
+
157
+ last_replayed_at = _parse_last_replayed_at(d.pop("last_replayed_at"))
158
+
159
+
160
+ def _parse_last_response_code(data: object) -> Union[None, int]:
161
+ if data is None:
162
+ return data
163
+ return cast(Union[None, int], data)
164
+
165
+ last_response_code = _parse_last_response_code(d.pop("last_response_code"))
166
+
167
+
168
+ outbox_id = UUID(d.pop("outbox_id"))
169
+
170
+
171
+
172
+
173
+ replay_count = d.pop("replay_count")
174
+
175
+ dead_letter_response = cls(
176
+ attempt_count=attempt_count,
177
+ destination_url=destination_url,
178
+ event_id=event_id,
179
+ failed_at=failed_at,
180
+ last_error=last_error,
181
+ last_replayed_at=last_replayed_at,
182
+ last_response_code=last_response_code,
183
+ outbox_id=outbox_id,
184
+ replay_count=replay_count,
185
+ )
186
+
187
+
188
+ dead_letter_response.additional_properties = d
189
+ return dead_letter_response
190
+
191
+ @property
192
+ def additional_keys(self) -> list[str]:
193
+ return list(self.additional_properties.keys())
194
+
195
+ def __getitem__(self, key: str) -> Any:
196
+ return self.additional_properties[key]
197
+
198
+ def __setitem__(self, key: str, value: Any) -> None:
199
+ self.additional_properties[key] = value
200
+
201
+ def __delitem__(self, key: str) -> None:
202
+ del self.additional_properties[key]
203
+
204
+ def __contains__(self, key: str) -> bool:
205
+ return key in self.additional_properties