-
Notifications
You must be signed in to change notification settings - Fork 0
/
response_components.go
268 lines (232 loc) · 10.3 KB
/
response_components.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
package finding
type responseStandard struct {
// Ack indicates whether the error is a fatal error (causing the request to fail) or a less severe
// error (a warning) that should be communicated to the user.
Ack string `xml:"ack"`
// ErrorMessage Information regarding an error or warning that occurred when eBay processed the request.
// Not returned when the ack value is Success. Run-time errors are not reported here,
// but are instead reported as part of a SOAP fault.
ErrorMessage []Error `xml:"errorMessage>error"`
// Timestamp represents the date and time when eBay processed the request.
Timestamp string `xml:"timestamp"`
// Version is the release version that eBay used to process the request. Developer Technical Support
// may ask you for the version value if you work with them to troubleshoot issues.
Version string `xml:"version"`
}
type Error struct {
Category string `xml:"category"`
Domain string `xml:"domain"`
ErrorID string `xml:"errorId"`
ExceptionID string `xml:"exceptionId"`
Message string `xml:"message"`
Parameters []Parameter `xml:"parameter"`
Severity string `xml:"severity"`
Subdomain string `xml:"subdomain"`
}
type Parameter struct {
Name string `xml:"name,attr"`
Value string `xml:",chardata"`
}
/*
=====================================================
*/
type ResponseAspectHistogramContainer struct {
AspectHistogramContainer AspectHistogramContainer `xml:"aspectHistogramContainer"`
}
// AspectHistogramContainer is response container for aspect histograms.
type AspectHistogramContainer struct {
Aspects []Aspect `xml:"aspect"`
DomainDisplayName string `xml:"domainDisplayName"`
DomainName string `xml:"domainName"`
}
// Aspect is a characteristic of an item in a domain.
type Aspect struct {
Name string `xml:"name,attr"`
ValueHistograms []ValueHistogram `xml:"valueHistogram"`
}
// ValueHistogram is a container that returns the name of the respective aspect value and the histogram
// (the number of available items) that share that item characteristic.
type ValueHistogram struct {
ValueName string `xml:"valueName,attr"`
// Count is the number of items that share the characteristic the respective aspect value.
Count int64 `xml:"count"`
}
/*
=====================================================
*/
type ResponseCategoryHistogramContainer struct {
CategoryHistogramContainer CategoryHistogramContainer `json:"categoryHistogramContainer" xml:"categoryHistogramContainer"`
}
// CategoryHistogramContainer is a response container for category histograms. Only returned when one or
// more category histograms are returned. A category histogram is not returned if there are no
// matching items or if the search is restricted to a single leaf category.
type CategoryHistogramContainer struct {
CategoryHistograms []CategoryHistogram `xml:"categoryHistogram"`
}
// CategoryHistogram Statistical (item count) information on the categories that contain
// items that match the search criteria or specified category or categories.
// A category histogram contains information for up to 10 child categories.
// Search result total entries may not necessarily match the sum of category histogram item counts.
type CategoryHistogram struct {
CategoryId string `xml:"categoryId"`
CategoryName string `xml:"categoryName"`
ChildCategoryHistograms []CategoryHistogram `xml:"childCategoryHistogram"`
Count int64 `xml:"count"`
}
/*
=====================================================
*/
type ResponseConditionHistogramContainer struct {
ConditionHistogramContainer ConditionHistogramContainer `json:"conditionHistogramContainer" xml:"conditionHistogramContainer"`
}
// ConditionHistogramContainer is a response container for condition histograms.
// Not returned when Condition is specified in itemFilter.
// That is, only returned when you have not yet narrowed your search based on specific conditions.
type ConditionHistogramContainer struct {
ConditionHistograms []ConditionHistogram `xml:"conditionHistogram"`
}
// ConditionHistogram Statistical (item count) information on the condition of items that match
// the search criteria (or specified category).
// For example, the number of brand new items that match the query.
type ConditionHistogram struct {
Condition Condition `xml:"condition"`
Count int `xml:"count"`
}
/*
=====================================================
*/
type ResponsePaginationOutput struct {
PaginationOutput PaginationOutput `xml:"paginationOutput"`
}
// PaginationOutput Indicates the pagination of the result set. Child elements indicate the page
// number that is returned, the maximum number of item listings to return per page,
// total number of pages that can be returned, and the total number of listings that
// match the search criteria.
type PaginationOutput struct {
PageNumber int `xml:"pageNumber"`
EntriesPerPage int `xml:"entriesPerPage"`
TotalPages int `xml:"totalPages"`
TotalEntries int `xml:"totalEntries"`
}
/*
=====================================================
*/
type ResponseSearchResult struct {
SearchResult SearchResult `xml:"searchResult"`
}
// SearchResult is a container for the item listings that matched the search criteria.
// The data for each item is returned in individual containers, if any matches were found.
type SearchResult struct {
Count int `xml:"count,attr"`
Items []Item `xml:"item"`
}
// Item is a container for the data of a single item that matches the search criteria.
type Item struct {
Attributes []ItemAttribute `xml:"attribute"`
CharityID string `xml:"charityId"`
Compatibility string `xml:"compatibility"`
Condition Condition `xml:"condition"`
Country string `xml:"country"`
DiscountPriceInfo DiscountPriceInfo `xml:"discountPriceInfo"`
Distance Distance `xml:"distance"`
EekStatuses []string `xml:"eekStatus"`
GalleryInfoContainer []GalleryURL `xml:"galleryInfoContainer>galleryURL"`
GalleryPlusPictureURLs []string `xml:"galleryPlusPictureURL"`
GalleryURL string `xml:"galleryURL"`
GlobalID string `xml:"globalId"`
ItemID string `xml:"itemId"`
ListingInfo ListingInfo `xml:"listingInfo"`
Location string `xml:"location"`
PaymentMethods []string `xml:"paymentMethod"`
PictureURLLarge string `xml:"pictureURLLarge"`
PictureURLSuperSize string `xml:"pictureURLSuperSize"`
PostalCode string `xml:"postalCode"`
PrimaryCategory Category `xml:"primaryCategory"`
ProductID string `xml:"productId"`
SecondaryCategory Category `xml:"secondaryCategory"`
SellerInfo SellerInfo `xml:"sellerInfo"`
SellingStatus SellingStatus `xml:"sellingStatus"`
ShippingInfo ShippingInfo `xml:"shippingInfo"`
StoreInfo StoreInfo `xml:"storeInfo"`
Subtitle string `xml:"subtitle"`
Title string `xml:"title"`
UnitPrice UnitPriceInfo `xml:"unitPrice"`
ViewItemURL string `xml:"viewItemURL"`
AutoPay bool `xml:"autoPay"`
EbayPlusEnabled bool `xml:"eBayPlusEnabled"`
ReturnsAccepted bool `xml:"returnsAccepted"`
TopRatedListing bool `xml:"topRatedListing"`
IsMultiVariationListing bool `xml:"isMultiVariationListing"`
}
type Distance struct {
Value float64 `xml:",cdata"`
Unit string `xml:"unit,attr"`
}
type ItemAttribute struct {
Name string `xml:"name"`
Value string `xml:"value"`
}
type Condition struct {
ConditionDisplayName string `xml:"conditionDisplayName"`
ConditionId string `xml:"conditionId"`
}
type DiscountPriceInfo struct {
MinimumAdvertisedPriceExposure string `xml:"minimumAdvertisedPriceExposure"`
OriginalRetailPrice float64 `xml:"originalRetailPrice"`
PricingTreatment string `xml:"pricingTreatment"`
SoldOffEbay bool `xml:"soldOffEbay"`
SoldOnEbay bool `xml:"soldOnEbay"`
}
type GalleryURL struct {
URL string `xml:",cdata"`
Size string `xml:"gallerySize,attr"`
}
type ListingInfo struct {
BestOfferEnabled bool `xml:"bestOfferEnabled"`
BuyItNowAvailable bool `xml:"buyItNowAvailable"`
Gift bool `xml:"gift"`
BuyItNowPrice Price `xml:"buyItNowPrice"`
ConvertedBuyItNowPrice Price `xml:"convertedBuyItNowPrice"`
EndTime string `xml:"endTime"`
ListingType string `xml:"listingType"`
StartTime string `xml:"startTime"`
WatchCount int `xml:"watchCount"`
}
type Price struct {
Value float64 `xml:",cdata"`
CurrencyID string `xml:"currencyId,attr"`
}
type Category struct {
CategoryId string `xml:"categoryId"`
CategoryName string `xml:"categoryName"`
}
type SellerInfo struct {
FeedbackRatingStar string `xml:"feedbackRatingStar"`
FeedbackScore int64 `xml:"feedbackScore"`
PositiveFeedbackPercent float64 `xml:"positiveFeedbackPercent"`
SellerUserName string `xml:"sellerUserName"`
TopRatedSeller bool `xml:"topRatedSeller"`
}
type SellingStatus struct {
BidCount int `xml:"bidCount"`
ConvertedCurrentPrice Price `xml:"convertedCurrentPrice"`
CurrentPrice Price `xml:"currentPrice"`
SellingState string `xml:"sellingState"`
TimeLeft string `xml:"timeLeft"`
}
type ShippingInfo struct {
ExpeditedShipping bool `xml:"expeditedShipping"`
OneDayShippingAvailable bool `xml:"oneDayShippingAvailable"`
HandlingTime int `xml:"handlingTime"`
ShippingServiceCost Price `xml:"shippingServiceCost"`
ShippingType string `xml:"shippingType"`
ShipToLocations []string `xml:"shipToLocations"`
}
type StoreInfo struct {
StoreName string `xml:"storeName"`
StoreURL string `xml:"storeURL"`
}
type UnitPriceInfo struct {
Quantity int64 `xml:"quantity"`
Type string `xml:"type"`
}