-
Notifications
You must be signed in to change notification settings - Fork 0
/
struct_explore_tabs.go
328 lines (325 loc) · 14.8 KB
/
struct_explore_tabs.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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
package main
// Generated from https://mholt.github.io/json-to-go/
// ExploreTabs is the payload that comes back from the API call.
type ExploreTabs struct {
ExploreTabs []struct {
TabID string `json:"tab_id"`
TabName string `json:"tab_name"`
PaginationMetadata struct {
HasNextPage bool `json:"has_next_page"`
ItemsOffset int `json:"items_offset"`
SectionOffset int `json:"section_offset"`
SearchSessionID string `json:"search_session_id"`
} `json:"pagination_metadata"`
Sections []struct {
BackendSearchID string `json:"backend_search_id"`
DisplayType string `json:"display_type"`
ExperimentsMetadata []interface{} `json:"experiments_metadata"`
ResultType string `json:"result_type"`
SearchSessionID string `json:"search_session_id"`
SectionID string `json:"section_id"`
SectionTypeUID string `json:"section_type_uid"`
IsPaginated bool `json:"is_paginated"`
BankaiSectionID string `json:"bankai_section_id"`
Refinements []interface{} `json:"refinements"`
Messages []struct {
Style string `json:"style"`
Title string `json:"title"`
} `json:"messages,omitempty"`
ReviewItems []interface{} `json:"review_items"`
Breadcrumbs []interface{} `json:"breadcrumbs"`
SectionMetadata struct {
} `json:"section_metadata"`
NearbyLocations []interface{} `json:"nearby_locations"`
Title string `json:"title,omitempty"`
Listings []struct {
Listing ExploreTabsListing `json:"listing"`
PricingQuote struct {
CanInstantBook bool `json:"can_instant_book"`
MonthlyPriceFactor float64 `json:"monthly_price_factor"`
PriceString string `json:"price_string"`
Rate struct {
Amount float64 `json:"amount"`
AmountFormatted string `json:"amount_formatted"`
Currency string `json:"currency"`
IsMicrosAccuracy bool `json:"is_micros_accuracy"`
} `json:"rate"`
RateType string `json:"rate_type"`
RateWithServiceFee struct {
Amount float64 `json:"amount"`
AmountFormatted string `json:"amount_formatted"`
Currency string `json:"currency"`
IsMicrosAccuracy bool `json:"is_micros_accuracy"`
} `json:"rate_with_service_fee"`
WeeklyPriceFactor float64 `json:"weekly_price_factor"`
ShouldShowFromLabel bool `json:"should_show_from_label"`
} `json:"pricing_quote"`
Verified struct {
Enabled bool `json:"enabled"`
BadgeText string `json:"badge_text"`
BadgeSecondaryText string `json:"badge_secondary_text"`
KickerBadgeType string `json:"kicker_badge_type"`
} `json:"verified"`
VerifiedCard bool `json:"verified_card"`
} `json:"listings,omitempty"`
LocalizedListingCount string `json:"localized_listing_count,omitempty"`
} `json:"sections"`
ExperimentsMetadata []interface{} `json:"experiments_metadata"`
HomeTabMetadata struct {
UrgencyCommitment struct {
MessageType string `json:"message_type"`
Message struct {
} `json:"message"`
} `json:"urgency_commitment"`
GoldenTicketUrgencyCommitment struct {
MessageType string `json:"message_type"`
Message struct {
} `json:"message"`
} `json:"golden_ticket_urgency_commitment"`
ListingCardsUrgencyCommitmentMetadata []interface{} `json:"listing_cards_urgency_commitment_metadata"`
ListingCardsPriceLineUrgencyCommitmentMetadata []interface{} `json:"listing_cards_price_line_urgency_commitment_metadata"`
Messages struct {
} `json:"messages"`
Facets struct {
} `json:"facets"`
Overrides struct {
} `json:"overrides"`
SearchFeedItems []interface{} `json:"search_feed_items"`
RemarketingIds []int `json:"remarketing_ids"`
Location struct {
CanonicalLocation string `json:"canonical_location"`
DisplayLocation string `json:"display_location"`
} `json:"location"`
Breadcrumbs []struct {
LocationName string `json:"location_name"`
CanonicalLocationName string `json:"canonical_location_name"`
Type string `json:"type"`
} `json:"breadcrumbs"`
ListingsCount int `json:"listings_count"`
Search struct {
NativeCurrency string `json:"native_currency"`
PriceRangeMaxNative int `json:"price_range_max_native"`
PriceRangeMinNative int `json:"price_range_min_native"`
PriceType string `json:"price_type"`
SearchID string `json:"search_id"`
MobileSessionID string `json:"mobile_session_id"`
IsBusinessTravelVerified bool `json:"is_business_travel_verified"`
BusinessTravelReadyData struct {
FilterCriteria struct {
} `json:"filter_criteria"`
ShowBtrUpsell bool `json:"show_btr_upsell"`
} `json:"business_travel_ready_data"`
Limit int `json:"limit"`
} `json:"search"`
Geography struct {
Accuracy int `json:"accuracy"`
City string `json:"city"`
CountryCode string `json:"country_code"`
Country string `json:"country"`
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
PlaceID string `json:"place_id"`
Precision string `json:"precision"`
ResultType string `json:"result_type"`
State string `json:"state"`
StateShort string `json:"state_short"`
ExtendedPrecision string `json:"extended_precision"`
FullAddress string `json:"full_address"`
Market string `json:"market"`
Province string `json:"province"`
Zip string `json:"zip"`
} `json:"geography"`
PriceHistogram struct {
AveragePrice int `json:"average_price"`
Histogram []int `json:"histogram"`
} `json:"price_histogram"`
Filters struct {
Sections []struct {
Items []struct {
Selected bool `json:"selected"`
Type string `json:"type"`
Title string `json:"title"`
Params []struct {
Key string `json:"key"`
Delete bool `json:"delete"`
InvisibleToUser bool `json:"invisible_to_user"`
ValueType string `json:"value_type"`
} `json:"params"`
} `json:"items"`
Selected bool `json:"selected"`
Title string `json:"title,omitempty"`
FilterBarTitle string `json:"filter_bar_title,omitempty"`
FilterSectionID string `json:"filter_section_id"`
BarItems []interface{} `json:"bar_items"`
CollapseState string `json:"collapse_state,omitempty"`
Subsections []interface{} `json:"subsections"`
ExperimentsMetadata []interface{} `json:"experiments_metadata"`
CollapseSubtitle string `json:"collapse_subtitle,omitempty"`
CollapseSelectedSubtitles []interface{} `json:"collapse_selected_subtitles,omitempty"`
ExpandText string `json:"expand_text,omitempty"`
CollapseText string `json:"collapse_text,omitempty"`
} `json:"sections"`
MoreFiltersButton struct {
Text string `json:"text"`
Verified bool `json:"verified"`
BgColor string `json:"bg_color"`
} `json:"more_filters_button"`
FilterBarOrdering struct {
Default []string `json:"default"`
Small []string `json:"small"`
Medium []string `json:"medium"`
} `json:"filter_bar_ordering"`
MoreFiltersOrdering struct {
Default []string `json:"default"`
Small []string `json:"small"`
Medium []string `json:"medium"`
} `json:"more_filters_ordering"`
MoreFiltersCounts struct {
Default int `json:"default"`
Small int `json:"small"`
Medium int `json:"medium"`
} `json:"more_filters_counts"`
FilterBarCounts struct {
Default []int `json:"default"`
Small []int `json:"small"`
Medium []int `json:"medium"`
} `json:"filter_bar_counts"`
ShowLeftFiltersPanel bool `json:"show_left_filters_panel"`
EligibleForLeftFiltersPanel bool `json:"eligible_for_left_filters_panel"`
} `json:"filters"`
} `json:"home_tab_metadata"`
} `json:"explore_tabs"`
Metadata struct {
CurrentTabID string `json:"current_tab_id"`
RequestUUID string `json:"request_uuid"`
SearchID string `json:"search_id"`
Query string `json:"query"`
QueryText string `json:"query_text"`
CurrentRefinementPaths []string `json:"current_refinement_paths"`
FederatedSearchID string `json:"federated_search_id"`
FederatedSearchSessionID string `json:"federated_search_session_id"`
Suggestions []interface{} `json:"suggestions"`
HasMap bool `json:"has_map"`
ShowAsHint bool `json:"show_as_hint"`
MarqueeMode string `json:"marquee_mode"`
SatoriVersion string `json:"satori_version"`
GtmExperiments []interface{} `json:"gtm_experiments"`
SavedSearchResponses []interface{} `json:"saved_search_responses"`
MapToggle bool `json:"map_toggle"`
PriceDisplayStrategy string `json:"price_display_strategy"`
SatoriConfig struct {
Market string `json:"market"`
StateCode string `json:"state_code"`
CountryCode string `json:"country_code"`
RegionID int `json:"region_id"`
Version string `json:"version"`
} `json:"satori_config"`
PageMetadata struct {
PageTitle string `json:"page_title"`
RenderType string `json:"render_type"`
CanonicalURL string `json:"canonical_url"`
LocationQuery bool `json:"location_query"`
} `json:"page_metadata"`
ExploreMapMetadata struct {
Pins []interface{} `json:"pins"`
Type string `json:"type"`
} `json:"explore_map_metadata"`
Geography struct {
Accuracy int `json:"accuracy"`
City string `json:"city"`
CountryCode string `json:"country_code"`
Country string `json:"country"`
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
PlaceID string `json:"place_id"`
Precision string `json:"precision"`
ResultType string `json:"result_type"`
State string `json:"state"`
StateShort string `json:"state_short"`
ExtendedPrecision string `json:"extended_precision"`
FullAddress string `json:"full_address"`
Market string `json:"market"`
Province string `json:"province"`
Zip string `json:"zip"`
} `json:"geography"`
RefinementDisplayText string `json:"refinement_display_text"`
} `json:"metadata"`
}
// ExploreTabsListing is the listing information we care about
type ExploreTabsListing struct {
Badges []interface{} `json:"badges"`
BathroomLabel string `json:"bathroom_label"`
Bathrooms float64 `json:"bathrooms"`
BedLabel string `json:"bed_label"`
BedroomLabel string `json:"bedroom_label"`
Bedrooms int `json:"bedrooms"`
Beds int `json:"beds"`
City string `json:"city"`
GuestLabel string `json:"guest_label"`
HostLanguages []interface{} `json:"host_languages"`
HostThumbnailURLSmall string `json:"host_thumbnail_url_small"`
HostThumbnailURL string `json:"host_thumbnail_url"`
ID int `json:"id"`
IsBusinessTravelReady bool `json:"is_business_travel_ready"`
IsFullyRefundable bool `json:"is_fully_refundable"`
IsHostHighlyRated bool `json:"is_host_highly_rated"`
IsNewListing bool `json:"is_new_listing"`
IsSuperhost bool `json:"is_superhost"`
KickerContent struct {
Messages []string `json:"messages"`
TextColor string `json:"text_color"`
} `json:"kicker_content"`
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
LocalizedCity string `json:"localized_city"`
Name string `json:"name"`
PersonCapacity int `json:"person_capacity"`
PictureCount int `json:"picture_count"`
PictureURL string `json:"picture_url"`
PictureUrls []string `json:"picture_urls"`
Picture struct {
ID int `json:"id"`
DominantSaturatedColor string `json:"dominant_saturated_color"`
LargeRo string `json:"large_ro"`
Picture string `json:"picture"`
PreviewEncodedPng string `json:"preview_encoded_png"`
SaturatedA11YDarkColor string `json:"saturated_a11y_dark_color"`
ScrimColor string `json:"scrim_color"`
} `json:"picture"`
PreviewAmenities string `json:"preview_amenities"`
PreviewEncodedPng string `json:"preview_encoded_png"`
PropertyTypeID int `json:"property_type_id"`
ReviewsCount int `json:"reviews_count"`
RoomAndPropertyType string `json:"room_and_property_type"`
RoomTypeCategory string `json:"room_type_category"`
RoomType string `json:"room_type"`
ScrimColor string `json:"scrim_color"`
ShowStructuredName bool `json:"show_structured_name"`
SpaceType string `json:"space_type"`
StarRating float64 `json:"star_rating"`
TierID int `json:"tier_id"`
User struct {
FirstName string `json:"first_name"`
HasProfilePic bool `json:"has_profile_pic"`
ID int `json:"id"`
IsSuperhost bool `json:"is_superhost"`
PictureURL string `json:"picture_url"`
SmartName string `json:"smart_name"`
ThumbnailURL string `json:"thumbnail_url"`
} `json:"user"`
WideKickerContent struct {
Messages []string `json:"messages"`
TextColor string `json:"text_color"`
} `json:"wide_kicker_content"`
NeighborhoodOverview string `json:"neighborhood_overview"`
PublicAddress string `json:"public_address"`
SeoReviews []interface{} `json:"seo_reviews"`
Space string `json:"space"`
Summary string `json:"summary"`
AmenityIds []int `json:"amenity_ids"`
PreviewAmenityNames []string `json:"preview_amenity_names"`
Reviews []interface{} `json:"reviews"`
StarRatingColor string `json:"star_rating_color"`
PreviewTags []interface{} `json:"preview_tags"`
AvgRating float64 `json:"avg_rating"`
}