robosystems-client 0.1.11__py3-none-any.whl → 0.1.13__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.

Potentially problematic release.


This version of robosystems-client might be problematic. Click here for more details.

Files changed (69) hide show
  1. robosystems_client/api/agent/query_financial_agent.py +4 -4
  2. robosystems_client/api/backup/create_backup.py +1 -1
  3. robosystems_client/api/backup/export_backup.py +14 -19
  4. robosystems_client/api/backup/get_backup_download_url.py +1 -1
  5. robosystems_client/api/backup/get_backup_stats.py +19 -1
  6. robosystems_client/api/backup/list_backups.py +19 -1
  7. robosystems_client/api/backup/restore_backup.py +1 -1
  8. robosystems_client/api/copy/copy_data_to_graph.py +314 -0
  9. robosystems_client/api/{credits_ → graph_credits}/check_credit_balance.py +42 -20
  10. robosystems_client/api/graph_health/__init__.py +1 -0
  11. robosystems_client/api/{graph_status → graph_health}/get_database_health.py +1 -1
  12. robosystems_client/api/graph_info/__init__.py +1 -0
  13. robosystems_client/api/{graph_status → graph_info}/get_database_info.py +1 -1
  14. robosystems_client/api/graph_limits/__init__.py +1 -0
  15. robosystems_client/api/graph_limits/get_graph_limits.py +259 -0
  16. robosystems_client/api/subgraphs/__init__.py +1 -0
  17. robosystems_client/api/{billing/upgrade_graph_subscription_v1_graph_id_billing_subscription_upgrade_post.py → subgraphs/create_subgraph.py} +82 -36
  18. robosystems_client/api/subgraphs/delete_subgraph.py +317 -0
  19. robosystems_client/api/subgraphs/get_subgraph_info.py +300 -0
  20. robosystems_client/api/subgraphs/get_subgraph_quota.py +276 -0
  21. robosystems_client/api/{billing/get_credit_billing_info_v1_graph_id_billing_credits_get.py → subgraphs/list_subgraphs.py} +58 -32
  22. robosystems_client/api/user/get_all_credit_summaries.py +1 -1
  23. robosystems_client/extensions/README.md +2 -6
  24. robosystems_client/models/__init__.py +46 -10
  25. robosystems_client/models/copy_response.py +223 -0
  26. robosystems_client/models/{kuzu_backup_health_response_kuzubackuphealth.py → copy_response_error_details_type_0.py} +5 -5
  27. robosystems_client/models/copy_response_status.py +10 -0
  28. robosystems_client/models/create_subgraph_request.py +185 -0
  29. robosystems_client/models/create_subgraph_request_metadata_type_0.py +44 -0
  30. robosystems_client/models/credit_summary_response.py +0 -8
  31. robosystems_client/models/custom_schema_definition.py +2 -2
  32. robosystems_client/models/data_frame_copy_request.py +125 -0
  33. robosystems_client/models/data_frame_copy_request_format.py +10 -0
  34. robosystems_client/models/delete_subgraph_request.py +89 -0
  35. robosystems_client/models/delete_subgraph_response.py +120 -0
  36. robosystems_client/models/get_graph_limits_response_getgraphlimits.py +44 -0
  37. robosystems_client/models/list_subgraphs_response.py +148 -0
  38. robosystems_client/models/s3_copy_request.py +375 -0
  39. robosystems_client/models/s3_copy_request_file_format.py +12 -0
  40. robosystems_client/models/s3_copy_request_s3_url_style_type_0.py +9 -0
  41. robosystems_client/models/subgraph_quota_response.py +158 -0
  42. robosystems_client/models/subgraph_response.py +279 -0
  43. robosystems_client/models/subgraph_response_metadata_type_0.py +44 -0
  44. robosystems_client/models/subgraph_summary.py +155 -0
  45. robosystems_client/models/subgraph_type.py +11 -0
  46. robosystems_client/models/url_copy_request.py +157 -0
  47. robosystems_client/models/url_copy_request_file_format.py +10 -0
  48. robosystems_client/models/url_copy_request_headers_type_0.py +44 -0
  49. {robosystems_client-0.1.11.dist-info → robosystems_client-0.1.13.dist-info}/METADATA +1 -1
  50. {robosystems_client-0.1.11.dist-info → robosystems_client-0.1.13.dist-info}/RECORD +62 -39
  51. robosystems_client/api/backup/kuzu_backup_health.py +0 -202
  52. robosystems_client/api/billing/get_available_subscription_plans_v1_graph_id_billing_available_plans_get.py +0 -198
  53. robosystems_client/api/billing/get_graph_pricing_info_v1_graph_id_billing_pricing_get.py +0 -198
  54. robosystems_client/api/billing/get_graph_subscription_v1_graph_id_billing_subscription_get.py +0 -198
  55. robosystems_client/models/backup_export_request.py +0 -72
  56. robosystems_client/models/credit_check_request.py +0 -82
  57. robosystems_client/models/upgrade_subscription_request.py +0 -82
  58. /robosystems_client/api/{billing → copy}/__init__.py +0 -0
  59. /robosystems_client/api/{credits_ → graph_billing}/__init__.py +0 -0
  60. /robosystems_client/api/{billing → graph_billing}/get_current_graph_bill.py +0 -0
  61. /robosystems_client/api/{billing → graph_billing}/get_graph_billing_history.py +0 -0
  62. /robosystems_client/api/{billing → graph_billing}/get_graph_monthly_bill.py +0 -0
  63. /robosystems_client/api/{billing → graph_billing}/get_graph_usage_details.py +0 -0
  64. /robosystems_client/api/{graph_status → graph_credits}/__init__.py +0 -0
  65. /robosystems_client/api/{credits_ → graph_credits}/check_storage_limits.py +0 -0
  66. /robosystems_client/api/{credits_ → graph_credits}/get_credit_summary.py +0 -0
  67. /robosystems_client/api/{credits_ → graph_credits}/get_storage_usage.py +0 -0
  68. /robosystems_client/api/{credits_ → graph_credits}/list_credit_transactions.py +0 -0
  69. {robosystems_client-0.1.11.dist-info → robosystems_client-0.1.13.dist-info}/WHEEL +0 -0
