Skip to content

Commit 2f895a7

Browse files
committed
implement method for robots
1 parent 475fc37 commit 2f895a7

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/viam/app/app_client.py

+21-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
GetRobotPartsResponse,
8181
GetRobotRequest,
8282
GetRobotResponse,
83+
GetRobotMetadataRequest,
84+
GetRobotMetadataResponse,
8385
GetRoverRentalRobotsRequest,
8486
GetRoverRentalRobotsResponse,
8587
GetUserIDByEmailRequest,
@@ -2554,7 +2556,7 @@ async def get_location_metadata(self, location_id: str) -> Mapping[str, Any]:
25542556
metadata = await cloud.get_location_metadata(location_id="<YOUR-LOCATION-ID>")
25552557
25562558
Args:
2557-
org_id (str): The ID of the location with which the user-defined metadata is associated.
2559+
location_id (str): The ID of the location with which the user-defined metadata is associated.
25582560
You can obtain your location ID from the Viam app's locations page.
25592561
25602562
Returns:
@@ -2563,3 +2565,21 @@ async def get_location_metadata(self, location_id: str) -> Mapping[str, Any]:
25632565
request = GetLocationMetadataRequest(location_id=location_id)
25642566
response: GetLocationMetadataResponse = await self._app_client.GetLocationMetadata(request)
25652567
return struct_to_dict(response.data)
2568+
2569+
async def get_robot_metadata(self, robot_id: str) -> Mapping[str, Any]:
2570+
"""Get a robot's user-defined metadata.
2571+
2572+
::
2573+
2574+
metadata = await cloud.get_robot_metadata(robot_id="<YOUR-ROBOT-ID>")
2575+
2576+
Args:
2577+
robot_id (str): The ID of the robot with which the user-defined metadata is associated.
2578+
You can obtain your robot ID from the Viam app's machine page.
2579+
2580+
Returns:
2581+
Mapping[str, Any]: The user-defined metadata converted from JSON to a Python dictionary
2582+
"""
2583+
request = GetRobotMetadataRequest(id=robot_id)
2584+
response: GetRobotMetadataResponse = await self._app_client.GetRobotMetadata(request)
2585+
return struct_to_dict(response.data)

0 commit comments

Comments
 (0)