diff --git a/client.py b/client.py index eb4dfd9..838fd7a 100644 --- a/client.py +++ b/client.py @@ -84,6 +84,11 @@ async def update_robot(self, robot_id: str, updates: dict): async def delete_robot(self, robot_id: str): await self._handle(self.client.delete(f"/robots/{robot_id}")) + async def duplicate_robot(self, robot_id: str, target_url: str): + return await self._handle( + self.client.post(f"/robots/{robot_id}/duplicate", json={"targetUrl": target_url}) + ) + async def execute_robot(self, robot_id: str, options: Optional[dict] = None): return await self._handle( self.client.post( diff --git a/robot.py b/robot.py index 3cfb087..6bbeb1a 100644 --- a/robot.py +++ b/robot.py @@ -62,6 +62,10 @@ async def update(self, updates: dict) -> None: updated = await self.client.update_robot(self.id, updates) self.robot_data = updated + async def duplicate(self, target_url: str): + new_robot_data = await self.client.duplicate_robot(self.id, target_url) + return Robot(self.client, new_robot_data) + async def delete(self) -> None: await self.client.delete_robot(self.id)