public class Attachment extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Attachment.AttachmentBuilder |
static class |
Attachment.AttachmentMetadata |
Constructor and Description |
---|
Attachment() |
Attachment(String msgSubtype,
String fallback,
String callbackId,
String color,
String pretext,
String serviceUrl,
String serviceName,
String serviceIcon,
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 videoHtml,
Integer videoHtmlWidth,
Integer videoHtmlHeight,
String footer,
String footerIcon,
String ts,
List<String> mrkdwnIn,
List<Action> actions,
List<LayoutBlock> blocks,
String filename,
Integer size,
String mimetype,
String url,
Attachment.AttachmentMetadata metadata) |
Modifier and Type | Method and Description |
---|---|
static Attachment.AttachmentBuilder |
builder() |
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
List<Action> |
getActions()
Actions are defined as an array, and hashes contained within it will be displayed in as buttons in the message attachment.
|
String |
getAppUnfurlUrl() |
String |
getAuthorIcon()
A valid URL that displays a small 16x16px image to the left of the author_name text.
|
String |
getAuthorLink()
A valid URL that will hyperlink the author_name text mentioned above.
|
String |
getAuthorName()
Small text used to display the author's name.
|
String |
getAuthorSubname() |
List<LayoutBlock> |
getBlocks() |
String |
getBotId() |
String |
getCallbackId()
This is optional value that specifies callback id when there are buttons.
|
String |
getChannelId() |
String |
getChannelName() |
String |
getColor()
Like traffic signals, color-coding messages can quickly communicate intent
and help separate them from the flow of other messages in the timeline.
|
String |
getFallback()
A plain-text summary of the attachment.
|
List<Field> |
getFields()
Fields are defined as an array, and hashes contained within it will be displayed in a table inside the message attachment.
|
String |
getFilename() |
String |
getFooter()
Add some brief text to help contextualize and identify an attachment.
|
String |
getFooterIcon()
To render a small icon beside your footer text, provide a publicly accessible URL string in the footer_icon field.
|
String |
getFromUrl() |
Integer |
getId() |
Integer |
getImageBytes() |
Integer |
getImageHeight() |
String |
getImageUrl()
A valid URL to an image file that will be displayed inside a message attachment.
|
Integer |
getImageWidth() |
Attachment.AttachmentMetadata |
getMetadata() |
String |
getMimetype() |
List<String> |
getMrkdwnIn()
By default,
message text
in attachments are not formatted.
|
String |
getMsgSubtype() |
String |
getOriginalUrl() |
String |
getPretext()
This is optional text that appears above the message attachment block.
|
String |
getServiceIcon() |
String |
getServiceName() |
String |
getServiceUrl() |
Integer |
getSize() |
String |
getText()
This is the main text in a message attachment, and can contain standard message markup (see details below).
|
Integer |
getThumbHeight() |
String |
getThumbUrl()
A valid URL to an image file that will be displayed as a thumbnail on the right side of a message attachment.
|
Integer |
getThumbWidth() |
String |
getTitle()
The title is displayed as larger, bold text near the top of a message attachment.
|
String |
getTitleLink()
The title is displayed as larger, bold text near the top of a message attachment.
|
String |
getTs()
ts (timestamp)
Does your attachment relate to something happening at a specific time?
|
String |
getUrl() |
String |
getVideoHtml() |
Integer |
getVideoHtmlHeight() |
Integer |
getVideoHtmlWidth() |
int |
hashCode() |
Boolean |
isAppUnfurl() |
Boolean |
isIndent() |
Boolean |
isMsgUnfurl() |
Boolean |
isReplyUnfurl() |
Boolean |
isThreadRootUnfurl() |
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 |
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 |
setBotId(String botId) |
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 |
setColor(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.
|
void |
setFallback(String fallback)
A plain-text summary of the attachment.
|
void |
setFields(List<Field> fields)
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 |
setFooter(String footer)
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 |
setId(Integer id) |
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 |
setIndent(Boolean indent) |
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 |
setSize(Integer size) |
void |
setText(String text)
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 |
setTitle(String title)
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 |
setTs(String ts)
ts (timestamp)
Does your attachment relate to something happening at a specific time?
|
void |
setUrl(String url) |
void |
setVideoHtml(String videoHtml) |
void |
setVideoHtmlHeight(Integer videoHtmlHeight) |
void |
setVideoHtmlWidth(Integer videoHtmlWidth) |
String |
toString() |
public Attachment()
public Attachment(String msgSubtype, String fallback, String callbackId, String color, String pretext, String serviceUrl, String serviceName, String serviceIcon, 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 videoHtml, Integer videoHtmlWidth, Integer videoHtmlHeight, String footer, String footerIcon, String ts, List<String> mrkdwnIn, List<Action> actions, List<LayoutBlock> blocks, String filename, Integer size, String mimetype, String url, Attachment.AttachmentMetadata metadata)
public Boolean isIndent()
public void setIndent(Boolean indent)
public Boolean isMsgUnfurl()
public void setMsgUnfurl(Boolean msgUnfurl)
public Boolean isReplyUnfurl()
public void setReplyUnfurl(Boolean replyUnfurl)
public Boolean isThreadRootUnfurl()
public void setThreadRootUnfurl(Boolean threadRootUnfurl)
public Boolean isAppUnfurl()
public void setAppUnfurl(Boolean appUnfurl)
public static Attachment.AttachmentBuilder builder()
public String getMsgSubtype()
public String getFallback()
public String getCallbackId()
public String getColor()
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 String getPretext()
public String getServiceUrl()
public String getServiceName()
public String getServiceIcon()
public String getAuthorName()
public String getAuthorLink()
public String getAuthorIcon()
public String getFromUrl()
public String getOriginalUrl()
public String getAuthorSubname()
public String getChannelId()
public String getChannelName()
public Integer getId()
public String getBotId()
public String getAppUnfurlUrl()
public String getTitle()
public String getTitleLink()
public String getText()
https://api.slack.com/docs/message-attachments#message_formatting
public List<Field> getFields()
public String getImageUrl()
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 Integer getImageWidth()
public Integer getImageHeight()
public Integer getImageBytes()
public String getThumbUrl()
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 Integer getThumbWidth()
public Integer getThumbHeight()
public String getVideoHtml()
public Integer getVideoHtmlWidth()
public Integer getVideoHtmlHeight()
public String getFooter()
public String getFooterIcon()
We'll render what you provide at 16px by 16px. It's best to use an image that is similarly sized.
public String getTs()
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 List<String> getMrkdwnIn()
public List<Action> getActions()
public List<LayoutBlock> getBlocks()
public String getFilename()
public Integer getSize()
public String getMimetype()
public String getUrl()
public Attachment.AttachmentMetadata getMetadata()
public void setMsgSubtype(String msgSubtype)
public void setFallback(String fallback)
public void setCallbackId(String callbackId)
public void setColor(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 void setPretext(String pretext)
public void setServiceUrl(String serviceUrl)
public void setServiceName(String serviceName)
public void setServiceIcon(String serviceIcon)
public void setAuthorName(String authorName)
public void setAuthorLink(String authorLink)
public void setAuthorIcon(String authorIcon)
public void setFromUrl(String fromUrl)
public void setOriginalUrl(String originalUrl)
public void setAuthorSubname(String authorSubname)
public void setChannelId(String channelId)
public void setChannelName(String channelName)
public void setId(Integer id)
public void setBotId(String botId)
public void setAppUnfurlUrl(String appUnfurlUrl)
public void setTitle(String title)
public void setTitleLink(String titleLink)
public void setText(String text)
https://api.slack.com/docs/message-attachments#message_formatting
public void setFields(List<Field> fields)
public void setImageUrl(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 void setImageWidth(Integer imageWidth)
public void setImageHeight(Integer imageHeight)
public void setImageBytes(Integer imageBytes)
public void setThumbUrl(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 void setThumbWidth(Integer thumbWidth)
public void setThumbHeight(Integer thumbHeight)
public void setVideoHtml(String videoHtml)
public void setVideoHtmlWidth(Integer videoHtmlWidth)
public void setVideoHtmlHeight(Integer videoHtmlHeight)
public void setFooter(String footer)
public void setFooterIcon(String footerIcon)
We'll render what you provide at 16px by 16px. It's best to use an image that is similarly sized.
public void setTs(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 void setMrkdwnIn(List<String> mrkdwnIn)
public void setActions(List<Action> actions)
public void setBlocks(List<LayoutBlock> blocks)
public void setFilename(String filename)
public void setSize(Integer size)
public void setMimetype(String mimetype)
public void setUrl(String url)
public void setMetadata(Attachment.AttachmentMetadata metadata)
protected boolean canEqual(Object other)
Copyright © 2020. All rights reserved.