File size: 546 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
package twiml_test

import (
	"encoding/xml"
	"os"

	"github.com/target/goalert/devtools/mocktwilio/twiml"
)

func ExampleGather() {
	var resp twiml.Response
	resp.Verbs = append(resp.Verbs, &twiml.Gather{
		Action:         "/gather",
		NumDigitsCount: 5,
		Verbs: []twiml.GatherVerb{
			&twiml.Say{
				Content: "Please enter your 5-digit zip code.",
			},
		},
	})

	_ = xml.NewEncoder(os.Stdout).Encode(resp)
	// Output:
	// <Response><Gather action="/gather" numDigits="5"><Say>Please enter your 5-digit zip code.</Say></Gather></Response>
}