pub struct TasksResource {
pub scripts: TaskScriptsResource,
pub secrets: TaskSecretsResource,
pub selection_config: TaskSelectionConfigResource,
pub metrics: TaskMetricsResource,
/* private fields */
}Expand description
Task automation (v3) — /api/v3/tasks, with nested scripts, secrets, selection_config,
and metrics sub-resources.
Fields§
§scripts: TaskScriptsResourceCustom scripts by type.
secrets: TaskSecretsResourceAccount secrets, grouped by prefix.
selection_config: TaskSelectionConfigResourceAccount task-selection configuration.
metrics: TaskMetricsResourceTask & agent metrics.
Implementations§
Source§impl TasksResource
impl TasksResource
Sourcepub async fn list(&self, filter: Option<&str>) -> Result<TaskList, ManagerError>
pub async fn list(&self, filter: Option<&str>) -> Result<TaskList, ManagerError>
List tasks (one page), optionally filtered.
Sourcepub async fn create(&self, body: SubmitTask) -> Result<Task, ManagerError>
pub async fn create(&self, body: SubmitTask) -> Result<Task, ManagerError>
Submit a new task.
Sourcepub async fn create_from_template(
&self,
template: &str,
variables: Value,
) -> Result<Task, ManagerError>
pub async fn create_from_template( &self, template: &str, variables: Value, ) -> Result<Task, ManagerError>
Submit a task from a named template, supplying the template variables.
Sourcepub async fn get(&self, task_id: &str) -> Result<Task, ManagerError>
pub async fn get(&self, task_id: &str) -> Result<Task, ManagerError>
Get a task by id.
Sourcepub async fn update(
&self,
task_id: &str,
body: Task,
) -> Result<Task, ManagerError>
pub async fn update( &self, task_id: &str, body: Task, ) -> Result<Task, ManagerError>
Update a task.
Sourcepub async fn interrupt(
&self,
task_id: &str,
interrupt_to: InterruptionTargetStates,
action: Option<ManualActionRequest>,
) -> Result<(), ManagerError>
pub async fn interrupt( &self, task_id: &str, interrupt_to: InterruptionTargetStates, action: Option<ManualActionRequest>, ) -> Result<(), ManagerError>
Interrupt a task, moving it to a target state.
Sourcepub async fn change_state(
&self,
task_id: &str,
state: TaskState,
) -> Result<(), ManagerError>
pub async fn change_state( &self, task_id: &str, state: TaskState, ) -> Result<(), ManagerError>
Change a task’s state.
The underlying generated operation is marked deprecated upstream, but it remains part of the spec and is wrapped here for parity with the TypeScript/Go SDKs.
Sourcepub async fn agent_action(
&self,
task_id: &str,
action: AgentActions,
manual_action: Option<ManualActionRequest>,
) -> Result<Task, ManagerError>
pub async fn agent_action( &self, task_id: &str, action: AgentActions, manual_action: Option<ManualActionRequest>, ) -> Result<Task, ManagerError>
Perform an agent action on a task (accept/reject/complete, …).
Sourcepub async fn set_agent_lock(
&self,
lock_state: AgentLocking,
) -> Result<AgentLockState, ManagerError>
pub async fn set_agent_lock( &self, lock_state: AgentLocking, ) -> Result<AgentLockState, ManagerError>
Lock or unlock the current agent.
Sourcepub async fn usage(&self) -> Result<TaskTimeSeries, ManagerError>
pub async fn usage(&self) -> Result<TaskTimeSeries, ManagerError>
Task usage (time series).
Sourcepub async fn usage_types(&self) -> Result<Vec<String>, ManagerError>
pub async fn usage_types(&self) -> Result<Vec<String>, ManagerError>
The set of task usage types.
Sourcepub async fn logs(&self) -> Result<LogsResponse, ManagerError>
pub async fn logs(&self) -> Result<LogsResponse, ManagerError>
Read the customer task logs.
Sourcepub async fn test_action(
&self,
body: TestAction,
) -> Result<TestActionResult, ManagerError>
pub async fn test_action( &self, body: TestAction, ) -> Result<TestActionResult, ManagerError>
Test an action without dispatching it.