option java_package = "ru.yandex.webmaster3.proto.searchquery.download";

import "wmconsole/backend/java/webmaster3-proto/internal/src/main/proto_internal/webmaster_common_proto.proto";

message CSVRequest {
    optional string host_id = 1;
    optional int64 user_id = 2;
    optional bytes user_ip = 3;
    optional string balancer_request_id = 4;
    optional CSVMode csv_mode = 5;
    optional int32 request_date = 6;

    optional int32 date_from = 20;
    optional int32 date_to = 21;
    optional int32 aggregate_period = 22;

    repeated int32 regions = 30;
    optional int32 region_inclusion = 31;

    repeated int32 indicators = 40;

    // group params
    optional UUID group_id = 50;

    // query params
    optional int64 query_id = 60;

    // ordering
    optional int32 order_by = 70;
    optional int32 order_direction = 71;

    enum CSVMode {
        // groups
        ALL_GROUPS__SELECTED_INDICATORS__WHOLE_PERIOD = 0;
        ALL_GROUPS__ONE_INDICATOR__BY_DATES = 1;
        ONE_GROUP__ALL_INDICATORS__BY_DATES = 2;

        // queries
        ALL_QUERIES__SELECTED_INDICATORS__WHOLE_PERIOD = 20;
        ALL_QUERIES__ONE_INDICATOR__BY_DATES = 21;
        ONE_QUERY__ALL_INDICATORS__BY_DATES = 22;
    }
}
