
interface GlobalParticipantAnalyticsSummaryItem {
    id: String!
    downloads: Long
    albumDownloads: Long
    trackDownloads: Long
    streams: Long
    saves: Long
    skips: Long
    skipRate: Float
    streamsStartDate: Date
    streamsEndDate: Date
    downloadsStartDate: Date
    downloadsEndDate: Date
}

type GlobalParticipantAnalyticsSummaryGenericItem implements GlobalParticipantAnalyticsSummaryItem {
    id: String!
    downloads: Long
    albumDownloads: Long
    trackDownloads: Long
    streams: Long
    saves: Long
    skips: Long
    skipRate: Float
    streamsStartDate: Date
    streamsEndDate: Date
    downloadsStartDate: Date
    downloadsEndDate: Date
}

type GlobalParticipantAnalyticsSummaryTrackItem implements GlobalParticipantAnalyticsSummaryItem {
    id: String!
    globalSoundRecording: GlobalSoundRecording!
    downloads: Long
    albumDownloads: Long
    trackDownloads: Long
    streams: Long
    saves: Long
    skips: Long
    skipRate: Float
    streamsStartDate: Date
    streamsEndDate: Date
    downloadsStartDate: Date
    downloadsEndDate: Date
}

type GlobalParticipantAnalyticsSummaryProductItem implements GlobalParticipantAnalyticsSummaryItem {
    id: String!
    product: Product!
    downloads: Long
    albumDownloads: Long
    trackDownloads: Long
    streams: Long
    saves: Long
    skips: Long
    skipRate: Float
    streamsStartDate: Date
    streamsEndDate: Date
    downloadsStartDate: Date
    downloadsEndDate: Date
}

type GlobalParticipantAnalyticsTimeseriesItem {
    id: String!
    date: Date!
    saves: Long
    skipRate: Float
    skips: Long
    value: Long
}

type GlobalParticipantAnalyticsSummary {
    items: [GlobalParticipantAnalyticsSummaryItem!]!
}

type GlobalParticipantAnalyticsTimeseries {
    items: [GlobalParticipantAnalyticsTimeseriesItem!]!
}

type GlobalParticipantAnalytics @key(fields: "globalParticipant { id }") {
    globalParticipant: GlobalParticipant!
    summary(type: GlobalParticipantAnalyticsSummaryType!, startDate: String, endDate: String, limit: Int, offset: Int, orderBy: String, orderDir: String, stores: [Int!], countries: [String!], distributors: String, streamSources: [StreamSourceFilter!]): GlobalParticipantAnalyticsSummary!
    timeseries(type: GlobalParticipantAnalyticsTimeseriesType!, resolution: String, ids:[String!], startDate: String, endDate: String, daysBack: Int, stores: [Int!], countries: [String!], distributors: String, streamSources: [StreamSourceFilter!]): GlobalParticipantAnalyticsTimeseries!
    demographicBreakdown(storeIds: [Int], countries: [String], startDate: String, days:Int, distributors: String): GlobalParticipantDemographics
    totalVsPlaylistStreamsByStore(startDate: String, days: Int, storeIds: [Int!], streamCountries: [String!]): TotalVsPlaylistStreamsByStore
    growthPeriods: [DeltaGrowth!]
    streamsAllTime(countries: [String!]): Long
    productDownloadsByCountry(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): ParticipantDownloadsByCountry!
    productDownloadsByStore(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): ParticipantDownloadsByStore!
    productDownloadsTotal(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): DownloadsTotal!
    trackStreamsTotal(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): StreamsTotal!
    trackStreamsByCountry(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): StreamsByCountry!
    trackStreamsBySoundRecording(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): TimeseriesBySoundRecording!
    trackStreamsBySourceOfStreams(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): StreamsBySourceOfStreams!
    trackStreamsByStore(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): TimeseriesByStore!
    trackDownloadsTotal(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): DownloadsTotal!
    trackDownloadsByCountry(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): ParticipantDownloadsByCountry!
    trackDownloadsBySoundRecording(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): DownloadsBySoundRecording!
    trackDownloadsByStore(storeIds: [Int!], countries: [String!], startDate: String, days: Int, distributors: String): ParticipantDownloadsByStore!
}
