/
advisories.go
58 lines (44 loc) · 1.14 KB
/
advisories.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
package bart
type AdvisoryService struct{}
func (s *AdvisoryService) Bsa(r *BsaRequest) (resp BsaResponse, err error) {
err = makeRequest("bsa.aspx", "bsa", r, &resp)
return
}
func (s *AdvisoryService) TrainCount(r *CountRequest) (resp CountResponse, err error) {
err = makeRequest("bsa.aspx", "count", r, &resp)
return
}
func (s *AdvisoryService) ElevatorStatus(r *ElevRequest) (resp BsaResponse, err error) {
err = makeRequest("bsa.aspx", "elev", r, &resp)
return
}
func (s *AdvisoryService) Help(r *HelpRequest) (resp HelpResponse, err error) {
err = makeRequest("bsa.aspx", "help", r, &resp)
return
}
type BsaRequest struct {
Orig string `url:"orig"`
}
type BsaResponse struct {
BartResponseMeta
Bsa Bsa `xml:"bsa"`
}
type Bsa struct {
Station string `xml:"station"`
Description string `xml:"description"`
SmsText string `xml:"sms_text"`
}
type CountRequest struct{}
type CountResponse struct {
BartResponseMeta
TrainCount int `xml:"traincount"`
}
type ElevRequest struct{}
type HelpRequest struct{}
type Message struct {
Help string `xml:"help"`
}
type HelpResponse struct {
BartResponseMeta
Message Message `xml:"message"`
}