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,185 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..models.subgraph_type import SubgraphType
8
+ from ..types import UNSET, Unset
9
+
10
+ if TYPE_CHECKING:
11
+ from ..models.create_subgraph_request_metadata_type_0 import (
12
+ CreateSubgraphRequestMetadataType0,
13
+ )
14
+
15
+
16
+ T = TypeVar("T", bound="CreateSubgraphRequest")
17
+
18
+
19
+ @_attrs_define
20
+ class CreateSubgraphRequest:
21
+ """Request model for creating a subgraph.
22
+
23
+ Attributes:
24
+ name (str): Alphanumeric name for the subgraph (e.g., dev, staging, prod1)
25
+ display_name (str): Human-readable display name for the subgraph
26
+ description (Union[None, Unset, str]): Optional description of the subgraph's purpose
27
+ schema_extensions (Union[None, Unset, list[str]]): Schema extensions to include (inherits from parent by
28
+ default)
29
+ subgraph_type (Union[Unset, SubgraphType]): Types of subgraphs.
30
+ metadata (Union['CreateSubgraphRequestMetadataType0', None, Unset]): Additional metadata for the subgraph
31
+ """
32
+
33
+ name: str
34
+ display_name: str
35
+ description: Union[None, Unset, str] = UNSET
36
+ schema_extensions: Union[None, Unset, list[str]] = UNSET
37
+ subgraph_type: Union[Unset, SubgraphType] = UNSET
38
+ metadata: Union["CreateSubgraphRequestMetadataType0", None, Unset] = UNSET
39
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
40
+
41
+ def to_dict(self) -> dict[str, Any]:
42
+ from ..models.create_subgraph_request_metadata_type_0 import (
43
+ CreateSubgraphRequestMetadataType0,
44
+ )
45
+
46
+ name = self.name
47
+
48
+ display_name = self.display_name
49
+
50
+ description: Union[None, Unset, str]
51
+ if isinstance(self.description, Unset):
52
+ description = UNSET
53
+ else:
54
+ description = self.description
55
+
56
+ schema_extensions: Union[None, Unset, list[str]]
57
+ if isinstance(self.schema_extensions, Unset):
58
+ schema_extensions = UNSET
59
+ elif isinstance(self.schema_extensions, list):
60
+ schema_extensions = self.schema_extensions
61
+
62
+ else:
63
+ schema_extensions = self.schema_extensions
64
+
65
+ subgraph_type: Union[Unset, str] = UNSET
66
+ if not isinstance(self.subgraph_type, Unset):
67
+ subgraph_type = self.subgraph_type.value
68
+
69
+ metadata: Union[None, Unset, dict[str, Any]]
70
+ if isinstance(self.metadata, Unset):
71
+ metadata = UNSET
72
+ elif isinstance(self.metadata, CreateSubgraphRequestMetadataType0):
73
+ metadata = self.metadata.to_dict()
74
+ else:
75
+ metadata = self.metadata
76
+
77
+ field_dict: dict[str, Any] = {}
78
+ field_dict.update(self.additional_properties)
79
+ field_dict.update(
80
+ {
81
+ "name": name,
82
+ "display_name": display_name,
83
+ }
84
+ )
85
+ if description is not UNSET:
86
+ field_dict["description"] = description
87
+ if schema_extensions is not UNSET:
88
+ field_dict["schema_extensions"] = schema_extensions
89
+ if subgraph_type is not UNSET:
90
+ field_dict["subgraph_type"] = subgraph_type
91
+ if metadata is not UNSET:
92
+ field_dict["metadata"] = metadata
93
+
94
+ return field_dict
95
+
96
+ @classmethod
97
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
98
+ from ..models.create_subgraph_request_metadata_type_0 import (
99
+ CreateSubgraphRequestMetadataType0,
100
+ )
101
+
102
+ d = dict(src_dict)
103
+ name = d.pop("name")
104
+
105
+ display_name = d.pop("display_name")
106
+
107
+ def _parse_description(data: object) -> Union[None, Unset, str]:
108
+ if data is None:
109
+ return data
110
+ if isinstance(data, Unset):
111
+ return data
112
+ return cast(Union[None, Unset, str], data)
113
+
114
+ description = _parse_description(d.pop("description", UNSET))
115
+
116
+ def _parse_schema_extensions(data: object) -> Union[None, Unset, list[str]]:
117
+ if data is None:
118
+ return data
119
+ if isinstance(data, Unset):
120
+ return data
121
+ try:
122
+ if not isinstance(data, list):
123
+ raise TypeError()
124
+ schema_extensions_type_0 = cast(list[str], data)
125
+
126
+ return schema_extensions_type_0
127
+ except: # noqa: E722
128
+ pass
129
+ return cast(Union[None, Unset, list[str]], data)
130
+
131
+ schema_extensions = _parse_schema_extensions(d.pop("schema_extensions", UNSET))
132
+
133
+ _subgraph_type = d.pop("subgraph_type", UNSET)
134
+ subgraph_type: Union[Unset, SubgraphType]
135
+ if isinstance(_subgraph_type, Unset):
136
+ subgraph_type = UNSET
137
+ else:
138
+ subgraph_type = SubgraphType(_subgraph_type)
139
+
140
+ def _parse_metadata(
141
+ data: object,
142
+ ) -> Union["CreateSubgraphRequestMetadataType0", None, Unset]:
143
+ if data is None:
144
+ return data
145
+ if isinstance(data, Unset):
146
+ return data
147
+ try:
148
+ if not isinstance(data, dict):
149
+ raise TypeError()
150
+ metadata_type_0 = CreateSubgraphRequestMetadataType0.from_dict(data)
151
+
152
+ return metadata_type_0
153
+ except: # noqa: E722
154
+ pass
155
+ return cast(Union["CreateSubgraphRequestMetadataType0", None, Unset], data)
156
+
157
+ metadata = _parse_metadata(d.pop("metadata", UNSET))
158
+
159
+ create_subgraph_request = cls(
160
+ name=name,
161
+ display_name=display_name,
162
+ description=description,
163
+ schema_extensions=schema_extensions,
164
+ subgraph_type=subgraph_type,
165
+ metadata=metadata,
166
+ )
167
+
168
+ create_subgraph_request.additional_properties = d
169
+ return create_subgraph_request
170
+
171
+ @property
172
+ def additional_keys(self) -> list[str]:
173
+ return list(self.additional_properties.keys())
174
+
175
+ def __getitem__(self, key: str) -> Any:
176
+ return self.additional_properties[key]
177
+
178
+ def __setitem__(self, key: str, value: Any) -> None:
179
+ self.additional_properties[key] = value
180
+
181
+ def __delitem__(self, key: str) -> None:
182
+ del self.additional_properties[key]
183
+
184
+ def __contains__(self, key: str) -> bool:
185
+ 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="CreateSubgraphRequestMetadataType0")
8
+
9
+
10
+ @_attrs_define
11
+ class CreateSubgraphRequestMetadataType0:
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
+ create_subgraph_request_metadata_type_0 = cls()
26
+
27
+ create_subgraph_request_metadata_type_0.additional_properties = d
28
+ return create_subgraph_request_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
@@ -16,7 +16,6 @@ class CreditSummaryResponse:
16
16
  Attributes:
