"""Schemas for top sound recordings endpoint.""" from marshmallow import fields from analytics.schemas.common import BaseSchema, SourceSchema class TopSoundRecordingItemSchema(BaseSchema): """Marshmallow schema for a items in a list of top sound recordings.""" isrc = fields.String() streams = fields.Integer() growth_percentage = fields.Float(data_key="growth_percentage") class TopSoundRecordingsSchema(BaseSchema): """Marshmallow schema for the list of top sound recordings.""" items = fields.Nested(nested=TopSoundRecordingItemSchema, many=True) sources = fields.Nested(SourceSchema, many=True)