updateScheduledTask method
PUT /accounts/projects/{project_id}/scheduled-tasks/{task_id}
Implementation
Future<void> updateScheduledTask({
required String projectId,
required String taskId,
String? roomName,
String? queueName,
dynamic payload,
String? schedule,
bool? active,
Map<String, String> annotations = const {},
}) async {
final encodedProjectId = Uri.encodeComponent(projectId);
final encodedTaskId = Uri.encodeComponent(taskId);
final uri = Uri.parse('$baseUrl/accounts/projects/$encodedProjectId/scheduled-tasks/$encodedTaskId');
final body = _UpdateScheduledTaskRequest(
roomName: roomName,
queueName: queueName,
payload: payload,
schedule: schedule,
active: active,
annotations: annotations,
).toJson();
final resp = await httpClient.put(uri, body: jsonEncode(body));
if (resp.statusCode >= 400) {
throw MeshagentException('Failed to update scheduled task. Status code: ${resp.statusCode}, body: ${resp.body}');
}
}