-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathresponse.go
240 lines (214 loc) · 10.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
// Copyright 2023 Matthew P. Dargan.
// SPDX-License-Identifier: Apache-2.0
package ebay
import "time"
// FindItemsAdvancedResponse represents the response from [FindingClient.FindItemsAdvanced].
type FindItemsAdvancedResponse struct {
ItemsResponse []FindItemsResponse `json:"findItemsAdvancedResponse"`
}
// FindItemsByCategoryResponse represents the response from [FindingClient.FindItemsByCategory].
type FindItemsByCategoryResponse struct {
ItemsResponse []FindItemsResponse `json:"findItemsByCategoryResponse"`
}
// FindItemsByKeywordsResponse represents the response from [FindingClient.FindItemsByKeywords].
type FindItemsByKeywordsResponse struct {
ItemsResponse []FindItemsResponse `json:"findItemsByKeywordsResponse"`
}
// FindItemsByProductResponse represents the response from [FindingClient.FindItemsByProduct].
type FindItemsByProductResponse struct {
ItemsResponse []FindItemsResponse `json:"findItemsByProductResponse"`
}
// FindItemsInEBayStoresResponse represents the response from [FindingClient.FindItemsInEBayStores].
type FindItemsInEBayStoresResponse struct {
ItemsResponse []FindItemsResponse `json:"findItemsIneBayStoresResponse"`
}
// FindItemsResponse represents the base response container for all Finding Service operations.
//
// See [BaseServiceResponse] for details about generic response fields.
// See [BaseFindingServiceResponse] for details about fields specific to the Finding API.
//
// [BaseServiceResponse]: https://developer.ebay.com/Devzone/finding/CallRef/types/BaseServiceResponse.html
// [BaseFindingServiceResponse]: https://developer.ebay.com/Devzone/finding/CallRef/types/BaseFindingServiceResponse.html
type FindItemsResponse struct {
Ack []string `json:"ack"`
ErrorMessage []ErrorMessage `json:"errorMessage"`
ItemSearchURL []string `json:"itemSearchURL"`
PaginationOutput []PaginationOutput `json:"paginationOutput"`
SearchResult []SearchResult `json:"searchResult"`
Timestamp []time.Time `json:"timestamp"`
Version []string `json:"version"`
}
// ErrorMessage is a message containing information regarding an error or warning that occurred
// when eBay processed the request. It is not returned when the ack value is Success.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/ErrorMessage.html.
type ErrorMessage struct {
Error []ErrorData `json:"error"`
}
// ErrorData represents error details.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/ErrorData.html.
type ErrorData struct {
Category []string `json:"category"`
Domain []string `json:"domain"`
ErrorID []string `json:"errorId"`
ExceptionID []string `json:"exceptionId"`
Message []string `json:"message"`
Parameter []string `json:"parameter"`
Severity []string `json:"severity"`
Subdomain []string `json:"subdomain"`
}
// PaginationOutput represents the pagination data for an item search.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/PaginationOutput.html.
type PaginationOutput struct {
EntriesPerPage []string `json:"entriesPerPage"`
PageNumber []string `json:"pageNumber"`
TotalEntries []string `json:"totalEntries"`
TotalPages []string `json:"totalPages"`
}
// SearchResult represents returned item listings, if any.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/SearchResult.html.
type SearchResult struct {
Count string `json:"@count"`
Item []SearchItem `json:"item"`
}
// SearchItem represents the data of a single item that matches the search criteria.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/SearchItem.html.
type SearchItem struct {
AutoPay []string `json:"autoPay"`
CharityID []string `json:"charityId"`
Compatibility []string `json:"compatibility"`
Condition []Condition `json:"condition"`
Country []string `json:"country"`
DiscountPriceInfo []DiscountPriceInfo `json:"discountPriceInfo"`
Distance []Distance `json:"distance"`
EBayPlusEnabled []string `json:"eBayPlusEnabled"`
EekStatus []string `json:"eekStatus"`
GalleryInfoContainer []GalleryURL `json:"galleryInfoContainer"`
GalleryPlusPictureURL []string `json:"galleryPlusPictureURL"`
GalleryURL []string `json:"galleryURL"`
GlobalID []string `json:"globalId"`
IsMultiVariationListing []string `json:"isMultiVariationListing"`
ItemID []string `json:"itemId"`
ListingInfo []ListingInfo `json:"listingInfo"`
Location []string `json:"location"`
PaymentMethod []string `json:"paymentMethod"`
PictureURLLarge []string `json:"pictureURLLarge"`
PictureURLSuperSize []string `json:"pictureURLSuperSize"`
PostalCode []string `json:"postalCode"`
PrimaryCategory []Category `json:"primaryCategory"`
ProductID []ProductID `json:"productId"`
ReturnsAccepted []string `json:"returnsAccepted"`
SecondaryCategory []Category `json:"secondaryCategory"`
SellerInfo []SellerInfo `json:"sellerInfo"`
SellingStatus []SellingStatus `json:"sellingStatus"`
ShippingInfo []ShippingInfo `json:"shippingInfo"`
StoreInfo []Storefront `json:"storeInfo"`
Subtitle []string `json:"subtitle"`
Title []string `json:"title"`
TopRatedListing []string `json:"topRatedListing"`
UnitPrice []UnitPriceInfo `json:"unitPrice"`
ViewItemURL []string `json:"viewItemURL"`
}
// Condition describes an item's condition.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/Condition.html.
type Condition struct {
ConditionDisplayName []string `json:"conditionDisplayName"`
ConditionID []string `json:"conditionId"`
}
// DiscountPriceInfo clarifies the discount treatment of an item that a seller can list.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/DiscountPriceInfo.html.
type DiscountPriceInfo struct {
MinimumAdvertisedPriceExposure []string `json:"minimumAdvertisedPriceExposure"`
OriginalRetailPrice []Price `json:"originalRetailPrice"`
PricingTreatment []string `json:"pricingTreatment"`
SoldOffEbay []string `json:"soldOffEbay"`
SoldOnEbay []string `json:"soldOnEbay"`
}
// Price specifies a monetary amount.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/Amount.html.
type Price struct {
CurrencyID string `json:"@currencyId"`
Value string `json:"__value__"`
}
// Distance is the distance that the item is from the buyer, calculated using buyerPostalCode.
// The unit for distance varies by site, and is either miles or kilometers.
//
// This value is only returned for distance-based searches which involves specifying a buyerPostalCode
// and either sort by Distance, or use a combination of the MaxDistance LocalSearch itemFilters.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/Distance.html.
type Distance struct {
Unit string `json:"@unit"`
Value string `json:"__value__"`
}
// GalleryURL is the URL for the Gallery thumbnail image.
// This value is only returned if the seller uploaded images for the item or
// the item was listed using a product identifier.
type GalleryURL struct {
GallerySize string `json:"@gallerySize"`
Value string `json:"__value__"`
}
// ListingInfo represents information specific to an item listing.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/ListingInfo.html.
type ListingInfo struct {
BestOfferEnabled []string `json:"bestOfferEnabled"`
BuyItNowAvailable []string `json:"buyItNowAvailable"`
BuyItNowPrice []Price `json:"buyItNowPrice"`
ConvertedBuyItNowPrice []Price `json:"convertedBuyItNowPrice"`
EndTime []time.Time `json:"endTime"`
Gift []string `json:"gift"`
ListingType []string `json:"listingType"`
StartTime []time.Time `json:"startTime"`
WatchCount []string `json:"watchCount"`
}
// Category represents details about a category.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/Category.html.
type Category struct {
CategoryID []string `json:"categoryId"`
CategoryName []string `json:"categoryName"`
}
// ProductID represents the unique identifier for a single product.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/ProductId.html.
type ProductID struct {
Type string `json:"@type"`
Value string `json:"__value__"`
}
// SellerInfo represents information about a listing's seller.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/SellerInfo.html.
type SellerInfo struct {
FeedbackRatingStar []string `json:"feedbackRatingStar"`
FeedbackScore []string `json:"feedbackScore"`
PositiveFeedbackPercent []string `json:"positiveFeedbackPercent"`
SellerUserName []string `json:"sellerUserName"`
TopRatedSeller []string `json:"topRatedSeller"`
}
// SellingStatus represents an item's selling details.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/SellingStatus.html.
type SellingStatus struct {
BidCount []string `json:"bidCount"`
ConvertedCurrentPrice []Price `json:"convertedCurrentPrice"`
CurrentPrice []Price `json:"currentPrice"`
SellingState []string `json:"sellingState"`
TimeLeft []string `json:"timeLeft"`
}
// ShippingInfo represents an item's shipping details.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/ShippingInfo.html.
type ShippingInfo struct {
ExpeditedShipping []string `json:"expeditedShipping"`
HandlingTime []string `json:"handlingTime"`
IntermediatedShipping []string `json:"intermediatedShipping"`
OneDayShippingAvailable []string `json:"oneDayShippingAvailable"`
ShippingServiceCost []Price `json:"shippingServiceCost"`
ShippingType []string `json:"shippingType"`
ShipToLocations []string `json:"shipToLocations"`
}
// Storefront denotes whether the item is a storefront listing.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/Storefront.html.
type Storefront struct {
StoreName []string `json:"storeName"`
StoreURL []string `json:"storeURL"`
}
// UnitPriceInfo represents the type (e.g kg,lb) and quantity of a unit.
// See https://developer.ebay.com/Devzone/finding/CallRef/types/UnitPriceInfo.html.
type UnitPriceInfo struct {
Quantity []string `json:"quantity"`
Type []string `json:"type"`
}