SlackCodeBlock

pydantic model safir.slack.blockkit.SlackCodeBlock

A component of a Slack message with a heading and a code block.

If the formatted output is longer than 3000 characters, it will be truncated to avoid the strict upper limit imposed by Slack.

Parameters:

data (Any)

Show JSON schema
{
   "title": "SlackCodeBlock",
   "description": "A component of a Slack message with a heading and a code block.\n\nIf the formatted output is longer than 3000 characters, it will be\ntruncated to avoid the strict upper limit imposed by Slack.",
   "type": "object",
   "properties": {
      "heading": {
         "title": "Heading",
         "type": "string"
      },
      "code": {
         "title": "Code",
         "type": "string"
      }
   },
   "required": [
      "heading",
      "code"
   ]
}

Fields:
field code: str [Required]

Text of the field as a code block.

field heading: str [Required]

Heading of the field (shown in bold).

to_slack()

Convert to a Slack Block Kit block.

Returns:

A Slack Block Kit block suitable for including in the fields or text section of a blocks element.

Return type:

dict