Class Attachment
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Constructor Summary
ConstructorDescriptionAttachment
(String msgSubtype, String fallback, String callbackId, String color, String pretext, String serviceUrl, String serviceName, String serviceIcon, String authorId, String authorName, String authorLink, String authorIcon, String fromUrl, String originalUrl, String authorSubname, String channelId, String channelName, Integer id, String botId, Boolean indent, Boolean msgUnfurl, Boolean replyUnfurl, Boolean threadRootUnfurl, Boolean appUnfurl, String appUnfurlUrl, String title, String titleLink, String text, List<Field> fields, String imageUrl, Integer imageWidth, Integer imageHeight, Integer imageBytes, String thumbUrl, Integer thumbWidth, Integer thumbHeight, String videoUrl, Attachment.VideoHtml videoHtml, Integer videoHtmlWidth, Integer videoHtmlHeight, String footer, String footerIcon, String ts, List<String> mrkdwnIn, List<Action> actions, List<LayoutBlock> blocks, List<File> files, String filename, Integer size, String mimetype, String url, Attachment.AttachmentMetadata metadata) -
Method Summary
Modifier and TypeMethodDescriptionstatic Attachment.AttachmentBuilder
builder()
protected boolean
boolean
Actions are defined as an array, and hashes contained within it will be displayed in as buttons in the message attachment.A valid URL that displays a small 16x16px image to the left of the author_name text.A valid URL that will hyperlink the author_name text mentioned above.Small text used to display the author's name.getBotId()
This is optional value that specifies callback id when there are buttons.getColor()
Like traffic signals, color-coding messages can quickly communicate intent and help separate them from the flow of other messages in the timeline.A plain-text summary of the attachment.Fields are defined as an array, and hashes contained within it will be displayed in a table inside the message attachment.getFiles()
Add some brief text to help contextualize and identify an attachment.To render a small icon beside your footer text, provide a publicly accessible URL string in the footer_icon field.getId()
A valid URL to an image file that will be displayed inside a message attachment.By default, message text in attachments are not formatted.This is optional text that appears above the message attachment block.getSize()
getText()
This is the main text in a message attachment, and can contain standard message markup (see details below).A valid URL to an image file that will be displayed as a thumbnail on the right side of a message attachment.getTitle()
The title is displayed as larger, bold text near the top of a message attachment.The title is displayed as larger, bold text near the top of a message attachment.getTs()
ts (timestamp) Does your attachment relate to something happening at a specific time?getUrl()
int
hashCode()
isIndent()
void
setActions
(List<Action> actions) Actions are defined as an array, and hashes contained within it will be displayed in as buttons in the message attachment.void
setAppUnfurl
(Boolean appUnfurl) void
setAppUnfurlUrl
(String appUnfurlUrl) void
setAuthorIcon
(String authorIcon) A valid URL that displays a small 16x16px image to the left of the author_name text.void
setAuthorId
(String authorId) void
setAuthorLink
(String authorLink) A valid URL that will hyperlink the author_name text mentioned above.void
setAuthorName
(String authorName) Small text used to display the author's name.void
setAuthorSubname
(String authorSubname) void
setBlocks
(List<LayoutBlock> blocks) void
void
setCallbackId
(String callbackId) This is optional value that specifies callback id when there are buttons.void
setChannelId
(String channelId) void
setChannelName
(String channelName) void
Like traffic signals, color-coding messages can quickly communicate intent and help separate them from the flow of other messages in the timeline.void
setFallback
(String fallback) A plain-text summary of the attachment.void
Fields are defined as an array, and hashes contained within it will be displayed in a table inside the message attachment.void
setFilename
(String filename) void
void
Add some brief text to help contextualize and identify an attachment.void
setFooterIcon
(String footerIcon) To render a small icon beside your footer text, provide a publicly accessible URL string in the footer_icon field.void
setFromUrl
(String fromUrl) void
void
setImageBytes
(Integer imageBytes) void
setImageHeight
(Integer imageHeight) void
setImageUrl
(String imageUrl) A valid URL to an image file that will be displayed inside a message attachment.void
setImageWidth
(Integer imageWidth) void
void
setMetadata
(Attachment.AttachmentMetadata metadata) void
setMimetype
(String mimetype) void
setMrkdwnIn
(List<String> mrkdwnIn) By default, message text in attachments are not formatted.void
setMsgSubtype
(String msgSubtype) void
setMsgUnfurl
(Boolean msgUnfurl) void
setOriginalUrl
(String originalUrl) void
setPretext
(String pretext) This is optional text that appears above the message attachment block.void
setReplyUnfurl
(Boolean replyUnfurl) void
setServiceIcon
(String serviceIcon) void
setServiceName
(String serviceName) void
setServiceUrl
(String serviceUrl) void
void
This is the main text in a message attachment, and can contain standard message markup (see details below).void
setThreadRootUnfurl
(Boolean threadRootUnfurl) void
setThumbHeight
(Integer thumbHeight) void
setThumbUrl
(String thumbUrl) A valid URL to an image file that will be displayed as a thumbnail on the right side of a message attachment.void
setThumbWidth
(Integer thumbWidth) void
The title is displayed as larger, bold text near the top of a message attachment.void
setTitleLink
(String titleLink) The title is displayed as larger, bold text near the top of a message attachment.void
ts (timestamp) Does your attachment relate to something happening at a specific time?void
void
setVideoHtml
(Attachment.VideoHtml videoHtml) void
setVideoHtmlHeight
(Integer videoHtmlHeight) void
setVideoHtmlWidth
(Integer videoHtmlWidth) void
setVideoUrl
(String videoUrl) toString()
-
Constructor Details
-
Attachment
public Attachment() -
Attachment
public Attachment(String msgSubtype, String fallback, String callbackId, String color, String pretext, String serviceUrl, String serviceName, String serviceIcon, String authorId, String authorName, String authorLink, String authorIcon, String fromUrl, String originalUrl, String authorSubname, String channelId, String channelName, Integer id, String botId, Boolean indent, Boolean msgUnfurl, Boolean replyUnfurl, Boolean threadRootUnfurl, Boolean appUnfurl, String appUnfurlUrl, String title, String titleLink, String text, List<Field> fields, String imageUrl, Integer imageWidth, Integer imageHeight, Integer imageBytes, String thumbUrl, Integer thumbWidth, Integer thumbHeight, String videoUrl, Attachment.VideoHtml videoHtml, Integer videoHtmlWidth, Integer videoHtmlHeight, String footer, String footerIcon, String ts, List<String> mrkdwnIn, List<Action> actions, List<LayoutBlock> blocks, List<File> files, String filename, Integer size, String mimetype, String url, Attachment.AttachmentMetadata metadata)
-
-
Method Details
-
isIndent
-
setIndent
-
isMsgUnfurl
-
setMsgUnfurl
-
isReplyUnfurl
-
setReplyUnfurl
-
isThreadRootUnfurl
-
setThreadRootUnfurl
-
isAppUnfurl
-
setAppUnfurl
-
builder
-
getMsgSubtype
-
getFallback
A plain-text summary of the attachment. This text will be used in clients that don't show formatted text (eg. IRC, mobile notifications) and should not contain any markup. -
getCallbackId
This is optional value that specifies callback id when there are buttons. -
getColor
Like traffic signals, color-coding messages can quickly communicate intent and help separate them from the flow of other messages in the timeline.An optional value that can either be one of good, warning, danger, or any hex color code (eg. #439FE0). This value is used to color the border along the left side of the message attachment.
-
getPretext
This is optional text that appears above the message attachment block. -
getServiceUrl
-
getServiceName
-
getServiceIcon
-
getAuthorId
-
getAuthorName
Small text used to display the author's name. -
getAuthorLink
A valid URL that will hyperlink the author_name text mentioned above. Will only work if author_name is present. -
getAuthorIcon
A valid URL that displays a small 16x16px image to the left of the author_name text. Will only work if author_name is present. -
getFromUrl
-
getOriginalUrl
-
getAuthorSubname
-
getChannelId
-
getChannelName
-
getId
-
getBotId
-
getAppUnfurlUrl
-
getTitle
The title is displayed as larger, bold text near the top of a message attachment. By passing a valid URL in the title_link parameter (optional), the title text will be hyperlinked. -
getTitleLink
The title is displayed as larger, bold text near the top of a message attachment. By passing a valid URL in the title_link parameter (optional), the title text will be hyperlinked. -
getText
This is the main text in a message attachment, and can contain standard message markup (see details below). The content will automatically collapse if it contains 700+ characters or 5+ linebreaks, and will display a "Show more..." link to expand the content.https://api.slack.com/docs/message-attachments#message_formatting
-
getFields
Fields are defined as an array, and hashes contained within it will be displayed in a table inside the message attachment. -
getImageUrl
A valid URL to an image file that will be displayed inside a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.Large images will be resized to a maximum width of 400px or a maximum height of 500px, while still maintaining the original aspect ratio.
-
getImageWidth
-
getImageHeight
-
getImageBytes
-
getThumbUrl
A valid URL to an image file that will be displayed as a thumbnail on the right side of a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.The thumbnail's longest dimension will be scaled down to 75px while maintaining the aspect ratio of the image. The filesize of the image must also be less than 500 KB.
For best results, please use images that are already 75px by 75px.
-
getThumbWidth
-
getThumbHeight
-
getVideoUrl
-
getVideoHtml
-
getVideoHtmlWidth
-
getVideoHtmlHeight
-
getTs
ts (timestamp) Does your attachment relate to something happening at a specific time?By providing the ts field with an integer value in "epoch time", the attachment will display an additional timestamp value as part of the attachment's footer.
Use ts when referencing articles or happenings. Your message will have its own timestamp when published.
-
getMrkdwnIn
By default, message text in attachments are not formatted. To enable formatting on attachment fields, add the name of the field (as defined in the API) in this list. -
getActions
Actions are defined as an array, and hashes contained within it will be displayed in as buttons in the message attachment. -
getBlocks
-
getFiles
-
getFilename
-
getSize
-
getMimetype
-
getUrl
-
getMetadata
-
setMsgSubtype
-
setFallback
A plain-text summary of the attachment. This text will be used in clients that don't show formatted text (eg. IRC, mobile notifications) and should not contain any markup. -
setCallbackId
This is optional value that specifies callback id when there are buttons. -
setColor
Like traffic signals, color-coding messages can quickly communicate intent and help separate them from the flow of other messages in the timeline.An optional value that can either be one of good, warning, danger, or any hex color code (eg. #439FE0). This value is used to color the border along the left side of the message attachment.
-
setPretext
This is optional text that appears above the message attachment block. -
setServiceUrl
-
setServiceName
-
setServiceIcon
-
setAuthorId
-
setAuthorName
Small text used to display the author's name. -
setAuthorLink
A valid URL that will hyperlink the author_name text mentioned above. Will only work if author_name is present. -
setAuthorIcon
A valid URL that displays a small 16x16px image to the left of the author_name text. Will only work if author_name is present. -
setFromUrl
-
setOriginalUrl
-
setAuthorSubname
-
setChannelId
-
setChannelName
-
setId
-
setBotId
-
setAppUnfurlUrl
-
setTitle
The title is displayed as larger, bold text near the top of a message attachment. By passing a valid URL in the title_link parameter (optional), the title text will be hyperlinked. -
setTitleLink
The title is displayed as larger, bold text near the top of a message attachment. By passing a valid URL in the title_link parameter (optional), the title text will be hyperlinked. -
setText
This is the main text in a message attachment, and can contain standard message markup (see details below). The content will automatically collapse if it contains 700+ characters or 5+ linebreaks, and will display a "Show more..." link to expand the content.https://api.slack.com/docs/message-attachments#message_formatting
-
setFields
Fields are defined as an array, and hashes contained within it will be displayed in a table inside the message attachment. -
setImageUrl
A valid URL to an image file that will be displayed inside a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.Large images will be resized to a maximum width of 400px or a maximum height of 500px, while still maintaining the original aspect ratio.
-
setImageWidth
-
setImageHeight
-
setImageBytes
-
setThumbUrl
A valid URL to an image file that will be displayed as a thumbnail on the right side of a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.The thumbnail's longest dimension will be scaled down to 75px while maintaining the aspect ratio of the image. The filesize of the image must also be less than 500 KB.
For best results, please use images that are already 75px by 75px.
-
setThumbWidth
-
setThumbHeight
-
setVideoUrl
-
setVideoHtml
-
setVideoHtmlWidth
-
setVideoHtmlHeight
-
setTs
ts (timestamp) Does your attachment relate to something happening at a specific time?By providing the ts field with an integer value in "epoch time", the attachment will display an additional timestamp value as part of the attachment's footer.
Use ts when referencing articles or happenings. Your message will have its own timestamp when published.
-
setMrkdwnIn
By default, message text in attachments are not formatted. To enable formatting on attachment fields, add the name of the field (as defined in the API) in this list. -
setActions
Actions are defined as an array, and hashes contained within it will be displayed in as buttons in the message attachment. -
setBlocks
-
setFiles
-
setFilename
-
setSize
-
setMimetype
-
setUrl
-
setMetadata
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-