-
Notifications
You must be signed in to change notification settings - Fork 1
/
response.go
310 lines (269 loc) · 9.8 KB
/
response.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
package postmord
import (
"cloud.google.com/go/civil"
)
type Response struct {
TrackingInformation TrackingInformation `json:"TrackingInformationResponse"`
}
type ParamValues struct {
Param string `json:"param"`
Value string `json:"value"`
}
type Faults struct {
FaultCode string `json:"faultCode"`
ExplanationText string `json:"explanationText"`
ParamValues []ParamValues `json:"paramValues"`
}
type CompositeFault struct {
Faults []Faults `json:"faults"`
}
type Service struct {
Code string `json:"code"`
Name string `json:"name"`
}
type Address struct {
Street1 string `json:"street1"`
Street2 string `json:"street2"`
City string `json:"city"`
CountryCode string `json:"countryCode"`
Country string `json:"country"`
PostCode string `json:"postCode"`
}
type Consignor struct {
Name string `json:"name"`
Issuercode string `json:"issuercode"`
Address Address `json:"address"`
}
type Consignee struct {
Name string `json:"name"`
Address Address `json:"address"`
}
type Contact struct {
ContactName string `json:"contactName"`
Phone string `json:"phone"`
MobilePhone string `json:"mobilePhone"`
Email string `json:"email"`
}
type ReturnParty struct {
Name string `json:"name"`
Address Address `json:"address"`
Contact Contact `json:"contact"`
}
type PickupParty struct {
Name string `json:"name"`
Address Address `json:"address"`
Contact Contact `json:"contact"`
}
type CollectionParty struct {
Name string `json:"name"`
Address Address `json:"address"`
Contact Contact `json:"contact"`
}
type StatusText struct {
Header string `json:"header"`
Body string `json:"body"`
EstimatedTimeOfArrival string `json:"estimatedTimeOfArrival"`
}
type Coordinate struct {
SrID string `json:"srId"`
Northing string `json:"northing"`
Easting string `json:"easting"`
}
type OpeningHour struct {
OpenFrom string `json:"openFrom"`
OpenTo string `json:"openTo"`
OpenFrom2 string `json:"openFrom2"`
OpenTo2 string `json:"openTo2"`
Monday bool `json:"monday"`
Tuesday bool `json:"tuesday"`
Wednesday bool `json:"wednesday"`
Thursday bool `json:"thursday"`
Friday bool `json:"friday"`
Saturday bool `json:"saturday"`
Sunday bool `json:"sunday"`
}
type DeliveryPoint struct {
Name string `json:"name"`
LocationDetail string `json:"locationDetail"`
Address Address `json:"address"`
Contact Contact `json:"contact"`
Coordinate []Coordinate `json:"coordinate"`
OpeningHour []OpeningHour `json:"openingHour"`
DisplayName string `json:"displayName"`
LocationID string `json:"locationId"`
ServicePointType string `json:"servicePointType"`
}
type DestinationDeliveryPoint struct {
Name string `json:"name"`
LocationDetail string `json:"locationDetail"`
Address Address `json:"address"`
Contact Contact `json:"contact"`
Coordinate []Coordinate `json:"coordinate"`
OpeningHour []OpeningHour `json:"openingHour"`
DisplayName string `json:"displayName"`
LocationID string `json:"locationId"`
ServicePointType string `json:"servicePointType"`
}
type TotalWeight struct {
Value string `json:"value"`
Unit string `json:"unit"`
}
type TotalVolume struct {
Value string `json:"value"`
Unit string `json:"unit"`
}
type AssessedWeight struct {
Value string `json:"value"`
Unit string `json:"unit"`
}
type AssessedVolume struct {
Value string `json:"value"`
Unit string `json:"unit"`
}
type SplitStatuses struct {
NoItemsWithStatus int `json:"noItemsWithStatus"`
NoItems int `json:"noItems"`
StatusDescription string `json:"statusDescription"`
Status string `json:"status"`
}
type ShipmentReferences struct {
Value string `json:"value"`
Type string `json:"type"`
Name string `json:"name"`
}
type AdditionalServices struct {
Code string `json:"code"`
GroupCode string `json:"groupCode"`
Name string `json:"name"`
}
type Acceptor struct {
SignatureReference string `json:"signatureReference"`
Name string `json:"name"`
}
type Weight struct {
Value string `json:"value"`
Unit string `json:"unit"`
}
type Length struct {
Value string `json:"value"`
Unit string `json:"unit"`
}
type Height struct {
Value string `json:"value"`
Unit string `json:"unit"`
}
type Width struct {
Value string `json:"value"`
Unit string `json:"unit"`
}
type Volume struct {
Value string `json:"value"`
Unit string `json:"unit"`
}
type StatedMeasurement struct {
Weight Weight `json:"weight"`
Length Length `json:"length"`
Height Height `json:"height"`
Width Width `json:"width"`
Volume Volume `json:"volume"`
}
type AssessedMeasurement struct {
Weight Weight `json:"weight"`
Length Length `json:"length"`
Height Height `json:"height"`
Width Width `json:"width"`
Volume Volume `json:"volume"`
}
type Location struct {
Name string `json:"name"`
CountryCode string `json:"countryCode"`
Country string `json:"country"`
LocationID string `json:"locationId"`
DisplayName string `json:"displayName"`
Postcode string `json:"postcode"`
City string `json:"city"`
LocationType string `json:"locationType"`
}
type GeoLocation struct {
GeoNorthing int `json:"geoNorthing"`
GeoEasting int `json:"geoEasting"`
GeoReferenceSystem string `json:"geoReferenceSystem"`
GeoPostalCode string `json:"geoPostalCode"`
GeoCity string `json:"geoCity"`
GeoCountryCode string `json:"geoCountryCode"`
}
type Events struct {
EventTime civil.DateTime `json:"eventTime"`
EventCode string `json:"eventCode"`
Location Location `json:"location"`
GeoLocation GeoLocation `json:"geoLocation"`
Status string `json:"status"`
EventDescription string `json:"eventDescription"`
LocalDeviationDode string `json:"localDeviationDode"`
}
type References struct {
Value string `json:"value"`
Type string `json:"type"`
Name string `json:"name"`
}
type FreeText struct {
Text string `json:"text"`
Type string `json:"type"`
}
type Items struct {
ItemID string `json:"itemId"`
EstimatedTimeOfArrival civil.DateTime `json:"estimatedTimeOfArrival"`
DropOffDate civil.DateTime `json:"dropOffDate"`
DeliveryDate civil.DateTime `json:"deliveryDate"`
ReturnDate civil.DateTime `json:"returnDate"`
TypeOfItem string `json:"typeOfItem"`
TypeOfItemName string `json:"typeOfItemName"`
TypeOfItemActual string `json:"typeOfItemActual"`
TypeOfItemActualName string `json:"typeOfItemActualName"`
AdditionalInformation string `json:"additionalInformation"`
NoItems int `json:"noItems"`
NumberOfPallets string `json:"numberOfPallets"`
Status string `json:"status"`
StatusText StatusText `json:"statusText"`
Acceptor Acceptor `json:"acceptor"`
StatedMeasurement StatedMeasurement `json:"statedMeasurement"`
AssessedMeasurement AssessedMeasurement `json:"assessedMeasurement"`
Events []Events `json:"events"`
References []References `json:"references"`
PreviousItemStates []string `json:"previousItemStates"`
FreeText []FreeText `json:"freeText"`
}
type Shipments struct {
ShipmentID string `json:"shipmentId"`
URI string `json:"uri"`
AssessedNumberOfItems int `json:"assessedNumberOfItems"`
CashOnDeliveryText string `json:"cashOnDeliveryText"`
DeliveryDate civil.DateTime `json:"deliveryDate"`
ReturnDate civil.DateTime `json:"returnDate"`
EstimatedTimeOfArrival civil.DateTime `json:"estimatedTimeOfArrival"`
NumberOfPallets string `json:"numberOfPallets"`
FlexChangePossible bool `json:"flexChangePossible"`
Service Service `json:"service"`
Consignor Consignor `json:"consignor"`
Consignee Consignee `json:"consignee"`
ReturnParty ReturnParty `json:"returnParty"`
PickupParty PickupParty `json:"pickupParty"`
CollectionParty CollectionParty `json:"collectionParty"`
StatusText StatusText `json:"statusText"`
Status string `json:"status"`
DeliveryPoint DeliveryPoint `json:"deliveryPoint"`
DestinationDeliveryPoint DestinationDeliveryPoint `json:"destinationDeliveryPoint"`
TotalWeight TotalWeight `json:"totalWeight"`
TotalVolume TotalVolume `json:"totalVolume"`
AssessedWeight AssessedWeight `json:"assessedWeight"`
AssessedVolume AssessedVolume `json:"assessedVolume"`
SplitStatuses []SplitStatuses `json:"splitStatuses"`
ShipmentReferences []ShipmentReferences `json:"shipmentReferences"`
AdditionalServices []AdditionalServices `json:"additionalServices"`
HarmonizedVersion int `json:"harmonizedVersion"`
Items []Items `json:"items"`
}
type TrackingInformation struct {
CompositeFault CompositeFault `json:"compositeFault"`
Shipments []Shipments `json:"shipments"`
}