All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.docusign.esign.client.ApiException Maven / Gradle / Ivy

Go to download

The official Docusign eSignature JAVA client is based on version 2.1 of the Docusign REST API and provides libraries for JAVA application integration. It is recommended that you use this version of the library for new development.

There is a newer version: 6.0.0
Show newest version
package com.docusign.esign.client;

import java.util.List;
import java.util.Map;

/** ApiException class. */
public class ApiException extends Exception {
  private int code = 0;
  private Map> responseHeaders = null;
  private String responseBody = null;

  /** ApiException constructor. */
  public ApiException() {}

  /**
   * ApiException constructor.
   *
   * @param throwable The Throwable type
   */
  public ApiException(Throwable throwable) {
    super(throwable);
  }

  /**
   * ApiException constructor.
   *
   * @param message The string message
   */
  public ApiException(String message) {
    super(message);
  }

  /**
   * ApiException constructor.
   *
   * @param message The string message
   * @param throwable The Throwable type
   * @param code The error code
   * @param responseHeaders The response headers
   * @param responseBody The body of response
   */
  public ApiException(
      String message,
      Throwable throwable,
      int code,
      Map> responseHeaders,
      String responseBody) {
    super(message, throwable);
    this.code = code;
    this.responseHeaders = responseHeaders;
    this.responseBody = responseBody;
  }

  /**
   * ApiException constructor.
   *
   * @param message The string message
   * @param code The error code
   * @param responseHeaders The response headers
   * @param responseBody The body of response
   */
  public ApiException(
      String message, int code, Map> responseHeaders, String responseBody) {
    this(message, (Throwable) null, code, responseHeaders, responseBody);
  }

  /**
   * ApiException constructor.
   *
   * @param message The string message
   * @param throwable The Throwable type
   * @param code The error code
   * @param responseHeaders The response headers
   */
  public ApiException(
      String message, Throwable throwable, int code, Map> responseHeaders) {
    this(message, throwable, code, responseHeaders, null);
  }

  /**
   * ApiException constructor.
   *
   * @param code The error code
   * @param responseHeaders The response headers
   * @param responseBody The body of response
   */
  public ApiException(int code, Map> responseHeaders, String responseBody) {
    this((String) null, (Throwable) null, code, responseHeaders, responseBody);
  }

  /**
   * ApiException constructor.
   *
   * @param code The error code
   * @param message The string message
   */
  public ApiException(int code, String message) {
    super(message);
    this.code = code;
  }

  /**
   * ApiException constructor.
   *
   * @param code The error code
   * @param message The string message
   * @param responseHeaders The response headers
   * @param responseBody The body of response
   */
  public ApiException(
      int code, String message, Map> responseHeaders, String responseBody) {
    this(code, message);
    this.responseHeaders = responseHeaders;
    this.responseBody = responseBody;
  }

  /**
   * Get the HTTP status code.
   *
   * @return HTTP status code
   */
  public int getCode() {
    return code;
  }

  /**
   * Get the HTTP response headers.
   *
   * @return A map of list of string
   */
  public Map> getResponseHeaders() {
    return responseHeaders;
  }

  /**
   * Get the HTTP response body.
   *
   * @return Response body in the form of string
   */
  public String getResponseBody() {
    return responseBody;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy