-
Notifications
You must be signed in to change notification settings - Fork 5
/
fedex_data.go
127 lines (111 loc) · 3.17 KB
/
fedex_data.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// History: Nov 20 13 tcolar Creation
package fedex
// Structures to unmarshall the Fedex SOAP answer into
// TrackReply : Track reply root (`xml:"Body>TrackReply"`)
type TrackReply struct {
HighestSeverity string
Notifications []Notification
Version Version
CompletedTrackDetails []CompletedTrackDetail
}
func (r TrackReply) Failed() bool {
return r.HighestSeverity != "SUCCESS"
}
type Version struct {
ServiceId string
Major int
Intermediate int
Minor int
}
type CompletedTrackDetail struct {
HighestSeverity string
Notifications []Notification
DuplicateWaybill bool
MoreData bool
TrackDetails []TrackDetail
}
type TrackDetail struct {
TrackingNumber string
TrackingNumberUniqueIdentifier string
Notification Notification
StatusDetail StatusDetail
CarrierCode string
OperatingCompanyOrCarrierDescription string
OtherIdentifiers []OtherIdentifier
Service Service
PackageWeight Weight
ShipmentWeight Weight
Packaging string
PackagingType string
PackageSequenceNumber int
PackageCount int
SpecialHandlings []SpecialHandling
ShipTimestamp string
ActualDeliveryTimestamp string
DestinationAddress Location
ActualDeliveryAddress Location
DeliveryLocationType string
DeliveryLocationDescription string
DeliveryAttempts int
DeliverySignatureName string
TotalUniqueAddressCountInConsolidation int
NotificationEventsAvailable string
RedirectToHoldEligibility string
Events []Event
}
type Notification struct {
Severity string
Source string
Code int
Message string
LocalizedMessage string
}
type StatusDetail struct {
CreationTime string
Code string
Description string
Location Location
AncillaryDetails []AncillaryDetail
}
type Location struct {
StreetLines string
City string
StateOrProvinceCode string
CountryCode string
CountryName string
Residential bool
}
type AncillaryDetail struct {
Reason string
ReasonDescription string
}
type OtherIdentifier struct {
PackageIdentifier Identifier
}
type Service struct {
Type string
Description string
ShortDescription string
}
type Weight struct {
Units string
Value float64
}
type Identifier struct {
Type string
Value string
}
type SpecialHandling struct {
Type string
Description string
PaymentType string
}
type Event struct {
Timestamp string
EventType string
EventDescription string
StatusExceptionCode string
StatusExceptionDescription string
Address Location
ArrivalLocation string
}