-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgeography2.go
178 lines (151 loc) · 6.26 KB
/
geography2.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
package dpd
const geographyNamespace = "http://dpd.ru/ws/geography/2015-05-20"
type operationGetCitiesCashPay struct {
GetCitiesCashPay *getCitiesCashPay `xml:"getCitiesCashPay,omitempty"`
}
type getCitiesCashPay struct {
Namespace string `xml:"xmlns,attr"`
Request *citiesCashPayRequest `xml:"request,omitempty"`
}
type citiesCashPayRequest struct {
Namespace string `xml:"xmlns,attr"`
Auth *Auth `xml:"auth,omitempty"`
CountryCode *string `xml:"countryCode,omitempty"`
}
type operationGetCitiesCashPayResponse struct {
GetCitiesCashPayResponse *GetCitiesCashPayResponse `xml:"getCitiesCashPayResponse,omitempty"`
}
//GetCitiesCashPayResponse list of DPD cities with C.O.D available
type GetCitiesCashPayResponse struct {
Return []*City `xml:"return,omitempty"`
}
//City with C.O.D available
type City struct {
CityID *int64 `xml:"cityId,omitempty"`
CountryCode *string `xml:"countryCode,omitempty"`
CountryName *string `xml:"countryName,omitempty"`
RegionCode *int `xml:"regionCode,omitempty"`
RegionName *string `xml:"regionName,omitempty"`
CityCode *string `xml:"cityCode,omitempty"`
CityName *string `xml:"cityName,omitempty"`
Abbreviation *string `xml:"abbreviation,omitempty"`
IndexMin *string `xml:"indexMin,omitempty"`
IndexMax *string `xml:"indexMax,omitempty"`
}
type operationGetParcelShops struct {
GetParcelShops *getParcelShops `xml:"getParcelShops,omitempty"`
}
type getParcelShops struct {
Request *ParcelShopRequest `xml:"request,omitempty"`
Ns string `xml:"xmlns,attr"`
}
//ParcelShopRequest GetParcelShops request body
type ParcelShopRequest struct {
Namespace string `xml:"xmlns,attr"`
Auth *Auth `xml:"auth,omitempty"`
CountryCode *string `xml:"countryCode,omitempty"`
RegionCode *string `xml:"regionCode,omitempty"`
CityCode *string `xml:"cityCode,omitempty"`
CityName *string `xml:"cityName,omitempty"`
}
type operationGetParcelShopsResponse struct {
GetParcelShopsResponse *getParcelShopsResponse `xml:"getParcelShopsResponse,omitempty"`
}
type getParcelShopsResponse struct {
Return *parcelShops `xml:"return,omitempty"`
}
type parcelShops struct {
ParcelShop []*ParcelShop `xml:"parcelShop,omitempty"`
}
//ParcelShop self delivery point with limits on dimensions and weight
type ParcelShop struct {
Code *string `xml:"code,omitempty"`
ParcelShopType *string `xml:"parcelShopType,omitempty"`
State *string `xml:"state,omitempty"`
Address *GeographyAddress `xml:"address,omitempty"`
Brand *string `xml:"brand,omitempty"`
ClientDepartmentNum *string `xml:"clientDepartmentNum,omitempty"`
GeoCoordinates *GeoCoordinates `xml:"geoCoordinates,omitempty"`
Limits *Limits `xml:"limits,omitempty"`
Schedule []*Schedule `xml:"schedule,omitempty"`
ExtraService []*ExtraServiceParameters `xml:"extraService,omitempty"`
Services []*string `xml:"services>serviceCode,omitempty"`
}
//GeographyAddress of ParcelShop or Terminal
type GeographyAddress struct {
CityID *int64 `xml:"cityId,omitempty"`
CountryCode *string `xml:"countryCode,omitempty"`
RegionCode *string `xml:"regionCode,omitempty"`
RegionName *string `xml:"regionName,omitempty"`
CityCode *string `xml:"cityCode,omitempty"`
CityName *string `xml:"cityName,omitempty"`
Index *string `xml:"index,omitempty"`
Street *string `xml:"street,omitempty"`
StreetAbbr *string `xml:"streetAbbr,omitempty"`
HouseNo *string `xml:"houseNo,omitempty"`
Building *string `xml:"building,omitempty"`
Structure *string `xml:"structure,omitempty"`
Ownership *string `xml:"ownership,omitempty"`
Description *string `xml:"descript,omitempty"`
}
//GeoCoordinates of ParcelShop or Terminal
type GeoCoordinates struct {
Latitude *float64 `xml:"latitude,omitempty"`
Longitude *float64 `xml:"longitude,omitempty"`
}
//Limits of ParcelShop
type Limits struct {
MaxShipmentWeight *float64 `xml:"maxShipmentWeight,omitempty"`
MaxWeight *float64 `xml:"maxWeight,omitempty"`
MaxLength *float64 `xml:"maxLength,omitempty"`
MaxWidth *float64 `xml:"maxWidth,omitempty"`
MaxHeight *float64 `xml:"maxHeight,omitempty"`
DimensionSum *float64 `xml:"dimensionSum,omitempty"`
}
//Schedule of ParcelShop or Terminal
type Schedule struct {
Operation *string `xml:"operation,omitempty"`
Timetable []*Timetable `xml:"timetable,omitempty"`
}
//Timetable for operations
type Timetable struct {
WeekDays *string `xml:"weekDays,omitempty"`
WorkTime *string `xml:"workTime,omitempty"`
}
//ExtraServiceParameters for ParcelShop or Terminal
type ExtraServiceParameters struct {
EsCode *string `xml:"esCode,omitempty"`
Params []*ExtraServiceParameter `xml:"params,omitempty"`
}
//ExtraServiceParameter ...
type ExtraServiceParameter struct {
Name *string `xml:"name,omitempty"`
Value *string `xml:"value,omitempty"`
}
type operationGetTerminalsSelfDelivery2 struct {
GetTerminalsSelfDelivery2 *getTerminalsSelfDelivery2Request `xml:"getTerminalsSelfDelivery2,omitempty"`
}
type getTerminalsSelfDelivery2Request struct {
Namespace string `xml:"xmlns,attr"`
Auth *Auth `xml:"auth,omitempty"`
}
type operationGetTerminalsSelfDelivery2Response struct {
Response *getTerminalsSelfDelivery2Response `xml:"getTerminalsSelfDelivery2Response,omitempty"`
}
type getTerminalsSelfDelivery2Response struct {
Return *Terminals `xml:"return,omitempty"`
}
//Terminals GetTerminalsSelfDelivery2 response body
type Terminals struct {
Terminal []*Terminal `xml:"terminal,omitempty"`
}
//Terminal ...
type Terminal struct {
TerminalCode *string `xml:"terminalCode,omitempty"`
TerminalName *string `xml:"terminalName,omitempty"`
Address *GeographyAddress `xml:"address,omitempty"`
GeoCoordinates *GeoCoordinates `xml:"geoCoordinates,omitempty"`
Schedule []*Schedule `xml:"schedule,omitempty"`
ExtraService []*ExtraServiceParameters `xml:"extraService,omitempty"`
Services []*string `xml:"services>serviceCode,omitempty"`
}