Class WebhookResponse

java.lang.Object
com.mimecast.robin.smtp.webhook.WebhookResponse

public class WebhookResponse extends Object
Simple immutable container for webhook responses.
  • Field Details

    • statusCode

      private final int statusCode
    • body

      private final String body
    • success

      private final boolean success
  • Constructor Details

    • WebhookResponse

      public WebhookResponse(int statusCode, String body, boolean success)
      Constructs a new WebhookResponse.
      Parameters:
      statusCode - HTTP status code returned by the webhook call.
      body - Raw response body returned by the webhook (may be empty but never null if set by caller).
      success - Convenience flag indicating if the call is considered successful (typically 2xx range).
  • Method Details

    • getStatusCode

      public int getStatusCode()
      Gets the HTTP status code returned by the webhook.
      Returns:
      HTTP status code as int.
    • getBody

      public String getBody()
      Gets the raw response body returned by the webhook.
      Returns:
      Response body string; may be empty if no body was provided.
    • isSuccess

      public boolean isSuccess()
      Indicates whether the webhook call was considered successful. This is derived at creation time (e.g. status code in 200-299 range).
      Returns:
      true if successful, false otherwise.