standardbots 2.0.0.dev1752004997__py3-none-any.whl → 2.0.1__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 standardbots might be problematic. Click here for more details.

@@ -284,6 +284,50 @@ class Default:
284
284
  )
285
285
 
286
286
 
287
+ def get_equipment(
288
+ self,
289
+ ) -> Response[
290
+ Union[
291
+ models.GetEquipmentConfigResponse,
292
+ models.ErrorResponse,
293
+ None
294
+ ],
295
+ models.GetEquipmentConfigResponse
296
+ ]:
297
+ """
298
+ Get the currently-configured equipment
299
+
300
+ """
301
+ path = "/api/v1/equipment"
302
+ try:
303
+ response = self._request_manager.request(
304
+ "GET",
305
+ path,
306
+ headers=self._request_manager.json_headers(),
307
+ )
308
+ parsed = None
309
+ if response.status == 200:
310
+ parsed = models.parse_get_equipment_config_response(json.loads(response.data))
311
+
312
+ is_user_error = response.status >= 400 and response.status <= 500
313
+ is_unavailable = response.status == 503
314
+ if parsed is None and (is_user_error or is_unavailable):
315
+ parsed = models.parse_error_response(json.loads(response.data))
316
+
317
+ return Response(
318
+ parsed,
319
+ response.status,
320
+ response
321
+ )
322
+ except urllib3.exceptions.MaxRetryError:
323
+ return Response(
324
+ models.ErrorResponse(
325
+ error=models.ErrorEnum.InternalServerError,
326
+ message="Connection Refused"
327
+ ),
328
+ 503,
329
+ None
330
+ )
287
331
  def control_gripper(
288
332
  self,
289
333
  body: models.GripperCommandRequest,
@@ -1186,18 +1186,106 @@ def serialize_environment_variable(data: EnvironmentVariable) -> object:
1186
1186
  }
1187
1187
 
1188
1188
  @dataclass
1189
- class EquipmentKeyAssignments:
1190
- """Dictionary mapping equipment IDs to equipment keys"""
1189
+ class EquipmentConfig:
1190
+ """Equipment configuration
1191
+ """
1192
+ id: Union[str, None] = None
1193
+ name: Union[str, None] = None
1194
+ kind: Union[str, None] = None
1195
+ is_enabled: Union[bool, None] = None
1196
+ config: Union[str, None] = None
1197
+
1198
+ def validate_id(self, value: str) -> Tuple[bool, str]:
1199
+ if value is None:
1200
+ return [False, "id is required for EquipmentConfig"]
1201
+
1202
+ if not isinstance(value, str):
1203
+ return [False, "id must be of type str for EquipmentConfig, got " + type(value).__name__]
1204
+
1205
+ return [True, ""]
1206
+
1207
+ def validate_name(self, value: str) -> Tuple[bool, str]:
1208
+ if value is None:
1209
+ return [True, ""]
1210
+
1211
+ if not isinstance(value, str):
1212
+ return [False, "name must be of type str for EquipmentConfig, got " + type(value).__name__]
1213
+
1214
+ return [True, ""]
1215
+
1216
+ def validate_kind(self, value: str) -> Tuple[bool, str]:
1217
+ if value is None:
1218
+ return [False, "kind is required for EquipmentConfig"]
1219
+
1220
+ if not isinstance(value, str):
1221
+ return [False, "kind must be of type str for EquipmentConfig, got " + type(value).__name__]
1222
+
1223
+ return [True, ""]
1224
+
1225
+ def validate_is_enabled(self, value: bool) -> Tuple[bool, str]:
1226
+ if value is None:
1227
+ return [False, "is_enabled is required for EquipmentConfig"]
1228
+
1229
+ if not isinstance(value, bool):
1230
+ return [False, "is_enabled must be of type bool for EquipmentConfig, got " + type(value).__name__]
1231
+
1232
+ return [True, ""]
1233
+
1234
+ def validate_config(self, value: str) -> Tuple[bool, str]:
1235
+ if value is None:
1236
+ return [False, "config is required for EquipmentConfig"]
1237
+
1238
+ if not isinstance(value, str):
1239
+ return [False, "config must be of type str for EquipmentConfig, got " + type(value).__name__]
1240
+
1241
+ return [True, ""]
1191
1242
 
1192
1243
  def __post_init__(self):
1193
1244
  # Type check incoming model - raise error if invalid (required or wrong type)
1245
+ is_valid, error_str = self.validate_id(self.id)
1246
+ if not is_valid:
1247
+ raise TypeError(error_str)
1248
+ is_valid, error_str = self.validate_name(self.name)
1249
+ if not is_valid:
1250
+ raise TypeError(error_str)
1251
+ is_valid, error_str = self.validate_kind(self.kind)
1252
+ if not is_valid:
1253
+ raise TypeError(error_str)
1254
+ is_valid, error_str = self.validate_is_enabled(self.is_enabled)
1255
+ if not is_valid:
1256
+ raise TypeError(error_str)
1257
+ is_valid, error_str = self.validate_config(self.config)
1258
+ if not is_valid:
1259
+ raise TypeError(error_str)
1194
1260
 
1195
- def parse_equipment_key_assignments(data: object):
1196
- return EquipmentKeyAssignments(
1261
+ def parse_equipment_config(data: object):
1262
+ return EquipmentConfig(
1263
+ id=parse_str(data["id"]) if "id" in data and data.get("id") is not None else None,
1264
+ name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
1265
+ kind=parse_str(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
1266
+ is_enabled=parse_bool(data["is_enabled"]) if "is_enabled" in data and data.get("is_enabled") is not None else None,
1267
+ config=parse_str(data["config"]) if "config" in data and data.get("config") is not None else None,
1197
1268
  )
1198
1269
 
1270
+ def serialize_equipment_config(data: EquipmentConfig) -> object:
1271
+ return {
1272
+ "id": serialize_str(data.id),
1273
+ "name": None if data.name is None else serialize_str(data.name),
1274
+ "kind": serialize_str(data.kind),
1275
+ "is_enabled": serialize_bool(data.is_enabled),
1276
+ "config": serialize_str(data.config),
1277
+ }
1278
+
1279
+ EquipmentKeyAssignments = Dict[str, str]
1280
+
1281
+ def parse_equipment_key_assignments(data: object) -> EquipmentKeyAssignments:
1282
+ return {
1283
+ parse_str(key): parse_str(value) for key, value in data.items()
1284
+ }
1285
+
1199
1286
  def serialize_equipment_key_assignments(data: EquipmentKeyAssignments) -> object:
1200
1287
  return {
1288
+ serialize_str(key): serialize_str(value) for key, value in data.items()
1201
1289
  }
1202
1290
 
1203
1291
  class ErrorEnum(Enum):
@@ -4058,6 +4146,14 @@ def parse_environment_variables_list(data: object) -> EnvironmentVariablesList:
4058
4146
  def serialize_environment_variables_list(data: EnvironmentVariablesList) -> List[object]:
4059
4147
  return [serialize_environment_variable(item) for item in data]
4060
4148
 
4149
+ EquipmentConfigList = List[EquipmentConfig]
4150
+
4151
+ def parse_equipment_config_list(data: object) -> EquipmentConfigList:
4152
+ return [parse_equipment_config(item) for item in data]
4153
+
4154
+ def serialize_equipment_config_list(data: EquipmentConfigList) -> List[object]:
4155
+ return [serialize_equipment_config(item) for item in data]
4156
+
4061
4157
  @dataclass
4062
4158
  class StartRecordingRequest:
4063
4159
  """Request to start recording movement and camera data"""
@@ -4077,7 +4173,7 @@ class StartRecordingRequest:
4077
4173
  if value is None:
4078
4174
  return [True, ""]
4079
4175
 
4080
- if not isinstance(value, EquipmentKeyAssignments):
4176
+ if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
4081
4177
  return [False, "equipmentKeyAssignments must be of type EquipmentKeyAssignments for StartRecordingRequest, got " + type(value).__name__]
4082
4178
 
4083
4179
  return [True, ""]
@@ -6668,6 +6764,37 @@ def serialize_routine(data: Routine) -> object:
6668
6764
  "environment_variables": None if data.environment_variables is None else serialize_environment_variables_list(data.environment_variables),
6669
6765
  }
6670
6766
 
6767
+ @dataclass
6768
+ class GetEquipmentConfigResponse:
6769
+ """Response to get the currently-configured equipment
6770
+ """
6771
+ equipment: Union[EquipmentConfigList, None] = None
6772
+
6773
+ def validate_equipment(self, value: EquipmentConfigList) -> Tuple[bool, str]:
6774
+ if value is None:
6775
+ return [True, ""]
6776
+
6777
+ if not (isinstance(value, list) and all(isinstance(x, EquipmentConfig) for x in value)):
6778
+ return [False, "equipment must be of type EquipmentConfigList for GetEquipmentConfigResponse, got " + type(value).__name__]
6779
+
6780
+ return [True, ""]
6781
+
6782
+ def __post_init__(self):
6783
+ # Type check incoming model - raise error if invalid (required or wrong type)
6784
+ is_valid, error_str = self.validate_equipment(self.equipment)
6785
+ if not is_valid:
6786
+ raise TypeError(error_str)
6787
+
6788
+ def parse_get_equipment_config_response(data: object):
6789
+ return GetEquipmentConfigResponse(
6790
+ equipment=parse_equipment_config_list(data["equipment"]) if "equipment" in data and data.get("equipment") is not None else None,
6791
+ )
6792
+
6793
+ def serialize_get_equipment_config_response(data: GetEquipmentConfigResponse) -> object:
6794
+ return {
6795
+ "equipment": None if data.equipment is None else serialize_equipment_config_list(data.equipment),
6796
+ }
6797
+
6671
6798
  @dataclass
6672
6799
  class CalibrationData:
6673
6800
  """The result of a calibration"""
@@ -8059,6 +8186,7 @@ class RecorderConfig:
8059
8186
  bots: Union[RecorderBotDetailsList, None] = None
8060
8187
  offset: Union[OffsetConfig, None] = None
8061
8188
  sensors: Union[SensorConfigList, None] = None
8189
+ equipmentKeyAssignments: Union[EquipmentKeyAssignments, None] = None
8062
8190
 
8063
8191
  def validate_isSecondary(self, value: bool) -> Tuple[bool, str]:
8064
8192
  if value is None:
@@ -8114,6 +8242,15 @@ class RecorderConfig:
8114
8242
 
8115
8243
  return [True, ""]
8116
8244
 
8245
+ def validate_equipmentKeyAssignments(self, value: EquipmentKeyAssignments) -> Tuple[bool, str]:
8246
+ if value is None:
8247
+ return [True, ""]
8248
+
8249
+ if not (isinstance(value, dict) and all((isinstance(k, str) and isinstance(val, str)) for k, val in value.items())):
8250
+ return [False, "equipmentKeyAssignments must be of type EquipmentKeyAssignments for RecorderConfig, got " + type(value).__name__]
8251
+
8252
+ return [True, ""]
8253
+
8117
8254
  def __post_init__(self):
8118
8255
  # Type check incoming model - raise error if invalid (required or wrong type)
8119
8256
  is_valid, error_str = self.validate_isSecondary(self.isSecondary)
@@ -8134,6 +8271,9 @@ class RecorderConfig:
8134
8271
  is_valid, error_str = self.validate_sensors(self.sensors)
8135
8272
  if not is_valid:
8136
8273
  raise TypeError(error_str)
8274
+ is_valid, error_str = self.validate_equipmentKeyAssignments(self.equipmentKeyAssignments)
8275
+ if not is_valid:
8276
+ raise TypeError(error_str)
8137
8277
 
8138
8278
  def parse_recorder_config(data: object):
8139
8279
  return RecorderConfig(
@@ -8143,6 +8283,7 @@ def parse_recorder_config(data: object):
8143
8283
  bots=parse_recorder_bot_details_list(data["bots"]) if "bots" in data and data.get("bots") is not None else None,
8144
8284
  offset=parse_offset_config(data["offset"]) if "offset" in data and data.get("offset") is not None else None,
8145
8285
  sensors=parse_sensor_config_list(data["sensors"]) if "sensors" in data and data.get("sensors") is not None else None,
8286
+ equipmentKeyAssignments=parse_equipment_key_assignments(data["equipmentKeyAssignments"]) if "equipmentKeyAssignments" in data and data.get("equipmentKeyAssignments") is not None else None,
8146
8287
  )
8147
8288
 
8148
8289
  def serialize_recorder_config(data: RecorderConfig) -> object:
@@ -8153,6 +8294,7 @@ def serialize_recorder_config(data: RecorderConfig) -> object:
8153
8294
  "bots": None if data.bots is None else serialize_recorder_bot_details_list(data.bots),
8154
8295
  "offset": None if data.offset is None else serialize_offset_config(data.offset),
8155
8296
  "sensors": None if data.sensors is None else serialize_sensor_config_list(data.sensors),
8297
+ "equipmentKeyAssignments": None if data.equipmentKeyAssignments is None else serialize_equipment_key_assignments(data.equipmentKeyAssignments),
8156
8298
  }
