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

com.mailslurp.models.WebhookDeliveryStatusPayload Maven / Gradle / Ivy

Go to download

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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * DELIVERY_STATUS webhook payload. Sent to your webhook url endpoint via HTTP POST when an email delivery status is created. This could be a successful delivery or a delivery failure.
 */
@ApiModel(description = "DELIVERY_STATUS webhook payload. Sent to your webhook url endpoint via HTTP POST when an email delivery status is created. This could be a successful delivery or a delivery failure.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-03T06:03:24.997Z[GMT]")
public class WebhookDeliveryStatusPayload {
  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;

  /**
   * 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_WEBHOOK_NAME = "webhookName";
  @SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
  private String webhookName;

  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private UUID id;

  public static final String SERIALIZED_NAME_USER_ID = "userId";
  @SerializedName(SERIALIZED_NAME_USER_ID)
  private UUID userId;

  public static final String SERIALIZED_NAME_SENT_ID = "sentId";
  @SerializedName(SERIALIZED_NAME_SENT_ID)
  private UUID sentId;

  public static final String SERIALIZED_NAME_REMOTE_MTA_IP = "remoteMtaIp";
  @SerializedName(SERIALIZED_NAME_REMOTE_MTA_IP)
  private String remoteMtaIp;

  public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
  @SerializedName(SERIALIZED_NAME_INBOX_ID)
  private UUID inboxId;

  public static final String SERIALIZED_NAME_REPORTING_MTA = "reportingMta";
  @SerializedName(SERIALIZED_NAME_REPORTING_MTA)
  private String reportingMta;

  public static final String SERIALIZED_NAME_RECIPIENTS = "recipients";
  @SerializedName(SERIALIZED_NAME_RECIPIENTS)
  private List recipients = null;

  public static final String SERIALIZED_NAME_SMTP_RESPONSE = "smtpResponse";
  @SerializedName(SERIALIZED_NAME_SMTP_RESPONSE)
  private String smtpResponse;

  public static final String SERIALIZED_NAME_SMTP_STATUS_CODE = "smtpStatusCode";
  @SerializedName(SERIALIZED_NAME_SMTP_STATUS_CODE)
  private Integer smtpStatusCode;

  public static final String SERIALIZED_NAME_PROCESSING_TIME_MILLIS = "processingTimeMillis";
  @SerializedName(SERIALIZED_NAME_PROCESSING_TIME_MILLIS)
  private Long processingTimeMillis;

  public static final String SERIALIZED_NAME_RECEIVED = "received";
  @SerializedName(SERIALIZED_NAME_RECEIVED)
  private OffsetDateTime received;

  public static final String SERIALIZED_NAME_SUBJECT = "subject";
  @SerializedName(SERIALIZED_NAME_SUBJECT)
  private String subject;


  public WebhookDeliveryStatusPayload 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 WebhookDeliveryStatusPayload 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 WebhookDeliveryStatusPayload 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 WebhookDeliveryStatusPayload 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 WebhookDeliveryStatusPayload id(UUID id) {
    
    this.id = id;
    return this;
  }

   /**
   * ID of delivery status
   * @return id
  **/
  @ApiModelProperty(required = true, value = "ID of delivery status")

  public UUID getId() {
    return id;
  }


  public void setId(UUID id) {
    this.id = id;
  }


  public WebhookDeliveryStatusPayload userId(UUID userId) {
    
    this.userId = userId;
    return this;
  }

   /**
   * User ID of event
   * @return userId
  **/
  @ApiModelProperty(required = true, value = "User ID of event")

  public UUID getUserId() {
    return userId;
  }


  public void setUserId(UUID userId) {
    this.userId = userId;
  }


  public WebhookDeliveryStatusPayload sentId(UUID sentId) {
    
    this.sentId = sentId;
    return this;
  }

