API call to create workers and worker description for the task generator
(base_url: str,
api_key: str,
workers: List)
| 73 | |
| 74 | |
| 75 | def create_workers(base_url: str, |
| 76 | api_key: str, |
| 77 | workers: List) -> str: |
| 78 | """ |
| 79 | API call to create workers and worker description for the task generator |
| 80 | """ |
| 81 | |
| 82 | res = post( |
| 83 | base_url, |
| 84 | api_key, |
| 85 | endpoint="/v2/maps", |
| 86 | data={ |
| 87 | "locations": [ |
| 88 | {"id": w.id, "name": w.id, "description": w.worker_description} |
| 89 | for w in workers |
| 90 | ] |
| 91 | }, |
| 92 | ) |
| 93 | |
| 94 | |
| 95 | return res["id"] |