Update dependencies for 1.18.0 release (#1175)

This commit is contained in:
Wim
2020-07-18 17:27:41 +02:00
committed by GitHub
parent 3b6a8be07b
commit 23d8742f0d
174 changed files with 2158 additions and 2164 deletions

View File

@@ -2,6 +2,7 @@ package slack
import (
"encoding/json"
"fmt"
"github.com/pkg/errors"
)
@@ -172,10 +173,12 @@ func (b *BlockElements) UnmarshalJSON(data []byte) error {
blockElement = &DatePickerBlockElement{}
case "plain_text_input":
blockElement = &PlainTextInputBlockElement{}
case "checkboxes":
blockElement = &CheckboxGroupsBlockElement{}
case "static_select", "external_select", "users_select", "conversations_select", "channels_select":
blockElement = &SelectBlockElement{}
default:
return errors.New("unsupported block element type")
return fmt.Errorf("unsupported block element type %v", blockElementType)
}
err = json.Unmarshal(r, blockElement)
@@ -275,6 +278,12 @@ func (a *Accessory) UnmarshalJSON(data []byte) error {
return err
}
a.MultiSelectElement = element.(*MultiSelectBlockElement)
case "checkboxes":
element, err := unmarshalBlockElement(r, &CheckboxGroupsBlockElement{})
if err != nil {
return err
}
a.CheckboxGroupsBlockElement = element.(*CheckboxGroupsBlockElement)
default:
element, err := unmarshalBlockElement(r, &UnknownBlockElement{})
if err != nil {
@@ -313,6 +322,9 @@ func toBlockElement(element *Accessory) BlockElement {
if element.RadioButtonsElement != nil {
return element.RadioButtonsElement
}
if element.CheckboxGroupsBlockElement != nil {
return element.CheckboxGroupsBlockElement
}
if element.SelectElement != nil {
return element.SelectElement
}