Class ImagesTaskResponse

java.lang.Object
ai.runapi.core.polling.AbstractTaskResponse
ai.runapi.recraft.types.ImagesTaskResponse
All Implemented Interfaces:
ai.runapi.core.polling.Poller.CompletedResult, ai.runapi.core.polling.TaskResponse
Direct Known Subclasses:
RemoveBackgroundResponse, UpscaleImageResponse

public class ImagesTaskResponse extends ai.runapi.core.polling.AbstractTaskResponse implements ai.runapi.core.polling.Poller.CompletedResult
Task response base containing generated image results.
  • Constructor Details

    • ImagesTaskResponse

      public ImagesTaskResponse()
  • Method Details

    • getId

      public String getId()
      Returns the task ID.
      Specified by:
      getId in interface ai.runapi.core.polling.TaskResponse
      Specified by:
      getId in class ai.runapi.core.polling.AbstractTaskResponse
    • getStatus

      public ai.runapi.core.polling.TaskStatus getStatus()
      Returns the current task status.
      Specified by:
      getStatus in interface ai.runapi.core.polling.TaskResponse
      Specified by:
      getStatus in class ai.runapi.core.polling.AbstractTaskResponse
    • getError

      public String getError()
      Returns the task error message, if the task failed.
      Specified by:
      getError in interface ai.runapi.core.polling.TaskResponse
      Specified by:
      getError in class ai.runapi.core.polling.AbstractTaskResponse
    • getImages

      public List<Image> getImages()
      Returns the generated image results, when present.
    • extraFields

      public Map<String,com.fasterxml.jackson.databind.JsonNode> extraFields()
      Returns unrecognized response fields preserved from the API response.
    • ensureResultPresent

      public void ensureResultPresent()
      Ensures a completed response contains its expected result field.
      Specified by:
      ensureResultPresent in interface ai.runapi.core.polling.Poller.CompletedResult