   /**
   * ID of sent email
   * @return sentId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "ID of sent email")

  public UUID getSentId() {
    return sentId;
  }


  public void setSentId(UUID sentId) {
    this.sentId = sentId;
  }


  public WebhookDeliveryStatusPayload remoteMtaIp(String remoteMtaIp) {
    
    this.remoteMtaIp = remoteMtaIp;
    return this;
  }

   /**
   * IP address of the remote Mail Transfer Agent
   * @return remoteMtaIp
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "IP address of the remote Mail Transfer Agent")

  public String getRemoteMtaIp() {
    return remoteMtaIp;
  }


  public void setRemoteMtaIp(String remoteMtaIp) {
    this.remoteMtaIp = remoteMtaIp;
  }


  public WebhookDeliveryStatusPayload inboxId(UUID inboxId) {
    
    this.inboxId = inboxId;
    return this;
  }

   /**
   * Id of the inbox
   * @return inboxId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Id of the inbox")

  public UUID getInboxId() {
    return inboxId;
  }


  public void setInboxId(UUID inboxId) {
    this.inboxId = inboxId;
  }


  public WebhookDeliveryStatusPayload reportingMta(String reportingMta) {
    
    this.reportingMta = reportingMta;
    return this;
  }

   /**
   * Mail Transfer Agent reporting delivery status
   * @return reportingMta
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Mail Transfer Agent reporting delivery status")

  public String getReportingMta() {
    return reportingMta;
  }


  public void setReportingMta(String reportingMta) {
    this.reportingMta = reportingMta;
  }


  public WebhookDeliveryStatusPayload recipients(List recipients) {
    
    this.recipients = recipients;
    return this;
  }

  public WebhookDeliveryStatusPayload addRecipientsItem(String recipientsItem) {
    if (this.recipients == null) {
      this.recipients = new ArrayList<>();
    }
    this.recipients.add(recipientsItem);
    return this;
  }

   /**
   * Recipients for delivery
   * @return recipients
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Recipients for delivery")

  public List getRecipients() {
    return recipients;
  }


  public void setRecipients(List recipients) {
    this.recipients = recipients;
  }


  public WebhookDeliveryStatusPayload smtpResponse(String smtpResponse) {
    
    this.smtpResponse = smtpResponse;
    return this;
  }

   /**
   * SMTP server response message
   * @return smtpResponse
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "SMTP server response message")

  public String getSmtpResponse() {
    return smtpResponse;
  }


  public void setSmtpResponse(String smtpResponse) {
    this.smtpResponse = smtpResponse;
  }


  public WebhookDeliveryStatusPayload smtpStatusCode(Integer smtpStatusCode) {
    
    this.smtpStatusCode = smtpStatusCode;
    return this;
  }

   /**
   * SMTP server status
   * @return smtpStatusCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "SMTP server status")

  public Integer getSmtpStatusCode() {
    return smtpStatusCode;
  }


  public void setSmtpStatusCode(Integer smtpStatusCode) {
    this.smtpStatusCode = smtpStatusCode;
  }


  public WebhookDeliveryStatusPayload processingTimeMillis(Long processingTimeMillis) {
    
    this.processingTimeMillis = processingTimeMillis;
    return this;
  }

   /**
   * Time in milliseconds for delivery processing
   * @return processingTimeMillis
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Time in milliseconds for delivery processing")

  public Long getProcessingTimeMillis() {
    return processingTimeMillis;
  }


  public void setProcessingTimeMillis(Long processingTimeMillis) {
    this.processingTimeMillis = processingTimeMillis;
  }


  public WebhookDeliveryStatusPayload received(OffsetDateTime received) {
    
    this.received = received;
    return this;
  }

   /**
   * Time event was received
   * @return received
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Time event was received")

  public OffsetDateTime getReceived() {
    return received;
  }


  public void setReceived(OffsetDateTime received) {
    this.received = received;
  }


  public WebhookDeliveryStatusPayload subject(String subject) {
    
    this.subject = subject;
    return this;
  }

   /**
   * Email subject
   * @return subject
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Email subject")

  public String getSubject() {
    return subject;
  }


  public void setSubject(String subject) {
    this.subject = subject;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    WebhookDeliveryStatusPayload webhookDeliveryStatusPayload = (WebhookDeliveryStatusPayload) o;
    return Objects.equals(this.messageId, webhookDeliveryStatusPayload.messageId) &&
        Objects.equals(this.webhookId, webhookDeliveryStatusPayload.webhookId) &&
        Objects.equals(this.eventName, webhookDeliveryStatusPayload.eventName) &&
        Objects.equals(this.webhookName, webhookDeliveryStatusPayload.webhookName) &&
        Objects.equals(this.id, webhookDeliveryStatusPayload.id) &&
        Objects.equals(this.userId, webhookDeliveryStatusPayload.userId) &&
        Objects.equals(this.sentId, webhookDeliveryStatusPayload.sentId) &&
        Objects.equals(this.remoteMtaIp, webhookDeliveryStatusPayload.remoteMtaIp) &&
        Objects.equals(this.inboxId, webhookDeliveryStatusPayload.inboxId) &&
        Objects.equals(this.reportingMta, webhookDeliveryStatusPayload.reportingMta) &&
        Objects.equals(this.recipients, webhookDeliveryStatusPayload.recipients) &&
        Objects.equals(this.smtpResponse, webhookDeliveryStatusPayload.smtpResponse) &&
        Objects.equals(this.smtpStatusCode, webhookDeliveryStatusPayload.smtpStatusCode) &&
        Objects.equals(this.processingTimeMillis, webhookDeliveryStatusPayload.processingTimeMillis) &&
        Objects.equals(this.received, webhookDeliveryStatusPayload.received) &&
        Objects.equals(this.subject, webhookDeliveryStatusPayload.subject);
  }

  @Override
  public int hashCode() {
    return Objects.hash(messageId, webhookId, eventName, webhookName, id, userId, sentId, remoteMtaIp, inboxId, reportingMta, recipients, smtpResponse, smtpStatusCode, processingTimeMillis, received, subject);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class WebhookDeliveryStatusPayload {\n");
    sb.append("    messageId: ").append(toIndentedString(messageId)).append("\n");
    sb.append("    webhookId: ").append(toIndentedString(webhookId)).append("\n");
    sb.append("    eventName: ").append(toIndentedString(eventName)).append("\n");
    sb.append("    webhookName: ").append(toIndentedString(webhookName)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    userId: ").append(toIndentedString(userId)).append("\n");
    sb.append("    sentId: ").append(toIndentedString(sentId)).append("\n");
    sb.append("    remoteMtaIp: ").append(toIndentedString(remoteMtaIp)).append("\n");
    sb.append("    inboxId: ").append(toIndentedString(inboxId)).append("\n");
    sb.append("    reportingMta: ").append(toIndentedString(reportingMta)).append("\n");
    sb.append("    recipients: ").append(toIndentedString(recipients)).append("\n");
    sb.append("    smtpResponse: ").append(toIndentedString(smtpResponse)).append("\n");
    sb.append("    smtpStatusCode: ").append(toIndentedString(smtpStatusCode)).append("\n");
    sb.append("    processingTimeMillis: ").append(toIndentedString(processingTimeMillis)).append("\n");
    sb.append("    received: ").append(toIndentedString(received)).append("\n");
    sb.append("    subject: ").append(toIndentedString(subject)).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