createBacklogTask method

Future<CreateBacklogTaskResponse> createBacklogTask({
  1. required String agentSpaceId,
  2. required Priority priority,
  3. required TaskType taskType,
  4. required String title,
  5. String? clientToken,
  6. String? description,
  7. ReferenceInput? reference,
})

Creates a new backlog task in the specified agent space

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter agentSpaceId : The unique identifier for the agent space where the task will be created

Parameter priority : The priority level of the task

Parameter taskType : The type of task being created

Parameter title : The title of the backlog task

Parameter clientToken : Client-provided token for idempotent operations

Parameter description : Optional detailed description of the task

Parameter reference : Optional reference information for the task

Implementation

Future<CreateBacklogTaskResponse> createBacklogTask({
  required String agentSpaceId,
  required Priority priority,
  required TaskType taskType,
  required String title,
  String? clientToken,
  String? description,
  ReferenceInput? reference,
}) async {
  final $payload = <String, dynamic>{
    'priority': priority.value,
    'taskType': taskType.value,
    'title': title,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (reference != null) 'reference': reference,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/backlog/agent-space/${Uri.encodeComponent(agentSpaceId)}/tasks',
    hostPrefix: 'dp.',
    exceptionFnMap: _exceptionFns,
  );
  return CreateBacklogTaskResponse.fromJson(response);
}