from marshmallow import Schema, fields from playlist.connectors.snowflake import SnowflakeQuery from playlist.queries.schema import ISRC class PlaylistPlacementSchema(Schema): isrc = ISRC(required=True) store_playlist_id = fields.Str(required=True) store_id = fields.Str(required=True) storefront = fields.Str(allow_none=True) class PlaylistPlacementStreamsOnDateQuerySchema(Schema): date = fields.Date(required=True) distributors = fields.List(fields.Str) stream_countries = fields.List(fields.Str) storefront_defined = fields.Boolean() permission_label_ids = fields.List(fields.Str) permission_subaccount_ids = fields.List(fields.Str) permission_label_participant_ids = fields.List(fields.Str) sound_recording_playlist_placements = fields.List( fields.Nested(PlaylistPlacementSchema) ) class PlaylistPlacementStreamsOnDateQuery(SnowflakeQuery): query_schema = PlaylistPlacementStreamsOnDateQuerySchema filename = "playlist_placement_streams_on_date.sql"