"""Schema for Audio Attributes.""" import marshmallow from marshmallow import fields from marshmallow import validate class TrackAudioAttributeBaseSchema(marshmallow.Schema): """Base Schema used track audio attribute data.""" tuid = fields.Int(required=True) track_attributes = fields.List( fields.Int(), required=True) change_source = fields.Str(load_from='change_source', allow_none=True, required=False, validate=validate.Length(max=255)) class TrackAudioAttributeUpsertSchema(marshmallow.Schema): """List of tuids to audio attribute IDs.""" items = fields.Nested(TrackAudioAttributeBaseSchema, many=True)