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
@@ -8,13 +8,15 @@ import (
|
||||
// Landing represents a landing page from the Yandex Music API.
|
||||
type Landing struct {
|
||||
BaseModel
|
||||
ID JSONID `json:"id"`
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
CoverURI string `json:"cover_uri"`
|
||||
Type string `json:"type"`
|
||||
Blocks []LandingBlock `json:"blocks"`
|
||||
Available bool `json:"available"`
|
||||
Pumpkin bool `json:"pumpkin"`
|
||||
ContentID string `json:"content_id"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Landing from JSON data.
|
||||
@@ -44,6 +46,12 @@ func (l *Landing) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
if v, ok := raw["available"]; ok {
|
||||
json.Unmarshal(v, &landing.Available)
|
||||
}
|
||||
if v, ok := raw["pumpkin"]; ok {
|
||||
json.Unmarshal(v, &landing.Pumpkin)
|
||||
}
|
||||
if v, ok := raw["content_id"]; ok {
|
||||
json.Unmarshal(v, &landing.ContentID)
|
||||
}
|
||||
|
||||
if v, ok := raw["blocks"]; ok {
|
||||
var blocks []LandingBlock
|
||||
|
||||
Reference in new issue
Block a user