"""Participant Activity schema.""" from marshmallow import Schema, fields, validate class SocialSpike(Schema): """Schema for generic participant event. Properties: - timestamp (str): ISO formatted datetime string - new_followers (int): number of follower increase - chartmetric_id (int): chartmetric artist identifier - network (string): social network that was event origin """ date = fields.DateTime(required=True, format='%Y-%m-%d') new_followers = fields.Integer(required=True) chartmetric_id = fields.Integer(required=True) network = fields.String( required=True, validate=validate.OneOf(['twitter', 'instagram', 'youtube']) )