syntax = "proto3";

package com.sonymusic.delphi.etl.apps.proto;

message AmazonAggregate {
    message DeviceType {
        /*
         * Field indicating type of device stream was made from
         */
        uint64 desktop = 1;
        uint64 cell_phone_app_mobile_web = 2;
        uint64 tablet_app = 3;
        uint64 in_dash_car_integration = 4;
        uint64 mobile_to_car_tether = 5;
        uint64 connected_home_tv = 6;
        uint64 connected_home_audio_tether = 7;
        uint64 gaming_system = 8;
        uint64 voice_controlled_device = 9;
        uint64 other = 10;
    }
    message Engagement {
        uint64 lean_forward = 1;
        uint64 lean_back = 2;
    }
    message OperatingSystem {
        /*
         * These were defined by getting the unique values from the data
         */
        uint64 alexa = 1;
        uint64 android = 2;
        uint64 fire_os = 3;
        uint64 ios = 4;
        uint64 mac_osx = 5;
        uint64 third_party_device_os = 6;
        uint64 unknown = 7;
        uint64 windows = 8;
    }
    message ReferralSourceType {
        /*
         * Referral source that drove the user to play the track (if any):
         * *other categories may be added over time to capture alternate referral sources.
         */
        uint64 websites_or_hyperlinks = 1;
        uint64 search_result = 2;
        uint64 promotional_marketing_inventory = 3;
        uint64 paid_promotion = 4;
        uint64 recommended_content_promotions = 5;
        uint64 not_available = 6;
    }
    message SelectionSourceType {
        /*
         * SME categories based on where in the client the stream was initiated
         * (to be amended and refined in partnership with provider)
         */
        uint64 album = 1;
        uint64 amf_station = 2;
        uint64 amf_station_seed = 3;
        uint64 artist = 4;
        uint64 auto_playlist = 5;
        uint64 custom_mix = 6;
        uint64 error = 7;
        uint64 genre = 8;
        uint64 gno_prime_playlist = 9;
        uint64 gno_unl_playlist = 10;
        uint64 golden_playlist = 11;
        uint64 prime_playlist = 12;
        uint64 prime_station = 13;
        uint64 prime_station_seed = 14;
        uint64 recently_added = 15;
        uint64 recently_played = 16;
        uint64 search = 17;
        uint64 shared_playlist = 18;
        uint64 similarity = 19;
        uint64 similarity_station = 20;
        uint64 songs = 21;
        uint64 station = 22;
        uint64 track = 23;
        uint64 undefined = 24;
        uint64 unknown = 25;
        uint64 unl_station_seed = 26;
        uint64 unlimited_playlist = 27;
        uint64 unlimited_station = 28;
        uint64 unlimited_station_se = 29;
        uint64 user_playlist = 30;
        uint64 personalize_playlist = 31;
    }
    message SubscriptionType {
        uint64 paid = 1;
        uint64 free = 2;
    }
}

message AmazonStreamStats {
    AmazonAggregate.DeviceType device_type = 1;
    AmazonAggregate.Engagement engagement = 2;
    AmazonAggregate.OperatingSystem operating_system = 3;
    AmazonAggregate.ReferralSourceType referral_source_type = 4;
    AmazonAggregate.SelectionSourceType selection_source_type = 5;
    AmazonAggregate.SubscriptionType subscription_type = 6;

    uint64 non_royalty_streams = 7;
    uint64 streams = 8;
}

message AmazonCountryStats {
    map<string, AmazonStreamStats> countries = 1;
}
