syntax = "proto3";
package apple_poc;

message Apple {
    /*
     * For details, see:
     * Detailed Stream Reports: https://help.apple.com/itc/musicsalesandtrends/#/itc1f31430ac
     */
    enum ContainerSubType {
        /*
         * The type of playlist or radio station from which the play occurred, providing
         * further detail beyond the existing Container Type field. Possible values include:
         * 0 = Not applicable
         * 1 = Private User Playlist
         * 2 = Editorial Playlist
         * 3 = Artist Playlist
         * 4 = Curator Playlist
         * 5 = Seeded by Artist/Song
         * 6 = Format Station
         * 7 = Editorial Station
         * 8 = Personal Mix Playlist
         * 9 = New Music Mix
         * 10 = Favorites Mix
         * 11 = Chill Mix
         * Note: there is no #12 here (also missing in the Apple docs)
         * 13 = Friends Mix
         * 14 = Algorithm Station
         * 15 = Replay Mix
         */
        NOT_APPLICABLE = 0;
        PRIVATE_USER_PLAYLIST = 1;
        EDITORIAL_PLAYLIST = 2;
        ARTIST_PLAYLIST = 3;
        CURATOR_PLAYLIST = 4;
        SEEDED_BY_ARTIST_SONG = 5;
        FORMAT_STATION = 6;
        EDITORIAL_STATION = 7;
        PERSONAL_MIX_PLAYLIST = 8;
        NEW_MUSIC_MIX = 9;
        FAVORITES_MIX = 10;
        CHILL_MIX = 11;
        // Note there is no #12 here (as per the Apple docs)
        FRIENDS_MIX = 13;
        ALGORITHM_STATION = 14;
        REPLAY_MIX = 15;
    }
    enum ContainerType {
        /*
         * Indicates the context from which the play originated. Possible values include:
         * 0 = Single Track
         * 1 = Radio station
         * 2 = Playlist
         * 3 = Album
         */
        SINGLE_TRACK = 0;
        RADIO_STATION = 1;
        PLAYLIST = 2;
        ALBUM = 3;
    }
    enum DeviceType {
        /*
         * The type of device where the event occurred. Possible values include:
         * 0 = Other
         * 1 = Mobile (such as an iPhone, iPad, or iPod touch)
         * 2 = Desktop (such as an iMac or MacBook)
         */
        OTHER = 0;
        MOBILE = 1;
        DESKTOP = 2;
    }
    enum OperatingSystem {
        /*
         * The operating system of the device on which the play occurred. Possible values include:
         * 0 = Other
         * 1 = iOS
         * 2 = Macintosh
         * 3 = Android
         * 4 = Windows
         * 5 = tvOS
         * 6 = Sonos
         */
        OTHER = 0;
        IOS = 1;
        MACINTOSH = 2;
        ANDROID = 3;
        WINDOWS = 4;
        TV_OS = 5;
        SONOS = 6;
    }
    enum Source {
        /*
         * Indicates where the play originated in the app. Possible values include:
         * 0 = Other
         * 1 = Library
         * 2 = Search
         * 3 = Discovery
         * 4 = MusicKit
         * 5 = External
         * 6 = Now Playing
         */
        OTHER = 0;
        LIBRARY = 1;
        SEARCH = 2;
        DISCOVERY = 3;
        MUSIC_KIT = 4;
        EXTERNAL = 5;
        NOW_PLAYING = 6;
    }
}

message AppleTrackStream {
    Apple.ContainerSubType container_sub_type = 1;
    Apple.ContainerType container_type = 2;
    Apple.DeviceType device_type = 3;
    Apple.OperatingSystem operating_system = 4;
    Apple.Source source = 5;
}
