robosystems-client 0.1.11__py3-none-any.whl → 0.1.12__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.
@@ -0,0 +1,158 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Union, cast
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
+ T = TypeVar("T", bound="SubgraphQuotaResponse")
10
+
11
+
12
+ @_attrs_define
13
+ class SubgraphQuotaResponse:
14
+ """Response model for subgraph quota information.
15
+
16
+ Attributes:
17
+ parent_graph_id (str): Parent graph identifier
18
+ tier (str): Graph tier
19
+ current_count (int): Current number of subgraphs
20
+ max_allowed (Union[None, Unset, int]): Maximum allowed subgraphs (None = unlimited)
21
+ remaining (Union[None, Unset, int]): Remaining subgraphs that can be created
22
+ total_size_mb (Union[None, Unset, float]): Total size of all subgraphs
23
+ max_size_mb (Union[None, Unset, float]): Maximum allowed total size
24
+ """
25
+
26
+ parent_graph_id: str
27
+ tier: str
28
+ current_count: int
29
+ max_allowed: Union[None, Unset, int] = UNSET
30
+ remaining: Union[None, Unset, int] = UNSET
31
+ total_size_mb: Union[None, Unset, float] = UNSET
32
+ max_size_mb: Union[None, Unset, float] = UNSET
33
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
34
+
35
+ def to_dict(self) -> dict[str, Any]:
36
+ parent_graph_id = self.parent_graph_id
37
+
38
+ tier = self.tier
39
+
40
+ current_count = self.current_count
41
+
42
+ max_allowed: Union[None, Unset, int]
43
+ if isinstance(self.max_allowed, Unset):
44
+ max_allowed = UNSET
45
+ else:
46
+ max_allowed = self.max_allowed
47
+
48
+ remaining: Union[None, Unset, int]
49
+ if isinstance(self.remaining, Unset):
50
+ remaining = UNSET
51
+ else:
52
+ remaining = self.remaining
53
+
54
+ total_size_mb: Union[None, Unset, float]
55
+ if isinstance(self.total_size_mb, Unset):
56
+ total_size_mb = UNSET
57
+ else:
58
+ total_size_mb = self.total_size_mb
59
+
60
+ max_size_mb: Union[None, Unset, float]
61
+ if isinstance(self.max_size_mb, Unset):
62
+ max_size_mb = UNSET
63
+ else:
64
+ max_size_mb = self.max_size_mb
65
+
66
+ field_dict: dict[str, Any] = {}
67
+ field_dict.update(self.additional_properties)
68
+ field_dict.update(
69
+ {
70
+ "parent_graph_id": parent_graph_id,
71
+ "tier": tier,
72
+ "current_count": current_count,
73
+ }
74
+ )
75
+ if max_allowed is not UNSET:
76
+ field_dict["max_allowed"] = max_allowed
77
+ if remaining is not UNSET:
78
+ field_dict["remaining"] = remaining
79
+ if total_size_mb is not UNSET:
80
+ field_dict["total_size_mb"] = total_size_mb
81
+ if max_size_mb is not UNSET:
82
+ field_dict["max_size_mb"] = max_size_mb
83
+
84
+ return field_dict
85
+
86
+ @classmethod
87
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
88
+ d = dict(src_dict)
89
+ parent_graph_id = d.pop("parent_graph_id")
90
+
91
+ tier = d.pop("tier")
92
+
93
+ current_count = d.pop("current_count")
94
+
95
+ def _parse_max_allowed(data: object) -> Union[None, Unset, int]:
96
+ if data is None:
97
+ return data
98
+ if isinstance(data, Unset):
99
+ return data
100
+ return cast(Union[None, Unset, int], data)
101
+
102
+ max_allowed = _parse_max_allowed(d.pop("max_allowed", UNSET))
103
+
104
+ def _parse_remaining(data: object) -> Union[None, Unset, int]:
105
+ if data is None:
106
+ return data
107
+ if isinstance(data, Unset):
108
+ return data
109
+ return cast(Union[None, Unset, int], data)
110
+
111
+ remaining = _parse_remaining(d.pop("remaining", UNSET))
112
+
113
+ def _parse_total_size_mb(data: object) -> Union[None, Unset, float]:
114
+ if data is None:
115
+ return data
116
+ if isinstance(data, Unset):
117
+ return data
118
+ return cast(Union[None, Unset, float], data)
119
+
120
+ total_size_mb = _parse_total_size_mb(d.pop("total_size_mb", UNSET))
121
+
122
+ def _parse_max_size_mb(data: object) -> Union[None, Unset, float]:
123
+ if data is None:
124
+ return data
125
+ if isinstance(data, Unset):
126
+ return data
127
+ return cast(Union[None, Unset, float], data)
128
+
129
+ max_size_mb = _parse_max_size_mb(d.pop("max_size_mb", UNSET))
130
+
131
+ subgraph_quota_response = cls(
132
+ parent_graph_id=parent_graph_id,
133
+ tier=tier,
134
+ current_count=current_count,
135
+ max_allowed=max_allowed,
136
+ remaining=remaining,
137
+ total_size_mb=total_size_mb,
138
+ max_size_mb=max_size_mb,
139
+ )
140
+
141
+ subgraph_quota_response.additional_properties = d
142
+ return subgraph_quota_response
143
+
144
+ @property
145
+ def additional_keys(self) -> list[str]:
146
+ return list(self.additional_properties.keys())
147
+
148
+ def __getitem__(self, key: str) -> Any:
149
+ return self.additional_properties[key]
150
+
151
+ def __setitem__(self, key: str, value: Any) -> None:
152
+ self.additional_properties[key] = value
153
+
154
+ def __delitem__(self, key: str) -> None:
155
+ del self.additional_properties[key]
156
+
157
+ def __contains__(self, key: str) -> bool:
158
+ return key in self.additional_properties
@@ -0,0 +1,279 @@
1
+ import datetime
2
+ from collections.abc import Mapping
3
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+ from dateutil.parser import isoparse
8
+
9
+ from ..models.subgraph_type import SubgraphType
10
+ from ..types import UNSET, Unset
11
+
12
+ if TYPE_CHECKING:
13
+ from ..models.subgraph_response_metadata_type_0 import SubgraphResponseMetadataType0
14
+
15
+
16
+ T = TypeVar("T", bound="SubgraphResponse")
17
+
18
+
19
+ @_attrs_define
20
+ class SubgraphResponse:
21
+ """Response model for a subgraph.
22
+
23
+ Attributes:
24
+ graph_id (str): Full subgraph identifier (e.g., kg123_dev)
25
+ parent_graph_id (str): Parent graph identifier
26
+ subgraph_index (int): Numeric index of the subgraph
27
+ subgraph_name (str): Alphanumeric name of the subgraph
28
+ display_name (str): Human-readable display name
29
+ subgraph_type (SubgraphType): Types of subgraphs.
30
+ status (str): Current status of the subgraph
31
+ created_at (datetime.datetime): When the subgraph was created
32
+ updated_at (datetime.datetime): When the subgraph was last updated
33
+ description (Union[None, Unset, str]): Description of the subgraph's purpose
34
+ size_mb (Union[None, Unset, float]): Size of the subgraph database in megabytes
35
+ node_count (Union[None, Unset, int]): Number of nodes in the subgraph
36
+ edge_count (Union[None, Unset, int]): Number of edges in the subgraph
37
+ last_accessed (Union[None, Unset, datetime.datetime]): When the subgraph was last accessed
38
+ metadata (Union['SubgraphResponseMetadataType0', None, Unset]): Additional metadata for the subgraph
39
+ """
40
+
41
+ graph_id: str
42
+ parent_graph_id: str
43
+ subgraph_index: int
44
+ subgraph_name: str
45
+ display_name: str
46
+ subgraph_type: SubgraphType
47
+ status: str
48
+ created_at: datetime.datetime
49
+ updated_at: datetime.datetime
50
+ description: Union[None, Unset, str] = UNSET
51
+ size_mb: Union[None, Unset, float] = UNSET
52
+ node_count: Union[None, Unset, int] = UNSET
53
+ edge_count: Union[None, Unset, int] = UNSET
54
+ last_accessed: Union[None, Unset, datetime.datetime] = UNSET
55
+ metadata: Union["SubgraphResponseMetadataType0", None, Unset] = UNSET
56
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
57
+
58
+ def to_dict(self) -> dict[str, Any]:
59
+ from ..models.subgraph_response_metadata_type_0 import SubgraphResponseMetadataType0
60
+
61
+ graph_id = self.graph_id
62
+
63
+ parent_graph_id = self.parent_graph_id
64
+
65
+ subgraph_index = self.subgraph_index
66
+
67
+ subgraph_name = self.subgraph_name
68
+
69
+ display_name = self.display_name
70
+
71
+ subgraph_type = self.subgraph_type.value
72
+
73
+ status = self.status
74
+
75
+ created_at = self.created_at.isoformat()
76
+
77
+ updated_at = self.updated_at.isoformat()
78
+
79
+ description: Union[None, Unset, str]
80
+ if isinstance(self.description, Unset):
81
+ description = UNSET
82
+ else:
83
+ description = self.description
84
+
85
+ size_mb: Union[None, Unset, float]
86
+ if isinstance(self.size_mb, Unset):
87
+ size_mb = UNSET
88
+ else:
89
+ size_mb = self.size_mb
90
+
91
+ node_count: Union[None, Unset, int]
92
+ if isinstance(self.node_count, Unset):
93
+ node_count = UNSET
94
+ else:
95
+ node_count = self.node_count
96
+
97
+ edge_count: Union[None, Unset, int]
98
+ if isinstance(self.edge_count, Unset):
99
+ edge_count = UNSET
100
+ else:
101
+ edge_count = self.edge_count
102
+
103
+ last_accessed: Union[None, Unset, str]
104
+ if isinstance(self.last_accessed, Unset):
105
+ last_accessed = UNSET
106
+ elif isinstance(self.last_accessed, datetime.datetime):
107
+ last_accessed = self.last_accessed.isoformat()
108
+ else:
109
+ last_accessed = self.last_accessed
110
+
111
+ metadata: Union[None, Unset, dict[str, Any]]
112
+ if isinstance(self.metadata, Unset):
113
+ metadata = UNSET
114
+ elif isinstance(self.metadata, SubgraphResponseMetadataType0):
115
+ metadata = self.metadata.to_dict()
116
+ else:
117
+ metadata = self.metadata
118
+
119
+ field_dict: dict[str, Any] = {}
120
+ field_dict.update(self.additional_properties)
121
+ field_dict.update(
122
+ {
123
+ "graph_id": graph_id,
124
+ "parent_graph_id": parent_graph_id,
125
+ "subgraph_index": subgraph_index,
126
+ "subgraph_name": subgraph_name,
127
+ "display_name": display_name,
128
+ "subgraph_type": subgraph_type,
129
+ "status": status,
130
+ "created_at": created_at,
131
+ "updated_at": updated_at,
132
+ }
133
+ )
134
+ if description is not UNSET:
135
+ field_dict["description"] = description
136
+ if size_mb is not UNSET:
137
+ field_dict["size_mb"] = size_mb
138
+ if node_count is not UNSET:
139
+ field_dict["node_count"] = node_count
140
+ if edge_count is not UNSET:
141
+ field_dict["edge_count"] = edge_count
142
+ if last_accessed is not UNSET:
143
+ field_dict["last_accessed"] = last_accessed
144
+ if metadata is not UNSET:
145
+ field_dict["metadata"] = metadata
146
+
147
+ return field_dict
148
+
149
+ @classmethod
150
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
151
+ from ..models.subgraph_response_metadata_type_0 import SubgraphResponseMetadataType0
152
+
153
+ d = dict(src_dict)
154
+ graph_id = d.pop("graph_id")
155
+
156
+ parent_graph_id = d.pop("parent_graph_id")
157
+
158
+ subgraph_index = d.pop("subgraph_index")
159
+
160
+ subgraph_name = d.pop("subgraph_name")
161
+
162
+ display_name = d.pop("display_name")
163
+
164
+ subgraph_type = SubgraphType(d.pop("subgraph_type"))
165
+
166
+ status = d.pop("status")
167
+
168
+ created_at = isoparse(d.pop("created_at"))
169
+
170
+ updated_at = isoparse(d.pop("updated_at"))
171
+
172
+ def _parse_description(data: object) -> Union[None, Unset, str]:
173
+ if data is None:
174
+ return data
175
+ if isinstance(data, Unset):
176
+ return data
177
+ return cast(Union[None, Unset, str], data)
178
+
179
+ description = _parse_description(d.pop("description", UNSET))
180
+
181
+ def _parse_size_mb(data: object) -> Union[None, Unset, float]:
182
+ if data is None:
183
+ return data
184
+ if isinstance(data, Unset):
185
+ return data
186
+ return cast(Union[None, Unset, float], data)
187
+
188
+ size_mb = _parse_size_mb(d.pop("size_mb", UNSET))
189
+
190
+ def _parse_node_count(data: object) -> Union[None, Unset, int]:
191
+ if data is None:
192
+ return data
193
+ if isinstance(data, Unset):
194
+ return data
195
+ return cast(Union[None, Unset, int], data)
196
+
197
+ node_count = _parse_node_count(d.pop("node_count", UNSET))
198
+
199
+ def _parse_edge_count(data: object) -> Union[None, Unset, int]:
200
+ if data is None:
201
+ return data
202
+ if isinstance(data, Unset):
203
+ return data
204
+ return cast(Union[None, Unset, int], data)
205
+
206
+ edge_count = _parse_edge_count(d.pop("edge_count", UNSET))
207
+
208
+ def _parse_last_accessed(data: object) -> Union[None, Unset, datetime.datetime]:
209
+ if data is None:
210
+ return data
211
+ if isinstance(data, Unset):
212
+ return data
213
+ try:
214
+ if not isinstance(data, str):
215
+ raise TypeError()
216
+ last_accessed_type_0 = isoparse(data)
217
+
218
+ return last_accessed_type_0
219
+ except: # noqa: E722
220
+ pass
221
+ return cast(Union[None, Unset, datetime.datetime], data)
222
+
223
+ last_accessed = _parse_last_accessed(d.pop("last_accessed", UNSET))
224
+
225
+ def _parse_metadata(
226
+ data: object,
227
+ ) -> Union["SubgraphResponseMetadataType0", None, Unset]:
228
+ if data is None:
229
+ return data
230
+ if isinstance(data, Unset):
231
+ return data
232
+ try:
233
+ if not isinstance(data, dict):
234
+ raise TypeError()
235
+ metadata_type_0 = SubgraphResponseMetadataType0.from_dict(data)
236
+
237
+ return metadata_type_0
238
+ except: # noqa: E722
239
+ pass
240
+ return cast(Union["SubgraphResponseMetadataType0", None, Unset], data)
241
+
242
+ metadata = _parse_metadata(d.pop("metadata", UNSET))
243
+
244
+ subgraph_response = cls(
245
+ graph_id=graph_id,
246
+ parent_graph_id=parent_graph_id,
247
+ subgraph_index=subgraph_index,
248
+ subgraph_name=subgraph_name,
249
+ display_name=display_name,
250
+ subgraph_type=subgraph_type,
251
+ status=status,
252
+ created_at=created_at,
253
+ updated_at=updated_at,
254
+ description=description,
255
+ size_mb=size_mb,
256
+ node_count=node_count,
257
+ edge_count=edge_count,
258
+ last_accessed=last_accessed,
259
+ metadata=metadata,
260
+ )
261
+
262
+ subgraph_response.additional_properties = d
263
+ return subgraph_response
264
+
265
+ @property
266
+ def additional_keys(self) -> list[str]:
267
+ return list(self.additional_properties.keys())
268
+
269
+ def __getitem__(self, key: str) -> Any:
270
+ return self.additional_properties[key]
271
+
272
+ def __setitem__(self, key: str, value: Any) -> None:
273
+ self.additional_properties[key] = value
274
+
275
+ def __delitem__(self, key: str) -> None:
276
+ del self.additional_properties[key]
277
+
278
+ def __contains__(self, key: str) -> bool:
279
+ return key in self.additional_properties
@@ -0,0 +1,44 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ T = TypeVar("T", bound="SubgraphResponseMetadataType0")
8
+
9
+
10
+ @_attrs_define
11
+ class SubgraphResponseMetadataType0:
12
+ """ """
13
+
14
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
15
+
16
+ def to_dict(self) -> dict[str, Any]:
17
+ field_dict: dict[str, Any] = {}
18
+ field_dict.update(self.additional_properties)
19
+
20
+ return field_dict
21
+
22
+ @classmethod
23
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
24
+ d = dict(src_dict)
25
+ subgraph_response_metadata_type_0 = cls()
26
+
27
+ subgraph_response_metadata_type_0.additional_properties = d
28
+ return subgraph_response_metadata_type_0
29
+
30
+ @property
31
+ def additional_keys(self) -> list[str]:
32
+ return list(self.additional_properties.keys())
33
+
34
+ def __getitem__(self, key: str) -> Any:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: Any) -> None:
38
+ self.additional_properties[key] = value
39
+
40
+ def __delitem__(self, key: str) -> None:
41
+ del self.additional_properties[key]
42
+
43
+ def __contains__(self, key: str) -> bool:
44
+ return key in self.additional_properties
@@ -0,0 +1,155 @@
1
+ import datetime
2
+ from collections.abc import Mapping
3
+ from typing import Any, TypeVar, Union, cast
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+ from dateutil.parser import isoparse
8
+
9
+ from ..models.subgraph_type import SubgraphType
10
+ from ..types import UNSET, Unset
11
+
12
+ T = TypeVar("T", bound="SubgraphSummary")
13
+
14
+
15
+ @_attrs_define
16
+ class SubgraphSummary:
17
+ """Summary model for listing subgraphs.
18
+
19
+ Attributes:
20
+ graph_id (str): Full subgraph identifier
21
+ subgraph_name (str): Alphanumeric name
22
+ display_name (str): Human-readable name
23
+ subgraph_type (SubgraphType): Types of subgraphs.
24
+ status (str): Current status
25
+ created_at (datetime.datetime): Creation timestamp
26
+ size_mb (Union[None, Unset, float]): Size in megabytes
27
+ last_accessed (Union[None, Unset, datetime.datetime]): Last access timestamp
28
+ """
29
+
30
+ graph_id: str
31
+ subgraph_name: str
32
+ display_name: str
33
+ subgraph_type: SubgraphType
34
+ status: str
35
+ created_at: datetime.datetime
36
+ size_mb: Union[None, Unset, float] = UNSET
37
+ last_accessed: Union[None, Unset, datetime.datetime] = UNSET
38
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
39
+
40
+ def to_dict(self) -> dict[str, Any]:
41
+ graph_id = self.graph_id
42
+
43
+ subgraph_name = self.subgraph_name
44
+
45
+ display_name = self.display_name
46
+
47
+ subgraph_type = self.subgraph_type.value
48
+
49
+ status = self.status
50
+
51
+ created_at = self.created_at.isoformat()
52
+
53
+ size_mb: Union[None, Unset, float]
54
+ if isinstance(self.size_mb, Unset):
55
+ size_mb = UNSET
56
+ else:
57
+ size_mb = self.size_mb
58
+
59
+ last_accessed: Union[None, Unset, str]
60
+ if isinstance(self.last_accessed, Unset):
61
+ last_accessed = UNSET
62
+ elif isinstance(self.last_accessed, datetime.datetime):
63
+ last_accessed = self.last_accessed.isoformat()
64
+ else:
65
+ last_accessed = self.last_accessed
66
+
67
+ field_dict: dict[str, Any] = {}
68
+ field_dict.update(self.additional_properties)
69
+ field_dict.update(
70
+ {
71
+ "graph_id": graph_id,
72
+ "subgraph_name": subgraph_name,
73
+ "display_name": display_name,
74
+ "subgraph_type": subgraph_type,
75
+ "status": status,
76
+ "created_at": created_at,
77
+ }
78
+ )
79
+ if size_mb is not UNSET:
80
+ field_dict["size_mb"] = size_mb
81
+ if last_accessed is not UNSET:
82
+ field_dict["last_accessed"] = last_accessed
83
+
84
+ return field_dict
85
+
86
+ @classmethod
87
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
88
+ d = dict(src_dict)
89
+ graph_id = d.pop("graph_id")
90
+
91
+ subgraph_name = d.pop("subgraph_name")
92
+
93
+ display_name = d.pop("display_name")
94
+
95
+ subgraph_type = SubgraphType(d.pop("subgraph_type"))
96
+
97
+ status = d.pop("status")
98
+
99
+ created_at = isoparse(d.pop("created_at"))
100
+
101
+ def _parse_size_mb(data: object) -> Union[None, Unset, float]:
102
+ if data is None:
103
+ return data
104
+ if isinstance(data, Unset):
105
+ return data
106
+ return cast(Union[None, Unset, float], data)
107
+
108
+ size_mb = _parse_size_mb(d.pop("size_mb", UNSET))
109
+
110
+ def _parse_last_accessed(data: object) -> Union[None, Unset, datetime.datetime]:
111
+ if data is None:
112
+ return data
113
+ if isinstance(data, Unset):
114
+ return data
115
+ try:
116
+ if not isinstance(data, str):
117
+ raise TypeError()
118
+ last_accessed_type_0 = isoparse(data)
119
+
120
+ return last_accessed_type_0
121
+ except: # noqa: E722
122
+ pass
123
+ return cast(Union[None, Unset, datetime.datetime], data)
124
+
125
+ last_accessed = _parse_last_accessed(d.pop("last_accessed", UNSET))
126
+
127
+ subgraph_summary = cls(
128
+ graph_id=graph_id,
129
+ subgraph_name=subgraph_name,
130
+ display_name=display_name,
131
+ subgraph_type=subgraph_type,
132
+ status=status,
133
+ created_at=created_at,
134
+ size_mb=size_mb,
135
+ last_accessed=last_accessed,
136
+ )
137
+
138
+ subgraph_summary.additional_properties = d
139
+ return subgraph_summary
140
+
141
+ @property
142
+ def additional_keys(self) -> list[str]:
143
+ return list(self.additional_properties.keys())
144
+
145
+ def __getitem__(self, key: str) -> Any:
146
+ return self.additional_properties[key]
147
+
148
+ def __setitem__(self, key: str, value: Any) -> None:
149
+ self.additional_properties[key] = value
150
+
151
+ def __delitem__(self, key: str) -> None:
152
+ del self.additional_properties[key]
153
+
154
+ def __contains__(self, key: str) -> bool:
155
+ return key in self.additional_properties
@@ -0,0 +1,11 @@
1
+ from enum import Enum
2
+
3
+
4
+ class SubgraphType(str, Enum):
5
+ MEMORY = "memory"
6
+ STATIC = "static"
7
+ TEMPORAL = "temporal"
8
+ VERSIONED = "versioned"
9
+
10
+ def __str__(self) -> str:
11
+ return str(self.value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robosystems-client
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: Python Client for RoboSystems financial graph database API
5
5
  Author: Harbinger FinLab
6
6
  License: MIT