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
@@ -12,8 +12,11 @@ type Label struct {
|
||||
Name string `json:"name"`
|
||||
CoverURI string `json:"cover_uri"`
|
||||
Description string `json:"description"`
|
||||
DescriptionFormatted string `json:"description_formatted"`
|
||||
Image string `json:"image"`
|
||||
Website string `json:"website"`
|
||||
SocialLinks []SocialLink `json:"social_links"`
|
||||
Links []Link `json:"links"`
|
||||
Type string `json:"type"`
|
||||
Available bool `json:"available"`
|
||||
Owner *User `json:"owner"`
|
||||
}
|
||||
@@ -45,10 +48,19 @@ func (l *Label) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
if v, ok := raw["available"]; ok {
|
||||
json.Unmarshal(v, &label.Available)
|
||||
}
|
||||
if v, ok := raw["social_links"]; ok {
|
||||
var links []SocialLink
|
||||
if v, ok := raw["description_formatted"]; ok {
|
||||
json.Unmarshal(v, &label.DescriptionFormatted)
|
||||
}
|
||||
if v, ok := raw["image"]; ok {
|
||||
json.Unmarshal(v, &label.Image)
|
||||
}
|
||||
if v, ok := raw["links"]; ok {
|
||||
var links []Link
|
||||
json.Unmarshal(v, &links)
|
||||
label.SocialLinks = links
|
||||
label.Links = links
|
||||
}
|
||||
if v, ok := raw["type"]; ok {
|
||||
json.Unmarshal(v, &label.Type)
|
||||
}
|
||||
if v, ok := raw["owner"]; ok {
|
||||
var user User
|
||||
|
||||
Reference in new issue
Block a user