java.lang.Object
com.alibaba.dashscope.types.common.ResponseBase
com.alibaba.dashscope.resources.jobs.Job

public final class Job extends ResponseBase
A long-running task (design §3): taskId is the primary name (job_id accepted as an alias), outputAs(Class) gives a typed view over the raw output node. Terminal states: SUCCEEDED / FAILED / CANCELED / UNKNOWN.
  • Field Details

  • Constructor Details

    • Job

      public Job()
  • Method Details

    • fromBody

      public static Job fromBody(com.fasterxml.jackson.databind.JsonNode body)
      Build from the task envelope body {request_id, output:{task_id,task_status,...}}. SDK-internal wiring (transport → job); users must not call it.
    • getTaskId

      public String getTaskId()
    • getTaskStatus

      public String getTaskStatus()
    • getOutput

      public com.fasterxml.jackson.databind.JsonNode getOutput()
      Raw output node of the task.
    • getUsage

      public com.fasterxml.jackson.databind.JsonNode getUsage()
    • outputAs

      public <T> T outputAs(Class<T> type)
      Typed view over the raw output node.
    • getResults

      public List<JobResult> getResults()
      The artifacts of a finished task (Python v2 Job.results parity): output.results when present, else the image parts lifted from a choices-style output (multimodal-generation answers image tasks with chat-style choices).
    • getImageUrls

      public List<String> getImageUrls()
      Image URLs of a finished image task; empty for other tasks.
    • getVideoUrl

      public String getVideoUrl()
      Video URL of a finished video task; null for other tasks.
    • getResultUrl

      public String getResultUrl()
      The single artifact of a one-result task: first image URL, else output.url, else video.
    • isSucceeded

      public boolean isSucceeded()
    • isFinished

      public boolean isFinished()
      Terminal: SUCCEEDED / FAILED / CANCELED / UNKNOWN (2.x TaskStatus parity).