"""Schema for Rights Attributes.""" import marshmallow from marshmallow import fields from marshmallow import validate class TrackRightsAttributeBaseSchema(marshmallow.Schema): """Base Schema used track rights 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 TrackRightsAttributeUpsertSchema(marshmallow.Schema): """List of tuids to rights attribute IDs.""" items = fields.Nested(TrackRightsAttributeBaseSchema, many=True)