option java_package = "ru.yandex.webmaster3.proto.dashboard.cache";

message RangeStatCache {
    optional int32 date_from                = 1;
    optional int32 date_to                  = 2;
    optional double value                   = 3;
    optional double difference              = 4;
}

message DatePoint {
    optional int32 time                     = 1;
    optional int64 value                    = 2;
}

message GroupHistoryDashboardCache {
    repeated GroupHistory histories         = 1;

    message GroupHistory {
        optional string group_id            = 1;
        optional int32 query_indicator      = 2;
        repeated RangeStatCache range_stat  = 3;
    }
}

message QueryListDashboardCache {
    repeated QueryStatistics queries        = 1;

    message QueryStatistics {
        optional int64 query_id             = 1;
        optional string query_text          = 2;
        repeated IndicatorStatistics indicators = 3;
    }

    message IndicatorStatistics {
        optional int32 query_indicator      = 1;
        repeated RangeStatCache range_stat  = 2;
    }
}

message SearchUrlHistoryCache {
    repeated SearchUrlHistory histories     = 1;

    message SearchUrlHistory {
        optional int32 indicator            = 1;
        repeated DatePoint data             = 2;
    }
}

message SearchUrlSamplesCache {
    repeated SearchUrlSample samples        = 1;

    message SearchUrlSample {
        optional string path                = 1;
        optional string url                 = 2;
        optional int32 last_access          = 3;
        optional int32 search_base_date     = 4;
        optional int32 event_type           = 5;
    }
}

message LinkExternalSamplesCache {
    repeated LinkSample samples             = 1;

    message LinkSample {
        optional string host_url            = 1;
        optional int32 host_url_last_access_date = 2;
        optional int32 host_http_code       = 3;
        optional string source_url          = 4;
        optional int32 source_http_code     = 5;
        optional int32 source_url_last_access_date = 6;
        optional int32 link_discover_date   = 7;

        optional string host_path           = 8;
        optional string host_id             = 9;
    }
}

message IndexingHistoryCache {
    repeated IndexingHistory histories      = 1;

    message IndexingHistory {
        optional int32 indicator            = 1;
        repeated DatePoint data             = 2;
    }
}

message IndexingIksHistoryCache {
    repeated DatePoint history              = 1;
}

message IndexingUrlsCountHistoryCache {
    repeated IndexingUrlsCountHistory histories = 1;

    message IndexingUrlsCountHistory {
        optional int32 indicator                = 1;
        repeated DatePoint data                 = 2;
    }
}

message IndexingEventSamplesCache {
    repeated IndexingEventSample samples = 1;
    required int64 total_count           = 2;
    message IndexingEventSample {
        required string url = 1;
        required int32 previous_code     = 2;
        required int32 current_code      = 3;
        required int64 last_access       = 4;
    }
}

message TurboCache {
    required bool turboOfferAccepted        = 1;
    required int64 autoparsedPagesCount     = 2;
    required bool autoparserEnabled         = 3;
    required bool hasTurboSources           = 4;
    required int64 turboPagesOnSearch       = 5;
    required int64 totalTurboPages          = 6;
    required int32 turboProblemsCount       = 7;
    required bool advertisementConfigured   = 8;
    required bool analyticsConfigured       = 9;
    required bool hasApiSources             = 10;
    required bool hasRssSources             = 11;
    required bool hasYmlSources             = 12;
    required bool autoRelatedEnabled        = 13;
    required int64 totalClicks              = 14;
    required int64 turboClicks              = 15;
    required int64 autoparsedClicks         = 16;
    required bool autoMordaAvailableButOff  = 17;
    required bool showYmlTeaser             = 18;
    required bool showShopTeaser            = 19;
    required bool showTeaserForStoreWithYmlFeedsWithoutTurbo            = 20;
    required bool showTeaserForNoStoreWithRssFeedsWithoutTurbo            = 21;
}
