kakaowork.blockkit module

class kakaowork.blockkit.ActionBlock(*, type: BlockType, elements: List[ButtonBlock])

Bases: Block

elements: List[ButtonBlock]
class kakaowork.blockkit.Block(*, type: BlockType)

Bases: BaseModel, ABC

class Config

Bases: object

underscore_attrs_are_private = True
validate_assignment = True
classmethod new(value: Union[Dict, Block]) Block
type: BlockType
class kakaowork.blockkit.BlockKitBuilder(*, type: BlockKitType, blocks: List[Block] = [], text: str = None, title: str = None, accept: str = None, decline: str = None, value: str = None)

Bases: BaseModel

class Config

Bases: object

validate_assignment = True
accept: Optional[str]
add_block(block: Union[Block, dict])
blocks: List[Block]
decline: Optional[str]
classmethod load(path: str) BlockKitBuilder
text: Optional[str]
title: Optional[str]
type: BlockKitType
value: Optional[str]
class kakaowork.blockkit.BlockKitType(value)

Bases: StrEnum

An enumeration.

MESSAGE = 'message'
MODAL = 'modal'
class kakaowork.blockkit.BlockType(value)

Bases: StrEnum

An enumeration.

ACTION = 'action'
BUTTON = 'button'
CONTEXT = 'context'
DESCRIPTION = 'description'
DIVIDER = 'divider'
HEADER = 'header'
INPUT = 'input'
LABEL = 'label'
SECTION = 'section'
SELECT = 'select'
TEXT = 'text'
classmethod block_cls(type: Union[str, BlockType]) Type[Block]
class kakaowork.blockkit.ButtonActionType(value)

Bases: StrEnum

An enumeration.

CALL_MODAL = 'call_modal'
OPEN_EXTERNAL_APP = 'open_external_app'
OPEN_INAPP_BROWSER = 'open_inapp_browser'
OPEN_SYSTEM_BROWSER = 'open_system_browser'
SUBMIT_ACTION = 'submit_action'
class kakaowork.blockkit.ButtonBlock(*, type: BlockType, text: str, style: ButtonStyle = ButtonStyle.DEFAULT, action_type: ButtonActionType = None, action_name: str = None, value: str = None)

Bases: Block

action_name: Optional[str]
action_type: Optional[ButtonActionType]
style: ButtonStyle
text: str
value: Optional[str]
class kakaowork.blockkit.ButtonStyle(value)

Bases: StrEnum

An enumeration.

DANGER = 'danger'
DEFAULT = 'default'
PRIMARY = 'primary'
class kakaowork.blockkit.ContextBlock(*, type: BlockType, content: TextBlock, image: ImageLinkBlock)

Bases: Block

content: TextBlock
image: ImageLinkBlock
class kakaowork.blockkit.DescriptionBlock(*, type: BlockType, term: str, content: TextBlock, accent: bool = None)

Bases: Block

accent: Optional[bool]
content: TextBlock
term: str
class kakaowork.blockkit.DividerBlock(*, type: BlockType)

Bases: Block

type: BlockType
class kakaowork.blockkit.HeaderBlock(*, type: BlockType, text: str, style: HeaderStyle = HeaderStyle.BLUE)

Bases: Block

style: HeaderStyle
text: str
class kakaowork.blockkit.HeaderStyle(value)

Bases: StrEnum

An enumeration.

BLUE = 'blue'
RED = 'red'
YELLOW = 'yellow'
class kakaowork.blockkit.ImageLinkBlock(*, type: BlockType, url: AnyHttpUrl)

Bases: Block

url: AnyHttpUrl
class kakaowork.blockkit.InputBlock(*, type: BlockType, name: str, required: bool = None, placeholder: str = None)

Bases: Block

name: str
placeholder: Optional[str]
required: Optional[bool]
class kakaowork.blockkit.LabelBlock(*, type: BlockType, text: str, markdown: bool)

Bases: Block

markdown: bool
text: str
class kakaowork.blockkit.SectionBlock(*, type: BlockType, content: TextBlock, accessory: ImageLinkBlock)

Bases: Block

accessory: ImageLinkBlock
content: TextBlock
class kakaowork.blockkit.SelectBlock(*, type: BlockType, name: str, options: List[SelectBlockOption], required: bool = None, placeholder: str = None)

Bases: Block

name: str
options: List[SelectBlockOption]
placeholder: Optional[str]
required: Optional[bool]
class kakaowork.blockkit.SelectBlockOption(*, text: str, value: str)

Bases: BaseModel

text: str
value: str
class kakaowork.blockkit.TextBlock(*, type: BlockType, text: str, markdown: bool = None, inlines: List[TextInline] = None)

Bases: Block

inlines: Optional[List[TextInline]]
markdown: Optional[bool]
text: str
class kakaowork.blockkit.TextInline(*, type: TextInlineType, text: str, bold: bool = None, italic: bool = None, strike: bool = None, color: TextInlineColor = None, url: str = None)

Bases: BaseModel

class Config

Bases: object

underscore_attrs_are_private = True
validate_assignment = True
bold: Optional[bool]
color: Optional[TextInlineColor]
italic: Optional[bool]
strike: Optional[bool]
text: str
type: TextInlineType
url: Optional[str]
class kakaowork.blockkit.TextInlineColor(value)

Bases: StrEnum

An enumeration.

BLUE = 'blue'
DEFAULT = 'default'
GREY = 'grey'
RED = 'red'
class kakaowork.blockkit.TextInlineType(value)

Bases: StrEnum

An enumeration.

STYLED = 'styled'