-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotify-user.go
67 lines (64 loc) · 1.87 KB
/
notify-user.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package finesse_api
import "encoding/xml"
type XmppUser struct {
//XMLName xml.Name `xml:"User"`
Dialogs string `xml:"dialogs"`
Extension string `xml:"extension"`
FirstName string `xml:"firstName"`
LastName string `xml:"lastName"`
LoginId string `xml:"loginId"`
LoginName string `xml:"loginName"`
MediaType string `xml:"mediaType"`
ReasonCodeId string `xml:"reasonCodeId"`
ReasonCode struct {
Category string `xml:"category"`
URL string `xml:"uri"`
Code string `xml:"code"`
Label string `xml:"label"`
ForAll bool `xml:"forAll"`
Id int `xml:"id"`
} `xml:"ReasonCode"`
Roles struct {
Role []string `xml:"role"`
} `xml:"roles"`
Settings struct {
WrapUpOnIncoming string `xml:"wrapUpOnIncoming"`
WrapUpOnOutgoing string `xml:"wrapUpOnOutgoing"`
DeviceSelection string `xml:"deviceSelection"`
} `xml:"settings"`
State string `xml:"state"`
StateChangeTime string `xml:"stateChangeTime"`
PendingState string `xml:"pendingState"`
TeamId string `xml:"teamId"`
TeamName string `xml:"teamName"`
SkillTargetId string `xml:"skillTargetId"`
URI string `xml:"uri"`
Teams struct {
Team []struct {
Id int `xml:"id"`
Name string `xml:"name"`
URI string `xml:"uri"`
} `xml:"Team"`
} `xml:"teams"`
MobileAgent struct {
Mode string `xml:"mode"`
DialNumber string `xml:"dialNumber"`
} `xml:"mobileAgent"`
ActiveDeviceId string `xml:"activeDeviceId"`
Devices struct {
Device []struct {
DeviceId string `xml:"deviceId"`
DeviceType string `xml:"deviceType"`
DeviceTypeName string `xml:"deviceTypeName"`
} `xml:"device"`
} `xml:"devices"`
}
func newXmppUser(data string) (*XmppUser, error) {
var u XmppUser
buffer := []byte(data)
err := xml.Unmarshal(buffer, &u)
if err != nil {
return nil, err
}
return &u, nil
}