Add missing model fields from Python reference
Feed: Added can_get_more_events, pumpkin, is_wizard_passed, headlines, today, next_revision Label: Added description_formatted, image, links ([]Link), type Landing: Added pumpkin, content_id Pin: Added content_restrictions Search: Added search_request_id, text, best, podcasts, podcast_episodes, clips, banner, page, per_page, misspell fields Clip: Rewrote with all missing fields (version, player_id, uuid, thumbnail, track_ids, disclaimers, explicit, cover, content_restrictions) Concert: Added datetime, afisha_url, city, place, address, content_rating, data_session_id, event_info
This commit is contained in:
1 parent
bc026d82b4
commit
463e0bcd1a
7 files changed
+198
-95
No files matched your search
+51
-19
@@ -8,25 +8,33 @@ import (
|
||||
// Concert represents a concert from the Yandex Music API.
|
||||
type Concert struct {
|
||||
BaseModel
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Date string `json:"date"`
|
||||
Time string `json:"time"`
|
||||
Venue *ConcertVenue `json:"venue"`
|
||||
Location *ConcertLocation `json:"location"`
|
||||
MinPrice int `json:"min_price"`
|
||||
MaxPrice int `json:"max_price"`
|
||||
Currency string `json:"currency"`
|
||||
TicketURI string `json:"ticket_uri"`
|
||||
ImageURI string `json:"image_uri"`
|
||||
Available bool `json:"available"`
|
||||
SoldOut bool `json:"sold_out"`
|
||||
Artists []Artist `json:"artists"`
|
||||
Genres []string `json:"genres"`
|
||||
Cashback *ConcertCashback `json:"cashback"`
|
||||
Tabs []ConcertTabConfig `json:"tabs"`
|
||||
Skeleton *ConcertSkeleton `json:"skeleton"`
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Date string `json:"date"`
|
||||
Time string `json:"time"`
|
||||
Datetime string `json:"datetime"`
|
||||
Venue *ConcertVenue `json:"venue"`
|
||||
Location *ConcertLocation `json:"location"`
|
||||
MinPrice int `json:"min_price"`
|
||||
MaxPrice int `json:"max_price"`
|
||||
Currency string `json:"currency"`
|
||||
TicketURI string `json:"ticket_uri"`
|
||||
ImageURI string `json:"image_uri"`
|
||||
Available bool `json:"available"`
|
||||
SoldOut bool `json:"sold_out"`
|
||||
Artists []Artist `json:"artists"`
|
||||
Genres []string `json:"genres"`
|
||||
Cashback *ConcertCashback `json:"cashback"`
|
||||
Tabs []ConcertTabConfig `json:"tabs"`
|
||||
Skeleton *ConcertSkeleton `json:"skeleton"`
|
||||
AfishaURL string `json:"afisha_url"`
|
||||
City string `json:"city"`
|
||||
Place string `json:"place"`
|
||||
Address string `json:"address"`
|
||||
ContentRating string `json:"content_rating"`
|
||||
DataSessionID string `json:"data_session_id"`
|
||||
EventInfo *ConcertEventInfo `json:"event_info"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Concert from JSON data.
|
||||
@@ -77,6 +85,30 @@ func (c *Concert) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
if v, ok := raw["genres"]; ok {
|
||||
json.Unmarshal(v, &concert.Genres)
|
||||
}
|
||||
if v, ok := raw["datetime"]; ok {
|
||||
json.Unmarshal(v, &concert.Datetime)
|
||||
}
|
||||
if v, ok := raw["afisha_url"]; ok {
|
||||
json.Unmarshal(v, &concert.AfishaURL)
|
||||
}
|
||||
if v, ok := raw["city"]; ok {
|
||||
json.Unmarshal(v, &concert.City)
|
||||
}
|
||||
if v, ok := raw["place"]; ok {
|
||||
json.Unmarshal(v, &concert.Place)
|
||||
}
|
||||
if v, ok := raw["address"]; ok {
|
||||
json.Unmarshal(v, &concert.Address)
|
||||
}
|
||||
if v, ok := raw["content_rating"]; ok {
|
||||
json.Unmarshal(v, &concert.ContentRating)
|
||||
}
|
||||
if v, ok := raw["data_session_id"]; ok {
|
||||
json.Unmarshal(v, &concert.DataSessionID)
|
||||
}
|
||||
if v, ok := raw["event_info"]; ok {
|
||||
json.Unmarshal(v, &concert.EventInfo)
|
||||
}
|
||||
|
||||
if v, ok := raw["venue"]; ok {
|
||||
var venue ConcertVenue
|
||||
|
||||
Reference in new issue
Block a user