ContextBlock
init
Creates an ContextBlock
instance.
Name | Type | Required | Default | Description |
---|---|---|---|---|
No arguments |
Return: The ContextBlock
instance.
id
Sets a custom identifier for the ContextBlock
instance.
Name | Type | Required | Default | Description |
---|---|---|---|---|
id |
| true | The custom identifier for the |
Return: The ContextBlock
instance.
image
Adds an ImageElement
to this ContextBlock
instance.
Name | Type | Required | Default | Description |
---|---|---|---|---|
imageUrl |
| true | The url for the image. | |
altText |
| false |
| The alt text for the image. |
Return: The new ImageElement
instance.
Throws: Megaphone.Provider.SlackBlockException
when more than 25 elements are added.
text
Adds a TextObject
to this ContextBlock
instance.
Name | Type | Required | Default | Description |
---|---|---|---|---|
text |
| true | The text for the |
Return: The new TextObject
instance.
Throws: Megaphone.Provider.SlackBlockException
when more than 25 elements are added.
getMemento
Converts the ContextBlock
instance to a serializable format.
Name | Type | Required | Default | Description |
---|---|---|---|---|
No arguments |
Return: (struct
) A struct representing this ContextBlock
instance.
Throws: Megaphone.Provider.SlackBlockException
when either 0 or more than 25 elements are present.
Last updated