
com.mailslurp.models.WebhookNewAttachmentPayload Maven / Gradle / Ivy
/*
* 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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.UUID;
/**
* NEW_ATTACHMENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to that contains an attachment. You can use the attachmentId to download the attachment.
*/
@ApiModel(description = "NEW_ATTACHMENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to that contains an attachment. You can use the attachmentId to download the attachment.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-05-03T02:14:29.400Z[GMT]")
public class WebhookNewAttachmentPayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
/**
* Name of the event type webhook is being triggered for.
*/
@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;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
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_ATTACHMENT_ID = "attachmentId";
@SerializedName(SERIALIZED_NAME_ATTACHMENT_ID)
private String attachmentId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_CONTENT_TYPE = "contentType";
@SerializedName(SERIALIZED_NAME_CONTENT_TYPE)
private String contentType;
public static final String SERIALIZED_NAME_CONTENT_LENGTH = "contentLength";
@SerializedName(SERIALIZED_NAME_CONTENT_LENGTH)
private Long contentLength;
public WebhookNewAttachmentPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookNewAttachmentPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookNewAttachmentPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookNewAttachmentPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookNewAttachmentPayload attachmentId(String attachmentId) {
this.attachmentId = attachmentId;
return this;
}
/**
* ID of attachment. Use the `AttachmentController` to
* @return attachmentId
**/
@ApiModelProperty(required = true, value = "ID of attachment. Use the `AttachmentController` to")
public String getAttachmentId() {
return attachmentId;
}
public void setAttachmentId(String attachmentId) {
this.attachmentId = attachmentId;
}
public WebhookNewAttachmentPayload name(String name) {
this.name = name;
return this;
}
/**
* Filename of the attachment if present
* @return name
**/
@ApiModelProperty(required = true, value = "Filename of the attachment if present")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public WebhookNewAttachmentPayload contentType(String contentType) {
this.contentType = contentType;
return this;
}
/**
* Content type of attachment such as 'image/png' or 'application/pdf
* @return contentType
**/
@ApiModelProperty(required = true, value = "Content type of attachment such as 'image/png' or 'application/pdf")
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public WebhookNewAttachmentPayload contentLength(Long contentLength) {
this.contentLength = contentLength;
return this;
}
/**
* Size of attachment in bytes
* @return contentLength
**/
@ApiModelProperty(required = true, value = "Size of attachment in bytes")
public Long getContentLength() {
return contentLength;
}
public void setContentLength(Long contentLength) {
this.contentLength = contentLength;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookNewAttachmentPayload webhookNewAttachmentPayload = (WebhookNewAttachmentPayload) o;
return Objects.equals(this.messageId, webhookNewAttachmentPayload.messageId) &&
Objects.equals(this.webhookId, webhookNewAttachmentPayload.webhookId) &&
Objects.equals(this.webhookName, webhookNewAttachmentPayload.webhookName) &&
Objects.equals(this.eventName, webhookNewAttachmentPayload.eventName) &&
Objects.equals(this.attachmentId, webhookNewAttachmentPayload.attachmentId) &&
Objects.equals(this.name, webhookNewAttachmentPayload.name) &&
Objects.equals(this.contentType, webhookNewAttachmentPayload.contentType) &&
Objects.equals(this.contentLength, webhookNewAttachmentPayload.contentLength);
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, webhookName, eventName, attachmentId, name, contentType, contentLength);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookNewAttachmentPayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" attachmentId: ").append(toIndentedString(attachmentId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n");
sb.append(" contentLength: ").append(toIndentedString(contentLength)).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