import "mapreduce/yt/interface/protos/extension.proto";

package NWebmaster.NUserSessions.NProto;

message TQuery {
    optional string Host                = 1 [(NYT.column_name) = "Host"];
    optional string Path                = 2 [(NYT.column_name) = "Path"];
    optional string Query               = 3 [(NYT.column_name) = "Query"];
    optional uint64 RegionId            = 4 [(NYT.column_name) = "RegionId"];
    optional uint64 Position            = 5 [(NYT.column_name) = "Position"];
    optional bool IsMobile              = 6 [(NYT.column_name) = "IsMobile"];
    optional bool IsPad                 = 7 [(NYT.column_name) = "IsPad"];
    //optional bool IsTurbo               = 8 [(NYT.column_name) = "IsTurbo"];
    optional uint64 Clicks              = 9 [(NYT.column_name) = "Clicks"];
    optional uint64 Shows               = 10 [(NYT.column_name) = "Shows"];
    optional uint64 TurboClicks         = 31 [(NYT.column_name) = "TurboClicks"];
    optional float Cm2                  = 11 [(NYT.column_name) = "Cm2"];
    optional bool IsNav                 = 12 [(NYT.column_name) = "IsNav"];
    optional uint64 RequestSource       = 13 [(NYT.column_name) = "RequestSource"];
    optional uint64 PageNo              = 14 [(NYT.column_name) = "PageNo"];
    optional string ReqID               = 15 [(NYT.column_name) = "ReqID"];
    optional string WebParentReqID      = 16 [(NYT.column_name) = "WebParentReqID"];
    optional string Referer             = 17 [(NYT.column_name) = "Referer"];
    optional uint64 ResultSource        = 18 [(NYT.column_name) = "ResultSource"];

    //https://wiki.yandex-team.ru/cookies/yandexuid/#format
    //https://wiki.yandex-team.ru/logs/usersessions/uidprefixes/
    optional string UID                     = 19 [(NYT.column_name) = "UID"];
    optional uint32 UIDAge                  = 20 [(NYT.column_name) = "UIDAge"];
    optional uint64 Timestamp               = 21 [(NYT.column_name) = "Timestamp"];

    optional uint32 IsMetrikaRobot          = 22 [(NYT.column_name) = "IsMetrikaRobot"];

    //https://a.yandex-team.ru/arc/trunk/arcadia/search/web/rearrange/porno/common/common.h?rev=4351857#L29-34
    // query type IDs
    //const double UNDEFINED_ID = -1.;
    //const double NORMAL_QUERY_ID = 6.;
    //const double PORNO_QUERY_ID = 100.;
    //const double GRAY_QUERY_ID = 3.;
    //const double FORCED_GRAY_QUERY_ID = 2.;
    //const double MEDICAL_QUERY_ID = 12.;
    optional int32 UpperPornoUpperPl        = 23 [(NYT.column_name) = "UpperPornoUpperPl"];

    optional string CorrectedQuery          = 24 [(NYT.column_name) = "CorrectedQuery"];
    optional bool IsMSP                     = 25 [(NYT.column_name) = "IsMSP"];
    optional bool IsReask                   = 26 [(NYT.column_name) = "IsReask"];    
}

message TStatistics {
    optional string Host                = 1 [(NYT.column_name) = "Host"];
    optional uint32 RegionId            = 2 [(NYT.column_name) = "RegionId"];
    optional uint32 Position            = 3 [(NYT.column_name) = "Position"];
    optional uint32 RequestSource       = 4 [(NYT.column_name) = "RequestSource"];
    optional uint32 ResultSource        = 5 [(NYT.column_name) = "ResultSource"];
    optional bool IsMobile              = 6 [(NYT.column_name) = "IsMobile"];
    optional bool IsPad                 = 7 [(NYT.column_name) = "IsPad"];
    optional uint64 Clicks              = 8 [(NYT.column_name) = "Clicks"];
    optional uint64 TurboClicks         = 9 [(NYT.column_name) = "TurboClicks"];
    optional uint64 Shows               = 10 [(NYT.column_name) = "Shows"];
}

message TUid {
    optional string UID                 = 1 [(NYT.column_name) = "UID"];
    optional uint64 Timestamp           = 2 [(NYT.column_name) = "Timestamp"];
}

message TMetrikaRobot {
    optional uint64 UserID              = 1 [(NYT.column_name) = "UserID"];
    optional uint32 UserIDType          = 2 [(NYT.column_name) = "UserIDType"];
    optional uint32 IsRobot             = 3 [(NYT.column_name) = "IsRobot"];
    optional uint32 Timestamp           = 4 [(NYT.column_name) = "Timestamp"];
}
