summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/nlopes/slack/dialog_text.go
diff options
context:
space:
mode:
authorDuco van Amstel <duco.vanamstel@gmail.com>2018-10-07 22:17:46 +0100
committerWim <wim@42.be>2018-10-07 23:17:46 +0200
commit917040b044e349eadc886f9685ada30d164687eb (patch)
treeea063d87a415f89060b376f29a844e4d1ed86363 /vendor/github.com/nlopes/slack/dialog_text.go
parent69646a160d8597944c307334901f0acfd32582c5 (diff)
downloadmatterbridge-msglm-917040b044e349eadc886f9685ada30d164687eb.tar.gz
matterbridge-msglm-917040b044e349eadc886f9685ada30d164687eb.tar.bz2
matterbridge-msglm-917040b044e349eadc886f9685ada30d164687eb.zip
Update of nlopes/slack dependency (#511)
Diffstat (limited to 'vendor/github.com/nlopes/slack/dialog_text.go')
-rw-r--r--vendor/github.com/nlopes/slack/dialog_text.go50
1 files changed, 50 insertions, 0 deletions
diff --git a/vendor/github.com/nlopes/slack/dialog_text.go b/vendor/github.com/nlopes/slack/dialog_text.go
new file mode 100644
index 00000000..bf9602cc
--- /dev/null
+++ b/vendor/github.com/nlopes/slack/dialog_text.go
@@ -0,0 +1,50 @@
+package slack
+
+// TextInputSubtype Accepts email, number, tel, or url. In some form factors, optimized input is provided for this subtype.
+type TextInputSubtype string
+
+const (
+ // InputSubtypeEmail email keyboard
+ InputSubtypeEmail TextInputSubtype = "email"
+ // InputSubtypeNumber numeric keyboard
+ InputSubtypeNumber TextInputSubtype = "number"
+ // InputSubtypeTel Phone keyboard
+ InputSubtypeTel TextInputSubtype = "tel"
+ // InputSubtypeURL Phone keyboard
+ InputSubtypeURL TextInputSubtype = "url"
+)
+
+// TextInputElement subtype of DialogInput
+// https://api.slack.com/dialogs#option_element_attributes#text_element_attributes
+type TextInputElement struct {
+ DialogInput
+ MaxLength int `json:"max_length,omitempty"`
+ MinLength int `json:"min_length,omitempty"`
+ Hint string `json:"hint,omitempty"`
+ Subtype TextInputSubtype `json:"subtype"`
+ Value string `json:"value"`
+}
+
+// NewTextInput constructor for a `text` input
+func NewTextInput(name, label, text string) *TextInputElement {
+ return &TextInputElement{
+ DialogInput: DialogInput{
+ Type: InputTypeText,
+ Name: name,
+ Label: label,
+ },
+ Value: text,
+ }
+}
+
+// NewTextAreaInput constructor for a `textarea` input
+func NewTextAreaInput(name, label, text string) *TextInputElement {
+ return &TextInputElement{
+ DialogInput: DialogInput{
+ Type: InputTypeTextArea,
+ Name: name,
+ Label: label,
+ },
+ Value: text,
+ }
+}