@@ -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)
@@ -0,0 +1,157 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, Literal, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..models.url_copy_request_file_format import URLCopyRequestFileFormat
8
+ from ..types import UNSET, Unset
9
+
10
+ if TYPE_CHECKING:
11
+ from ..models.url_copy_request_headers_type_0 import URLCopyRequestHeadersType0
12
+
13
+
14
+ T = TypeVar("T", bound="URLCopyRequest")
15
+
16
+
17
+ @_attrs_define
18
+ class URLCopyRequest:
19
+ """Request model for URL copy operations (future).
20
+
21
+ Attributes:
22
+ table_name (str): Target Kuzu table name
23
+ url (str): HTTP(S) URL to the data file
24
+ file_format (URLCopyRequestFileFormat): File format of the URL data
25
+ ignore_errors (Union[Unset, bool]): Skip duplicate/invalid rows (enables upsert-like behavior) Default: True.
26
+ extended_timeout (Union[Unset, bool]): Use extended timeout for large datasets Default: False.
27
+ validate_schema (Union[Unset, bool]): Validate source schema against target table Default: True.
28
+ source_type (Union[Literal['url'], Unset]): Source type identifier Default: 'url'.
29
+ headers (Union['URLCopyRequestHeadersType0', None, Unset]): Optional HTTP headers for authentication
30
+ """
31
+
32
+ table_name: str
33
+ url: str
34
+ file_format: URLCopyRequestFileFormat
35
+ ignore_errors: Union[Unset, bool] = True
36
+ extended_timeout: Union[Unset, bool] = False
37
+ validate_schema: Union[Unset, bool] = True
38
+ source_type: Union[Literal["url"], Unset] = "url"
39
+ headers: Union["URLCopyRequestHeadersType0", None, Unset] = UNSET
40
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
41
+
42
+ def to_dict(self) -> dict[str, Any]:
43
+ from ..models.url_copy_request_headers_type_0 import URLCopyRequestHeadersType0
44
+
45
+ table_name = self.table_name
46
+
47
+ url = self.url
48
+
49
+ file_format = self.file_format.value
50
+
51
+ ignore_errors = self.ignore_errors
52
+
53
+ extended_timeout = self.extended_timeout
54
+
55
+ validate_schema = self.validate_schema
56
+
57
+ source_type = self.source_type
58
+
59
+ headers: Union[None, Unset, dict[str, Any]]
60
+ if isinstance(self.headers, Unset):
61
+ headers = UNSET
62
+ elif isinstance(self.headers, URLCopyRequestHeadersType0):
63
+ headers = self.headers.to_dict()
64
+ else:
65
+ headers = self.headers
66
+
67
+ field_dict: dict[str, Any] = {}
68
+ field_dict.update(self.additional_properties)
69
+ field_dict.update(
70
+ {
71
+ "table_name": table_name,
72
+ "url": url,
73
+ "file_format": file_format,
74
+ }
75
+ )
76
+ if ignore_errors is not UNSET:
77
+ field_dict["ignore_errors"] = ignore_errors
78
+ if extended_timeout is not UNSET:
79
+ field_dict["extended_timeout"] = extended_timeout
80
+ if validate_schema is not UNSET:
81
+ field_dict["validate_schema"] = validate_schema
82
+ if source_type is not UNSET:
83
+ field_dict["source_type"] = source_type
84
+ if headers is not UNSET:
85
+ field_dict["headers"] = headers
86
+
87
+ return field_dict
88
+
89
+ @classmethod
90
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
91
+ from ..models.url_copy_request_headers_type_0 import URLCopyRequestHeadersType0
92
+
93
+ d = dict(src_dict)
94
+ table_name = d.pop("table_name")
95
+
96
+ url = d.pop("url")
97
+
98
+ file_format = URLCopyRequestFileFormat(d.pop("file_format"))
99
+
100
+ ignore_errors = d.pop("ignore_errors", UNSET)
101
+
102
+ extended_timeout = d.pop("extended_timeout", UNSET)
103
+
104
+ validate_schema = d.pop("validate_schema", UNSET)
105
+
106
+ source_type = cast(Union[Literal["url"], Unset], d.pop("source_type", UNSET))
107
+ if source_type != "url" and not isinstance(source_type, Unset):
108
+ raise ValueError(f"source_type must match const 'url', got '{source_type}'")
109
+
110
+ def _parse_headers(
111
+ data: object,
112
+ ) -> Union["URLCopyRequestHeadersType0", None, Unset]:
113
+ if data is None:
114
+ return data
115
+ if isinstance(data, Unset):
116
+ return data
117
+ try:
118
+ if not isinstance(data, dict):
119
+ raise TypeError()
120
+ headers_type_0 = URLCopyRequestHeadersType0.from_dict(data)
121
+
122
+ return headers_type_0
123
+ except: # noqa: E722
124
+ pass
125
+ return cast(Union["URLCopyRequestHeadersType0", None, Unset], data)
126
+
127
+ headers = _parse_headers(d.pop("headers", UNSET))
128
+
129
+ url_copy_request = cls(
130
+ table_name=table_name,
131
+ url=url,
132
+ file_format=file_format,
133
+ ignore_errors=ignore_errors,
134
+ extended_timeout=extended_timeout,
135
+ validate_schema=validate_schema,
136
+ source_type=source_type,
137
+ headers=headers,
138
+ )
139
+
140
+ url_copy_request.additional_properties = d
141
+ return url_copy_request
142
+
143
+ @property
144
+ def additional_keys(self) -> list[str]:
145
+ return list(self.additional_properties.keys())
146
+
147
+ def __getitem__(self, key: str) -> Any:
148
+ return self.additional_properties[key]
149
+
150
+ def __setitem__(self, key: str, value: Any) -> None:
151
+ self.additional_properties[key] = value
152
+
153
+ def __delitem__(self, key: str) -> None:
154
+ del self.additional_properties[key]
155
+
156
+ def __contains__(self, key: str) -> bool:
157
+ return key in self.additional_properties
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class URLCopyRequestFileFormat(str, Enum):
5
+ CSV = "csv"
6
+ JSON = "json"
7
+ PARQUET = "parquet"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
@@ -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="URLCopyRequestHeadersType0")
8
+
9
+
10
+ @_attrs_define
11
+ class URLCopyRequestHeadersType0:
12
+ """ """
13
+
14
+ additional_properties: dict[str, str] = _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
+ url_copy_request_headers_type_0 = cls()
26
+
27
+ url_copy_request_headers_type_0.additional_properties = d
28
+ return url_copy_request_headers_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) -> str:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: str) -> 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