Package com.mailosaur.models
Class Attachment
java.lang.Object
com.mailosaur.models.BaseModel
com.mailosaur.models.Attachment
Describes a message attachment.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontent()Gets the base64-encoded content of the attachment.Gets the content identifier (for attachments that are embedded within the body of the message).Gets the MIME type of the attachment.fileName()Gets the filename of the attachment.id()Gets the unique identifier for the attachment.length()Gets the file size, in bytes.withContent(String content) Sets the base64-encoded content of the attachment.withContentId(String contentId) Sets the content identifier (for attachments that are embedded within the body of the message).withContentType(String contentType) Sets the MIME type of the attachment.withFileName(String fileName) Sets the filename of the attachment.Methods inherited from class com.mailosaur.models.BaseModel
nullableString
-
Constructor Details
-
Attachment
public Attachment()
-
-
Method Details
-
id
Gets the unique identifier for the attachment.- Returns:
- Attachment ID.
-
contentType
Gets the MIME type of the attachment.- Returns:
- Attachment MIME type.
-
withContentType
Sets the MIME type of the attachment.- Parameters:
contentType- MIME type.- Returns:
- the Attachment object itself.
-
fileName
Gets the filename of the attachment. -
withFileName
Sets the filename of the attachment.- Parameters:
fileName- Attachment filename.- Returns:
- the Attachment object itself.
-
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
Sets the base64-encoded content of the attachment.- Parameters:
content- Base64-encoded content of the attachment.- Returns:
- the Attachment object itself.
-
contentId
Gets the content identifier (for attachments that are embedded within the body of the message).- Returns:
- The content identifier
-
withContentId
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
Gets the file size, in bytes.- Returns:
- The file size, in bytes.
-