17
17
  graph_id (str):
18
18
  graph_tier (str):
19
- credit_multiplier (float):
20
19
  current_balance (float):
21
20
  monthly_allocation (float):
22
21
  consumed_this_month (float):
@@ -27,7 +26,6 @@ class CreditSummaryResponse:
27
26
 
28
27
  graph_id: str
29
28
  graph_tier: str
30
- credit_multiplier: float
31
29
  current_balance: float
32
30
  monthly_allocation: float
33
31
  consumed_this_month: float
@@ -41,8 +39,6 @@ class CreditSummaryResponse:
41
39
 
42
40
  graph_tier = self.graph_tier
43
41
 
44
- credit_multiplier = self.credit_multiplier
45
-
46
42
  current_balance = self.current_balance
47
43
 
48
44
  monthly_allocation = self.monthly_allocation
@@ -65,7 +61,6 @@ class CreditSummaryResponse:
65
61
  {
66
62
  "graph_id": graph_id,
67
63
  "graph_tier": graph_tier,
68
- "credit_multiplier": credit_multiplier,
69
64
  "current_balance": current_balance,
70
65
  "monthly_allocation": monthly_allocation,
71
66
  "consumed_this_month": consumed_this_month,
@@ -85,8 +80,6 @@ class CreditSummaryResponse:
85
80
 
86
81
  graph_tier = d.pop("graph_tier")
87
82
 
88
- credit_multiplier = d.pop("credit_multiplier")
89
-
90
83
  current_balance = d.pop("current_balance")
91
84
 
92
85
  monthly_allocation = d.pop("monthly_allocation")
@@ -111,7 +104,6 @@ class CreditSummaryResponse:
111
104
  credit_summary_response = cls(
112
105
  graph_id=graph_id,
113
106
  graph_tier=graph_tier,
114
- credit_multiplier=credit_multiplier,
115
107
  current_balance=current_balance,
116
108
  monthly_allocation=monthly_allocation,
117
109
  consumed_this_month=consumed_this_month,
@@ -0,0 +1,89 @@
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="DeleteSubgraphRequest")
10
+
11
+
12
+ @_attrs_define
13
+ class DeleteSubgraphRequest:
14
+ """Request model for deleting a subgraph.
15
+
16
+ Attributes:
17
+ force (Union[Unset, bool]): Force deletion even if subgraph contains data Default: False.
18
+ backup_first (Union[Unset, bool]): Create a backup before deletion Default: True.
19
+ backup_location (Union[None, Unset, str]): S3 location for backup (uses default if not specified)
20
+ """
21
+
22
+ force: Union[Unset, bool] = False
23
+ backup_first: Union[Unset, bool] = True
24
+ backup_location: Union[None, Unset, str] = UNSET
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+ force = self.force
29
+
30
+ backup_first = self.backup_first
31
+
32
+ backup_location: Union[None, Unset, str]
33
+ if isinstance(self.backup_location, Unset):
34
+ backup_location = UNSET
35
+ else:
36
+ backup_location = self.backup_location
37
+
38
+ field_dict: dict[str, Any] = {}
39
+ field_dict.update(self.additional_properties)
40
+ field_dict.update({})
41
+ if force is not UNSET:
42
+ field_dict["force"] = force
43
+ if backup_first is not UNSET:
44
+ field_dict["backup_first"] = backup_first
45
+ if backup_location is not UNSET:
46
+ field_dict["backup_location"] = backup_location
47
+
48
+ return field_dict
49
+
50
+ @classmethod
51
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
52
+ d = dict(src_dict)
53
+ force = d.pop("force", UNSET)
54
+
55
+ backup_first = d.pop("backup_first", UNSET)
56
+
57
+ def _parse_backup_location(data: object) -> Union[None, Unset, str]:
58
+ if data is None:
59
+ return data
60
+ if isinstance(data, Unset):
61
+ return data
62
+ return cast(Union[None, Unset, str], data)
63
+
64
+ backup_location = _parse_backup_location(d.pop("backup_location", UNSET))
65
+
66
+ delete_subgraph_request = cls(
67
+ force=force,
68
+ backup_first=backup_first,
69
+ backup_location=backup_location,
70
+ )
71
+
72
+ delete_subgraph_request.additional_properties = d
73
+ return delete_subgraph_request
74
+
75
+ @property
76
+ def additional_keys(self) -> list[str]:
77
+ return list(self.additional_properties.keys())
78
+
79
+ def __getitem__(self, key: str) -> Any:
80
+ return self.additional_properties[key]
81
+
82
+ def __setitem__(self, key: str, value: Any) -> None:
83
+ self.additional_properties[key] = value
84
+
85
+ def __delitem__(self, key: str) -> None:
86
+ del self.additional_properties[key]
87
+
88
+ def __contains__(self, key: str) -> bool:
89
+ return key in self.additional_properties
@@ -0,0 +1,120 @@
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 ..types import UNSET, Unset
10
+
11
+ T = TypeVar("T", bound="DeleteSubgraphResponse")
12
+
13
+
14
+ @_attrs_define
15
+ class DeleteSubgraphResponse:
16
+ """Response model for subgraph deletion.
17
+
18
+ Attributes:
19
+ graph_id (str): Deleted subgraph identifier
20
+ status (str): Deletion status
21
+ deleted_at (datetime.datetime): When deletion occurred
22
+ backup_location (Union[None, Unset, str]): Location of backup if created
23
+ message (Union[None, Unset, str]): Additional information about the deletion
24
+ """
25
+
26
+ graph_id: str
27
+ status: str
28
+ deleted_at: datetime.datetime
29
+ backup_location: Union[None, Unset, str] = UNSET
30
+ message: Union[None, Unset, str] = UNSET
31
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
32
+
33
+ def to_dict(self) -> dict[str, Any]:
34
+ graph_id = self.graph_id
35
+
36
+ status = self.status
37
+
38
+ deleted_at = self.deleted_at.isoformat()
39
+
40
+ backup_location: Union[None, Unset, str]
41
+ if isinstance(self.backup_location, Unset):
42
+ backup_location = UNSET
43
+ else:
44
+ backup_location = self.backup_location
45
+
46
+ message: Union[None, Unset, str]
47
+ if isinstance(self.message, Unset):
48
+ message = UNSET
49
+ else:
50
+ message = self.message
51
+
52
+ field_dict: dict[str, Any] = {}
53
+ field_dict.update(self.additional_properties)
54
+ field_dict.update(
55
+ {
56
+ "graph_id": graph_id,
57
+ "status": status,
58
+ "deleted_at": deleted_at,
59
+ }
60
+ )
61
+ if backup_location is not UNSET:
62
+ field_dict["backup_location"] = backup_location
63
+ if message is not UNSET:
64
+ field_dict["message"] = message
65
+
66
+ return field_dict
67
+
68
+ @classmethod
69
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
70
+ d = dict(src_dict)
71
+ graph_id = d.pop("graph_id")
72
+
73
+ status = d.pop("status")
74
+
75
+ deleted_at = isoparse(d.pop("deleted_at"))
76
+
77
+ def _parse_backup_location(data: object) -> Union[None, Unset, str]:
78
+ if data is None:
79
+ return data
80
+ if isinstance(data, Unset):
81
+ return data
82
+ return cast(Union[None, Unset, str], data)
83
+
84
+ backup_location = _parse_backup_location(d.pop("backup_location", UNSET))
85
+
86
+ def _parse_message(data: object) -> Union[None, Unset, str]:
87
+ if data is None:
88
+ return data
89
+ if isinstance(data, Unset):
90
+ return data
91
+ return cast(Union[None, Unset, str], data)
92
+
93
+ message = _parse_message(d.pop("message", UNSET))
94
+
95
+ delete_subgraph_response = cls(
96
+ graph_id=graph_id,
97
+ status=status,
98
+ deleted_at=deleted_at,
99
+ backup_location=backup_location,
100
+ message=message,
101
+ )
102
+
103
+ delete_subgraph_response.additional_properties = d
104
+ return delete_subgraph_response
105
+
106
+ @property
107
+ def additional_keys(self) -> list[str]:
108
+ return list(self.additional_properties.keys())
109
+
110
+ def __getitem__(self, key: str) -> Any:
111
+ return self.additional_properties[key]
112
+
113
+ def __setitem__(self, key: str, value: Any) -> None:
114
+ self.additional_properties[key] = value
115
+
116
+ def __delitem__(self, key: str) -> None:
117
+ del self.additional_properties[key]
118
+
119
+ def __contains__(self, key: str) -> bool:
120
+ return key in self.additional_properties
@@ -0,0 +1,148 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, 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
+ if TYPE_CHECKING:
10
+ from ..models.subgraph_summary import SubgraphSummary
11
+
12
+
13
+ T = TypeVar("T", bound="ListSubgraphsResponse")
14
+
15
+
16
+ @_attrs_define
17
+ class ListSubgraphsResponse:
18
+ """Response model for listing subgraphs.
19
+
20
+ Attributes:
21
+ parent_graph_id (str): Parent graph identifier
22
+ parent_graph_name (str): Parent graph name
23
+ parent_graph_tier (str): Parent graph tier
24
+ subgraph_count (int): Total number of subgraphs
25
+ subgraphs (list['SubgraphSummary']): List of subgraphs
26
+ max_subgraphs (Union[None, Unset, int]): Maximum allowed subgraphs for this tier (None = unlimited)
27
+ total_size_mb (Union[None, Unset, float]): Combined size of all subgraphs in megabytes
28
+ """
29
+
30
+ parent_graph_id: str
31
+ parent_graph_name: str
32
+ parent_graph_tier: str
33
+ subgraph_count: int
34
+ subgraphs: list["SubgraphSummary"]
35
+ max_subgraphs: Union[None, Unset, int] = UNSET
36
+ total_size_mb: Union[None, Unset, float] = UNSET
37
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
38
+
39
+ def to_dict(self) -> dict[str, Any]:
40
+ parent_graph_id = self.parent_graph_id
41
+
42
+ parent_graph_name = self.parent_graph_name
43
+
44
+ parent_graph_tier = self.parent_graph_tier
45
+
46
+ subgraph_count = self.subgraph_count
47
+
48
+ subgraphs = []
49
+ for subgraphs_item_data in self.subgraphs:
50
+ subgraphs_item = subgraphs_item_data.to_dict()
51
+ subgraphs.append(subgraphs_item)
52
+
53
+ max_subgraphs: Union[None, Unset, int]
54
+ if isinstance(self.max_subgraphs, Unset):
55
+ max_subgraphs = UNSET
56
+ else:
57
+ max_subgraphs = self.max_subgraphs
58
+
59
+ total_size_mb: Union[None, Unset, float]
60
+ if isinstance(self.total_size_mb, Unset):
61
+ total_size_mb = UNSET
62
+ else:
63
+ total_size_mb = self.total_size_mb
64
+
65
+ field_dict: dict[str, Any] = {}
66
+ field_dict.update(self.additional_properties)
67
+ field_dict.update(
68
+ {
69
+ "parent_graph_id": parent_graph_id,
70
+ "parent_graph_name": parent_graph_name,
71
+ "parent_graph_tier": parent_graph_tier,
72
+ "subgraph_count": subgraph_count,
73
+ "subgraphs": subgraphs,
74
+ }
75
+ )
76
+ if max_subgraphs is not UNSET:
77
+ field_dict["max_subgraphs"] = max_subgraphs
78
+ if total_size_mb is not UNSET:
79
+ field_dict["total_size_mb"] = total_size_mb
80
+
81
+ return field_dict
82
+
83
+ @classmethod
84
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
85
+ from ..models.subgraph_summary import SubgraphSummary
86
+
87
+ d = dict(src_dict)
88
+ parent_graph_id = d.pop("parent_graph_id")
89
+
90
+ parent_graph_name = d.pop("parent_graph_name")
91
+
92
+ parent_graph_tier = d.pop("parent_graph_tier")
93
+
94
+ subgraph_count = d.pop("subgraph_count")
95
+
96
+ subgraphs = []
97
+ _subgraphs = d.pop("subgraphs")
98
+ for subgraphs_item_data in _subgraphs:
99
+ subgraphs_item = SubgraphSummary.from_dict(subgraphs_item_data)
100
+
101
+ subgraphs.append(subgraphs_item)
102
+
103
+ def _parse_max_subgraphs(data: object) -> Union[None, Unset, int]:
104
+ if data is None:
105
+ return data
106
+ if isinstance(data, Unset):
107
+ return data
108
+ return cast(Union[None, Unset, int], data)
109
+
110
+ max_subgraphs = _parse_max_subgraphs(d.pop("max_subgraphs", UNSET))
111
+
112
+ def _parse_total_size_mb(data: object) -> Union[None, Unset, float]:
113
+ if data is None:
114
+ return data
115
+ if isinstance(data, Unset):
116
+ return data
117
+ return cast(Union[None, Unset, float], data)
118
+
119
+ total_size_mb = _parse_total_size_mb(d.pop("total_size_mb", UNSET))
120
+
121
+ list_subgraphs_response = cls(
122
+ parent_graph_id=parent_graph_id,
123
+ parent_graph_name=parent_graph_name,
124
+ parent_graph_tier=parent_graph_tier,
125
+ subgraph_count=subgraph_count,
126
+ subgraphs=subgraphs,
127
+ max_subgraphs=max_subgraphs,
128
+ total_size_mb=total_size_mb,
129
+ )
130
+
131
+ list_subgraphs_response.additional_properties = d
132
+ return list_subgraphs_response
133
+
134
+ @property
135
+ def additional_keys(self) -> list[str]:
136
+ return list(self.additional_properties.keys())
137
+
138
+ def __getitem__(self, key: str) -> Any:
139
+ return self.additional_properties[key]
140
+
141
+ def __setitem__(self, key: str, value: Any) -> None:
142
+ self.additional_properties[key] = value
143
+
144
+ def __delitem__(self, key: str) -> None:
145
+ del self.additional_properties[key]
146
+
147
+ def __contains__(self, key: str) -> bool:
148
+ return key in self.additional_properties