Class ButtonElement.ButtonElementBuilder
- java.lang.Object
-
- com.slack.api.model.block.element.ButtonElement.ButtonElementBuilder
-
- Enclosing class:
- ButtonElement
public static class ButtonElement.ButtonElementBuilder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ButtonElement.ButtonElementBuilderactionId(String actionId)An identifier for this action.ButtonElementbuild()ButtonElement.ButtonElementBuilderconfirm(ConfirmationDialogObject confirm)A confirm object that defines an optional confirmation dialog after the button is clicked.ButtonElement.ButtonElementBuilderstyle(String style)Decorates buttons with alternative visual color schemes.ButtonElement.ButtonElementBuildertext(PlainTextObject text)A text object that defines the button's text.StringtoString()ButtonElement.ButtonElementBuilderurl(String url)A URL to load in the user's browser when the button is clicked.ButtonElement.ButtonElementBuildervalue(String value)The value to send along with the interaction payload.
-
-
-
Method Detail
-
text
public ButtonElement.ButtonElementBuilder text(PlainTextObject text)
A text object that defines the button's text. Can only be of type: plain_text. Maximum length for the text in this field is 75 characters.- Returns:
this.
-
actionId
public ButtonElement.ButtonElementBuilder actionId(String actionId)
An identifier for this action. You can use this when you receive an interaction payload to identify the source of the action. Should be unique among all other action_ids used elsewhere by your app. Maximum length for this field is 255 characters.- Returns:
this.
-
url
public ButtonElement.ButtonElementBuilder url(String url)
A URL to load in the user's browser when the button is clicked. Maximum length for this field is 3000 characters. If you're using url, you'll still receive an interaction payload and will need to send an acknowledgement response.- Returns:
this.
-
value
public ButtonElement.ButtonElementBuilder value(String value)
The value to send along with the interaction payload. Maximum length for this field is 2000 characters.- Returns:
this.
-
style
public ButtonElement.ButtonElementBuilder style(String style)
Decorates buttons with alternative visual color schemes. Use this option with restraint.`primary` gives buttons a green outline and text, ideal for affirmation or confirmation actions. `primary` should only be used for one button within a set.
`danger` gives buttons a red outline and text, and should be used when the action is destructive. Use danger even more sparingly than `primary`.
If you don't include this field, the `default` button style will be used.
- Returns:
this.
-
confirm
public ButtonElement.ButtonElementBuilder confirm(ConfirmationDialogObject confirm)
A confirm object that defines an optional confirmation dialog after the button is clicked.- Returns:
this.
-
build
public ButtonElement build()
-
-