pub struct InputBlockBuilder { /* private fields */ }Expand description
Consuming builder for InputBlock. Validation runs in Self::build.
Implementations§
Source§impl InputBlockBuilder
impl InputBlockBuilder
Sourcepub fn label(self, value: impl Into<PlainTextInput>) -> Self
pub fn label(self, value: impl Into<PlainTextInput>) -> Self
Sets the label shown above the input.
Sourcepub fn element(self, value: impl Into<InputElement>) -> Self
pub fn element(self, value: impl Into<InputElement>) -> Self
Sets the input element that collects the user’s value.
Sourcepub fn dispatch_action(self, value: bool) -> Self
pub fn dispatch_action(self, value: bool) -> Self
Sets whether changing the element sends a block_actions payload immediately.
Sourcepub fn clear_dispatch_action(self) -> Self
pub fn clear_dispatch_action(self) -> Self
Omits dispatch_action, including any model default.
Sourcepub fn block_id(self, value: impl Into<String>) -> Self
pub fn block_id(self, value: impl Into<String>) -> Self
Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
Sourcepub fn clear_block_id(self) -> Self
pub fn clear_block_id(self) -> Self
Omits block_id, including any model default.
Sourcepub fn hint(self, value: impl Into<PlainTextInput>) -> Self
pub fn hint(self, value: impl Into<PlainTextInput>) -> Self
Sets helper text shown below the input.
Sourcepub fn clear_hint(self) -> Self
pub fn clear_hint(self) -> Self
Omits hint, including any model default.
Sourcepub fn optional(self, value: bool) -> Self
pub fn optional(self, value: bool) -> Self
Sets whether the modal can be submitted when this input is empty.
Sourcepub fn clear_optional(self) -> Self
pub fn clear_optional(self) -> Self
Omits optional, including any model default.
Sourcepub fn extension(self, key: impl Into<String>, value: impl Into<Value>) -> Self
pub fn extension(self, key: impl Into<String>, value: impl Into<Value>) -> Self
Adds or replaces an unmodeled extension; reserved names fail at build time.
Sourcepub fn build(self) -> Result<InputBlock, ValidationError>
pub fn build(self) -> Result<InputBlock, ValidationError>
Validates all fields and their receiving context.
§Errors
Returns a ValidationError for missing fields, invalid values, reserved
extension names, or unsupported field combinations and child contexts.