Skip to content

Commit 70b7538

Browse files
committed
feat: add robot duplication
1 parent 7217c6b commit 70b7538

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ async def update_robot(self, robot_id: str, updates: dict):
8484
async def delete_robot(self, robot_id: str):
8585
await self._handle(self.client.delete(f"/robots/{robot_id}"))
8686

87+
async def duplicate_robot(self, robot_id: str, target_url: str):
88+
return await self._handle(
89+
self.client.post(f"/robots/{robot_id}/duplicate", json={"targetUrl": target_url})
90+
)
91+
8792
async def execute_robot(self, robot_id: str, options: Optional[dict] = None):
8893
return await self._handle(
8994
self.client.post(

robot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ async def update(self, updates: dict) -> None:
6262
updated = await self.client.update_robot(self.id, updates)
6363
self.robot_data = updated
6464

65+
async def duplicate(self, target_url: str):
66+
new_robot_data = await self.client.duplicate_robot(self.id, target_url)
67+
return Robot(self.client, new_robot_data)
68+
6569
async def delete(self) -> None:
6670
await self.client.delete_robot(self.id)
6771

0 commit comments

Comments
 (0)