/
enqueue.go
34 lines (27 loc) · 843 Bytes
/
enqueue.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package verbs
import (
"encoding/xml"
"github.com/RJPearson94/twilio-sdk-go/twiml/voice/verbs/nouns"
)
type EnqueueAttributes struct {
Action *string `xml:"action,attr,omitempty"`
Method *string `xml:"method,attr,omitempty"`
WaitURL *string `xml:"waitUrl,attr,omitempty"`
WaitURLMethod *string `xml:"waitUrlMethod,attr,omitempty"`
WorkflowSid *string `xml:"workflowSid,attr,omitempty"`
}
type Enqueue struct {
XMLName xml.Name `xml:"Enqueue"`
Text *string `xml:",chardata"`
EnqueueAttributes
Children []interface{}
}
func (e *Enqueue) Task(body string) {
e.TaskWithAttributes(nouns.TaskAttributes{}, body)
}
func (e *Enqueue) TaskWithAttributes(attributes nouns.TaskAttributes, body string) {
e.Children = append(e.Children, nouns.Task{
Text: body,
TaskAttributes: attributes,
})
}