public static class Attachment.AttachmentBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
Attachment.AttachmentBuilder |
actions(List<Action> actions)
Actions are defined as an array, and hashes contained within it will be displayed in as buttons in the message attachment.
|
Attachment.AttachmentBuilder |
appUnfurl(Boolean appUnfurl) |
Attachment.AttachmentBuilder |
appUnfurlUrl(String appUnfurlUrl) |
Attachment.AttachmentBuilder |
authorIcon(String authorIcon)
A valid URL that displays a small 16x16px image to the left of the author_name text.
|
Attachment.AttachmentBuilder |
authorId(String authorId) |
Attachment.AttachmentBuilder |
authorLink(String authorLink)
A valid URL that will hyperlink the author_name text mentioned above.
|
Attachment.AttachmentBuilder |
authorName(String authorName)
Small text used to display the author's name.
|
Attachment.AttachmentBuilder |
authorSubname(String authorSubname) |
Attachment.AttachmentBuilder |
blocks(List<LayoutBlock> blocks) |
Attachment.AttachmentBuilder |
botId(String botId) |
Attachment |
build() |
Attachment.AttachmentBuilder |
callbackId(String callbackId)
This is optional value that specifies callback id when there are buttons.
|
Attachment.AttachmentBuilder |
channelId(String channelId) |
Attachment.AttachmentBuilder |
channelName(String channelName) |
Attachment.AttachmentBuilder |
color(String color)
Like traffic signals, color-coding messages can quickly communicate intent
and help separate them from the flow of other messages in the timeline.
|
Attachment.AttachmentBuilder |
fallback(String fallback)
A plain-text summary of the attachment.
|
Attachment.AttachmentBuilder |
fields(List<Field> fields)
Fields are defined as an array, and hashes contained within it will be displayed in a table inside the message attachment.
|
Attachment.AttachmentBuilder |
filename(String filename) |
Attachment.AttachmentBuilder |
footer(String footer)
Add some brief text to help contextualize and identify an attachment.
|
Attachment.AttachmentBuilder |
footerIcon(String footerIcon)
To render a small icon beside your footer text, provide a publicly accessible URL string in the footer_icon field.
|
Attachment.AttachmentBuilder |
fromUrl(String fromUrl) |
Attachment.AttachmentBuilder |
id(Integer id) |
Attachment.AttachmentBuilder |
imageBytes(Integer imageBytes) |
Attachment.AttachmentBuilder |
imageHeight(Integer imageHeight) |
Attachment.AttachmentBuilder |
imageUrl(String imageUrl)
A valid URL to an image file that will be displayed inside a message attachment.
|
Attachment.AttachmentBuilder |
imageWidth(Integer imageWidth) |
Attachment.AttachmentBuilder |
indent(Boolean indent) |
Attachment.AttachmentBuilder |
metadata(Attachment.AttachmentMetadata metadata) |
Attachment.AttachmentBuilder |
mimetype(String mimetype) |
Attachment.AttachmentBuilder |
mrkdwnIn(List<String> mrkdwnIn)
By default,
message text
in attachments are not formatted.
|
Attachment.AttachmentBuilder |
msgSubtype(String msgSubtype) |
Attachment.AttachmentBuilder |
msgUnfurl(Boolean msgUnfurl)
NOTE: The the following Booleans (is_msg_unfurl, is_reply_unfurl, is_thread_root_unfurl,
is_app_unfurl) default to null intentionally to support block attachments.
|
Attachment.AttachmentBuilder |
originalUrl(String originalUrl) |
Attachment.AttachmentBuilder |
pretext(String pretext)
This is optional text that appears above the message attachment block.
|
Attachment.AttachmentBuilder |
replyUnfurl(Boolean replyUnfurl) |
Attachment.AttachmentBuilder |
serviceIcon(String serviceIcon) |
Attachment.AttachmentBuilder |
serviceName(String serviceName) |
Attachment.AttachmentBuilder |
serviceUrl(String serviceUrl) |
Attachment.AttachmentBuilder |
size(Integer size) |
Attachment.AttachmentBuilder |
text(String text)
This is the main text in a message attachment, and can contain standard message markup (see details below).
|
Attachment.AttachmentBuilder |
threadRootUnfurl(Boolean threadRootUnfurl) |
Attachment.AttachmentBuilder |
thumbHeight(Integer thumbHeight) |
Attachment.AttachmentBuilder |
thumbUrl(String thumbUrl)
A valid URL to an image file that will be displayed as a thumbnail on the right side of a message attachment.
|
Attachment.AttachmentBuilder |
thumbWidth(Integer thumbWidth) |
Attachment.AttachmentBuilder |
title(String title)
The title is displayed as larger, bold text near the top of a message attachment.
|
Attachment.AttachmentBuilder |
titleLink(String titleLink)
The title is displayed as larger, bold text near the top of a message attachment.
|
String |
toString() |
Attachment.AttachmentBuilder |
ts(String ts)
ts (timestamp)
Does your attachment relate to something happening at a specific time?
|
Attachment.AttachmentBuilder |
url(String url) |
Attachment.AttachmentBuilder |
videoHtml(String videoHtml) |
Attachment.AttachmentBuilder |
videoHtmlHeight(Integer videoHtmlHeight) |
Attachment.AttachmentBuilder |
videoHtmlWidth(Integer videoHtmlWidth) |
public Attachment.AttachmentBuilder msgSubtype(String msgSubtype)
public Attachment.AttachmentBuilder fallback(String fallback)
public Attachment.AttachmentBuilder callbackId(String callbackId)
public Attachment.AttachmentBuilder color(String color)
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.
public Attachment.AttachmentBuilder pretext(String pretext)
public Attachment.AttachmentBuilder serviceUrl(String serviceUrl)
public Attachment.AttachmentBuilder serviceName(String serviceName)
public Attachment.AttachmentBuilder serviceIcon(String serviceIcon)
public Attachment.AttachmentBuilder authorId(String authorId)
public Attachment.AttachmentBuilder authorName(String authorName)
public Attachment.AttachmentBuilder authorLink(String authorLink)
public Attachment.AttachmentBuilder authorIcon(String authorIcon)
public Attachment.AttachmentBuilder fromUrl(String fromUrl)
public Attachment.AttachmentBuilder originalUrl(String originalUrl)
public Attachment.AttachmentBuilder authorSubname(String authorSubname)
public Attachment.AttachmentBuilder channelId(String channelId)
public Attachment.AttachmentBuilder channelName(String channelName)
public Attachment.AttachmentBuilder id(Integer id)
public Attachment.AttachmentBuilder botId(String botId)
public Attachment.AttachmentBuilder indent(Boolean indent)
public Attachment.AttachmentBuilder msgUnfurl(Boolean msgUnfurl)
public Attachment.AttachmentBuilder replyUnfurl(Boolean replyUnfurl)
public Attachment.AttachmentBuilder threadRootUnfurl(Boolean threadRootUnfurl)
public Attachment.AttachmentBuilder appUnfurl(Boolean appUnfurl)
public Attachment.AttachmentBuilder appUnfurlUrl(String appUnfurlUrl)
public Attachment.AttachmentBuilder title(String title)
public Attachment.AttachmentBuilder titleLink(String titleLink)
public Attachment.AttachmentBuilder text(String text)
https://api.slack.com/docs/message-attachments#message_formatting
public Attachment.AttachmentBuilder fields(List<Field> fields)
public Attachment.AttachmentBuilder imageUrl(String imageUrl)
Large images will be resized to a maximum width of 400px or a maximum height of 500px, while still maintaining the original aspect ratio.
public Attachment.AttachmentBuilder imageWidth(Integer imageWidth)
public Attachment.AttachmentBuilder imageHeight(Integer imageHeight)
public Attachment.AttachmentBuilder imageBytes(Integer imageBytes)
public Attachment.AttachmentBuilder thumbUrl(String thumbUrl)
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.
public Attachment.AttachmentBuilder thumbWidth(Integer thumbWidth)
public Attachment.AttachmentBuilder thumbHeight(Integer thumbHeight)
public Attachment.AttachmentBuilder videoHtml(String videoHtml)
public Attachment.AttachmentBuilder videoHtmlWidth(Integer videoHtmlWidth)
public Attachment.AttachmentBuilder videoHtmlHeight(Integer videoHtmlHeight)
public Attachment.AttachmentBuilder footer(String footer)
public Attachment.AttachmentBuilder footerIcon(String footerIcon)
We'll render what you provide at 16px by 16px. It's best to use an image that is similarly sized.
public Attachment.AttachmentBuilder ts(String ts)
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.
public Attachment.AttachmentBuilder mrkdwnIn(List<String> mrkdwnIn)
public Attachment.AttachmentBuilder actions(List<Action> actions)
public Attachment.AttachmentBuilder blocks(List<LayoutBlock> blocks)
public Attachment.AttachmentBuilder filename(String filename)
public Attachment.AttachmentBuilder size(Integer size)
public Attachment.AttachmentBuilder mimetype(String mimetype)
public Attachment.AttachmentBuilder url(String url)
public Attachment.AttachmentBuilder metadata(Attachment.AttachmentMetadata metadata)
public Attachment build()
Copyright © 2020. All rights reserved.