Class ResponseBase

java.lang.Object
com.alibaba.dashscope.types.common.ResponseBase
Direct Known Subclasses:
AppCompletion, ChatCompletion, ChatCompletionChunk, DecisionResult, DeletionStatus, Deployment, DeploymentList, DesignedVoice, DesignedVoiceList, EmbeddingResponse, FileList, FileObject, FineTune, FineTuneList, Job, JobLogs, JobStatus, Model, ModelList, MultimodalChatChunk, MultimodalChatCompletion, MultimodalEmbeddingResponse, Page, Phrase, PhraseList, RerankResponse, TokenCount, Vocabulary, VocabularyList, Voice, VoiceList

public class ResponseBase extends Object
Base of every 3.0 response (design §3): the server envelope flattened — requestId, statusCode, code, message, headers — plus isError() for raiseOnError(false) mode (2.x return-value style).
  • Constructor Details

    • ResponseBase

      public ResponseBase()
  • Method Details

    • fillEnvelope

      public void fillEnvelope(String requestId, int statusCode, String code, String message, Map<String,String> headers)
      Envelope fill is SDK-internal wiring (transport → response); users must not call it.
    • getRequestId

      public String getRequestId()
    • getStatusCode

      public int getStatusCode()
      HTTP status of the exchange (200 also for the 200-with-business-code error layer).
    • getCode

      public String getCode()
      Business error code; null/absent on success.
    • getMessage

      public String getMessage()
    • getHeaders

      public Map<String,String> getHeaders()
    • isError

      public boolean isError()
      true when the response carries a business error code (raiseOnError=false mode).