/
structs.go
85 lines (68 loc) · 1.99 KB
/
structs.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package emschedule
import "time"
// SOAP structs for calls
type RoomAvailabilityRequestSOAP struct {
XMLName struct{} `xml:"http://DEA.EMS.API.Web.Service/ GetRoomAvailability"`
Username string `xml:"UserName"`
Password string
RoomID int
BookingDate time.Time
StartTime time.Time
EndTime time.Time
}
type RoomAvailabilityResponseSOAP struct {
XMLName struct{} `xml:"http://DEA.EMS.API.Web.Service/ GetRoomAvailabilityResponse"`
Result string `xml:"GetRoomAvailabilityResult"`
}
type AllBuildingsRequestSOAP struct {
XMLName struct{} `xml:"http://DEA.EMS.API.Web.Service/ GetBuildings"`
Username string `xml:"UserName"`
Password string
}
type AllBuildingsResponseSOAP struct {
XMLName struct{} `xml:"http://DEA.EMS.API.Web.Service/ GetBuildingsResponse"`
Result string `xml:"GetBuildingsResult"`
}
type AllRoomsRequestSOAP struct {
XMLName struct{} `xml:"http://DEA.EMS.API.Web.Service/ GetRooms"`
Username string `xml:"UserName"`
Password string
Buildings []int `xml:"int"`
}
type AllRoomsResponseSOAP struct {
XMLName struct{} `xml:"http://DEA.EMS.API.Web.Service/ GetRoomsResponse"`
Result string `xml:"GetRoomsResult"`
}
type BuildingRequestSOAP struct {
XMLName struct{} `xml:"http://DEA.EMS.API.Web.Service/ GetBuildings"`
Username string `xml:"UserName"`
Password string
}
type BuildingResponseSOAP struct {
XMLName struct{} `xml:"http://DEA.EMS.API.Web.Service/ GetBuildingsResponse"`
Result string `xml:"GetBuildingsResult"`
}
// Structs for holding data from EMS
type RoomResponse struct {
Response []RoomAvailability `xml:"Data"`
}
type RoomAvailability struct {
Available bool
}
type AllBuildings struct {
Buildings []Building `xml:"Data"`
}
type Building struct {
BuildingCode string `xml:"BuildingCode"`
ID int `xml:"ID"`
Description string `xml:"Description"`
}
type AllRooms struct {
Rooms []Room `xml:"Data"`
}
type Room struct {
Room string
ID int
Description string
Available bool
}