Class Attachment

java.lang.Object
com.mailosaur.models.BaseModel
com.mailosaur.models.Attachment

public class Attachment extends BaseModel
Describes a message attachment.
  • Constructor Details

    • Attachment

      public Attachment()
  • Method Details

    • id

      public String id()
      Gets the unique identifier for the attachment.
      Returns:
      Attachment ID.
    • contentType

      public String contentType()
      Gets the MIME type of the attachment.
      Returns:
      Attachment MIME type.
    • withContentType

      public Attachment withContentType(String contentType)
      Sets the MIME type of the attachment.
      Parameters:
      contentType - MIME type.
      Returns:
      the Attachment object itself.
    • fileName

      public String fileName()
      Gets the filename of the attachment.
    • withFileName

      public Attachment withFileName(String fileName)
      Sets the filename of the attachment.
      Parameters:
      fileName - Attachment filename.
      Returns:
      the Attachment object itself.
    • content

      public String content()
      Gets the base64-encoded content of the attachment. Note: This is only populated when sending attachments.
      Returns:
      The base64-encoded content of the attachment.
    • withContent

      public Attachment withContent(String content)
      Sets the base64-encoded content of the attachment.
      Parameters:
      content - Base64-encoded content of the attachment.
      Returns:
      the Attachment object itself.
    • contentId

      public String contentId()
      Gets the content identifier (for attachments that are embedded within the body of the message).
      Returns:
      The content identifier
    • withContentId

      public Attachment withContentId(String contentId)
      Sets the content identifier (for attachments that are embedded within the body of the message).
      Parameters:
      contentId - The content identifier.
      Returns:
      the Attachment object itself.
    • length

      public Long length()
      Gets the file size, in bytes.
      Returns:
      The file size, in bytes.