8157
8299
 
8158
8300
  @dataclass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: standardbots
3
- Version: 2.0.0.dev1752004997
3
+ Version: 2.0.1
4
4
  Summary: Standard Bots RO1 Robotics API
5
5
  Home-page:
6
6
  Author: Standard Bots Support
@@ -0,0 +1,12 @@
1
+ standardbots/__init__.py,sha256=PT6Z2HPama2fb6SaNhF3J1skpYABQWGgDzKEtQY6BDM,29
2
+ standardbots/auto_generated/__init__.py,sha256=PZtDUzYcjIO6R-gE-0NzY0vFXk1Je1tJ3je0ivV5o-k,98
3
+ standardbots/auto_generated/apis.py,sha256=PImtR3DhXTi2SAMyaXavFwKIPL_UDU8t7f50E9m-GLw,135953
4
+ standardbots/auto_generated/models.py,sha256=5MnjT25IiCWU1D-mUBC1yKvU2kFB9iv0ymdmP7Q28vc,375459
5
+ tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ tests/fixtures/client_fixt.py,sha256=LfeKYuYfHui-7YEFBlgtV33QN-MEI7DhAkJ6BUoZP6s,633
7
+ tests/fixtures/robot_fixt.py,sha256=6-0SgAjhEOUeydfRRu4dRVX-no1yYQxGKesAtvoPppc,1716
8
+ tests/fixtures/routines_fixt.py,sha256=XdcWUM0dl2SWJhtLd8-xYqI4nh4ge23SqJWquCIrQe0,2124
9
+ standardbots-2.0.1.dist-info/METADATA,sha256=9IaNdXRYQ6NxbLwIPtzJOjtQOrU1w9b2gVWtkJZ45ns,544
10
+ standardbots-2.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ standardbots-2.0.1.dist-info/top_level.txt,sha256=eHgNxowGe-eEE7gOyeuwXN3bHLClu-TQ1VnsOOzzTkw,19
12
+ standardbots-2.0.1.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- standardbots/__init__.py,sha256=PT6Z2HPama2fb6SaNhF3J1skpYABQWGgDzKEtQY6BDM,29
2
- standardbots/auto_generated/__init__.py,sha256=PZtDUzYcjIO6R-gE-0NzY0vFXk1Je1tJ3je0ivV5o-k,98
3
- standardbots/auto_generated/apis.py,sha256=trnBawZofsn73BlW5xoc9a2Xk6Jv8ZH6hrFJ_Tj05JU,134395
4
- standardbots/auto_generated/models.py,sha256=0NV8bRT41FDU37JmtNCgw5grJj7MP0qPVsqSwJXRm5E,369635
5
- tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- tests/fixtures/client_fixt.py,sha256=LfeKYuYfHui-7YEFBlgtV33QN-MEI7DhAkJ6BUoZP6s,633
7
- tests/fixtures/robot_fixt.py,sha256=6-0SgAjhEOUeydfRRu4dRVX-no1yYQxGKesAtvoPppc,1716
8
- tests/fixtures/routines_fixt.py,sha256=XdcWUM0dl2SWJhtLd8-xYqI4nh4ge23SqJWquCIrQe0,2124
9
- standardbots-2.0.0.dev1752004997.dist-info/METADATA,sha256=MzSZZlj2phW9t1n9ZpMXVAQ-RylTIBMkw1q5ei1TnZ4,558
10
- standardbots-2.0.0.dev1752004997.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- standardbots-2.0.0.dev1752004997.dist-info/top_level.txt,sha256=eHgNxowGe-eEE7gOyeuwXN3bHLClu-TQ1VnsOOzzTkw,19
12
- standardbots-2.0.0.dev1752004997.dist-info/RECORD,,