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,7 +8,7 @@ import (
|
||||
// Pin represents a pin from the Yandex Music API.
|
||||
type Pin struct {
|
||||
BaseModel
|
||||
ID JSONID `json:"id"`
|
||||
ID JSONID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Image string `json:"image"`
|
||||
@@ -21,6 +21,7 @@ type Pin struct {
|
||||
CreatedAt string `json:"created_at"`
|
||||
ExpiresAt string `json:"expires_at"`
|
||||
Active bool `json:"active"`
|
||||
ContentRestrictions *ContentRestrictions `json:"content_restrictions"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Pin from JSON data.
|
||||
@@ -59,6 +60,11 @@ func (p *Pin) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
if v, ok := raw["active"]; ok {
|
||||
json.Unmarshal(v, &pin.Active)
|
||||
}
|
||||
if v, ok := raw["content_restrictions"]; ok {
|
||||
var cr ContentRestrictions
|
||||
json.Unmarshal(v, &cr)
|
||||
pin.ContentRestrictions = &cr
|
||||
}
|
||||
|
||||
if v, ok := raw["track"]; ok {
|
||||
var track Track
|
||||
|
||||
Reference in new issue
Block a user