Package com.mimecast.robin.smtp.webhook
Class WebhookResponse
java.lang.Object
com.mimecast.robin.smtp.webhook.WebhookResponse
Simple immutable container for webhook responses.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebhookResponse(int statusCode, String body, boolean success) Constructs a new WebhookResponse. -
Method Summary
Modifier and TypeMethodDescriptiongetBody()Gets the raw response body returned by the webhook.intGets the HTTP status code returned by the webhook.booleanIndicates whether the webhook call was considered successful.
-
Field Details
-
statusCode
private final int statusCode -
body
-
success
private final boolean success
-
-
Constructor Details
-
WebhookResponse
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
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.
-