syntax = "proto3";

package filter_list_manager;

option java_multiple_files = false;
option java_package = "com.adguard.flm.protobuf";
option java_outer_classname = "OuterError";

message AGOuterError {
  string message = 1;
  oneof error {
    CannotOpenDatabase cannot_open_database = 2;
    NotADatabase not_a_database = 3;
    DatabaseBusy database_busy = 4;
    DiskFull disk_full = 5;
    EntityNotFound entity_not_found = 6;
    PathNotFound path_not_found = 7;
    PathHasDeniedPermission path_has_denied_permission = 8;
    PathAlreadyExists path_already_exists = 9;
    TimedOut timed_out = 10;
    HttpClientNetworkError http_client_network_error = 11;
    HttpStrict200Response http_strict_200_response = 12;
    HttpClientBodyRecoveryFailed http_client_body_recovery_failed = 13;
    FilterContentIsLikelyNotAFilter filter_content_is_likely_not_a_filter = 14;
    FilterParserError filter_parser_error = 15;
    FieldIsEmpty field_is_empty = 16;
    Mutex mutex = 17;
    InvalidConfiguration invalid_configuration = 18;
    Other other = 19;
    FilterIntegrityCheckFailed filter_integrity_check_failed = 20;
  }
}

message CannotOpenDatabase {}

message NotADatabase {}

message DiskFull {}

message DatabaseBusy {}

message EntityNotFound {
  int64 entity_id = 1;
}

message PathNotFound {
  string path = 1;
}

message PathHasDeniedPermission {
  string path = 1;
}

message PathAlreadyExists {
  string path = 1;
}

// Do not duplicate the message
message TimedOut {}

// Do not duplicate the message
message HttpClientNetworkError {}

message HttpStrict200Response {
  uint32 status_code = 1;
  string url = 2;
}

// Do not duplicate the message
message HttpClientBodyRecoveryFailed {}

// Do not duplicate the message
message FilterContentIsLikelyNotAFilter {}

// Do not duplicate the message
message FilterParserError {}

message FieldIsEmpty {
  string field_name = 1;
}

// Do not duplicate the message
message Mutex {}

// Do not duplicate the message
message InvalidConfiguration {
  string msg = 1;
}

// Do not duplicate the message
message Other {}

message FilterIntegrityCheckFailed {
  int32 filter_id = 1;
}
