/
client.go
38 lines (30 loc) · 915 Bytes
/
client.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
35
36
37
38
package nouns
import (
"encoding/xml"
)
type ClientAttributes struct {
Method *string `xml:"method,attr,omitempty"`
StatusCallback *string `xml:"statusCallback,attr,omitempty"`
StatusCallbackEvent *string `xml:"statusCallbackEvent,attr,omitempty"`
StatusCallbackMethod *string `xml:"statusCallbackMethod,attr,omitempty"`
URL *string `xml:"url,attr,omitempty"`
}
type Client struct {
XMLName xml.Name `xml:"Client"`
Text *string `xml:",chardata"`
ClientAttributes
Children []interface{}
}
func (c *Client) Identity(clientIdentity string) {
c.Children = append(c.Children, &Identity{
Text: clientIdentity,
})
}
func (c *Client) Parameter() {
c.Children = append(c.Children, &Parameter{})
}
func (c *Client) ParameterWithAttributes(attributes ParameterAttributes) {
c.Children = append(c.Children, &Parameter{
ParameterAttributes: &attributes,
})
}