![JAR search and dependency download from the Maven repository](/logo.png)
com.mailslurp.models.CreateWebhookOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mailslurp-client-java Show documentation
Show all versions of mailslurp-client-java Show documentation
Official MailSlurp email API - create real inboxes then send and receive emails and attachments from tests and code.
The newest version!
/*
* MailSlurp API
* MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
*
* The version of the OpenAPI document: 6.5.2
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.mailslurp.models;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.mailslurp.models.BasicAuthOptions;
import com.mailslurp.models.WebhookHeaders;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the webhook's event is triggered. Webhooks are great for processing many inbound emails and responding to other events at scale. Customize the payload sent to your endpoint by setting the `requestBodyTemplate` property to a string with moustache style variables. Property names from the standard payload model for the given event are available as variables.
*/
@ApiModel(description = "Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the webhook's event is triggered. Webhooks are great for processing many inbound emails and responding to other events at scale. Customize the payload sent to your endpoint by setting the `requestBodyTemplate` property to a string with moustache style variables. Property names from the standard payload model for the given event are available as variables.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-03T06:03:24.997Z[GMT]")
public class CreateWebhookOptions {
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
private String url;
public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth";
@SerializedName(SERIALIZED_NAME_BASIC_AUTH)
private BasicAuthOptions basicAuth;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
/**
* Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_INCLUDE_HEADERS = "includeHeaders";
@SerializedName(SERIALIZED_NAME_INCLUDE_HEADERS)
private WebhookHeaders includeHeaders;
public static final String SERIALIZED_NAME_REQUEST_BODY_TEMPLATE = "requestBodyTemplate";
@SerializedName(SERIALIZED_NAME_REQUEST_BODY_TEMPLATE)
private String requestBodyTemplate;
public static final String SERIALIZED_NAME_USE_STATIC_IP_RANGE = "useStaticIpRange";
@SerializedName(SERIALIZED_NAME_USE_STATIC_IP_RANGE)
private Boolean useStaticIpRange = false;
public static final String SERIALIZED_NAME_IGNORE_INSECURE_SSL_CERTIFICATES = "ignoreInsecureSslCertificates";
@SerializedName(SERIALIZED_NAME_IGNORE_INSECURE_SSL_CERTIFICATES)
private Boolean ignoreInsecureSslCertificates;
public CreateWebhookOptions url(String url) {
this.url = url;
return this;
}
/**
* Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation.
* @return url
**/
@ApiModelProperty(required = true, value = "Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation.")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public CreateWebhookOptions basicAuth(BasicAuthOptions basicAuth) {
this.basicAuth = basicAuth;
return this;
}
/**
* Get basicAuth
* @return basicAuth
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public BasicAuthOptions getBasicAuth() {
return basicAuth;
}
public void setBasicAuth(BasicAuthOptions basicAuth) {
this.basicAuth = basicAuth;
}
public CreateWebhookOptions name(String name) {
this.name = name;
return this;
}
/**
* Optional name for the webhook
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional name for the webhook")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CreateWebhookOptions eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name.
* @return eventName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public CreateWebhookOptions includeHeaders(WebhookHeaders includeHeaders) {
this.includeHeaders = includeHeaders;
return this;
}
/**
* Get includeHeaders
* @return includeHeaders
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public WebhookHeaders getIncludeHeaders() {
return includeHeaders;
}
public void setIncludeHeaders(WebhookHeaders includeHeaders) {
this.includeHeaders = includeHeaders;
}
public CreateWebhookOptions requestBodyTemplate(String requestBodyTemplate) {
this.requestBodyTemplate = requestBodyTemplate;
return this;
}
/**
* Template for the JSON body of the webhook request that will be sent to your server. Use Moustache style `{{variableName}}` templating to use parts of the standard webhook payload for the given event.
* @return requestBodyTemplate
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Template for the JSON body of the webhook request that will be sent to your server. Use Moustache style `{{variableName}}` templating to use parts of the standard webhook payload for the given event.")
public String getRequestBodyTemplate() {
return requestBodyTemplate;
}
public void setRequestBodyTemplate(String requestBodyTemplate) {
this.requestBodyTemplate = requestBodyTemplate;
}
public CreateWebhookOptions useStaticIpRange(Boolean useStaticIpRange) {
this.useStaticIpRange = useStaticIpRange;
return this;
}
/**
* Use static IP range when calling webhook endpoint
* @return useStaticIpRange
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Use static IP range when calling webhook endpoint")
public Boolean getUseStaticIpRange() {
return useStaticIpRange;
}
public void setUseStaticIpRange(Boolean useStaticIpRange) {
this.useStaticIpRange = useStaticIpRange;
}
public CreateWebhookOptions ignoreInsecureSslCertificates(Boolean ignoreInsecureSslCertificates) {
this.ignoreInsecureSslCertificates = ignoreInsecureSslCertificates;
return this;
}
/**
* Ignore insecure SSL certificates when sending request. Useful for self-signed certs.
* @return ignoreInsecureSslCertificates
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Ignore insecure SSL certificates when sending request. Useful for self-signed certs.")
public Boolean getIgnoreInsecureSslCertificates() {
return ignoreInsecureSslCertificates;
}
public void setIgnoreInsecureSslCertificates(Boolean ignoreInsecureSslCertificates) {
this.ignoreInsecureSslCertificates = ignoreInsecureSslCertificates;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateWebhookOptions createWebhookOptions = (CreateWebhookOptions) o;
return Objects.equals(this.url, createWebhookOptions.url) &&
Objects.equals(this.basicAuth, createWebhookOptions.basicAuth) &&
Objects.equals(this.name, createWebhookOptions.name) &&
Objects.equals(this.eventName, createWebhookOptions.eventName) &&
Objects.equals(this.includeHeaders, createWebhookOptions.includeHeaders) &&
Objects.equals(this.requestBodyTemplate, createWebhookOptions.requestBodyTemplate) &&
Objects.equals(this.useStaticIpRange, createWebhookOptions.useStaticIpRange) &&
Objects.equals(this.ignoreInsecureSslCertificates, createWebhookOptions.ignoreInsecureSslCertificates);
}
@Override
public int hashCode() {
return Objects.hash(url, basicAuth, name, eventName, includeHeaders, requestBodyTemplate, useStaticIpRange, ignoreInsecureSslCertificates);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateWebhookOptions {\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" includeHeaders: ").append(toIndentedString(includeHeaders)).append("\n");
sb.append(" requestBodyTemplate: ").append(toIndentedString(requestBodyTemplate)).append("\n");
sb.append(" useStaticIpRange: ").append(toIndentedString(useStaticIpRange)).append("\n");
sb.append(" ignoreInsecureSslCertificates: ").append(toIndentedString(ignoreInsecureSslCertificates)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy